PWM Control Calculation Audit

PWM Control Calculation Audit

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
actuators
beginner
Ada 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.

— timing, voltage, power, and ripple, ~4 minutes

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.

PWM duty changes ideal average drive An input card leads through the rule average drive = 12 V x duty / 100 to the ideal average drive result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. Increasing duty raises ideal average drive while PWM frequency and winding ripple stay fixed here.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 35 %.

  2. 2

    Name the relationship. average drive = 12 V x duty / 100

  3. 3

    Substitute with units. 12 V x 35 / 100 = 4.20 V

  4. 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.

35 %
Chapter baseline
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?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only pwm duty moves here. Field effects named in the technical boundary stay fixed.

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.

period = 1 / frequency; on_time = duty x period; average_voltage = supply x duty; current_slope = winding_voltage / inductance

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.

TrySelect Check audit with 20 kHz, 35% duty, a 12 V supply, and the 8-bit timer calculation.
ObserveThe ledger reports 17.5 microseconds on-time, code 89, 4.2 V ideal average, and 0.14 A ripple.
ExplainDuty fixes ideal average drive, while the 20 kHz period limits how long winding current can ramp during each pulse.
Technical boundaries. The audit assumes ideal switching, fixed fan current, linear duty scaling, and the stated inductive ripple. It does not model transistor loss, diode recovery, winding resistance versus temperature, fan back-EMF, minimum start duty, timer jitter, or supply ripple.
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.