Basic questions about a motor controller circuit

I recently put together this circuit

http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads

I used a 12V power supply and a 12V motor, I have to admit I was a bit worried I would fry my arduino, but it all worked flawlessly. It leaves me with a few questions though.

Q1: In this example the diode seems to be connected in parallel to the transistor. I understand what a diode is, but it seems that it would work when put in series... not in parallel. Is the circuit wrong? The only other explanation I can conceive is that the the diode offers less resistance then the transistor when the current is reversed so it goes over the diode.... still wouldn't this be better in series?... I'm definitely missing something here.

Q2: Two way motor control, I have an extra TIP120, but what additional things are necessary to drive the motor in either direction? I realize I could just make a second circuit, and use software to prevent them both from being active, but it seems like I would want to do this with hardware.... so if the software tells both circuits to be on damage will be prevented. Please don't tell me to get an L293... this exercise is not meant to be practical... but to learn some basics.

You need a H-Bridge for bidirectional drive.
You cant get around it.

You need a H-Bridge for bidirectional drive.
You cant get around it.

really? I know this is over my head, but it seems possible. Can you help me understand why it is not? Maybe answer Q1?

A1) Diode and Transistor are connected in parallel, but not working in parallel. They work alternatingly, because the current passes in both directions. When the motor is working, the current passes by transitor. When motor stops, there is a fast reverse current from motor coil that passes by diode. Opposite, not parallel.

A2) Take a look at this example. There are many H-Bridges circuits, using 4, 6 transistors, relays, Mosfets...
This is only an example, and it doesn't have protection diodes.
http://www.solarbotics.net/library/circuits/driver_4varHbridge.html

A1) Diode and Transistor are connected in parallel, but not working in parallel. They work alternatingly, because the current passes in both directions. When the motor is working, the current passes by transitor. When motor stops, there is a fast reverse current from motor coil that passes by diode. Opposite, not parallel.

ok, I get it, opposite, not parallel, but since they are connected in parallel, why does the current go over the diode, because it is the path of least resistance?

A2) Take a look at this example. There are many H-Bridges circuits, using 4, 6 transistors, relays, Mosfets...
This is only an example, and it doesn't have protection diodes.
http://www.solarbotics.net/library/circuits/driver_4varHbridge.html

awesome, thanks, looks like I will need 4-6 transistors, but the ones used in these circuits are cheap

really? I know this is over my head, but it seems possible. Can you help me understand why it is not?

Well it is. You would have just made a h-bridge though. :wink:
They arent terribly complicated circuits.

ok, I get it, opposite, not parallel, but since they are connected in parallel, why does the current go over the diode, because it is the path of least resistance?

Yes, you can consider the resistance to explain it, but it's a question of how diodes and transistors are internally made. Simplifying (because in fact it's not so simple), simple diodes conducts current in one way (from anode to cathode). Transistors construction is similar to diodes. You can imagine one diode from collector to base and another from base to emitter, with the same orientation (anode at collector, cathode at base - anode at base, cathode at emitter in the example). This serial "double diode" is in opposite orientation comparing to diode in your example Lab: Using a Transistor to Control High Current Loads with an Arduino – ITP Physical Computing.
So when the current orientation is from motor to GND, it flows through transistor, not through diode. And when its orientation is from GND to motor, it flows through diode, not transistor.

Thanks man, I really appreciate your patience and willingness to explain. I've been reading the examples and I think I will be making an h-bridge myself, the transistors listed are dirt cheap, the schematics are provided, and I can use this as an opportunity to learn eagle.

I will surely go the normal route and buy them in the future, but I see this as a chance to learn a few new things... and I love making things... if it works it proves to me that I understood.

ok so I copied the 4 transistor h-bridge schematic and made a board.

Steve Bolt's 4-transistor H-bridge
http://www.solarbotics.net/library/circuits/driver_4varHbridge.html

My first time using eagle, and first time making a board. It was easier than I thought.... if I got it right.

SMHB stands for Stupid Mans H-Bridge.... cause I could have just bought one on a chip... but as I said this is for learning.

http://www.jesandari.com/junk/SMHB.brd
http://www.jesandari.com/junk/SMHB.sch

oops almost forgot the image

I would love some feedback, corrections, tips, constructive criticism etc

hey

just a thought on the transistors- those are really tiny transistors. Why not use something beefier? Also you might consider that an L293 does what you have in that circuit with less wiring and less work :slight_smile:

D

Daniel2

hey

just a thought on the transistors- those are really tiny transistors. Why not use something beefier? Also you might consider that an L293 does what you have in that circuit with less wiring and less work :slight_smile:

D

Please don't tell me to get an L293... this exercise is not meant to be practical... but to learn some basics.

I will surely go the normal route and buy them in the future, but I see this as a chance to learn a few new things... and I love making things... if it works it proves to me that I understood.

And Aballen, try to make larger board wires, to don't get them destroyed with higher currents. And I think the circuit is simple, and can be done in a single sided board. Or not?

Yes I think I can get it on a single side, this is just my first crack at it... and my first time using eagle. For this one I used the autorouting feature. Can I tell eagle to use a single side?

Does the circuit look ok? Everything is packed tight is that ok? If I want to get it printed is it a problem that some of the text rolls off the side of the board? I'm thinking I only need the traces etched, not the text, but I'm not sure if it would be a problem if I sent it out like this.

I'll make the traces bigger too. I figure I can switch out the resistors, and transistors for a bit more power if I want to later... assuming I can get similar dimensions... but like I said, this is more of an exercise for me than anything else, just trying to build the basic skills for bigger and better things later.

Thanks again I'll post a single sided one in the next couple of days.

I think I did it. Does this look like it will work?... seems like some of the traces and vias are pretty close. I think I may try and get 2 from batchpcb, just to see if it will work.

Thanks for asking for single sided and thicker traces, some google, and rotating 2 transistors seems to have done it. Seems like I can spend more time and get it even cleaner...

Aballen,

your design is getting better.

But I think there are too much wires between pads. This can be a problem when soldering, or when etching (if you make the board at home), causing bridges.

I was trying to write a text to comment, but it was getting too complex, so I did a version. You can use it or change it if you dislike. And redrew the schematics to get less confused. The board is a little bit larger, but no wires between pads.

Files:
Board: http://www.4shared.com/file/36449148/c4c93cf1/H-bridge.html
Schematics: http://www.4shared.com/file/36449142/241cd5ef/H-bridge.html

How very cool of you Adilson! Thank you. I was thinking the same thing about the wires between pads, as well as too close to vias, yours is much cleaner.

I'm going to keep yours, but I will play with mine as well, as I said this is for learning... an you really are helping.

So the simpler schematic makes the routing easier? Did you route this yourself or let eagle do it? I guess this is the kind of thing that I will get better as I practice. What I have been doing is ripup, move parts around, and then autoroute, sometimes auto wont work, so I don't save, and start over.... I'm going to try a few more attempts today as well.

Your recommendation on single sided was great, double siding a circuit this simple was too easy, and a waste.

I understand. I just made it for an example, to help you to see that is possible to make it many ways. I think you're doing it right, if you want to learn PCB projects, Eagle, electronics...

I never use auto routing. To play chess since 4 years old helps a lot. :slight_smile:
And I've learned to make PCB 20 years ago, with pencil and paper. This makes things easier too.

Look the unrouted wires, and think about it like tangled string. You must imagine what will happen if you move, rotate, without moving, like a chess game. When you think you found one solution, then make the move, and press ratsnest button. Start again, until be sure it's the final solution. Then you can route. This is useful for autorouting too, but I think only at this point.

Good luck.

P.S.: be sure the circuit will work before making the PCB. Use a protoboard.

Ok I think I got it, only 1 wire going under a resistor. The rest looks sloppy, but I think it will work.

I never use auto routing. To play chess since 4 years old helps a lot. :slight_smile:
And I've learned to make PCB 20 years ago, with pencil and paper. This makes things easier too.

If you have a truly horrendous mess, use the auto router to see if it can find things you cant see.
Then rip it up and do it properly.

Its amazing how much time I'm spending on a simple circuit... some good will come out of it though.

I'm definitely learning, it seems it is all about the placement. I ripup, then change the placement so it look like there are no overlaps, then autoroute... though I think it jut used the routings I wanted it to anyway... then I tweak som eof the wires to be shorter, more direct etc.

I'll keep playing with it..... single sided definitely makes it more challenging.

Its amazing how much time I'm spending on a simple circuit... some good will come out of it though.

I'm definitely learning, it seems it is all about the placement. I ripup, then change the placement so it look like there are no overlaps, then autoroute... though I think it jut used the routings I wanted it to anyway... then I tweak som eof the wires to be shorter, more direct etc.

I'll keep playing with it..... single sided definitely makes it more challenging.

I think now you can understand one of many reasons I spent time making the new Arduino Serial Single Sided Version3 prototype... :slight_smile: