H-bridge question

Status
Not open for further replies.

digital_blue

New Member
I'm trying to build a line follower robot from the following site:

Robots

I'm having some trouble understanding how the H-bridge motor controls should work. Since all the transistor bases are connected together, wouldn't it short? I've read through the code and there seems to be a section of code that has something to do with PWM. Can anyone explain to me how this H-bridge works?

thanks
 
About the transistors shorting, they will not because of the strange arrangement of the TWO different NPN and PNP types of transistors (yes it is a strange arrangement, normally you have two low-side transistors of the same type and two high-side transistors of the same type. The guy arranged them in the strange configuration where forward motor current would flow through NPNs only and reverse motor current would flow through PNPs only- likely to save a control pin on the MCU. For 2 pin control you would use two high side PNPs and two low-side NPN, with each control pin controlling both a PNP and NPN. You can also replace PNPs with P-channel MOSFETs and NPNs with N-channel MOSFETs for lower losses and simpler gate drive requirements. And of course, you can have 4 pins each controlling a transistor independently for the most flexible control. You can also use all N-channel MOSFETs for greater efficiency, but your high-side gate requirents become more complex.

A current that turns the a NPN on will turn a PNP off and vice versa- and remember it's with respect to the base-emitter, not the base and ground (half the time the base is not connected to ground but some other voltage). It's also a the base current flow that controls BJTs. MOSFETs are voltage controlled (again, it's the voltage between gate and source, not gate and ground that controls it since the source is not connected to ground half the time).

The motor's inductance will not allow current to change instantly through the motor. When the voltage is varying rapidly, the inductance will smooth the current out to some level in between the full ON and full OFF and the exact amount is controlled by how much time the voltage spends ON vs. the voltage spends OFF in the motor. This varying of the ON pulse and OFF pulse time for the voltage is called PWM.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…