Shop OBEX P1 Docs P2 Docs Learn Events
Using an H-bridge motor controller — Parallax Forums

Using an H-bridge motor controller

bulkheadbulkhead Posts: 405
edited 2006-02-27 02:04 in General Discussion
I plan to drive a few motors with a few L293D motor drivers (from www.solarbotics.com). Are there any VP's or predefined classes that deal with using H-bridges?

Also, it says for this H-bridge that it has "back-emf diode protection." Does this mean that my Javelin is safe from interferance? Do I need to take any other measures to protect my Javelin incase the H-bridge overheats (and melts)? Right now I have 220 ohm resistors on each of my Javelins pins, so that should be sufficient protection in case of a short if the L293D goes out?

Thanks.

Edit: Ok, I did some research, and if I am correct, I can simply wire the L293 for single wire control (1 per motor)? It says it can be wired so that setting the pin to Vcc and Gnd make the motor rotate in its respective directions (cw and ccw) and nothing at all is "brake". Then, to "pulse" the h-bridge, I can use the PWM class?

Does it matter how often I pulse it? For example, I can have a high time of 100 and a low time of 100, or a high time of 10 and a low of 10. Each should result in the same overall time that the motors are turned on, but the second has a 10x faster "pulse rate."

Post Edited (bulkhead) : 2/26/2006 7:37:26 AM GMT

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-02-26 13:11
    I have not seen such a class. I did find a reference on the BS forum:
    http://downloads.solarbotics.com/PDF/kit10.pdf

    As you find out:
    The last schematic on page 10 shows a single line interface for
    a manual switch. I think you can replace that switch by a javelin I/O pin:
    high output for rotation one way, low output for rotation the other way,
    input (high impedance) for brake.

    You can protect the javelin I/O pin with a 100 ohm resistor.
    I think 220 ohm may be too large compared to the 1kOhm in the schematic.

    I don't think you can use PWM with the single line interface.
    PWM toggles between low and high outputs which means the motor direction
    switches twice every pwm period, probably resulting in no rotation at all.

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-02-26 13:29
    A L293D appnote can be found here
    http://www.eckhard-gosch.de/download/driverapp.pdf

    regards peter
    ·
  • bulkheadbulkhead Posts: 405
    edited 2006-02-26 18:08
    Ok, thanks for the links, I'll check them out. Hmm, I didn't think about the PWM toggling between low and high. I guess I can use a 2 pin set up to do this instead. One pin controls the direction (high low or input) and another pin controls a switching transistor which switches the signal from the first pin on and off? Then I can use PWM on the second pin?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-02-26 18:32
    The appnote shows pwm speed control. Indeed a second pin is used for direction.

    regards peter
  • bulkheadbulkhead Posts: 405
    edited 2006-02-27 01:25
    Ok, I've decided to first experiment with a 3 pin control set up- 2 pins to control direction, and 1 pin with PWM to control the "enable" line. Maybe later I'll try single or dual pin control.

    Looking at the L293D, I found the L298. It can handle more current, but requires "back-EMF protection diodes for chip protection". Is this done with 2 diodes, both connecting from D1 to D2 (the motor's 2 wires), but each in opposite directions? Would an LED work for this, or is there some other "diode" that I should use?

    Thanks.
  • mountaineermountaineer Posts: 27
    edited 2006-02-27 02:04
    I think the L298 are overkill for the solarbotics motors. You might want to look at the Texas Intruments SN754410 @ "http://acroname.com/robotics/parts/R6-754410.html". It is a direct replacement for the L293D but can handle more current.

    You might also want to look at "http://www.oopic.com/odcmotor2.htm". It explains how to use active motor braking.

    Have Fun, botguy

    go troy?
Sign In or Register to comment.