Explanation
An H-bridge has four meaningful states. Top left and bottom right conduct: direction 1. Top right and bottom left conduct: direction 2. Both bottom (or both top) conduct: the motor terminals are shorted and the motor brakes. All open: the motor coasts. The two switches on one side must never conduct at the same time; that would short-circuit the supply.
Motor driver ICs contain the switches, the control logic and usually freewheeling diodes that absorb the voltage spikes when the motor inductance is switched off. The L293D contains four half-bridges, i.e. two complete H-bridges, and according to its data sheet is rated for up to 600 mA per channel at 4.5 to 36 V. Each bridge has two direction inputs and an enable input through which speed is set with PWM.
In drive engineering the same principle is called a four-quadrant controller: driving and braking in both directions.
In practice: Design & Make – Mecanum rover, Circuit board (motor driver board)
The Mecanum rover's motor driver board carries two L293D in DIP-16 packages, because one IC drives two motors. Each motor has two direction pins and one PWM-capable enable pin. The project data sum it up: the direction pins decide where, the enable pin decides how hard. Two equal direction levels do not mean off but brake; switching off is done via the enable pin.
To the training project Design & Make – Mecanum rover
Common mistakes
- Setting both direction pins to the same level to switch off. The motor brakes actively instead of coasting.
- Running motors with more current than the driver can handle. It overheats and shuts down or fails.
- Correcting a reversed motor only in the code. Schematic, wiring and software no longer match afterwards.