Pulse Width Modulation

What is Pulse Width Modulation (PWM) ?

Pulse Width Modulation (PWM) is a technique used in electronics to encode information in the form of a pulsing signal. It is a way to convey analog information using digital signals. It is commonly employed to control the power delivered to electronic devices, particularly in applications like motor speed control, light dimming, and voltage regulation.

In a PWM system, the signal consists of a series of pulses with varying widths. The term “pulse width” refers to the duration of time the signal is in the high (on) state within each cycle. The ratio of the on-time to the total time of one cycle is known as the duty cycle.

50% duty cycle pulse width modulation

PWM Characteristics

A PWM signal serves as a means to generate digital pulses for regulating analog circuits. Its behavior is primarily characterized by two key components:

Duty cycle

A duty cycle represents the portion of one cycle during which a system or signal is active. It’s commonly conveyed as a ratio or percentage. A period (Tperiod) denotes the duration required for a signal to complete a full ON-OFF cycle. When the signal is in its high state, we denote it as ON and the time duration for which the waveform is in ON state is called Ton. The time duration for which the waveform is in OFF state is called Toff. Basically Ton + Toff = Tperiod. The duty cycle (D) represent the fraction of time the signal is in ON state out of total time period. It is the ratio of Ton and Tperiod.

$$D=\cfrac{T_{on}}{T_{on}+T_{off}}=\cfrac{T_{on}}{T_{period}}$$

For example, a digital signal that maintains an equal division between ON and OFF states, resulting in a half-and-half distribution, possesses a 50% duty cycle, resembling an ideal square wave. Conversely, a signal that spends three-quarters of its time in the ON state and one-quarter in the OFF state exhibits a duty cycle of 75%.

Frequency and Time period

The frequency refers to how often something repeats or happens within a specific timeframe. It specifically pertains to the rate of vibration that generates a wave, such as sound, radio, or light waves, usually measured per second. Frequency plays a crucial role in PWM’s effectiveness in controlling an application. Hence, the square wave frequency must be sufficiently high, particularly when managing LEDs, to achieve the desired dimming effect.

For instance, a duty cycle of 50% at 1 Hz would be perceptible to the human eye, indicating the LED’s alternating ON and OFF states. However, with a frequency of 100 Hz or above, the same 50% duty cycle would result in half-intensity light.

Working principle of PWM

Pulse-width modulation employs a square or rectangular wave where the width of the pulses is modulated while keeping the time period of the waveform unchanged. This leads to changes in the average value of the waveform.

PWM_averaging-1

In this section, we will mathematically derive the average value of the output waveform of a PWM signal. Let’s assume the function is f(t), the OFF state voltage is Vlow, the ON state voltage is Vhigh, the time period is Tperiod, the ON state time is Ton, and the OFF state time is Toff. We can find the average using the integral function as shown below:

$$\overline V_{out}=\cfrac{1}{T_{period}}\int_{0}^{T_{period}}f(t)\cdot{}dt$$

$$\overline V_{out}=\cfrac{1}{T_{period}}\left[\int_{0}^{T_{on}}V_{high}\cdot{}dt+\int_{0}^{T_{off}}V_{low}\cdot{}dt\right]$$

$$\overline V_{out}=\cfrac{V_{high}\cdot{}T_{on}+V_{low}\cdot{}T_{off}}{T_{period}}$$

We can write the above expression in terms of duty cycle (D) as follows:

$$\overline V_{out}=D\cdot{}V_{high}+(1-D)\cdot{}V_{low}$$

Most of the time, Vlow equals 0V, so :

$$\overline V_{out}=D\cdot{}V_{high}$$

Example of PWM waveforms

PWM signal passed through a low pass filter

If a PWM waveform is passed through a low pass filter, the filter attenuates its harmonics to generate a DC output voltage. As shown above, the DC output voltage is the average voltage of the PWM waveform for a 35% duty cycle waveform.

25percent duty acd

The above figure shows that the ON state time is 25% of the time period of the waveform. This means the duty cycle (D) is 0.25 or 25%. If the V(in) is passed through a low pass filter with a cutoff frequency much lower than 1/Tperiod, we get an average output voltage equal to around 250mV. The input high voltage is 1V, and the low voltage is 0V. This is in accordance with our findings in the previous section, where we concluded that the average is DVhigh.

75percent duty acd
The above figure shows that the ON state time is 75% of the time period of the waveform. This means the duty cycle (D) is 0.75 or 75%. The average output voltage equals around 750mV, which is again equal to 0.75 X 1V (DVhigh).

Applications of PWM

  1. Delta-sigma modulator
  2. DC-DC switching regulators
  3. Speed control of DC motors
  4. Servo motor control
  5. Class-D amplifiers
  6. LED brightness control

Quick Calculators

RC circuit
Time Constant (s) =

Cutoff Frequency (Hz) =

Time Constant (s) =

Cutoff Frequency (Hz) =

Impedance magnitude (Ω) =

Resonant frequency (Hz) =

Topics