Let's Make Robots!

Big Motor Driver (Inspired by Chris the Carpenter)

High-Current Motor Driver

I'm not sure how I stumbled upon this site but find myself visiting it on a daily basis now.  I spent the better part of a week reading through a numerous amount of posts and became inspired by some of the designs.

One design that caught my interest was the motor controller made by Chris the Carpenter (with contributions from others).  So, instead of mooching information off of the site I decided I should contribute something.

I have posted a motor controller design that is supposed to be simple, robust, cost effective, and able to handle high currents.  Above is a schematic of the first part of the design.  I will post an updated version to include a PIC to accept commands from a PC, Microcontroller, etc. and provide the direction/PWM signals to the H-bridge.  I am still working on the PCB but here is what I have done so far for review/critism.  What is not shown in the schematic are the in-line fuses for protection.

For the PIC, I use MBasic and PicBasic Pro to write the code.  This should convert easly to the BS2 and PicAxe.

More to come and thanks for whatever welcome I may receive (hopefully a warm one).

 

** Updated 04 January 2009 **

Here is an updated version based on advice provided below.  Again, if you find any errors let me know.

Thanks to all who provide help/advice and to those who show interest.  I know there are easier ways to do this but this is sorta an addiction now.

Updated controller

 

** Updated 10 Jan 2009 **

 I updated the schematic again.  As suggested I changed the MOSFET driver to a TLP250 and dropped the 1K resistor across the Gate to source.

Update the schematic to show that the logic grounds are isolated from the dirty motor grounds.

Hobbybotics_Motor_Controller_5_800x600.jpg

 

** Updated 10 Jan 2009 **

Updated the schematic for those that want to save an I/O pin.  There is a Hex Inverter/Buffer circuit (U1) that feeds the inputs of the Optoisolator (U2).  If you look at the wiring for the Hex Inverter you will notice that the output of the second inverter feeds the input of the first inverter.  So, when a logic 1 is placed across pin-3 it is inverted into a logic 0 which turns off the Reverse Relay.  A logic 0 is also placed at the input of the first inverter which gets converted to a logic 1 on its output and turns on the Forward Relay.

By using the inverter circuit you will no longer have the capability for dynamic breaking.  In other words, one of the relays will be active as longs as powered is applied to the circuit.  Disabling the PWM signal will keep the motor from turning.

 Hobbybotics_Motor_Controller_6_800x600.jpg

 

** Updated 11 Jan 2009 **

Finished the PCB design.  Once boards are complete will test and post schematic and board files once any kinks are worked out.

Hobbybotics_Motor_Controller_PCB1_800x600.jpg

Hobbybotics_Motor_Controller_PCB1.jpg

** Updated 22 January 2009 **

I got the prototype boards back from the manufacture two days after I sent them off.  As you'll see below, the quality is excellent.  Tonight I populated the board and checked out functionality with a multimeter prior to testing with a motor.  I managed to get everything put together right so on to the smoke check.  I hooked up a good size motor with a lot of torque and applied power.  The motor moved in both directions and the MOSFET did not even get warm.  This test was applying full power to the motor and not PWM.  Next, I'll write some code and test functionality with PWM hooked to my Oscope so I can check the signals and see how high I can take the frequency.  I'll get around to posting some video but, in the mean time, here are some pictures of one of the finished boards.

PCB Top

PCB Bottom

 P1220006_1.jpg

P1220008_1.jpg

P1220010_1.jpg

P1220011_1.jpg

P1220012_1.jpg

P1220012_2_1.jpg

P1220014_1.jpg

** Bill Of Materials **

Component Description Part Number Vendor Cost
C1 220 uF P10325-ND Digikey $0.72
C2 0.1uF BC1114CT-ND Digikey $0.20
D1 1N4001 Rectifier 50V 1A 1N4001DICT-ND Digikey $0.30
D2 1N4001 Rectifier 50V 1A 1N4001DICT-ND Digikey $0.30
D3 Schottky Diode 45V 15A STPS1545D Mouser $0.80
D4 Schottky Diode 45V 15A STPS1545D Mouser $0.80
D5 Schottky Diode 45V 15A STPS1545D Mouser $0.80
D6 Schottky Diode 45V 15A STPS1545D Mouser $0.80
J1 4-Pin Header, Male 2077095 Jameco $0.19
J2 Screw Terminal, 2-Pin 160785 Jameco $0.65
J3 Screw Terminal, 2-Pin 160785 Jameco $0.65
J4 Screw Terminal, 2-Pin 160785 Jameco $0.65
LED1 3mm Red, T1 253278 Jameco $0.26
LED2 3mm Red, T1 253278 Jameco $0.26
LED3 3mm Red, T1 253278 Jameco $0.26
Q1 2N2222 NPN Bipolar Transistor 600mA 75V P2N2222AG Mouser $0.21
Q2 2N2222 NPN Bipolar Transistor 600mA 75V P2N2222AG Mouser $0.21
Q3 IRFZ44N Single-Gate MOSFET Transistor N-Channel 60V 50A IRFZ44NPBF Mouser $1.30
R1 270 Carbon Film 1/4W P270BACT-ND Digikey $0.08
R2 270 Carbon Film 1/4W P270BACT-ND Digikey $0.08
R3 270 Carbon Film 1/4W P270BACT-ND Digikey $0.08
R4 1K Carbon Film 1/4W P1.0KBACT-ND Digikey $0.08
R5 1K Carbon Film 1/4W P1.0KBACT-ND Digikey $0.08
R6 10K Carbon Film 1/4W P10KBACT-ND Digikey $0.08
R7 10K Carbon Film 1/4W P10KBACT-ND Digikey $0.08
R8 39 Metal Film 1/4W 39.2XBK-ND Digikey $0.11
RLY1 SPDT 12V @ 20A ACT112 Mouser $2.17
RLY2 SPDT 12V @ 20A ACT112 Mouser $2.17
U1 PS2501-2 Dual NPN Phototransistor PS2501-2-A Mouser $0.87
U2 TLP250 Photocoupler IGBT MOSFET Driver TLP250F-ND Digikey $1.88
PCB Printed Circuit Board N/A
ExpressPCB $20.28
        Total
        $37.40

** 24 January 2009 **

I added a few of pictures of the test application and the temporary PWM controller used for testing.

Test Application

Temporary PWM Controller and Motor Controller

P1230006_1.jpg

** 02 February 2009 **

Added a crappy video of the motor controller being tested.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

This design is rated up to 14V @ 20 Amps.  The voltage/current constraints are based on the ratings on the relays that are chosen.  There is a PWM/speed controller designed for this controller.  The next revision of the boards will have the PWM controller integrated on the board.  They will also include positional feedback, current/voltage monitoring and I2C.  I am considering designing the relay boards as separate plugin attachments so that different values can be swapped in based on needs.

This design should handle your wheelchair motors with no problems.  I will be uploading the board files, schematics, PIC code and test applications shortly.

Alright I am looking forward to that! Does a relay with amp max that exceeds the amp of the motor incredibly make it bad? For example, say I have a motor rated at 25A and I provide a relay rated at 40A, is this detrimental to the motor? Also, does the Ah/voltage of the batteries I use affect the chosen amperage of the relay?

 

Actually, that is better as it leaves some room for stall current of the motor.  The Ah/voltage of the batteries will not affect what relay you choose.  Hopefully I can get some video up soon.  I need to get one of those YouTube cameras instead of the DV camera I have. 

Thanks! I didnt know they made youtube cameras.

 

Edit: what is the part # of the relays you used thats the only part # you didnt include, it might be hard finding relays for the board I base off of your schematic, so I'll just wait for you to upload your .brd file.

Edit #2: I also noticed there is no fuse, do you plan on adding a 40+ amp interrupt rating? With a 24 volt voltage rating, some kind of circuit protection would be useful, unless you already have one and I dont see it :D.

 

The fuse is not shown in the pictures but is built into the test power cables.  The fuse is a 40 amp 24V rated spade type fuse.  The same type that is used in cars and audio equipment.  I plan on adding it to the board for the final design.  I'm going to finish up the current Build of Materials with the prices/vendors.  I have an extra board if you would like to test this design.  You would need to furnish your own components.  Let me know if you would like to have it and I can send it to you.

Hmmm if you have forward and reverse headers, then what is the PWM header for?

The FWD and REV pins are just for direction control.  The PWM pin is to pulse the DC voltage that is applied to the motor so the speed can be controlled.

 

For those that want to save an extra pin, the last schematic I posted incorporates a NOT-gate so that the FWD/REV pin will operate from one Output pin.  The second Output pin is for the speed control.  If you look at the way the NOT-gate is wired you will notice that the output of the second gate also feeds the input of the first gate.  This is so when a high is placed on that input pin it will be inverted low on the output of that gate which places a low on the input of the first gate.  The first gate inverts the low input to a high output.  Therefore, when the input is high, the forward direction is selected and when the input is low, the reverse direction is selected.  The only hangup with this circuit is you will not have dynamic breaking.  The only way to stop the motors is by setting the PWM pin to 0.

The FWD and REV pins are just for direction control.  The PWM pin is to pulse the DC voltage that is applied to the motor so the speed can be controlled.

 

 

That makes sense, but does that mean this controller doesnt allow for individual motor speed control?

Also, looking forward to the .sch or .brd files, I really don't want to find a library for all the parts you used :D.

The controller as feature here will control a single motor and thus, allow for individual motor speed control.  I'll go ahead and upload the current schematic and board files so you can play around with the design.  I created them using ExpressPCB.  The next design will include a 8 pin PIC on the board that will provide the direction/PWM control.  All you'll have to do is send it serial commands from the microcontroller of your choice.  I'll also upload the current test application and PIC source code as well.  Be advised, the PIC source is minimum as I wrote it for testing functionality.  I think I'm going to shoot some video with my current digital camera and upload.  That may take a while as I'll have to import the video afterwards.