Ada Audits the PWM Numbers
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
Ada Audits the PWM Numbers
A 12 V ventilation fan is driven at 20 kHz and 35% duty, so each 50 microsecond period holds the switch on for 17.5 microseconds and commands an ideal average of 4.2 V — register code 89 on an 8-bit timer. The fan pulls 0.5 A at full speed, about 2.1 W at this duty, yet the winding current still ripples 0.14 A at 20 kHz and ten times that, 1.4 A, if the frequency drops to 2 kHz. This audit re-derives every figure and asks whether a duty-cycle number alone is enough evidence, or whether frequency, resolution, ripple, and measured current must be recorded too.
Companion to the chapter PWM Actuator Control — every number here comes from that chapter.
The math says what the pin commands; the physics decides how the winding current, motor inertia, acoustic noise, and driver heat turn that command into motion.
The chapter's values
Use only the chapter values above: a 12 V fan, 20 kHz PWM, 35% duty, 8-bit and 10-bit timer examples, a 0.5 A full-speed fan current, and the ripple example with 4 V back-EMF, 1 mH winding inductance, and the same 35% duty.
The worked checks
| Check | Calculation | Result |
| 20 kHz timing | 1 / 20,000 = 0.00005 s; 0.00005 s x 1,000,000 = 50 microseconds | One period is 50 microseconds |
| 35% high time | 0.35 x 50 = 17.5; 50 - 17.5 = 32.5 | 17.5 microseconds on, 32.5 microseconds off |
| Ideal average drive | 12 x 0.35 = 4.2 | 4.2 V average command, before driver loss and motor dynamics |
| Timer register values | round(0.35 x 255) = 89; round(0.35 x 1023) = 358 | 8-bit code 89; 10-bit code 358 |
| Fan power screen | 12 x 0.5 = 6 W; 0.35 x 0.5 = 0.175 A; 12 x 0.175 = 2.1 W | 35% duty is about 2.1 W before losses and non-linear behavior |
| Resolution step size | 1 / 255 = 0.0039216; 12 x 0.0039216 = 0.0471 V; 1 / 4095 = 0.0002442; 12 x 0.0002442 = 0.00293 V | 8-bit steps are about 47 mV on 12 V; 12-bit steps are about 2.9 mV |
| Ripple at 20 kHz | (12 - 4) / 0.001 = 8000 A/s; 8000 x 17.5e-6 = 0.14 A | Current rises about 0.14 A during the on-pulse |
| Ripple at 2 kHz | 1 / 2000 = 500 microseconds; 0.35 x 500 = 175 microseconds; 8000 x 175e-6 = 1.4 A | Same duty, ten times the ripple because the pulse is ten times longer |
Design implication: duty cycle is not enough evidence by itself. Record the frequency, resolution, driver limits, ripple behavior, acoustic target, and measured current so the PWM command can be tied to a physical actuator result.
Every number above is taken from the chapter’s own examples and re-derived step by step.