Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Ro-Bot-X on May 28, 2009, 11:50:03 PM

Title: OSCAR - dual DC motor module
Post by: Ro-Bot-X on May 28, 2009, 11:50:03 PM
I need to upgrade my robot from servos to DC motors, so I need a motor controller module. Since we are talking about these I2C modules why not try to build one that could be compatible with the standard. Take a look and let me know if you find issues with the design. It is suposed to be half standard size. An I have to say I hate the I2C connectors on both sides!

Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 29, 2009, 02:02:01 AM
i have to say that i hate the 12C on both sides did get to me a bit but meh...
your pics look alright, im not one for finding kinks in circuits so i cant spot anything.
Title: Re: OSCAR - dual DC motor module
Post by: Asellith on May 29, 2009, 11:11:03 AM
whats the dimensions of the board? Did you go with 32.5 x 64 mm ?
Title: Re: OSCAR - dual DC motor module
Post by: Webbot on May 29, 2009, 11:56:29 AM
I need to upgrade my robot from servos to DC motors, so I need a motor controller module. Since we are talking about these I2C modules why not try to build one that could be compatible with the standard. Take a look and let me know if you find issues with the design. It is suposed to be half standard size. An I have to say I hate the I2C connectors on both sides!

The SN7xxx chip you've used claims to have diodes on the output stage but another post on the forum has suggested that they don't protect it if you switch from full-speed-fwd to full-speed-rev. So it may be advisable to add external diodes at the motor outputs.
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on May 29, 2009, 06:13:42 PM
SN754410 is rated 1A per motor. I have used this H-bridge in robots before and had no problems. Also I have stacked 2 of them one over the other with a heat sink between them and above the second one to double the amps and it works fine. As usual, people tend to use the parts they have some experience with. I know there are other chips out there but I don't have any experience with them. So far I have built small robots and didn't need more amps, but there will be the time to get there. Probably L298N would be ok as a medium sized driver, perhaps use one chip per motor to double the amps.

 If you have experience with other H-bridge chips, please let us know how they perform, if they are easy to work with and so on.

I have added 2 jumpers on the board so the user can tie the Vcc (5V) to the I2C connectors or not if it is not needed. The board will get 5V regulated onboard, so it will be possible to be used from the computer instead from the microcontroller. I have modified the I2C connector to be SDA, Vcc, GND, Nc, SCL. This way, if swapped, just the I2C bus will be unusable, but no smoke and flames.

I have ordered one board at Batch PCB, goes for $9.80. I'll make it public, but beware it's still beta, as it was not tested yet as is.

Thanks.
Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 29, 2009, 06:46:00 PM
i just have my I2C headers next to each other, is this a problem?
Title: Re: OSCAR - dual DC motor module
Post by: Webbot on May 29, 2009, 07:51:59 PM
SN754410 is rated 1A per motor. I have used this H-bridge in robots before and had no problems. Also I have stacked 2 of them one over the other with a heat sink between them and above the second one to double the amps and it works fine. As usual, people tend to use the parts they have some experience with. I know there are other chips out there but I don't have any experience with them. So far I have built small robots and didn't need more amps, but there will be the time to get there. Probably L298N would be ok as a medium sized driver, perhaps use one chip per motor to double the amps.

Thats what I thought - 1A replacement for L293D right? I've not had problems - but check this post: http://www.societyofrobots.com/robotforum/index.php?topic=7889.0 (http://www.societyofrobots.com/robotforum/index.php?topic=7889.0) which implies external diodes are still needed.

The L298 is good for higher current requirements and is used by 3rd parties for motor controller boards.  Along with L297 which help generate the correct sequences for stepper motors. I've covered both in my motor controller and stepper motor tuts - no plug intended - just a reminder.
Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 29, 2009, 07:58:41 PM
so ro-bot-x, are you making a smaller current dc motor driver?
Title: Re: OSCAR - dual DC motor module
Post by: sonictj on May 29, 2009, 08:05:57 PM
Quote
http://www.societyofrobots.com/robotforum/index.php?topic=7889.0

Thats my post lol.  What I discovered was that fast switching of directions will kill the motor drivers.  This happens because large amounts of current are generated when motors change directions.  My professor for my robotics work told me that when a motor switches directions there are spikes in current.  I don't know exactly why but this can easily kill any h-bridge that does not have a high enough current rating. The sn754410 chip's diodes may not have been my problem.
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on May 29, 2009, 08:53:15 PM
so ro-bot-x, are you making a smaller current dc motor driver?

Smaller than 1A per motor? No need. This one is for motors up to 1A (or even 2A if stacked). Next level should be the L298N, that's 2A (or 4A if tied in paralel). After that, there is Sabertooth... and so on. I'll let the pro's knock their brains out...

Like I have said before, I have used this chip with 2 motors with 900mA stall current and had no pwm. It worked perfectly on the sumo bot I had at the time. The only thing I had to do was installing a 1000uF cap in paralel with the battery or the microcontroller would reset at fast switching directions.
Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 29, 2009, 09:06:32 PM
im doing the one with the l298 but im not sure about more amperage...
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on May 30, 2009, 05:47:17 AM
im doing the one with the l298 but im not sure about more amperage...

One L298 chip can drive 2 DC motors at 2 amps or, if you tie the inputs and outputs in paralel, you get to drive 1 DC motor at 4amps. Because the SN754410 is in DIP form factor you can easy stack another one on top and double the amps, but the form factor of the L298 prevents you from doing this. Is this clear enough?
Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 30, 2009, 06:11:09 AM
ahh yes.
you could do it with the l298 if you bent the pins and had double layers...
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on May 31, 2009, 12:04:34 PM
Here's the rendered image of the module:
Title: Re: OSCAR - dual DC motor module
Post by: BANE on May 31, 2009, 01:52:11 PM
Nice, I'd buy one :)  would it be compatible with theses encoder?  http://www.lynxmotion.com/Product.aspx?productID=448&CategoryID=11 (http://www.lynxmotion.com/Product.aspx?productID=448&CategoryID=11)
Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 31, 2009, 02:06:21 PM
what is the board size?
and it looks great man, good job!
as soon as i start getting some money ill order some pcbs of mine (im applying for a job at target)...
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on May 31, 2009, 02:19:53 PM
I have tyed to make the board half the Axon size. But I was modifying an old board design and didn't make the size perfect as I thought I did. So, the board is a bit wider than half the Axon size and same lenght. The final dimensions in mm are 39x64 instead of 32.5x64. Sorry about that. I don't think I'll be able to re-reoute the traces to make it fit the standard half size. Oh well. If the firmware is going to work fine, I'll try to do it. If not, it will be just a prototype.
Title: Re: OSCAR - dual DC motor module
Post by: SmAsH on May 31, 2009, 02:21:58 PM
well, there has been a bit of debate over this but the modules did not have to be stacked, we just wanted that as a option... so its all good ;D
Title: Re: OSCAR - dual DC motor module
Post by: Asellith on June 01, 2009, 07:43:31 AM
Quote
My professor for my robotics work told me that when a motor switches directions there are spikes in current.  I don't know exactly why but this can easily kill any h-bridge that does not have a high enough current rating.

Motors are basically inductors and inductors can't instantly change current. So for a few microseconds or slower the current is really high till the voltage adjusts. Switching to full fwd and full rev several times in quick succession will push those diodes really hard and cause heating problems. Its the equivalent of hitting a one way door with a sledge hammer. The first few times it might not move but keep slamming into it and it will eventually break.

Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on June 03, 2009, 05:56:32 AM
Update:

Because of different considerations I have changed the tiny861 with tiny2313. Here is the new board:
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on July 01, 2009, 06:28:44 AM
I received 2 (yay! - I ordered one, the other is a bonus) boards from BatchPCB yesterday, so I have some work to do to populate one of them today, since is Canada Day and I'm not working anything else. I am still waiting for the motors to come, but I should have them before the end of the week. I guess this weekend I'll be able to test the first software prototype for the motor controller module.

Here's a picture of the boards I received:
Title: Re: OSCAR - dual DC motor module
Post by: Ro-Bot-X on July 01, 2009, 08:31:16 AM
I have populated the board almost completly. Unfortunatelly I have to wait until tomorrow to get some parts I am missing, stupid me I haven't checked my parts box ahead of time as I usually do. Oh well...

I compared the boards to the Axon I have. The width is about a milimeter bigger, so 2 boards side by side are are wider than the Axon. This will be corrected in the next version. The lenght of the boards is OK, the distance between the mounting holes is perhaps half a milimeter or less longer, but they have enough play space to be mounted on stand offs on top of the Axon.

Also, the text on the silk scree did not came out as I intended. For some reason, the text is spread out over a longer distance than it was showed in Eagle. I will have to make corrections for the next version.

I have used dual LEDs to show the motor direction, but I used 3 pin LEDs instead of 2 pin LEDs. It looks like this was a mistake. For direct drive, it's fine, but if I use PWM, the LEDs will flicker oddly changing collors. In the next version I will use 2 pin LEDs connected directly in paralel with the input pins on the motor driver. Also the 1000uF capacitor is bigger than I thought and the 0.1uF capacitor had to be bended down to make some room for the big one. This will also be fixed.

Depending on how code will fit in the microcontroller 2k flash, next version will use a different microcontroller. For now, I'll do my best to fit all the features I can in this one.

I have decided to sell the second board. I have payed $9.98 for one boar plus $10 handling and $10 shipping. Anyone interested to get a board for $10 plus shipping, send me a PM. All prices are in US $.

Edit: here are some pictures of the motor controller module on top of the Axon: