viewof targetSpeed = Inputs.range([0, 100], {step: 1, value: 50, label: "Target Output (%)"})
viewof pwmResolution = Inputs.select(
[8, 10, 12],
{value: 8, label: "PWM Resolution", format: x => x === 8 ? "8-bit (0-255)" : x === 10 ? "10-bit (0-1023)" : "12-bit (0-4095)"}
)
viewof pwmFrequency = Inputs.select(
[490, 1000, 5000, 20000],
{value: 5000, label: "PWM Frequency", format: x => x === 490 ? "490 Hz (Arduino)" : x === 1000 ? "1 kHz" : x === 5000 ? "5 kHz (ESP32 default)" : "20 kHz (Silent)"}
)Interactive PWM Calculator
Interactive PWM Calculator
animation
actuators
pwm
Try Leave Target Output (%) at 50, PWM Resolution at 8-bit and PWM Frequency at 5 kHz, then adjust the target.
Observe The opening settings give PWM Value 128 / 255 and a 200.00 microsecond period split into equal ON and OFF times.
Explain PWM Resolution sets the maximum count; Target Output (%) scales and rounds that count, while PWM Frequency sets the period.
Technical boundaries. Average-voltage calculation assumes ideal switching of fixed 5 V and 12 V supplies. Timing uses the requested percentage rather than the rounded PWM count; motor speed and switching losses are not calculated.