PWM Basics
Pulse-width modulation — frequency, duty cycle, resolution, and typical applications.
Reference
Core definitions
- Duty cycle D
- = t_on / T (fraction of period the signal is high)
- Frequency f
- = 1 / T
- Average V
- = D · V_high (if V_low = 0)
- Resolution
- = log₂(period in timer ticks)
- Average power
- P = D · V² / R (into resistive load)
Typical frequencies
| Use | Frequency | Rationale |
|---|---|---|
| LED dimming (visible) | 200 Hz – 2 kHz | Above flicker threshold |
| LED dimming (camera-safe) | > 5 kHz | Avoid rolling shutter stripes |
| Motor control (low) | 10–25 kHz | Above audible range |
| BLDC / ESC | 8–32 kHz | Balance switching loss vs noise |
| DC-DC converters | 100 kHz – 2 MHz | Smaller passives at higher f |
| Audio D-class amp | ~400 kHz | Beyond audio band |
Smoothing to DC
- LC or RC filter with corner well below PWM frequency (f_c < f_pwm / 10) gives a clean DC average.
- Resolution matters: 8-bit PWM = 256 steps, 0.39% per LSB; 10-bit = 0.1% per LSB.
- Slew-rate limits: fast PWM edges cause EMI; add small series resistor or use slew-rate-limited gate drive.
- Fan / motor: DC average drives the load; at very low duty, startup torque may be insufficient — use min-duty floor.
Last updated: