A simple system configuration to drive higher current motors with minimal cost or hassle.
Jim Munro (firstname.lastname@example.org)
My robot for the Trinity College Firefighting Home Robot Contest is controlled by the MIT Handyboard. I chose the Handyboard because I find it to be both easy to use and program, it has a good blend of features, a user-friendly 'OS' and programming environment as well as a large base of user contributed software.
The Handyboard includes 2 onboard H-Bridge Motor Driver Chips to drive up to four DC motors. However, the motors I've chosen are somewhat large and may exceed the power requirements of the chip if a motor stalls, so as a guard against noisy motors and blowing the chips I've decided to upgrade my motor drivers to something with more 'horsepower'.
There are some other solutions out there for the Handyboard but they require either a bipolar power supply or you have to etch a carrier circuit board, neither of which I care to deal with. I want to be able to plug in a simple power supply and go. I decided to use the Magnevation board that can be found at http://www.magnevation.com. Aside from the benefit of being a ready to use solution it also has a few features that are not found on the Handyboard.
Some of the things I like about the Magnevation board:
Since I was building the Handyboard and Motor Driver board specifically for the firefighting robot task, I left off a lot of the components from the Handyboard that I didn't plan on using. This saved weight, building time and most importantly, money. Specifically, I left off the dip sockets located in spots U10 and U11 on the board and I was also able to leave out the Resistor pack 2 and the LEDs. (Since I'm only driving 2 motors I will be working only with U11 in my work but adding them at U10 would be nearly identical.)
You may notice that I actually included Resistor pack 2 on my board, this was an accident on my part and can be left off without any ill effects since it only affects the motor indicator LEDs which are not on board!
After deciding on a solution, I was then left with the problem of how to connect the boards together. There are a few options to examine:
The method for jumpering is pretty straightforward, just run a short wire from position 1 to position 3 of the dip socket and likewise from 2 to 6, 9 to 14 and 10 to 11 as illustrated in the picture below. In essence, this brings out the motor control signals straight to the appropriate pins on the motor output header located just to the right of the Dip socket U11 pictured below.
After the jumpers are installed, the front might look something like this. Notice the last jumper hidden beneath the one installed from pin 9 to pin 14.
A ground reference signal is needed from the Handyboard to the Motor chips so I chose to incorporate one per connector into the 3 pin headers, using the empty middle socket as ground in each 3-pin cable. This will allow me to test with just one wire at a time if all leads are connected. To do this, all we need is a simple connection on the bottom of the board as illustrated below.
Next, I installed the female strip header cut to 6-positions and labeled them as below. Notice that easiest configuration I came up with for jumpering turned out to reverse the Direction and PWM signal pins for the 2nd motor. It probably won't be a problem but it may be inconvenient or confusing if not clearly labeled. It may have been better to switch this so both connectors would be the identical in layout. I'll leave that as a choice for the experimenter.
If you already have an existing Handyboard and don't want to remove the DIP sockets, it would be a simple matter to jumper the pins of the socket with small lengths of wire in the same order as above in order to make the connections. This would also be useful if you don't want to make any 'radical' changes to the board or if you might later want to add the original motor chips and don't want to desolder a bunch of wires from the board.
Now it's time to build a cable.
Since we only need signal wires from the Handyboard to the motor driver board, the wire can be fairly thin. I chose to use some colored ribbon cable. It's thin, easy to find and the colors make it easier to debug if you have a bundle of wires tied together. I cut off a decent length and used a 6 wire strip, three per motor connection.
Connecting it to the Handyboard I found it easiest to build the cable by cutting some pieces of male pin headers at .100 spacing to the correct length, in this case 3 pins per motor ( 1 for Enable/Speed Control and 1 for Direction and a middle ground connection). Solder these to the appropriate wires from the cable (see diagram). I used 90 degree headers to further decrease any height problems should I decide to enclose the robot from the top. I didn't want any tall wires sticking straight up from the board, it also angles the wires off of the board in the appropriate direction which is convenient and looks clean.
Information on building these connectors can be found here.
Connecting to the Magnevation Board
The other ends of the wires are to be connected to the male headers on the Magnevation board. The Magnevation board has brought out a lot of the signals to headers on the board, there is a 40-pin header strip at the front of the board. Many of these signals are specific to the OOPic Microcontroller and can be ignored, the main ones we need to worry about are the PWM Signal, Direction, Brake and a Ground connection, one each per motor for a total of 7 connections minimum.
You can follow the pinout listed on the Magnevation web page but for a summary you can just remember the following:
To create the cable ends to connect to the Magnevation motor board you can use whatever is easy. I have a simple, popular method that I outline here.
Putting it all together
Now all we need to do is test out our connection. Connect the pin headers to the positions located on the Handyboard, middle pin of both wires is a ground wire (at least one of these connections is necessary for the boards to function together). Now connect the connectors to the motor board and we are ready to start up the motors.
Turn on the Handyboard, start up Interactive C. At the prompt,
motor(x, y)where x is the motor port (from 0 to 3) that this particular motor is connected to. For me it's 2 and 3, the bottom 2 motors and where y is the speed (from -100 to +100) that you want to set the motors to.
So by typing
I can see the motor turning at half the speed it is capable of going. Try it at a 100 and we have full speed. Working okay?
If not, make sure you've connected the Ground from the Handyboard to the Ground connection on the Motor Driver Board.
If I knew then what I know now...
There you have it, a simple, cheap way to interface 2 high-current or high voltage DC motors to the Handyboard. The effort was minimal, the cost was reasonable and it's a nice looking, reliable connection.
|Handyboard||Check out www.handyboard.com for details on building and parts lists|
|Magnevation Board||Order from either www.magnevation.com
or from Acroname.
I ordered the blank PCB from Acroname for $12.00
|LMD18200 H-bridge chips||Order from Digikey (P/N LMD18200T-ND) at $11.69 in single quantities to save some money. I had the rest of the parts in my bits bin.|
|LMD 18200 3A 55VDC H-Bridge Motor Driver||http://www.national.com/ds/LM/LMD18200.pdf|