Hbridge Confusion...
Technic-R-C
Posts: 117
Hello,
I'm wiring an hbridge to my propeller·but have come across a problem that I cannot resolve.· it makes absolutely no sense...
my hbridge circuit·is shown below
The problem is that when I send a high signal to transistors 1 and 3 (which makes the·motor move in one·direction)·then transistor #2 acts as if a signal was sent to·its base terminal·in effect shorting the collector and emmiter terminals.... I figured out why this short is occuring, it is because the collector terminals on 1 and 2 are connected, but this is how an hbridge is built which makes no sense. Either I am missing something big or don't understand what I am doing.
Any insight would be much appreciated
Thank you
Technic-R-C
I'm wiring an hbridge to my propeller·but have come across a problem that I cannot resolve.· it makes absolutely no sense...
my hbridge circuit·is shown below
The problem is that when I send a high signal to transistors 1 and 3 (which makes the·motor move in one·direction)·then transistor #2 acts as if a signal was sent to·its base terminal·in effect shorting the collector and emmiter terminals.... I figured out why this short is occuring, it is because the collector terminals on 1 and 2 are connected, but this is how an hbridge is built which makes no sense. Either I am missing something big or don't understand what I am doing.
Any insight would be much appreciated
Thank you
Technic-R-C
Comments
Depending on the motor battery voltage, you may need some further amplification for the transistor bases. You'll need to give more information.
I read through the article and understand more about H-Bridges, esp. when it comes to differentiating between the NPN and PNP transistors.· However I still do not understand why transistor #2 in my circuit shorts the collector and emitter terminals when I never saturate the base pin???· How does connecting the collector pins (1 and 2)·turn on a transistor that has not yet been turned·on with a high signal to the base pin??· Shouldn't the collector and emitter pins ONLY short when the base pin gets a high signal?
Technic-R-C
I can't answer your question for the incomplete circuit you've posted. Remember that NPN transistors normallly have the collector connected to a more positive potential than the emitter and will conduct when the base conducts current from a more positive potential relative to the emitter. For a PNP transistor, the collector has to be connected to a more negative potential than the emitter and will conduct when the base conducts current from a more negative potential relative to the emitter. In a proper H-bridge, the NPN transistors have their emitters connected to the negative power supply terminal while the PNP transistors have their emitters connected to the positive power supply terminal. The negative power supply terminal is usually considered ground because that's how the logic circuits are designed.
I used an external power supply (9V battery) to power my motor.· I did as Mike suggested, connected the Propeller's ground directly to the battery's ground.· When I hooked everything up and had all the transistors recieving no signal, I checked and confirmed that the PNP transistors collector and emitter terminals were shorting for some reason.... I can't figure out why.· Any suggestions?
Technic-R-C
Q1 and Q4 must turn·On at the same time·and, not concomitantly, Q2 and·Q4 must be Off (and vice versa.)
The PNP (in) should be pulled high and a NPN (in) should be pulled low, not be left to float.
Why don't you try building one half of it, the Q1 and Q4 section/s?
[noparse][[/noparse]No offence, but I think that you are in past your ken.]
Do you mean the inputs are floating?
If I were you, I would start out simpler, get an NPN, put an ohm meter across E and C, hardwire the base to GND and see the result on the meter. Then hardwire the base to +V and see the result. Do the same with PNP, then you will get a better understanding of how the transistors and circuits should work before you start trying the more complex process of designing an Hbridge. If you are floating inputs, see what that reaction is also on the meter. When the microprocessor is not turned on or has no program or is in between turning on or changing programs, your inputs to the transistors will float, that is not good because you are going to be producing smoke after a while. You should figure out whether you need to pull up or down the base inputs with a higher value pullup/pulldown resistor like 10k or higher, to avoid problems when the bases are floating. Use the pullups connected directly to the base.
Post Edited (T Chap) : 7/20/2010 7:03:40 PM GMT
I meant that all the transistor bases were recieving a low signal from the propeller. Thank you, my ohm meter isn't in the best working condition but I will give it a go.
PJ Allen:· I did try one part of the circuit (only Q1 and Q4) and I was able to control the motor in one direction.· However immediatly when I hooked up the other two transistors the motor wouldn't budge.· In your previous post you mentioned that Q1 and Q4 must turn on at the same time, so·I set the propeller pins connected to the transistor bases (Q1 and Q4) high.
What I don't understand is that you mentioned that:
"A PNP is "on" when its base is more negative (less positive) than its emitter".
How then would·I turn the PNP,·Q2,·"off" if the emitter (seeing 9.6 volts) is always more positive than the base (seeing 3.3 volts).· Wouldn't it be always "on" which explains why the collector and emitter terminals of Q2 are shorting no matter what signal (high or low) i send to Q2's base?
Technic-R-C
They cannot share the same I/O pin.
http://forums.parallax.com/showthread.php?p=538764
..regardless if the I/O is even defined as an OUTPUT or an INPUT you will still have problems driving a HIGH-SIDE transistor when the supply voltage to the H-Bridge is higher than the I/O voltage can provide.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
This is a bit more complicated than what you have, but it can do more, with less IOs.
Of course there are always H-bridge ICs out there that will give you low IO count and low part count, but where is the education (?fun?) in that?
Keep up the learning with the discrete components. Once you understand it, you can do all kinds of fun stuff. It also helps you understand the limitations of the hardware you are using. Just some advice, I didn't quite understand NPN/PNP thing for a while, you are dealing with voltage and amperage on the base. MOSFETs simplify that by only (for most purposes) caring about voltage on the gate. They waste less power, and allow more through, and they generate a significant amount less heat.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Post Edited (Bobb Fwed) : 7/21/2010 12:56:26 AM GMT
Mouser Part #: 511-L6393D
Manufacturer Part #: L6393D
Manufacturer: STMicroelectronics
Hope this helps,
Brian
The next thing I need to do is place a resistor between the base and emitter so they assume a close potential and keep the transistor turned off when I send a high (5V) signal through the basic stamp pin.· I know I need to select the values of the resistor so that when the logic is high the base coltage is less than .5v lower than the emitter and when the logic is low it is more than .6v lower than the emitter.· But I do not know how to figure this value out? can somebody explain this to me please?· Schematic below.
Edit: will·connecting the emitter and base pins with a resistor·ruin·the transistor?
Technic-R-C
Post Edited (Technic-R-C) : 7/23/2010 9:11:49 PM GMT
I think a solution that is almost as simple, won't waste nearly as much power, and won't require quite so much precision is to put a NPN between the black resistor and the red one.
Like this:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
I will try it out now
Technic-R-C
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Technic-R-C
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Another question: If i switched my Hbridge power supply to 16 volts would I have to change the resistor values?
edit (don't mind the <6amps part, that was with 6 7812 regulators)
Post Edited (Technic-R-C) : 7/23/2010 11:33:43 PM GMT
On the other hand, an identical H-Bridge built with MOSFETs will go to about 19A. I think that is the direction you need to go.
With 16V input, you do not need to change anything. And you may get a slight boost in current, but probably not. Try changing the 1K resistor on Q1-Q4 to a 520 or less. That may help you some.
What are those transistors rated for current-wise?
EDIT: it is most likely the Q1 and Q4 transistors that are limiting you. The PNP transistors get a good amount of current on the base because of the higher voltage, but the NPN on Q1 and Q4 are getting the same resistance with a lower voltage, thus less power is allowed to flow.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Post Edited (Bobb Fwed) : 7/23/2010 11:52:41 PM GMT
All of the transistors, TIP31 and TIP42, are rated for 10A continuous current.
With MOSFETs you will be drawing less than 1mA on all your IOs and you will have the option to power much more powerful motors than your 3A one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
From the manual the:· Current Source/Sink per 8 pins is 100 mA
So I can afford to use even smaller resistor values I believe.
Real quick math overview:
Wouldn't 4 I/O pins connected to 100 and 220 ohm resistors give you:
V = IR
5v / 100 ohms = 0.05 Amps * 2 = .1A
5V / 220 ohms =·0.02 Amps·* 2 = 0.045A
added together gives you .1045amps aka 104.5mA which is way to much. Is this correct?
Post Edited (Technic-R-C) : 7/24/2010 12:24:57 AM GMT
If you added a second transistor (an NPN as a darlington pair, or a PNP --it has a name, but I can't remember what--) to the Q1 and Q3, you could increase the limit without stressing the IOs.
EDIT: I don't know why I didn't think of the darlington pair earlier...I guess I wanted to keep it simple. But a darlington pair with 2.2K resistor would allow the transistor to sink more than 6A.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Post Edited (Bobb Fwed) : 7/24/2010 12:43:33 AM GMT
Great place to mess with everything without purchasing parts: LTspice IV. It's not perfect, but it gets you really close. Usually the problem is that the program doesn't have the parts you have on hand.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Thank you for all your help Bobb! I understand the concepts 100x more than I did when I initially started.
Thanks again to everyone,
Technic-R-C
On both I am using just 1 I/O for each half of the H-bridge.
BJT: I am controlling the PNP transistor's base current with NPN which is being controlled by R1 (no need for the resistor in between the NPN and PNP). At 3.3V, the controlling I/O will only need to source a maximum of 1.4mA (assuming your BJT's are the same as the default spice ones). Q2 and Q3 will have to be heatsinked to be able to dissipate the (minimum of) 36W of power going through them. R1 and R3 should be changed when the controlling voltages change (3.3V vs. 5V).
MOSFET: This is my suggested circuit. It uses one less part than the BJT. No heatsinking is necessary if the ambient temperature is below 40C or so. At 3A there will only be 1.5W of power that will need dissipation. The MOSFETs I chose I use every day, they are rated for 3.4A and 2W. So this one SOIC part could be both your power FETs (but it would be better to split them up). Really, R5 should be a 1K or less. The higher value will cause the P-channel MOSFET to take a while to turn off, thus dissipating a lot of power while doing so. If you will be switching it on/off a lot (more than a couple times per second), put a 470 or less. This circuit would work for an I/O as low as 2.8V and as high as 20V. The I/O pin will only have to source 0.4mA (max).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!