PWM Duty Cycle & Motor RPM Calculator
PWM duty, motor speed, RC filtre ve timer register hesaplarını tarayıcıda yapın
About
Client-side PWM calculator: duty cycle is clamped to 0–100%, average voltage uses VCC × duty, motor speed uses an explicit linear no-load approximation, and timer frequency uses clock/(prescaler × (ARR + 1)).
Examples
Half-speed 12 V motor
calculatePwmDutyCycleMotor({ ..., dutyPercent: 50, vccVolts: 12, maxRpm: 3000 }){ averageVoltage: 6, estimatedRpm: 1500, onTimeUs: 500 @1kHz }Linear scaling halves both voltage and RPM at 50% duty with a 500 µs on-time.
AVR-style 400 Hz timer
calculateTimer(16_000_000, 64, 624){ frequencyHz: 400, resolutionBits: 9 }16 MHz / (64 × 625 counts) is exactly 400 Hz with 625 steps of resolution.
About this tool
PWM Duty Cycle Motor models drive signals with calculatePwmDutyCycleMotor({ pwmFrequencyHz, dutyPercent, vccVolts, maxRpm, resistanceOhms, capacitanceFarads, clockHz, prescaler, arr }): duty clamps to 0–100, averageVoltage and estimatedRpm scale linearly, on/off times derive from the period, and rcCutoffHz = 1/(2πRC) judges filter ripple. Timer helpers use calculateTimer(clockHz, prescaler, arr) with frequency = clock / (prescaler × (ARR + 1)).
Timer detail is explicit: timer reports the selected prescaler/ARR pair while timerOptions sweeps [1, 8, 64, 256, 1024] at the same ARR, each with resolutionBits = floor(log2(ARR + 1)). A 16 MHz clock with prescaler 64 and ARR 624 yields exactly 400 Hz at 9-bit resolution.
Invalid numerics fall back safely (zero/NaN clock → 16 MHz, unclamped duty → clamped), and the rippleNote flags good filtering when fc is below one-tenth of the PWM rate.
How to use this tool
Set PWM and duty
Enter pwmFrequencyHz and dutyPercent — 50% at 12 V averages 6 V and half the max RPM.
Size the filter
Enter resistanceOhms and capacitanceFarads, then compare rcCutoffHz against the PWM rate.
Solve the timer
Enter clockHz, prescaler, and arr; read frequencyHz plus resolutionBits from timer.
Compare prescalers
Scan timerOptions across 1/8/64/256/1024 to trade frequency against resolution.
Use cases
Driving DC motors
Predict average voltage and RPM from duty before wiring an H-bridge.
Filtering PWM into analog
Push the RC cutoff a decade below the PWM rate for smooth DAC-like output.
Configuring MCU timers
Pick prescaler/ARR pairs that hit a target frequency with usable resolution.
Common mistakes
Mistake:Forgetting ARR is zero-indexed.
Fix:Frequency divides by ARR + 1 counts, not ARR — ARR 624 means 625 steps.
Mistake:Filtering with fc near the PWM rate.
Fix:Raise R or C until fc sits below PWM/10, or ripple rides through into the motor or analog output.
Mistake:Expecting zero clock to throw.
Fix:Non-positive clocks fall back to 16 MHz — pass an explicit clockHz instead of relying on the default.
Frequently asked questions
What does this tool do?
It models PWM drives with calculatePwmDutyCycleMotor: clamped duty, on/off times, linear average voltage and RPM, RC cutoff with ripple note, plus calculateTimer prescaler/ARR solving with a five-option comparison table.
What does 50% duty give, or 16 MHz / 64 / ARR 624?
50% duty halves supply voltage and max RPM (12 V → 6 V, 3000 → 1500 RPM). The 16 MHz / 64 / 624 timer gives exactly 400 Hz at 9-bit resolution.
Is my motor setup uploaded or stored?
No. Duty scaling, filter math, and timer solving run entirely in your browser.
Why is ripple high, or why did my clock fall back?
Ripple rises when the RC cutoff nears the PWM rate — push fc below PWM/10. Zero or non-finite clocks fall back to 16 MHz instead of throwing, so pass clockHz explicitly.
Related guides
References & standards
Related tools
Device Information
See what your browser reveals about your device — screen, hardware hints, platform and capabilities.
Digital Bubble Level
Measure surface tilt with a visual bullseye and a ±0.2° level threshold.
Digital Compass
Read a device heading with a manual desktop simulator and magnetic interference guidance.
Flashlight & Signal Beacon
Use a supported phone LED or a dimmable full-screen light with blink patterns, SOS and Morse signals.
GPS Speedometer
Track speed and distance from GPS with a Haversine fallback when speed is null.
I2C & SPI Bus Timing Diagram
Scan I2C device lists for address conflicts (7-bit/8-bit normalized) and inspect SPI CPOL/CPHA timing modes with pull-up and max-speed guidance. Runs entirely in your browser.