Shop OBEX P1 Docs P2 Docs Learn Events
H-bridges in my tank — Parallax Forums

H-bridges in my tank

ArchiverArchiver Posts: 46,084
edited 2001-10-15 23:54 in General Discussion
I've got a medium size tracked vehicle (18", 10 lb), driven with 2 DC
motors, controlled with 2 H-bridges via a BS2 talking to an R/C
receiver (instead of L/R sticks, I use the BS2 to mix a single speed
input with a steering wheel input).
The vehicle goes fwd/rev just fine, can even spin in place (opposite
track directions). But make a gentle turn? No way. With tracks off
the ground, I can vary left/right track speeds independently, as
required for turning. But on the ground, it just goes straight.
Apparently, any juice to the "slow" side allows that side to be
dragged along at the fast side's speed... appears to "over run" the
slow motor. This may happen because it's mechanically easier than
actually making the turn, which involves all kinds of forces on the
tracks.

Question: Might the slow motor run closer to it's intended speed if I
apply PWM to the direction pin of the H-bridge, instead of the enable
pin?

Enable PWM is obvious- select direction, then PWM the enable pin to
control speed. But I wonder if I enable, then PWM the direction pin,
the motor might resist being over-run?
50% pwm on direction should cause the motor to stand still (0 avg
current), while 60/40 should make it crawl in one direction. But does
this have draw backs? More power usage? Over heat the motor?
Any h-bridge experts out there?
patmat

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 14:03
    You may need to brake or reverse the track on the inside to make it turn
    properly.

    Original Message

    > I've got a medium size tracked vehicle (18", 10 lb), driven with 2 DC
    > motors, controlled with 2 H-bridges via a BS2 talking to an R/C
    > receiver (instead of L/R sticks, I use the BS2 to mix a single speed
    > input with a steering wheel input).
    > The vehicle goes fwd/rev just fine, can even spin in place (opposite
    > track directions). But make a gentle turn? No way. With tracks off
    > the ground, I can vary left/right track speeds independently, as
    > required for turning. But on the ground, it just goes straight.
    > Apparently, any juice to the "slow" side allows that side to be
    > dragged along at the fast side's speed... appears to "over run" the
    > slow motor. This may happen because it's mechanically easier than
    > actually making the turn, which involves all kinds of forces on the
    > tracks.
    >
    > Question: Might the slow motor run closer to it's intended speed if I
    > apply PWM to the direction pin of the H-bridge, instead of the enable
    > pin?
    >
    > Enable PWM is obvious- select direction, then PWM the enable pin to
    > control speed. But I wonder if I enable, then PWM the direction pin,
    > the motor might resist being over-run?
    > 50% pwm on direction should cause the motor to stand still (0 avg
    > current), while 60/40 should make it crawl in one direction. But does
    > this have draw backs? More power usage? Over heat the motor?
    > Any h-bridge experts out there?
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 14:57
    Actually, braking (electrically, not mechanical, that's cruel!) is
    another option, though not available on my current H-bridge (Allegro
    2998). But for smooth gradual turns, I'd have to figure out variable
    pwm on the brake pin as well as the enable... more than I wanted to
    do.
    I hope pwm'ing the direction pin may effectively reverse the inside
    track at PWM frequency, as opposed to a non-smooth stop-brake-turn-
    release-go maneuver.
    patmat

    --- In basicstamps@y..., Rodent <daweasel@s...> wrote:
    > You may need to brake or reverse the track on the inside to make it
    turn
    > properly.
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 15:16
    Hey! Maybe not so tough! If I get a brake-capable H-bridge, then I
    just invert the enable signal and feed to the brake pin...so bridge
    is either enabled or braked.
    Maybe less harsh than reversing the motor at PWM frequency?
    patmat


    > But for smooth gradual turns, I'd have to figure out variable
    > pwm on the brake pin as well as the enable... more than I wanted to
    > do.
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 15:25
    On the Allegro H-Bridge I use (3951) , you PWM only the enable pin -- the
    phase pin is held high or low for whatever direction you want. Looks like
    the 2998 would work the same way, although you don't have a brake pin.

    Once you calculate your PWM values for various turns, you can put them in a
    lookup table and use an index value for the direction you want to turn.

    Original Message

    > Actually, braking (electrically, not mechanical, that's cruel!) is
    > another option, though not available on my current H-bridge (Allegro
    > 2998). But for smooth gradual turns, I'd have to figure out variable
    > pwm on the brake pin as well as the enable... more than I wanted to
    > do.
    > I hope pwm'ing the direction pin may effectively reverse the inside
    > track at PWM frequency, as opposed to a non-smooth stop-brake-turn-
    > release-go maneuver.
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 17:17
    I'm not an expert on tank style movement, but wouldn't widening the distance
    between the treads make turns easier?
    Or maybe shortening the length? Is it too late for that kind of stuff? This
    seems more of a mehanical problem
    than a software problem. Putting 50% pwm on the direction pin would keep the
    motor at stall current consumption
    and that's no good!

    good luck!
    raphael
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 17:43
    --- In basicstamps@y..., raphael <raphael@w...> wrote:
    > I'm not an expert on tank style movement, but wouldn't widening the
    distance between the treads make turns easier?
    > Or maybe shortening the length? Is it too late for that kind of
    stuff?

    ****It's a scale model, changes verboten! (The original had lots of
    driveline problems too)

    This seems more of a mehanical problem
    > than a software problem. Putting 50% pwm on the direction pin would
    keep the motor at stall current consumption
    > and that's no good!


    **** That was my fear, sounds like getting an H-bridge with braking
    might be better.
    patmat



    >
    > good luck!
    > raphael
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 18:13
    > I'm not an expert on tank style movement, but wouldn't widening the distance
    > between the treads make turns easier? Or maybe shortening the length? Is it
    too
    > late for that kind of stuff? This seems more of a mehanical problem than a
    > software problem. Putting 50% pwm on the direction pin would keep the motor at
    > stall current consumption and that's no good!

    Actually, it tends to be opposite; a narrower tread spacing reduces the
    friction.

    In general, you should avoid using tank treads at all costs as the system
    require far more torque (and consumes far more current) than you would
    need for a wheeled solution.


    Mark Hillier, VE6HVW
    President, HVW Technologies Inc.
    Canadian Distributors of Parallax Products and other Neat Stuff
    Tel: (403)-730-8603 Fax: (403)-730-8903
    See our NEW BASIC Stamp Prototyping tools !
    http://www.hvwtech.com/stampstack.htm
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 21:29
    --- In basicstamps@y..., "Pat Matthews" <patmat2350@a...> wrote:
    > Hey! Maybe not so tough! If I get a brake-capable H-bridge, then I
    > just invert the enable signal and feed to the brake pin...so bridge
    > is either enabled or braked.
    > Maybe less harsh than reversing the motor at PWM frequency?
    > patmat
    >
    >
    > > But for smooth gradual turns, I'd have to figure out variable
    > > pwm on the brake pin as well as the enable... more than I wanted
    to
    > > do.

    According to my step-father, a former T.C. Tank Commander before
    tanks had steering wheels. Full scale tanks act the same way.
    Whenever turning there is a noticable reduction in speed as power is
    removed from the 'inside' track and braking is applied. The amount
    required is also dependent on the surface conditions.

    So, if you are driving your tank on asphalt, you will probably need
    to brake, or reverse the inside track quite a bit to the turn. In
    sand, the drag is greater and just removing power should show some
    turning.

    Using an H-bridge with braking capability and PWMing the brake on the
    inside track will save you some battery power. Your other option is
    of course to slowly increase power in the reverse direction, but uses
    battery power. Either way, the motor has current in the coils and
    will generate heat.

    But anyway you look at it, there isn't any smooth transition from
    forward. You need to at least brake or reverse the one track to make
    any significant turn. Suggest you make a dead-band in the center of
    your steering stick where the edge of the dead-band is no power
    forward. Slowly increase brake with transition to reverse power.

    Good luck.
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-15 23:54
    > Hey! Maybe not so tough! If I get a brake-capable H-bridge, then I
    > just invert the enable signal and feed to the brake pin...so bridge
    > is either enabled or braked.

    Check the manual for your H-bridge chip. You may burn it up by braking
    unnecessarily. Look for a duty cycle, or maximum amount of time that the
    brake can be safly applied.

    Joshua
Sign In or Register to comment.