How to control DC motor speed with PWM: duty cycle, frequency and driver circuit
PWM controls DC motor speed by switching full voltage on and off. Learn the duty cycle formula, the PWM frequency, stall current, flyback protection and speed feedback.
Updated 2026-11-28
1. The direct answer
Pulse-width modulation (PWM) controls the average voltage across a DC motor by switching the full supply on and off rapidly. The average voltage equals the duty cycle D times the supply voltage, where D = t_on / T. A 50 percent duty cycle on a 12 V supply gives an average of 6 V. The motor responds to the average, because the winding inductance and rotor inertia smooth the current. At light load speed is roughly proportional to the average voltage, but load pulls speed down, so accurate speed needs closed-loop feedback.
2. Core formulas
- Average voltage: V_avg = D × V_supply.
- No-load speed: n ≈ K × V_avg, where K is the speed constant in rpm per volt, taken from the datasheet.
- Stall current: I_stall = V / R_armature. A 12 V motor with 1 Ω armature resistance can draw 12 A at stall.
- Torque: T ≈ K_t × I. The driver must supply current, not just voltage.
3. Worked example
A 12 V brushed motor has a speed constant of 500 rpm per volt, so full voltage gives about 6000 rpm with no load. At 50 percent duty the average is 6 V and the no-load speed is about 3000 rpm. Add a load and the speed falls, say to 2600 rpm, and the current rises. At stall, the current during each on-time is still V_supply / R_armature, which is 12 A in this motor, so the driver's peak and average current limits must cover it.
4. PWM frequency and audible noise
- Below about 20 kHz the motor can whine at the switching frequency, which most people can hear.
- Typical driver frequencies are 15 to 25 kHz. Higher frequency reduces current ripple and noise, but raises switching loss in the driver.
- At very low duty cycles the motor stutters or does not turn, because friction and brush contact drop need a minimum voltage.
5. Driver circuit and protection
- Use an H-bridge for forward and reverse. A single low-side MOSFET gives speed control in one direction only.
- Protect the switches with a freewheel path. When current is interrupted, the motor inductance produces a voltage spike. Use a diode rated for the peak current, or the body diode of the MOSFET, with a suitable clamp.
- Choose by current, not only voltage: size the driver for stall current and the motor's continuous current.
- Fit a current limit or fuse in the supply, so a stalled motor cannot overheat the driver.
6. Closed-loop speed control
PWM alone gives open-loop speed, which drifts with load and supply voltage. For steady speed, add a tachometer, an encoder, or back-EMF sensing. A PI controller compares the target speed with the measured speed and adjusts the duty cycle until they match. Brushed motors with encoders are usually controlled this way.
Sourcing a motor or production equipment from China? We can find and contact the right factories for you in Chinese. Ask on WhatsApp →