Professional Documents
Culture Documents
Pulse-Width Modulation - Wikipedia
Pulse-Width Modulation - Wikipedia
Pulse-Width Modulation - Wikipedia
PWM is useful for cont rolling t he average power or amplit ude delivered by an elect rical signal.
The average value of volt age (and current ) fed t o t he load is cont rolled by swit ching t he supply
bet ween 0 and 100% at a rat e fast er t han it t akes t he load t o change significant ly. The longer
t he swit ch is on, t he higher t he t ot al power supplied t o t he load. Along wit h maximum power point
t racking (MPPT), it is one of t he primary met hods of cont rolling t he out put of solar panels t o
t hat which can be ut ilized by a bat t ery.[2] PWM is part icularly suit ed for running inert ial loads such
as mot ors, which are not as easily affect ed by t his discret e swit ching. The goal of PWM is t o
cont rol a load; however, t he PWM swit ching frequency must be select ed carefully in order t o
smoot hly do so.
The PWM swit ching frequency can vary great ly depending on load and applicat ion. For example,
swit ching only has t o be done several t imes a minut e in an elect ric st ove; 100 or 120 Hz (double
of t he ut ilit y frequency) in a lamp dimmer; bet ween a few kilohert z (kHz) and t ens of kHz for a
mot or drive; and well int o t he t ens or hundreds of kHz in audio amplifiers and comput er power
supplies. Choosing a swit ching frequency t hat is t oo high for t he applicat ion may cause
premat ure failure of mechanical cont rol component s despit e get t ing smoot h cont rol of t he load.
Select ing a swit ching frequency t hat is t oo low for t he applicat ion causes oscillat ions in t he load.
The main advant age of PWM is t hat power loss in t he swit ching devices is very low. When a
swit ch is off t here is pract ically no current , and when it is on and power is being t ransferred t o
t he load, t here is almost no volt age drop across t he swit ch. Power loss, being t he product of
volt age and current , is t hus in bot h cases close t o zero. PWM also works well wit h digit al
cont rols, which, because of t heir on/off nat ure, can easily set t he needed dut y cycle. PWM has
also been used in cert ain communicat ion syst ems where it s dut y cycle has been used t o convey
informat ion over a communicat ions channel.
In elect ronics, many modern microcont rollers (MCUs) int egrat e PWM controllers exposed t o
ext ernal pins as peripheral devices under firmware cont rol. These are commonly used for direct
current (DC) mot or cont rol in robot ics, swit ched-mode power supply regulat ion, and ot her
applicat ions.
Duty cycle
The t erm duty cycle describes t he proport ion of 'on' t ime t o t he regular int erval or 'period' of t ime;
a low dut y cycle corresponds t o low power, because t he power is off for most of t he t ime. Dut y
cycle is expressed in percent , 100% being fully on. When a digit al signal is on half of t he t ime and
off t he ot her half of t he t ime, t he digit al signal has a dut y cycle of 50% and resembles a "square"
wave. When a digit al signal spends more t ime in t he on st at e t han t he off st at e, it has a dut y
cycle of >50%. When a digit al signal spends more t ime in t he off st at e t han t he on st at e, it has a
dut y cycle of <50%. Here is a pict orial t hat illust rat es t hese t hree scenarios:
History
The Corliss st eam engine was pat ent ed in 1849. It used pulse-widt h modulat ion t o cont rol t he
int ake valve of a st eam engine cylinder. A cent rifugal governor was used t o provide aut omat ic
feedback.
Some machines (such as a sewing machine mot or) require part ial or variable power. In t he past ,
cont rol (such as in a sewing machine's foot pedal) was implement ed by use of a rheost at
connect ed in series wit h t he mot or t o adjust t he amount of current flowing t hrough t he mot or. It
was an inefficient scheme, as t his also wast ed power as heat in t he resist or element of t he
rheost at , but t olerable because t he t ot al power was low. While t he rheost at was one of several
met hods of cont rolling power (see aut ot ransformers and Variac for more info), a low cost and
efficient power swit ching/adjust ment met hod was yet t o be found. This mechanism also needed
t o be able t o drive mot ors for fans, pumps and robot ic servos, and needed t o be compact
enough t o int erface wit h lamp dimmers. PWM emerged as a solut ion for t his complex problem.
The Philips, N. V. company designed an opt ical scanning syst em (published (ht t ps://www.pearl-hifi.
com/06_ Lit _ Archive/02_ PEARL_ Arch/Vol_ 16/Sec_ 53/Philips_ Tech_ Review/PTechReview-08-
1946-097.pdf) in 1946) for variable area film soundt rack which produced t he PWM. It was
int ended for reducing noise when playing back a film soundt rack. The proposed syst em had a
t hreshold bet ween "whit e" and "black" part s of soundt rack.[3]
One early applicat ion of PWM was in t he Sinclair X10, a 10 W audio amplifier available in kit form in
t he 1960s. At around t he same t ime PWM st art ed t o be used in AC mot or cont rol.[4]
Of not e, for about a cent ury, some variable-speed elect ric mot ors have had decent efficiency,
but t hey were somewhat more complex t han const ant -speed mot ors, and somet imes required
bulky ext ernal elect rical apparat us, such as a bank of variable power resist ors or rot at ing
convert ers such as t he Ward Leonard drive.
Principle
If we consider a periodic pulse wave wit h period , low value , a high value and a
const ant dut y cycle D (Figure 1), t he average value of t he waveform is given by:
However, by varying (i.e. modulat ing) t he dut y cycle (and possibly also t he period), t he following
more advanced pulse-widt h modulat ed waves allow variat ion of t he average value of t he
waveform.
The int ersect ive met hod is a simple way t o generat e a PWM out put signal (magent a in above
figure) wit h fixed period and varying dut y cycle is by using a comparat or t o swit ch t he PWM
out put st at e when t he input waveform (red) int ersect s wit h a sawt oot h or a t riangle waveform
(blue).
Depending on t he t ype of sawt oot h or t riangle waveform (green in below figure), int ersect ive
PWM signals (blue in t he below figure) can be aligned in t hree manners:
Leading edge modulat ion (t op plot ) uses a reverse sawt oot h wave t o generat e t he PWM. The
PWM's leading edge is held at t he leading edge of t he window and t he t railing edge is
modulat ed.
Trailing edge modulat ion (middle plot ) uses a normal sawt oot h wave t o generat e t he PWM.
The PWM's t railing edge is fixed and t he leading edge is modulat ed.
Cent ered pulses (bot t om) uses a t riangle waveform t o generat e t he PWM. The pulse cent er is
fixed in t he cent er of t he t ime window and bot h edges of t he pulse are moved t o compress or
expand t he widt h.
Many digit al circuit s can generat e PWM signals (e.g., many microcont rollers have PWM out put s).
They normally use a count er t hat increment s periodically (it is connect ed direct ly or indirect ly t o
t he clock of t he circuit ) and is reset at t he end of every period of t he PWM. When t he count er
value is more t han t he reference value, t he PWM out put changes st at e from high t o low (or low
t o high).[5] This t echnique is referred t o as time propor tioning, part icularly as time-
propor tioning control[6] – which proportion of a fixed cycle t ime is spent in t he high st at e.
The increment ed and periodically reset count er is t he discret e version of t he int ersect ing
met hod's sawt oot h. The analog comparat or of t he int ersect ing met hod becomes a simple
int eger comparison bet ween t he current count er value and t he digit al (possibly digit ized)
reference value. The dut y cycle can only be varied in discret e st eps, as a funct ion of t he count er
resolut ion. However, a high-resolut ion count er can provide quit e sat isfact ory performance.
Spectrum
The result ing spect ra (of t he t hree alignment s) are similar. Each cont ains a dc component , a base
sideband cont aining t he modulat ing signal, and phase modulat ed carriers at each harmonic of t he
frequency of t he pulse. The amplit udes of t he harmonic groups are rest rict ed by a
envelope (sinc funct ion) and ext end t o infinit y. The infinit e bandwidt h is caused by t he nonlinear
operat ion of t he pulse-widt h modulat or. In consequence, a digit al PWM suffers from aliasing
dist ort ion t hat significant ly reduce it s applicabilit y for modern communicat ion syst ems. By
limit ing t he bandwidt h of t he PWM kernel, aliasing effect s can be avoided.[7]
On t he cont rary, delt a modulat ion and delt a-sigma modulat ion are random processes t hat
produces a cont inuous spect rum wit hout dist inct harmonics. While int ersect ive PWM uses a fixed
period but a varying dut y cycle, t he period of delt a and delt a-sigma modulat ed PWMs varies in
addit ion t o t heir dut y cycle.
Delta modulation
Delt a modulat ion produces a PWM signal (magent a in above figure) which changes st at e
whenever it s int egral (blue) hit s t he limit s (green) surrounding t he input (red).
Asynchronous delta-sigma PWM
Asynchronous (i.e. unclocked) delt a-sigma modulat ion produces a PWM out put (blue in bot t om
plot ) which is subt ract ed from t he input signal (green in t op plot ) t o form an error signal (blue in
t op plot ). This error is int egrat ed (magent a in middle plot ). When t he int egral of t he error exceeds
t he limit s (t he upper and lower grey lines in middle plot ), t he PWM out put changes st at e. By
int egrat ing t he difference of t he error wit h t he input signal, delt a-sigma modulat ion shapes noise
of t he result ing spect rum t o be more in higher frequencies above t he input signal's band.
Space vect or modulat ion is a PWM cont rol algorit hm for mult i-phase AC generat ion, in which t he
reference signal is sampled regularly; aft er each sample, non-zero act ive swit ching vect ors
adjacent t o t he reference vect or and one or more of t he zero swit ching vect ors are select ed for
t he appropriat e fract ion of t he sampling period in order t o synt hesize t he reference signal as t he
average of t he used vect ors.
Direct t orque cont rol is a met hod used t o cont rol AC mot ors. It is closely relat ed wit h t he delt a
modulat ion (see above). Mot or t orque and magnet ic flux are est imat ed and t hese are cont rolled
t o st ay wit hin t heir hyst eresis bands by t urning on a new combinat ion of t he device's
semiconduct or swit ches each t ime eit her signal t ries t o deviat e out of it s band.
PWM sampling theorem
The process of PWM conversion is non-linear and it is generally supposed t hat low pass filt er
signal recovery is imperfect for PWM. The PWM sampling t heorem[8] shows t hat PWM
conversion can be perfect :
Applications
Servos
Telecommunications
In t elecommunicat ions, PWM is a form of signal modulat ion where t he widt hs of t he pulses
correspond t o specific dat a values encoded at one end and decoded at t he ot her.
Pulses of various lengt hs (t he informat ion it self) will be sent at regular int ervals (t he carrier
frequency of t he modulat ion).
_ _ _ _ _ _ _ _
| | | | | | | | | | | | | | | |
Clock | | | | | | | | | | | | | | | |
__| |____| |____| |____| |____| |____| |____| |____| |____
_ __ ____ ____ _
PWM signal | | | | | | | | | |
| | | | | | | | | |
_________| |____| |___| |________| |_| |___________
Data 0 1 2 4 0 4 1 0
The inclusion of a clock signal is not necessary, as t he leading edge of t he dat a signal can be
used as t he clock if a small offset is added t o each dat a value in order t o avoid a dat a value wit h
a zero lengt h pulse.
Data 0 1 2 4 0 4 1
0
Power delivery
PWM can be used t o cont rol t he amount of power delivered t o a load wit hout incurring t he
losses t hat would result from linear power delivery by resist ive means. Drawbacks t o t his
t echnique are t hat t he power drawn by t he load is not const ant but rat her discont inuous (see
Buck convert er), and energy delivered t o t he load is not cont inuous eit her. However, t he load may
be induct ive, and wit h a sufficient ly high frequency and when necessary using addit ional passive
elect ronic filt ers, t he pulse t rain can be smoot hed and average analog waveform recovered.
Power flow int o t he load can be cont inuous. Power flow from t he supply is not const ant and will
require energy st orage on t he supply side in most cases. (In t he case of an elect rical circuit , a
capacit or t o absorb energy st ored in (oft en parasit ic) supply side induct ance.)
High frequency PWM power cont rol syst ems are easily realisable wit h semiconduct or swit ches.
As explained above, almost no power is dissipat ed by t he swit ch in eit her on or off st at e.
However, during t he t ransit ions bet ween on and off st at es, bot h volt age and current are nonzero
and t hus power is dissipat ed in t he swit ches. By quickly changing t he st at e bet ween fully on and
fully off (t ypically less t han 100 nanoseconds), t he power dissipat ion in t he swit ches can be
quit e low compared t o t he power being delivered t o t he load.
Modern semiconduct or swit ches such as MOSFETs or insulat ed-gat e bipolar t ransist ors (IGBTs)
are well suit ed component s for high-efficiency cont rollers. Frequency convert ers used t o cont rol
AC mot ors may have efficiencies exceeding 98%. Swit ching power supplies have lower efficiency
due t o low out put volt age levels (oft en even less t han 2 V for microprocessors are needed) but
st ill more t han 70–80% efficiency can be achieved.
Variable-speed comput er fan cont rollers usually use PWM, as it is far more efficient when
compared t o a pot ent iomet er or rheost at . (Neit her of t he lat t er is pract ical t o operat e
elect ronically; t hey would require a small drive mot or.)
Light dimmers for home use employ a specific t ype of PWM cont rol. Home-use light dimmers
t ypically include elect ronic circuit ry which suppresses current flow during defined port ions of
each cycle of t he AC line volt age. Adjust ing t he bright ness of light emit t ed by a light source is
t hen merely a mat t er of set t ing at what volt age (or phase) in t he AC half-cycle t he dimmer
begins t o provide elect ric current t o t he light source (e.g. by using an elect ronic swit ch such as a
t riac). In t his case t he PWM dut y cycle is t he rat io of t he conduct ion t ime t o t he durat ion of t he
half AC cycle defined by t he frequency of t he AC line volt age (50 Hz or 60 Hz depending on t he
count ry).
These rat her simple t ypes of dimmers can be effect ively used wit h inert (or relat ively slow
react ing) light sources such as incandescent lamps, for example, for which t he addit ional
modulat ion in supplied elect rical energy which is caused by t he dimmer causes only negligible
addit ional fluct uat ions in t he emit t ed light . Some ot her t ypes of light sources such as light -
emit t ing diodes (LEDs), however, t urn on and off ext remely rapidly and would perceivably flicker if
supplied wit h low frequency drive volt ages. Perceivable flicker effect s from such rapid response
light sources can be reduced by increasing t he PWM frequency. If t he light fluct uat ions are
sufficient ly rapid (fast er t han t he flicker fusion t hreshold), t he human visual syst em can no longer
resolve t hem and t he eye perceives t he t ime average int ensit y wit hout flicker.
In elect ric cookers, cont inuously variable power is applied t o t he heat ing element s such as t he
hob or t he grill using a device known as a simmerst at . This consist s of a t hermal oscillat or running
at approximat ely t wo cycles per minut e and t he mechanism varies t he dut y cycle according t o
t he knob set t ing. The t hermal t ime const ant of t he heat ing element s is several minut es, so t hat
t he t emperat ure fluct uat ions are t oo small t o mat t er in pract ice.
Voltage regulation
PWM is also used in efficient volt age regulat ors. By swit ching volt age t o t he load wit h t he
appropriat e dut y cycle, t he out put will approximat e a volt age at t he desired level. The swit ching
noise is usually filt ered wit h an induct or and a capacit or.
One met hod measures t he out put volt age. When it is lower t han t he desired volt age, it t urns on
t he swit ch. When t he out put volt age is above t he desired volt age, it t urns off t he swit ch.
Varying t he dut y cycle of a pulse waveform in a synt hesis inst rument creat es useful t imbral
variat ions. Some synt hesizers have a dut y-cycle t rimmer for t heir square-wave out put s, and t hat
t rimmer can be set by ear; t he 50% point (t rue square wave) was dist inct ive, because even-
numbered harmonics essent ially disappear at 50%. Pulse waves, usually 50%, 25%, and 12.5%,
make up t he soundt racks of classic video games. The t erm PWM as used in sound (music)
synt hesis refers t o t he rat io bet ween t he high and low level being secondarily modulat ed wit h a
low frequency oscillat or. This gives a sound effect similar t o chorus or slight ly det uned
oscillat ors played t oget her. (In fact , PWM is equivalent t o t he sum of t wo sawt oot h waves wit h
one of t hem invert ed.)[10]
Class-D amplifiers produce a PWM equivalent of a lower frequency input signal t hat can be sent
t o a loudspeaker via a suit able filt er net work t o block t he carrier and recover t he original lower
frequency signal. Since t hey swit ch power direct ly from t he high supply rail and low supply rail,
t hese amplifiers have efficiency above 90% and can be relat ively compact and light , even for
large power out put s. For a few decades, indust rial and milit ary PWM amplifiers have been in
common use, oft en for driving servo mot ors. Field-gradient coils in MRI machines are driven by
relat ively high-power PWM amplifiers.
Hist orically, a crude form of PWM has been used t o play back PCM digit al sound on t he PC
speaker, which is driven by only t wo volt age levels, t ypically 0 V and 5 V. By carefully t iming t he
durat ion of t he pulses, and by relying on t he speaker's physical filt ering propert ies (limit ed
frequency response, self-induct ance, et c.) it was possible t o obt ain an approximat e playback of
mono PCM samples, alt hough at a very low qualit y, and wit h great ly varying result s bet ween
implement at ions. The Sega 32x uses PWM t o play sample-based sound in it s games.
In more recent t imes, t he Direct St ream Digit al sound encoding met hod was int roduced, which
uses a generalized form of pulse-widt h modulat ion called pulse-densit y modulat ion, at a high
enough sampling rat e (t ypically in t he order of MHz) t o cover t he whole acoust ic frequencies
range wit h sufficient fidelit y. This met hod is used in t he SACD format , and reproduct ion of t he
encoded audio signal is essent ially similar t o t he met hod used in class-D amplifiers.
Electrical
SPWM (sine–t riangle pulse-widt h modulat ion) signals are used in micro-invert er design (used in
solar and wind power applicat ions). These swit ching signals are fed t o t he FETs t hat are used in
t he device. The device's efficiency depends on t he harmonic cont ent of t he PWM signal. There is
much research on eliminat ing unwant ed harmonics and improving t he fundament al st rengt h, some
of which involves using a modified carrier signal inst ead of a classic sawt oot h signal[11][12][13] in
order t o decrease power losses and improve efficiency. Anot her common applicat ion is in
robot ics where PWM signals are used t o cont rol t he speed of t he robot by cont rolling t he
mot ors.
PWM t echniques would t ypically be used t o make some indicat or (like a LED) "soft blink". The
light will slowly go from dark t o full int ensit y, and slowly dimmed t o dark again. Then it repeat s.
The period would be several soft -blinks per second up t o several seconds for one blink. An
indicat or of t his t ype would not dist urb as much as a "hard-blinking" on/off indicat or. The indicat or
lamp on t he Apple iBook G4, PowerBook 6,7 (2005) was of t his t ype. This kind of indicat or is also
called "pulsing glow", as opposed t o calling it "flashing".
See also
Class-D amplifier
H-bridge
RC servo
Sliding mode cont rol - produces smoot h behavior by way of discont inuous swit ching in syst ems
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.0
01.0001) . ISBN 978-0-19-872572-5.
3. Westmijze, W. K. (1946). "A New Method of Counteracting Noise in Sound Film Reproduction" (http
s://ieeexplore.ieee.org/document/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 (https://www.worldcat.org/issn/0097-5834) – via IEEE.
5. Barr, Michael (1 September 2001). "Introduction to Pulse Width Modulation (PWM)" (https://barrgro
up.com/Embedded-Systems/How-To/PWM-Pulse-Width-Modulation) . Barr Group.
7. 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 (https://citeseerx.ist.psu.edu/
viewdoc/summary?doi=10.1.1.454.9157) . doi:10.1109/TCSI.2012.2215776 (https://doi.org/10.110
9%2FTCSI.2012.2215776) . S2CID 21795841 (https://api.semanticscholar.org/CorpusID:2179584
1) .
8. 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.
9. Wescott, Tim (August 14, 2018). "Sampling: What Nyquist Didn't Say, and What to Do About It" (htt
p://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. 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.
12. Hirak Patangia, Sri Nikhil Gupta Gourisetti, “Real Time Harmonic Elimination Using a Modified
Carrier”, CONIELECOMP, Mexico, Feb 2012.
13. 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 Int roduct ion t o Delt a Sigma Convert ers (ht t p://www.beis.de/Elekt ronik/Delt aSigma/Delt aSi
gma.ht ml)
Pulse Widt h Modulat ion in PID cont rol loop - free simulat or (ht t p://www.pidlab.com/en/pwm-d
emo)
Pulse Widt h Modulat ion in Deskt op monit ors - monit or flicker (ht t p://www.t ft cent ral.co.uk/art i
cles/pulse_ widt h_ modulat ion.ht m)