Author Topic: H-Bridge Questions  (Read 4243 times)

0 Members and 1 Guest are viewing this topic.

Offline KerryTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 0
H-Bridge Questions
« on: August 05, 2009, 12:29:48 PM »
Hello everyone,

I have recently started reading about robotics and have found this web site to be incredibly helpful.  I am getting ready to tackle my first robot project (I plan on attempting the $50 robot), but in the process I have come up with a couple of questions that I hope someone can help me with before I begin.

When I was in school, I remember doing a lab where we used PWM and an H-bridge circuit to do position and speed control with a DC motor.  Being a mechanical engineer, we glossed over the circuitry and focused on the control (programming) aspects.  So in my mind, I've always associated PWM with H-bridges.  Recent reading suggests that this is not the case...

Now I'm thinking that PWM and H-bridges are independent - PWM is simply for speed control, and an H-bridge lets you change direction.  You can have either one without having the other.

In the H-bridge tutorial on this site, there is a claim that "you need an H-bridge to control any robot with a motor."  I didn't remember seeing anything about an H-bridge in the $50 robot tutorial - does this mean that there is an H-bridge built into the AtMega8 chip?  When I look at the $50 robot tutorial, I expect to see some kind of high-current transistor (an H-bridge?) to avoid sending high currents through the MCU.  But I don't see that... so are there high currents going through the MCU, or is an H-bridge required?  Do I have it completely wrong?

I've read about chips that have PWM built in.  What does this mean?  Can't I just take a digital output and use a timer to create PWM on any chip?

So to sum everything up, I'm pretty confused.  Can someone straighten me out?  I feel like I'm very close to grasping everything, but I just can't quite get it...

Thanks!

-Kerry

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: H-Bridge Questions
« Reply #1 on: August 05, 2009, 12:53:03 PM »
I'm a Mechanical Engineer too.  The h-brides in the $50 robot are in the servos themselves.  Servos contain both control logic circuitry and driving circuitry.  You use a special form of PWM to drive servos.  A servo's internal controller listens for different pulse widths ~.5-2ms this pattern is sent at 50Hz typically.  The pulse width will correspond to the servo's output shaft position.  If you remember your controls class a servo uses a feedback loop, a potentiometer, to determine the drive shaft's angular position.

For the $50 robot you will modify servo's to trick the control circuitry.  Here's the tutorial http://www.societyofrobots.com/actuators_modifyservo.shtml

PWM is used with DC motors to vary speed.  A higher duty cycle corresponds to a faster rpm.  An H-bridge allows for direction change as you said before.  For your information atmega8 does not contain any circuitry for driving motors (H-bridges) , but you can control them.

Offline wil.hamilton

  • Robot Overlord
  • ****
  • Posts: 207
  • Helpful? 6
  • rtfm
Re: H-Bridge Questions
« Reply #2 on: August 05, 2009, 01:37:19 PM »
servos are more than just a motor, they have circuitry which responds to the pulses in a PWM signal.  this circuitry acts as an H-bridge.

if you wanted to use any other dc motor, or removed the circuitry from a servo, you would need an h-bridge to control it.

H-bridges allow you to pass current either direction through a dc motor changing the direction it spins.  speed control is done with PWM because PWM is essentially the controller sending on/off signals really fast, how often, or the rate it sends them is how fast the motor goes.  if it sends more on singals (the on signal is longer) the motor will go faster
use the google.  it's your friend.

Offline KerryTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 0
Re: H-Bridge Questions
« Reply #3 on: August 05, 2009, 02:20:20 PM »
Great!  Thanks a lot, this was exactly the explanation I was looking for!

-Kerry

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: H-Bridge Questions
« Reply #4 on: August 05, 2009, 03:05:07 PM »
and about the pwm being built in, if you look at the pinout of the atmega8, some pins will have "pwm" written next to it... these pins are able to output a pwm signal, and thus are the best when controlling servos :P
Howdy

Offline ceruleanplains

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 0
  • Got Wumpus?
    • Project Log
Re: H-Bridge Questions
« Reply #5 on: August 07, 2009, 09:03:52 AM »
Actually the H-bridge to control a motor is a quite wrong claim. 

You can do it a bunch of different ways including using DPDT relays or a couple SPDT relays in the place of the H-bridge completely to control a motor in 2 directions.  You can also just control a motor in one direction with a single SPDT relay and even just a SPST relay if you want to have the ground off the relay. 

Another way of controlling motors is using bi-polar transistors which can be very very cheap motor control.  This is really only good when you have a light motor however.

If you have something that consumes a lot of amps then the H-bridge or the relay approaches are good.  Relays are not good for rapid PWM however since they usually have a mechanically open/shut time on their gate. 

Also PWM isn't required for motor operation.  You can just have it pulse high or pulse low for each control line if you want.  PWM however does increase your options, but it requires some protection for shoot-through on your transistors (temporary short-circuits) increases the duty load on your MCU, and adds some complexity to your software.





Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: H-Bridge Questions
« Reply #6 on: August 07, 2009, 06:11:18 PM »
Hi,

Actually the H-bridge to control a motor is a quite wrong claim. 

[...]
Another way of controlling motors is using bi-polar transistors which can be very very cheap motor control.  This is really only good when you have a light motor however.

If you have something that consumes a lot of amps then the H-bridge or the relay approaches are good.  Relays are not good for rapid PWM however since they usually have a mechanically open/shut time on their gate. 
Please, please, please... Don't write such nonsense, somebody might take it as the truth.

The term "H-bridge" only covers a topology using 4 control elements, not the nature of them (it could even be ordinary mechanical switches).
Transistor are usually used for the control elements.
MOSFETs as well as BjTs are transistors (that's what the "T" in their acronyms stand for).
High power BjTs are quite widespread - eg. 20A is a very light load for some BjTs.
Relays don't have gates.
Using a relay to switch direction and a single power transistor (whether MOSFET or BjT) is probably the simplest effective circuit to understand for a B1FF while still enabling tight control over the motor speed).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline ceruleanplains

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 0
  • Got Wumpus?
    • Project Log
Re: H-Bridge Questions
« Reply #7 on: August 08, 2009, 08:21:01 AM »
PNP/NPN Bipolar transistors to which I was referring in my mind were the 2222A and the 2907A.  So half-bridge, totem, whatever... sure.  If you don't need direction control then you just need one.

Relays have a gate if the gate is defined as the element... which is what I meant.



Agree that using a switch for direction and a transistor for power is probably the simpliest method.  Looks like the 2N5210 can do something like 50 amps for 625W.
Admittingly there's just about any kind of component out there for an application.  It comes down to cost per unit.

Offline guru

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 1
  • Robotics, CNC, Electronics, Programming
    • ColinMacKenzie.net
Re: H-Bridge Questions
« Reply #8 on: August 09, 2009, 10:14:00 PM »
PWM however does increase your options, but it requires some protection for shoot-through on your transistors (temporary short-circuits)

Shoot-thru by PWM: Not really. The PWM part does'nt cause shoot-through since you are just turning the same side on and off; so in the off portion the motor is freewheeling. The shoot-through comes when you try to change directions or change from dynamic braking to either direction. Mosfet delays, especially when you use P-channel mosfets can produce the shoot-thru you are talking about.

Even if you dont use PWM and just full-on/full-off you will still have shoot-thru on the direction change if you don't account for it --- see my current thread "My tranny's are committing suicide!" :-)

However, you are right that protection is more of a factor when using PWM because of the back-emf/current that must be shuffled away during the off period through the anti-parallel diodes.

Also, when I say turn the same side on and off, you typically only turn *one element* of *one side* on and off. Keeping one transistor on means that transistor's back-emf diode doesnt need to work and thus dissipate heat. You can get real fancy and alternate the transistor you turn off during PWM and over time spread the motors back-current between the two transistors and thier two back-emf diodes. Thus, you can use cheaper/smaller protection diodes.

 

SMF spam blocked by CleanTalk