OAP Motor Control Module Design
Links
LMD18200 H-Bridge
-
Speed control of a 12V DC motor is achieved by using the classic H-bridge topology.
![]() |
. To get a motor to turn in one direction, simply close an opposing pair of switches. For instance, in the diagram if you close the A and D switches, the motor should turn in one direction, perhaps clockwise. If the B and C switches are to be closed with A and D open, then the motor turns the opposite direction, in this case counter clockwise.[8] |
In an H-bridge, four switching components are used to alternately connect each of the motor terminals to either the positive or negative supply rails. By adjusting the duty cycle of the various switches, the average voltage applied to the motor terminals may be adjusted from full positive to full negative, permitting smooth control from full forward to full reverse.
Control Signals (DafyddWalters)
The MCM circuit was designed to drive a pair of LMD182000's H-bridges. In locked antiphase mode, the 20kHz pulse-code modulation (-
In locked-antiphase mode, the LMD182000's PWM pins are kept high, and the brake is kept low.
-
In low-power mode the LMD182000's PWM pins are driven low, and the brake is high.
To be compatible with the OAP MCM, the H-bridge driver must be able to be directly driven using transistor to transistor-level logic (
TTL-level)
PCM control signals at 20kHz, and be capable of being driven in locked antiphase mode (instead of direction+PWM).
Pulse-Width Modulation (PWM)
Overview
-
Controlling a DC motor's speed is not as easy as varying it's supply voltage because a motor loses torque (power) as the voltage is lowered and finally stops rotating. The OAP motor driver uses a technique known as "Pulse Width Modulation - PWM" to control speed. With PWM, the motor receives full voltage whenever energized - however, the duration of the voltage changes (switches) very rapidly. As a result, the motor rotates smoothly and with full power regardless of its speed. [4]
-
The two common methods of pulse width modulation are locked antiphase and sign magnitude. One comparison between locked-antiphase PWM vs. sign-magnitude PWM concerns controlling the descent of a robot down a ramp. With sign-magnitude, it's like pushing the robot down the ramp with your hand. If the ramp is steep enough the robot will accelerate away from your hand -- you've lost control. Locked-antiphase is like holding onto the robot with both hands and guiding it down the ramp. The robot will only go as fast as the controller dictates. [7]
Sign Magnitude PWM
-
Alternating between driving the motor and allowing the motor to coast, i.e. switching the enable line.
Locked-Antiphase Mode
-
In locked-antiphase mode, the PWM signal is applied only to the direction input to the H-Bridge. ie: It changes polarity of the motor voltage at the PWM frequency. That is, opposite legs of the H-bridge are always switched in opposite polarity. This ensures that the full supply voltage is applied to the terminals of the motor, either in the forward or reverse direction. By adjusting the duty cycle appropriately, any desired average voltage may be synthesized. [5] In locked-antiphase the PWM duty cycles for various speeds are:
-
0% pwm = 100% reverse
-
25% pwm = 50% reverse
-
50% pwm = zero - stopped
-
75% pwm = 50% forward
-
100% pwm = 100% forward [6]
![]() |
| Benefits | Drawbacks |
| There is no 'zero cross' distortion; a 50% duty cycle means 0V output, 100% duty cycle means full forward, and 0% means full reverse. | The only voltages applied to the motor are full positive or full negative, and at low DC current levels, a significant torque ripple is present at the PWM frequency. |
| It only takes 1 PWM output to run the H Bridge. | The great disadvantage of this type of control is that, when the applied power is zero, the power supplies are dispensing power 50% of the time. This power is converted to heat. For this reason, this kind of control is not recommended for controlling high-power motors.[1] |
| It enables swift motor changes. | |
| The full supply voltage is applied to the terminals of the motor, either in the forward or reverse direction. |
[ref 1, 2]
50% Duty Cycle
-
The motor's inductance acts as a low-pass filter that changes the alternating current to a DC value. Thus, the motor only responds the the average DC voltage. ie: if the power supply is 12 volts and the PWM is 50% duty cycle, the motor sees an average DC voltage of 0.0 volts. That's +12 for half the time and -12 for the other half. In fact, it sees a virtual short across it's terminals - you get breaking for free. [8] At 50% duty cycle the average current is zero.
-
Motor winding inducance is responsible for preventing the motor from drawing the maximum current and burning up when it is stopped. One must use a sufficiently high frequency PWM signal to allow the motor winding to appear as a high impedance. Alternatively, an inductor can be put in series with the motor. There will be a small current when speed is zero depending on the PWM frequency and inductance. Of course, the motor isn't a perfect low pass filter, and the resulting waveform will have ripple. If the motor has too little inductance for the PWM frequency used, then there will be a lot of ripple and the power loss will go up. You'll also be able to feel vibration in the motor when it is stopped.
75% Duty Cycle
-
With 12 volts and a 75% duty cycle the motor sees +12 for 75% and -12 for 25% . The average is +6 volts and the motor runs at half speed.
Calculating PWM Frequency
-
The following formula is used to calculate the highest PWM frequency you can use for your motor:
-
f - switching frequency
-
L - motor winding inductance (from manufacturer specifications)
-
R - armature resistance (can be measured with your volt-ohmmeter
-
2*pi*f*L >> R
-
[ref 2]
Bibliography (Scott Crawford)
| 1 | Braga, Newton C., Robotics, Megatronics, and AI: Experimental Circuit Blocks for Designers; www.newnespress.com; 25 Oct 2001 |
| 2 | Building Robot Drivetrains; Clark D, Owings M.; McGraw-Hill, www.books.mcgraw-hill.com; September 11, 2002 |
| 3 | Maxon, K., Reaching the Next Step in Motion Control and Sensor-Software Fusion for Mobile Robots, http://www.users.qwest.net/~kmaxon/page/side/art2_137.htm |
| 4 | PMW overview for Electronic Kit KIT-189, Gateway Electronics; http://www.gatewayelex.com/ |
| 5 | ORCA Project authors; http://web.mit.edu/orca/www/2004_motorController.shtml; 1998-2006 MIT |
| 6 | Ayers, Eric Z.; http://ayershome.org/~eric/robots/linefollower2/ |
| 7 | Monty Goodson; OpenServo.com newsgroup, June 8, 2004; http://www.openservo.com/forums/viewtopic.php?p=987&sid=3d5e250e85ea214e0e54a50cbb276568 |
| 8 | robologist@yahoo.com; Motor driver circuit; http://www.geocities.com/robodave2000/circuits.htm |
CategoryTechnicalSpecs CategoryDesign

