Pulse Width Modulation
Pulse Width Modulation
The PWM switching frequency can vary greatly depending on load and application. For example,
switching only has to be done several times a minute in an electric stove; 100 or 120 Hz (double of the
utility frequency) in a lamp dimmer; between a few kilohertz (kHz) and tens of kHz for a motor drive;
and well into the tens or hundreds of kHz in audio amplifiers and computer power supplies. Choosing a
switching frequency that is too high for the application may cause premature failure of mechanical
control components despite getting smooth control of the load. Selecting a switching frequency that is too
low for the application causes oscillations in the load. The main advantage of PWM is that power loss in
the switching devices is very low. When a switch is off there is practically no current, and when it is on
and power is being transferred to the load, there is almost no voltage drop across the switch. Power loss,
being the product of voltage and current, is thus in both cases close to zero. PWM also works well with
digital controls, which, because of their on/off nature, can easily set the needed duty cycle. PWM has also
been used in certain communication systems where its duty cycle has been used to convey information
over a communications channel.
In electronics, many modern microcontrollers (MCUs) integrate PWM controllers exposed to external
pins as peripheral devices under firmware control. These are commonly used for direct current (DC)
motor control in robotics, switched-mode power supply regulation, and other applications.
Duty cycle
The term duty cycle describes the proportion of 'on' time to the regular interval or 'period' of time; a low
duty cycle corresponds to low power, because the power is off for most of the time. Duty cycle is
expressed in percent, 100% being fully on. When a digital signal is on half of the time and off the other
half of the time, the digital signal has a duty cycle of 50% and resembles a "square" wave. When a digital
signal spends more time in the on state than the off state, it has a duty cycle of >50%. When a digital
signal spends more time in the off state than the on state, it has a duty cycle of <50%. Here is a pictorial
that illustrates these three scenarios:
History
The Corliss steam engine was patented in 1849. It used pulse-width modulation to control the intake
valve of a steam engine cylinder. A centrifugal governor was used to provide automatic feedback.
Some machines (such as a sewing machine motor) require partial or variable power. In the past, control
(such as in a sewing machine's foot pedal) was implemented by use of a rheostat connected in series with
the motor to adjust the amount of current flowing through the motor. It was an inefficient scheme, as this
also wasted power as heat in the resistor element of the rheostat, but tolerable because the total power
was low. While the rheostat was one of several methods of controlling power (see autotransformers and
Variac for more info), a low cost and efficient power switching/adjustment method was yet to be found.
This mechanism also needed to be able to drive motors for fans, pumps and robotic servomechanisms,
and needed to be compact enough to interface with lamp dimmers. PWM emerged as a solution for this
complex problem.
PWM telecommunications systems were invented just prior to the start of World War II, but at that time
time-division multiplexing was already in use and there were only experimental PWM systems. This
changed with the introduction of the cavity magnetron in 1940, which could produce pulses of microwave
frequency energy but could not vary its frequency or precisely control its amplitude. A PWM encoder was
used to trigger a magnetron in the British Army's Wireless Set Number 10, which provided long-distance
telephone relay, up to 80 kilometres (50 mi).[3]
The Philips, N. V. company designed an optical scanning system (published (https://www.pearl-hifi.com/
06_Lit_Archive/02_PEARL_Arch/Vol_16/Sec_53/Philips_Tech_Review/PTechReview-08-1946-097.pd
f) in 1946) for variable area film soundtrack which produced the PWM. It was intended to reduce noise
when playing back a film soundtrack. The proposed system had a threshold between "white" and "black"
parts of soundtrack.[4]
One early application of PWM was in the Sinclair X10, a 10 W audio amplifier available in kit form in
the 1960s. At around the same time, PWM started to be used in AC motor control.[5]
Of note, for about a century, some variable-speed electric motors have had decent efficiency, but they
were somewhat more complex than constant-speed motors, and sometimes required bulky external
electrical apparatus, such as a bank of variable power resistors or rotating converters such as the Ward
Leonard drive.
Principle
This latter expression can be fairly simplified in many cases where as . From
this, the average value of the signal ( ) is directly dependent on the duty cycle D.
However, by varying (i.e. modulating) the duty cycle (and possibly also the period), the following more
advanced pulse-width modulated waves allow variation of the average value of the waveform.
Intersective method PWM
The intersective method is a simple way to generate a PWM output signal (magenta in above figure) with
fixed period and varying duty cycle is by using a comparator to switch the PWM output state when the
input waveform (red) intersects with a sawtooth or a triangle waveform (blue).
Depending on the type of sawtooth or triangle waveform (green in below figure), intersective PWM
signals (blue in the below figure) can be aligned in three manners:
Leading edge modulation (top plot) uses a reverse sawtooth wave to generate the PWM.
The PWM's leading edge is held at the leading edge of the window and the trailing edge is
modulated.
Trailing edge modulation (middle plot) uses a normal sawtooth wave to generate the PWM.
The PWM's trailing edge is fixed and the leading edge is modulated.
Centered pulses (bottom) uses a triangle waveform to generate the PWM. The pulse center
is fixed in the center of the time window and both edges of the pulse are moved to compress
or expand the width.
Time proportioning
Many digital circuits can generate PWM signals (e.g., many microcontrollers have PWM outputs). They
normally use a counter that increments periodically (it is connected directly or indirectly to the clock of
the circuit) and is reset at the end of every period of the PWM. When the counter value is more than the
reference value, the PWM output changes state from high to low (or low to high).[6] This technique is
referred to as time proportioning, particularly as time-proportioning control[7] – which proportion of a
fixed cycle time is spent in the high state.
The incremented and periodically reset counter is the discrete version of the intersecting method's
sawtooth. The analog comparator of the intersecting method becomes a simple integer comparison
between the current counter value and the digital (possibly digitized) reference value. The duty cycle can
only be varied in discrete steps, as a function of the counter resolution. However, a high-resolution
counter can provide quite satisfactory performance.
Spectrum
The resulting spectra (of the three alignments) are similar. Each contains a DC component, a base
sideband containing the modulating signal, and phase modulated carriers at each harmonic of the
frequency of the pulse. The amplitudes of the harmonic groups are restricted by a envelope (sinc
function) and extend to infinity. The infinite bandwidth is caused by the nonlinear operation of the pulse-
width modulator. In consequence, a digital PWM suffers from aliasing distortion that significantly reduce
its applicability for modern communication systems. By limiting the bandwidth of the PWM kernel,
aliasing effects can be avoided.[8]
On the contrary, delta modulation and delta-sigma modulation are random processes that produces a
continuous spectrum without distinct harmonics. While intersective PWM uses a fixed period but a
varying duty cycle, the period of delta and delta-sigma modulated PWMs varies in addition to their duty
cycle.
Delta modulation
Delta modulation produces a PWM signal (magenta in above figure) which changes state whenever its
integral (blue) hits the limits (green) surrounding the input (red).
Asynchronous (i.e. unclocked) delta-sigma modulation produces a PWM output (blue in bottom plot)
which is subtracted from the input signal (green in top plot) to form an error signal (blue in top plot). This
error is integrated (magenta in middle plot). When the integral of the error exceeds the limits (the upper
and lower grey lines in middle plot), the PWM output changes state. By integrating the difference of the
error with the input signal, delta-sigma modulation shapes noise of the resulting spectrum to be more in
higher frequencies above the input signal's band.
If you have a signal that is bandlimited to a bandwidth of f0 then you can collect all the
information there is in that signal by sampling it at discrete times, as long as your sample rate
is greater than 2f0.[10]
Applications
Servos
PWM is used to control servomechanisms; see servo control.
Telecommunications
In telecommunications, PWM is a form of signal modulation where the widths of the pulses correspond
to specific data values encoded at one end and decoded at the other.
Pulses of various lengths (the information itself) will be sent at regular intervals (the carrier frequency of
the modulation).
_ _ _ _ _ _ _ _
| | | | | | | | | | | | | | | |
Clock | | | | | | | | | | | | | | | |
__| |____| |____| |____| |____| |____| |____| |____| |____
_ __ ____ ____ _
PWM signal | | | | | | | | | |
| | | | | | | | | |
_________| |____| |___| |________| |_| |___________
Data 0 1 2 4 0 4 1 0
The inclusion of a clock signal is not necessary, as the leading edge of the data signal can be used as the
clock if a small offset is added to each data value in order to avoid a data value with a zero length pulse.
Data 0 1 2 4 0 4 1 0
Power delivery
PWM can be used to control the amount of power delivered to a load without incurring the losses that
would result from linear power delivery by resistive means. Drawbacks to this technique are that the
power drawn by the load is not constant but rather discontinuous (see Buck converter), and energy
delivered to the load is not continuous either. However, the load may be inductive, and with a sufficiently
high frequency and when necessary using additional passive electronic filters, the pulse train can be
smoothed and average analog waveform recovered. Power flow into the load can be continuous. Power
flow from the supply is not constant and will require energy storage on the supply side in most cases. (In
the case of an electrical circuit, a capacitor to absorb energy stored in (often parasitic) supply side
inductance.)
High frequency PWM power control systems are easily realisable with semiconductor switches. As
explained above, almost no power is dissipated by the switch in either on or off state. However, during
the transitions between on and off states, both voltage and current are nonzero and thus power is
dissipated in the switches. By quickly changing the state between fully on and fully off (typically less
than 100 nanoseconds), the power dissipation in the switches can be quite low compared to the power
being delivered to the load.
Modern semiconductor switches such as MOSFETs or insulated-gate bipolar transistors (IGBTs) are well
suited components for high-efficiency controllers. Frequency converters used to control AC motors may
have efficiencies exceeding 98%. Switching power supplies have lower efficiency due to low output
voltage levels (often even less than 2 V for microprocessors are needed) but still more than 70–80%
efficiency can be achieved.
Variable-speed computer fan controllers usually use PWM, as it is far more efficient when compared to a
potentiometer or rheostat. (Neither of the latter is practical to operate electronically; they would require a
small drive motor.)
Light dimmers for home use employ a specific type of PWM control. Home-use light dimmers typically
include electronic circuitry that suppresses current flow during defined portions of each cycle of the AC
line voltage. Adjusting the brightness of light emitted by a light source is then merely a matter of setting
at what voltage (or phase) in the AC half-cycle the dimmer begins to provide electric current to the light
source (e.g. by using an electronic switch such as a triac). In this case the PWM duty cycle is the ratio of
the conduction time to the duration of the half AC cycle defined by the frequency of the AC line voltage
(50 Hz or 60 Hz depending on the country).
These rather simple types of dimmers can be effectively used with inert (or relatively slow reacting) light
sources such as incandescent lamps, for example, for which the additional modulation in supplied
electrical energy which is caused by the dimmer causes only negligible additional fluctuations in the
emitted light. Some other types of light sources such as light-emitting diodes (LEDs), however, turn on
and off extremely rapidly and would perceivably flicker if supplied with low-frequency drive voltages.
Perceivable flicker effects from such rapid response light sources can be reduced by increasing the PWM
frequency. If the light fluctuations are sufficiently rapid (faster than the flicker fusion threshold), the
human visual system can no longer resolve them and the eye perceives the time average intensity without
flicker.
In electric cookers, continuously variable power is applied to the heating elements such as the hob or the
grill using a device known as a simmerstat. This consists of a thermal oscillator running at approximately
two cycles per minute and the mechanism varies the duty cycle according to the knob setting. The
thermal time constant of the heating elements is several minutes so that the temperature fluctuations are
too small to matter in practice.
Voltage regulation
PWM is also used in efficient voltage regulators. By switching the voltage to the load with the
appropriate duty cycle, the output will approximate a voltage at the desired level. The switching noise is
usually filtered with an inductor and a capacitor.
One method measures the output voltage. When it is lower than the desired voltage, it turns on the switch.
When the output voltage is above the desired voltage, it turns off the switch.
Class-D amplifiers produce a PWM equivalent of a lower frequency input signal that can be sent to a
loudspeaker via a suitable filter network to block the carrier and recover the original lower frequency
signal. Since they switch power directly from the high supply rail and low supply rail, these amplifiers
have efficiency above 90% and can be relatively compact and light, even for large power outputs. For a
few decades, industrial and military PWM amplifiers have been in common use, often for driving
servomotors. Field-gradient coils in MRI machines are driven by relatively high-power PWM amplifiers.
Historically, a crude form of PWM has been used to play back PCM digital sound on the PC speaker,
which is driven by only two voltage levels, typically 0 V and 5 V. By carefully timing the duration of the
pulses, and by relying on the speaker's physical filtering properties (limited frequency response, self-
inductance, etc.) it was possible to obtain an approximate playback of mono PCM samples, although at a
very low quality, and with greatly varying results between implementations. The Sega 32X uses PWM to
play sample-based sound in its games.
In more recent times, the Direct Stream Digital sound encoding method was introduced, which uses a
generalized form of pulse-width modulation called pulse-density modulation, at a high enough sampling
rate (typically in the order of MHz) to cover the whole acoustic frequencies range with sufficient fidelity.
This method is used in the SACD format, and reproduction of the encoded audio signal is essentially
similar to the method used in class-D amplifiers.
Electrical
SPWM (sine–triangle pulse-width modulation) signals are used in solar inverter design. These switching
signals are fed to the FETs that are used in the device. The device's efficiency depends on the harmonic
content of the PWM signal. There is much research on eliminating unwanted harmonics and improving
the fundamental strength, some of which involves using a modified carrier signal instead of a classic
sawtooth signal[12][13][14] in order to decrease power losses and improve efficiency. Another common
application is in robotics where PWM signals are used to control the speed of the robot by controlling the
motors.
See also
Analog signal to discrete time interval converter
Class-D amplifier
Computer fan control
Continuously variable slope delta modulation
Delta-sigma modulation
H-bridge
Pulse-amplitude modulation
Pulse-code modulation
Pulse-density modulation
Pulse-frequency modulation
Pulse-position modulation
Radio control
Random pulse-width modulation
RC servo
Sliding mode control - produces smooth behavior by way of discontinuous switching in
systems
Space vector modulation
Sound chip
References
1. Butterfield, Andrew J.; Szymanski, John, eds. (2018). "A Dictionary of Electronics and
Electrical Engineering" (https://dx.doi.org/10.1093/acref/9780198725725.001.0001). Oxford
Reference. doi:10.1093/acref/9780198725725.001.0001 (https://doi.org/10.1093%2Facref%
2F9780198725725.001.0001). ISBN 978-0-19-872572-5.
2. "Sizing a Grid-Tied PV System ...with Battery Backup" (https://www.homepower.com/article
s/solar-electricity/design-installation/sizing-grid-tied-pv-system-battery-backup). Home
Power Magazine.
3. "Pulse-Width Modulation: The Basic Principles Described" (https://worldradiohistory.com/U
K/Wireless-World/40s/Wireless-World-1945-12.pdf) (PDF). Wireless World. December 1945.
pp. 361–362.
4. Westmijze, W. K. (1946). "A New Method of Counteracting Noise in Sound Film
Reproduction" (https://web.archive.org/web/20220906215112/https://ieeexplore.ieee.org/doc
ument/7252228/authors#authors). Journal of the Society of Motion Picture Engineers. 47
(5): 426–440. doi:10.5594/J12769 (https://doi.org/10.5594%2FJ12769). ISSN 0097-5834 (ht
tps://search.worldcat.org/issn/0097-5834). Archived from the original (https://ieeexplore.iee
e.org/document/7252228/authors#authors) on September 6, 2022 – via IEEE.
5. Schönung, A.; Stemmler, H. (August 1964). "Geregelter Drehstrom-Umkehrantrieb mit
gesteuertem Umrichter nach dem Unterschwingungsverfahren". BBC Mitteilungen. 51 (8/9):
555–577.
6. Barr, Michael (1 September 2001). "Introduction to Pulse Width Modulation (PWM)" (https://
barrgroup.com/Embedded-Systems/How-To/PWM-Pulse-Width-Modulation). Barr Group.
7. Fundamentals of HVAC Control Systems, by Robert McDowall, p. 21 (https://books.google.c
om/books?id=UMk1EUp-W-UC&pg=PA21&dq=%22time+proportioning%22)
8. Hausmair, Katharina; Shuli Chi; Peter Singerl; Christian Vogel (February 2013). "Aliasing-
Free Digital Pulse-Width Modulation for Burst-Mode RF Transmitters". IEEE Transactions on
Circuits and Systems I: Regular Papers. 60 (2): 415–427. CiteSeerX 10.1.1.454.9157 (http
s://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.454.9157).
doi:10.1109/TCSI.2012.2215776 (https://doi.org/10.1109%2FTCSI.2012.2215776).
S2CID 21795841 (https://api.semanticscholar.org/CorpusID:21795841).
9. J. Huang, K. Padmanabhan, and O. M. Collins, “The sampling theorem with constant
amplitude variable width pulses”, IEEE transactions on Circuits and Systems, vol. 58, pp.
1178 - 1190, June 2011.
10. Wescott, Tim (August 14, 2018). "Sampling: What Nyquist Didn't Say, and What to Do About
It" (http://www.wescottdesign.com/articles/Sampling/sampling.pdf) (PDF). Wescott Design
Services. "The Nyquist-Shannon sampling theorem is useful, but often misused when
engineers establish sampling rates or design anti-aliasing filters."
11. "Synthesizing Strings: PWM & String Sounds" (https://www.soundonsound.com/techniques/
synthesizing-strings-pwm-string-sounds). www.soundonsound.com.
12. Hirak Patangia, Sri Nikhil Gupta Gourisetti, "A Harmonically Superior Modulator with Wide
Baseband and Real-Time Tunability", IEEE International Symposium on Electronic Design
(ISED), India, Dec.11.
13. Hirak Patangia, Sri Nikhil Gupta Gourisetti, “Real Time Harmonic Elimination Using a
Modified Carrier”, CONIELECOMP, Mexico, Feb 2012.
14. Hirak Patangia, Sri Nikhil Gupta Gourisetti, “A Novel Strategy for Selective Harmonic
Elimination Based on a Sine-Sine PWM Model”, MWSCAS, U.S.A, Aug 2012.
External links
An Introduction to Delta Sigma Converters (http://www.beis.de/Elektronik/DeltaSigma/Delta
Sigma.html)
Pulse Width Modulation in PID control loop - free simulator (http://www.pidlab.com/en/pwm-
demo)
Pulse Width Modulation in Desktop monitors - monitor flicker (http://www.tftcentral.co.uk/arti
cles/pulse_width_modulation.htm)
Retrieved from "https://en.wikipedia.org/w/index.php?title=Pulse-width_modulation&oldid=1292073469"