PWM Control Calculation Audit
PWM Control Calculation Audit
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
PWM Control Calculation Audit
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.
See the relationship before changing it
The figure reads from left to right. The blue card is pwm duty. The middle card applies this page's rule. The green card is ideal average drive. Walk the arrows once: set the input, apply the rule, then read the result with its unit.
The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only pwm duty, so the numeric fixture does not switch without explanation.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 35 %.
- 2
Name the relationship. average drive = 12 V x duty / 100
- 3
Substitute with units. 12 V x 35 / 100 = 4.20 V
- 4
Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.
Predict, then change pwm duty
Try Predict the direction of average drive = 12 V x duty / 100. Test another pwm duty, then compare ideal average drive.
Observe Increasing duty raises ideal average drive while PWM frequency and winding ripple stay fixed here. Reset pwm duty to 35 and compare ideal average drive.
Explain Increasing duty raises ideal average drive while PWM frequency and winding ripple stay fixed here.
Check yourself
What should you do before trusting a moved-control result?
What does this small model leave out?
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.
Audit result
35% of 12 V is 4.2 V and 35% of 255 rounds to 89; the 0.14 A ripple claim depends on the stated load model.