Alternative motor drivers?

Forum about the OS-Railway project available on Thingiverse. Here you can ask questions, look at building pictures, share ideas, pictures and STL's.
sidneylopsides
Posts: 12
Joined: Sun May 17, 2020 4:33 pm

Alternative motor drivers?

Postby sidneylopsides » Sun May 17, 2020 5:20 pm

First of all, thank you for this whole project!
After seeing it I wanted to make British stuff to use, and I've spent the last couple of weeks working on ideas. I've got a BR Class 08 and LNER Y1 pretty much done, and an LNER Y7 in design, plus a completed 10ft wagon chassis.

I've got to the point I can start doing the electronics, I've got a few Weeks D1 mini spare and hadn't actually look led at the code and schematics properly until now.

I've got a a few DRV8833 drivers already and thought I could just substitute those, the TB6612 has very different wiring.

It's been a while since I did anything on Arduino and I'm not sure if there an easy change I can make to use these drivers instead?

admin
Site Admin
Posts: 409
Joined: Thu Jan 11, 2018 7:46 pm

Re: Alternative motor drivers?

Postby admin » Sun May 17, 2020 7:04 pm

Hi!

Nice! please post some pictures of your projects! :) I'm working on updates here trying to improve the transmission to be easier to build and get to work.

Regarding the electronics, I have not used the DRV8833 but when I google it together with nodemcu I can see a number of examples of wiring so I would not think it's a problem. Just look at those and hook everything up on an experiment deck before you solder it and out it in the train.

sidneylopsides
Posts: 12
Joined: Sun May 17, 2020 4:33 pm

Re: Alternative motor drivers?

Postby sidneylopsides » Sun May 17, 2020 8:25 pm

I will do! And will share them when running well, coupling rods are an extra complication.

Now I've got the boys to bed and had time to sit and look, I've got a better idea of what I need to do, but still not got it.

The TB6612 code uses 3 pins, two to set direciton and one for PWM, but the DRV8833 just takes PWM from one of two pins for direction and speed.

So instead of

analogWrite(motor_PWM, actual_speed);

digitalWrite(motor_AIN1, motionDirection);
digitalWrite(motor_AIN2, !motionDirection);

It should be something like

forward

digitalWrite(motor_AIN1, actual_speed);
digitalWrite(motor_AIN2, 0);

backward

digitalWrite(motor_AIN1, 0);
digitalWrite(motor_AIN2, actual_speed);

I'll keep looking, it's slowly coming back to me, I'm sure I'll get it eventually.

edit: Think I figured it out, but i'm not getting a wifi AP to test it! Tried the example Acces point sketch and it worked, but nothing with your code.


another edit!

It's all working, but commands take a good 2-3 seconds to react, is that normal? Speed changes don't apply until I press the direction again.

skpaul585
Posts: 5
Joined: Sun Jan 03, 2021 2:54 am

Re: Alternative motor drivers?

Postby skpaul585 » Sat Mar 06, 2021 1:46 am

Hi

Could you please share your full code and the diagram for DRV8833 with NodMCU here so that I can try.

Thanks.

Thor
Posts: 3
Joined: Wed Mar 17, 2021 6:52 pm

Re: Alternative motor drivers?

Postby Thor » Thu Mar 25, 2021 7:22 pm

https://fr.aliexpress.com/item/32987942205.html

What do you think of this engine?
It has an integrated gearbox, and it runs at 1000 rpm.
But it is 53mm long. Can it fit in the locomotive?
He dont have 2.3 mm shift. Maybe, I need to adapt some things ?


Who is online

Users browsing this forum: No registered users and 1 guest