|
|
| |
|
Gift Guide
Microcontrollers
Robotics
Radio Control
Building Kits
Contact Us |
 |  |
Click here for printer friendly page ... |
Motor Control Using the SN754410 Quad Half H-Bridge ICby Al Margolis, founder www.HobbyEngineering.com An h-bridge is an electrical circuit which allows low power digital circuits, such as microcontrollers, to operate motors and other high energy electrical devices. An h-bridge is essentially a switch. The switch is "flipped" using digital inputs which typically operate at three to five volts and which draw very little current. Just as your little finger can flip a switch that starts a huge motor to lift a drawbridge, an h-bridge allows "little" digital signals to start motors operating at much higher voltages and currents.Using the SN754410 Quad Half H-Bridge IC The SN754410 is a quad half h-bridge IC. The "quad" means that it has four circuit elements, so the chip contains four "half h-bridges". A full h-bridge can drive a motor in both directions (clockwise or counterclockwise) by supplying current in either direction through the motor windings. A half h-bridge can supply current flowing in one direction only so the chip can control up to four motors as long as you only need each motor to move in one direction.
The following table is a wiring diagram for the SN754410 when used as two full h-bridges.
| Pin | Name | Full H-Brdige Function | Notes | | 1 | 1,2EN | Motor 1 Enable | 0V (LOW) = disable motor 5V (HIGH) = enable motor You can use this pin to implement an emergency off switch or to activate electrical braking. In most simple robotics application you can just connect this pin to 5V (HIGH / VDD) and save a pin on your microcontroller. | | 2 | 1A | Motor 1 Clockwise / Forward | 0V (LOW) = ignore 5V (HIGH) = apply current in one direction
| | 3 | 1Y | Motor 1 Power (Output) | | | 4 | Ground | Ground | All 4 ground pins must be connected! | | 5 | Ground | Ground | All 4 ground pins must be connected! | | 6 | 2Y | Motor 1 Power (Output) | | | 7 | 2A | Motor 1 Counterclockwise / Reverse | 0V (LOW) = ignore 5V (HIGH) = apply current in the other direction
| | 8 | VCC2 | Motor Power Source (Input) | This should generally be attached directly to your battery or other primary source. You should not power your motors through your controller board power regulator unless you are absolutley sure that it has adequate current capacity and noise filtering. | | 9 | 3,4EN | Motor 2 Enable | 0V (LOW) = disable motor 5V (HIGH) = enable motor You can use this pin to implement an emergency off switch or to activate electrical braking. In most simple robotics application you can just connect this pin to 5V (HIGH / VDD) and save a pin on your microcontroller. | | 10 | 3A | Motor 2 Clockwise / Forward | 0V (LOW) = ignore 5V (HIGH) = apply current in one direction
| | 11 | 3Y | Motor 2 Power (Output) | | | 12 | Ground | Ground | All 4 ground pins must be connected! | | 13 | Ground | Ground | All 4 ground pins must be connected! | | 14 | 4Y | Motor 2 Power (Output) | | | 15 | 4A | Motor 2 Counterclockwise / Reverse | 0V (LOW) = ignore 5V (HIGH) = apply current in the other direction
| | 16 | VCC1 | IC Logic Power (Input) | Regulated 5v (VCC / VDD) |
Basic Stamp Example Program' {$STAMP BS2sx}
' SN754410 Demo Program #1
'
' This program exercises motors attached to a SN755410NE H-Bridge IC.
' It simply runs the motors full speed in one direction for a period of time,
' pauses and repeats in the opposite direction.
'
' This program assumes the simplist possible hardware implimentation so three
' Basic Stamp I/O pins are required for each motor.
'
' The support routines assume that the three connections for each motor are
' made sequentiantially along one side of an APPMOD connector. That results in
' the numeric sequence of the pins being a sequentional count by two. The first
' Basic Stamp pin number is the Motor ID and is connected to the enable pin
' for that motor on the h-bridge. The next Basic Stamp pin (Motor ID + 2)
' is connected to the h-bridge "on" pin for the forward direction. The last
' pin is connected to the h-bridge "on" pin for the reverse direction.
MotorID VAR Byte ' Current Motor ID
Motor1 CON 1 ' Motor 1 control on stamp pins 1, 3 and 5
' SN754410 pins 1 (1,2EN), 2 (1A) and 7 (2A)
Motor2 CON 2 ' Motor 2 control on stamp pins 2, 4 and 6
' SN754410 pins 9 (3,4EN), 10 (3A) and 15 (4A)
Loop:
DEBUG CR, "s"
MotorID = Motor1
GOSUB MotorBrake
MotorID = Motor2
GOSUB MotorBrake
PAUSE 1000
DEBUG "F"
MotorID = Motor1
GOSUB MotorForward
MotorID = Motor2
GOSUB MotorForward
PAUSE 1000
DEBUG "s"
MotorID = Motor1
GOSUB MotorBrake
MotorID = Motor2
GOSUB MotorBrake
PAUSE 1000
DEBUG "R"
MotorID = Motor1
GOSUB MotorReverse
MotorID = Motor2
GOSUB MotorReverse
PAUSE 1000
GOTO Loop
MotorCoast:
LOW MotorID
HIGH MotorID + 2
HIGH MotorID + 4
RETURN
MotorBrake:
LOW MotorID + 2
LOW MotorID + 4
HIGH MotorID
RETURN
MotorForward:
LOW MotorID + 4
HIGH MotorID + 2
HIGH MotorID
RETURN
MotorReverse:
LOW MotorID + 2
HIGH MotorID + 4
HIGH MotorID
RETURN
|
|
The content on this page was updated on 9/6/2005
|
| |