Search The Site...

Things To Do...

Print this article

Share this article

Add this article to your Favourites

Read this topic's Message Board

Pulse Width Modulation
By Michael Adler and Tim Surtell
Return to the Homepage

Control your Meccano models (or anything else) from your Windows PC!
Take a look at my new MECControl project at

The control of electric motors is something which interests nearly everyone involved with Meccano model building.  Every model has its own motor requirements with regard to the space available, the power of the motor, its speed, whether it must stop and start frequently, and the need for reduction gearing.

On the face of it, simple methods of control are perfectly adequate, with a regulated voltage supply, a simple on/off switch, and the means to reverse the motor. Speed can be controlled with a wire-wound potentiometer (variable resistor) or a circuit such as the Darlington Pair Speed Control.

Further Information Darlington Pair Speed Control - A circuit for linear motor control

In reality, these methods can provide very unrealistic results.  The main problem is poor starting performance, the motor tending to jump almost instantly from a stationary position to what is often more than half speed.  The main cause of this seems to be the starting characteristic of the motor itself which when under load seems reluctant to start.

Motor Characteristics

A motor has a relatively low resistance when it is stationary.  As the speed control is advanced, the current through the motor increases, but the voltage across the motor remains quite low.  The speed control therefore has to be well advanced before the voltage and power fed to the motor are high enough to overcome its reluctance to start.  As the motor speed and the load on it changes, there are changes in its internal resistance.  Speed regulation is not very good under these circumstances, particularly at low speed.

Pulse Width Modulation

Pulse Width Modulation (PWM) is a common technique for speed control which can overcome the problem of the poor starting performance of a motor.

A good analogy is bicycle riding.  You peddle (exert energy) and then coast (relax) using your momentum to carry you forward.  As you slow down (due to wind resistance, friction, road shape) you peddle to speed up and then coast again.  The 'duty cycle' is the ratio of peddling time to the total time (peddle + coast time).  A 100% duty cycle means you are peddling all the time, and a 50% duty cycle means you are peddling only half the time.

PWM for motor speed control works in a very similar way.  Instead of supplying a varying voltage to a motor, it is supplied with a fixed voltage value (such as 12V) which starts it spinning immediately.  The voltage is then removed and the motor 'coasts'.  By continuing this voltage on/off cycle with a varying duty cycle, the motor speed can be controlled.

The waveforms in figure 1 help to explain the way in which this method of control operates.  In each case the signal has maximum and minimum voltages of 12V and 0V.

  • In waveform 1a, the signal has a mark-space ratio of 1:1. With the signal at 12V for 50% of the time, the average voltage is 6V, so the motor runs at half its maximum speed.
  • In waveform 1b, the signal has a mark-space ratio of 3:1, which means that the output is at 12V for 75% of the time.  This clearly gives an average output voltage of 9V, so the motor runs at 3/4 of its maximum speed.
  • In waveform 1c, the signal has a mark-space ratio is 1:3, giving an output signal that is 12V for just 25% of the time.  The average output voltage of this signal is just 3V, so the motor runs at 1/4 of its maximum speed.

By varying the mark-space ratio of the signal over the full range, it is possible to obtain any desired average output voltage from 0V to 12V. The motor will work perfectly well, provided that the frequency of the pulsed signal is set correctly, a suitable frequency being 30Hz.  Setting the frequency too low gives jerky operation, and setting it too high might increase the motor's impedance.

Figure 1: Pulse width modulation waveforms

Designing a PWM Circuit

The concept of PWM inherently requires timing.  Two 555 timer ICs and some potentiometers can be used to generate a PWM signal, and since PWM provides a digital, on/off signal, it is also easy to use a PC or micro-controller to create the signal; however this is beyond the scope of this article.

The circuit in figure 2 uses two 555 ICs and is actually a combination of two types of circuit.  The first is a free running multivibrator (astable) with an adjustable frequency around 30Hz.  The output of this circuit then triggers a pulse shaping (monostable) circuit which adjusts the width of the pulse.  The circuit produces a duty cycle in the range of approximately 0.3% to 97%.

Figure 2: A pulse width modulation circuit using 555 ICs

The speed of the motor is controlled with a single potentiometer (variable resistor).  It is possible to run a Meccano M5 motor to test the circuit, and it will run from dead still to full speed using the potentiometer speed control and a 6V battery as the sole power source.  If you have a 12V motor, you can of course use a 12V power source.

The motor is switched on and off via a TIP31C transistor (shown in figure 3) which can handle motors rated up to 3A at 100V, or a total power of 40W.  If you are using a high power motor, make sure there is a heatsink bolted to the transistor.

Figure 3: Pin-out diagram of the TIP32C transistor

Further Information The 555 Timer - Background information about the 555
The 555 Astable Circuit
The 555 Monostable Circuit
Calibrating the Circuit

The nature of this circuit means that the motor can never be fully switched off.  However, the minimum 0.3% duty cycle should be low enough to effectively stop the motor running.

When you first switch the circuit on and move the speed potentiometer slowly from its minimum position to its maximum position, you will probably find that the speed of the motor increases linearly, then suddenly drops slightly before increasing again.  This is due to the pulse width becoming longer than the time allowed for it by the 555 astable.

The frequency preset of the 555 astable circuit solves this problem by allowing the frequency of the signal to be adjusted so that the speed potentiometer can achieve its full range.  To calibrate it, set the speed potentiometer to its maximum position, then adjust the frequency preset so that the motor runs as fast as possible.  If you have a multimeter that can measure frequency, you can check the modulation frequency at pin 3 of the 555 astable, and confirm the range of the duty cycle at pin 3 of the monostable.

 Shopping List

Here is a list of the parts required to build the PWM circuit as shown in figure 2.

0.01μF Metallised Polyester Film Capacitor   2   64-2381   0.44   0.88
0.1μF Metallised Polyester Film Capacitor   2   64-2384   0.32   0.64
1kΩ 0.25W Metal Film Resistor   4   62-3450   2.66
(per pack of 100)
1N4148 Signal Diode   1   47-3416   0.02   0.02
220μF 16V Radial Electrolytic Capacitor   1   11-0261   0.02   0.02
220kΩ 0.2W Linear Potentiometer   1   65-0735   1.67   1.67
38mm Heatsink for TO220 Style Transistor Cases   1   36-0442   0.45   0.45
500kΩ Horizontal Cermet Potentiometer   1   67-0622   0.43   0.43
8-pin Dual-in-line IC Socket   2   22-1720   0.43   0.86
NE555N Timer IC (Standard 555)   2   82-0336   0.82   1.64
TIP31C High Power NPN Transistor   1   -   0.00   0.00
Grand Total   9.27

Full printer-friendly parts list

Order the above items from Rapid Electronics via our Circuits Shop and help support the Electronics in Meccano website, without affecting the price you pay! Just click on an item for information about it and/or to add it to your Rapid order.

Orders can also be placed by telephoning Rapid on 01206 751 166 or visiting their website at Prices quoted include VAT at 20%.

 Print This Article

 Bookmark or Share This Article   


Post your questions and comments about this article to the Controlling Motors Message Board.
We also have many other message boards for your comments, advice and suggestions.

 Free Email Updates!

Join yourEiM and receive email when your favourite articles and topics are updated.  Click here to sign up now!

Article Information
Topic: Controlling Motors | Created: 17/06/2003 | Last modified: 11/02/2007 | First published in EiM: Issue 6 (January 2000)

Top of Page | Homepage | About | Search | Topics | Features | Circuits Shop | yourEiM

© 1998 - 2024 Tim Surtell