multi direction dc motor

Discussion in 'Sensors and Actuators' started by greeniekin, Oct 20, 2011.

1. greeniekin

8
0
Oct 20, 2011
I have 2 6v dc motors for a tank tred kind of project. so they will need to be driven independently. Though that's not the part I'm having trouble with.

I hooked up 4 transistors to a motors power leads and had an output from a microcontroller to two base pins of 2 different transistors. So current could flow through one direction then another two for the same set up to drive it in the opposite direction, with another wire from the micro-controller to turn it on. For every base connection I had a 330 ohm resistor.
This worked. Though what went from a strong push that could climb everything can not turn the wheels when placed on the ground.

The transistors I use are 2N3904.
Is it just the case that these transistors will drain that much of the current or is something wrong with my circuit. Any help is much appreciated

I now know this circuit is called a H bridge. The searching hasn't helped me. Though I'm still not sure what I am to do. Do I need different transistors?

2. duke37

5,364
772
Jan 9, 2011
The 2N3904 is rated at 200mA maximum, perhaps your motor consumes more than this.
I do not understand how you use four of these in an H-bridge. Post a diagram of what you have.

3. BobK

7,682
1,689
Jan 5, 2010
In addition to what duke37 said, you cannot use an NPN transistor for the high-side switches in your bridge. You need a PNP transitor for these.

Assuming the uC is putting out 5V, the base of the NPN high-side driver is going to be at 5V when you turn it on, which means the emitter can rise no higher than 4.3V when the transistor is on.

Bob

4. greeniekin

8
0
Oct 20, 2011
Here is a picture of how I have set things out.

Clearly my simplified understanding of transistors is letting me down.
So PNP transistors allow larger current to flow?
They confuse me a bit because current seems to flow in the opposite direction for every connection including base.

Last edited: Oct 21, 2011
5. duke37

5,364
772
Jan 9, 2011
Nice clear picture.
I thought that this may be the circuit you are using. A NPN transistor needs the base to be more positive than the emitter to pass current. The 'high side' transistors if driven by 5V will have less than 5V on the base depending on the resistance and the emitter will be 0.6V less than this so the motor voltage will be low.

The top side transistors need to be pnp with the emitters connected to 5V. All polarities will be reversed so the base needs to be lower than the 5V line to turn on. It may be easier to understand if you stand on your head!

Transistors both pnp and npn come in a variety of voltage and current capability but npn are the most common. In your diagram, it is the voltage that you set, not the current that limits the motor power.

6. BobK

7,682
1,689
Jan 5, 2010
I thought I said that

Bob

7. duke37

5,364
772
Jan 9, 2011
Yes indeed Bob, great minds think alike!

If you change the high side transistors to pnp and connect the inputs of the resistors of the two left transistors together, when the input is high, the npn will be on and the pnp will be off. Doing the same on the right hand side, driven in anti-phase, may give a working circuit.

However, there is a problem called shoot through where both upper and lower transistors are on together during the switching transition, effectively shorting the power supply. The best way of avoiding this is to turn off all transistors for a short time (say a msec) before changing direction. You will need four inputs from your computer to do this.

Duke

8. Resqueline

2,848
2
Jul 31, 2009
Google foolproof h-bridge. Here and here are a couple of design examples.
They require more than just 4 transistors but won't "ever" short the power supply.

9. greeniekin

8
0
Oct 20, 2011
Thank you all.
I found some 2N3906 PNP transistors laying around and made this circuit.
I tried doing it with only 4 transistors though I couldn't get it to work(connecting a pnp and npn on the left to input 1 and some for input 2 on the right). It has enough torque to move when on the ground now. Still not as much when you hook it up directly,but I supose some power lose needs to happen.

I think i need to order some better transistors for one I've used nearly all of mine. Then at the same time i can get the parts to build what Resqueline suggested.

10. Resqueline

2,848
2
Jul 31, 2009
That's a better circuit. Yes, with those transistors you lose 0.3V * 2 = 0.6V at 200mA (which is the max they'll take). You should have a couple of resistors more though.
Get back with more questions on the circuit you'll want to try before you build it. I believe the first (random) example I linked to was designed for no less than 10V supply.

File size:
26.6 KB
Views:
230
11. new_hope

18
0
Oct 22, 2011
You would need to setup two mosfets to drive the motor (they will run about 1\$ each). Using this you could also pause the motor. I'll find the article i read and link it to you as i have not yet cared to reverse a motor.

12. greeniekin

8
0
Oct 20, 2011
I have been thinking of buying either of TIP120/TIP121/TIP122 NPN transistors and TIP125/TIP126/TIP127 transistors to replace in my circuit. They seems to be referenced a lot regarding the h-bridge topic and will allow up to 5Amps as opposed to my current ones 200mA, and have built in diodes.

I know you said more resistors would be necessary, and I hate to sound so stupid. But where about. You don't need to explain everything, once I understand enough to Google it. I should be set.

I don't know how much this matters. I will be running two brushed DC motors with 210 mA free run and 2.4 A stall current at 7.2 V. I plan to just duplicate my H bridge for the second motor and have it parallel with the other. I know it will divide the power again, hopefully that will not be a problem><.

13. Resqueline

2,848
2
Jul 31, 2009
The extra resistors and their values are depicted in my previous attachment. It was there for a reason. Did you actually not notice and have look at it?
For a low-voltage low-loss 5A bridge I'd rather use logic-level MOSFET's as output transistors.

14. greeniekin

8
0
Oct 20, 2011
I'm sorry that was rather stupid of me. For some reason I thought that was a quote box around that picture and it was just re-showing my image.

I will have a look into MOSFET's and try make a decision on what parts to buy.

15. greeniekin

8
0
Oct 20, 2011
I searched mosfet on jaycar site and got rather confused about it all.
In the end I purchased BD681G and BD682G because it had 4amp as apposed to 200ma.

Though they seem to work worse when replacing the ones in Resqueline circuit. I thought that maybe the message from microcontroller was not high enough for this so i left the transistor connected to input as 2n3904. Though that didn't help at all.
I was very stupid in thinking this was a good beginer project and a step up from LEDs.
Once again thank you for all your help.

Last edited: Nov 3, 2011
16. BobK

7,682
1,689
Jan 5, 2010
That should have worked fine. Did you try measuring various voltages and currents to try to diagnose the problem?

Bob

17. new_hope

18
0
Oct 22, 2011
MOSFET's aren't to hard to understand. Maybe it was the article. For future reference for yourself or anyone who comes across this article it is the same as powering a small motor of 5v straight from an MCU.

http://www.electronics-tutorials.ws/transistor/tran_7.html

The main part for reversing and pausing a motor using mosfets is in the section called Complementary MOSFET motor controller.

With the higher wattage motor you simply have the source connected to the larger electric supply. You control the flow of electricity through the gate. When you put electricity up to the input pin for the gate it flows to the drain and if it is higher then the gate threshhold then it allows all the electricty to flow from the source....which can be as great as you want it assuming you have a MOSFET that can handle the motor rating you are using.

Using two mosfets...one being an N-channel and one being a P-channel and connecting each Drain together then to the motor you can control the flow of current through each mosfet to the motor with one pin of the MCU (i thought it was two).
But there is N-channel and P-channel mosfets.

mosfets is the same as PWM it just allows you to control higher currents and voltages.

18. greeniekin

8
0
Oct 20, 2011
I think i figured it out.
I read somewhere that that the symbol Vce(sat) indicates the voltage drop from a transistor. Which for BD681G and BD682G is 2.5. And with 2 of them it would result in a 5v drop... from the 5 volts power being supplied.

I have some 2n2222 and i think 2N2907.It allows 800ma but has 1.6 Vce(sat) and would be 3.2v drop. Still seems less than ideal.

My original transistors have Vce(sat) of 0.3v,but unfortunatly Ic of 200Ma

Anyone know of good components I could use?

Edit:
It works well now and thank you all for your patience and help.

Last edited: Nov 7, 2011
19. BobK

7,682
1,689
Jan 5, 2010
How about letting us know what you changed to make it work fine?

bob

20. new_hope

18
0
Oct 22, 2011
Vce most likely means Voltage through the collector to the emitter. I could be wrong. No such help on locating other components for you. I'm in much the same boat.