PWM Motor Speed Control

PWM Motor Speed Control

Watch duty cycle, PWM frequency, load, and H-bridge direction change a DC motor control decision.

animation
pwm
motor
actuation
control
Animation Actuation PWM Beginner First

PWM Motor Speed Control

Change duty cycle, frequency, load, and direction. The waveform, H-bridge state, motor estimate, current warning, and tuning notes all update together.

55%duty cycle
3.3 Videal average voltage
1750 rpmestimated speed
0.42 Aestimated motor current
TryLoad Cooling fan, set Duty cycle to 50% and Supply voltage to 12 V, then advance one Step.
ObserveAt 50% duty, compare the Average drive, motor current, ripple, and speed estimate with the 100% case.
ExplainA 50% PWM command halves ideal on-time, while winding inductance and back-EMF determine current ripple and prevent speed from scaling perfectly linearly.
Technical boundariesThe motor equations use lumped resistance, inductance, back-EMF, and load estimates; they omit commutation, bearing friction, thermal drift, switching loss, supply sag, and controller current limiting.
Colour keyactuators identitycurrent / primaryreference / datasuccesscautionerror / failure
Goal

Separate PWM duty, ideal average voltage, real motor response, and driver protection.

Try First

Set the robot wheel to heavy load and low duty. Notice that duty can rise while speed still stalls.

Watch

The moving marker, pulse width, rotor, active H-bridge switches, and warning badges update together.

Why It Matters

Motor PWM is not just a slider. Frequency, load, current limit, and switching protection decide whether it works reliably.

Controls

Choose a motor case, then tune the pulse and load conditions.

Scenariocooling fan
Viewwaveform
Playbackmanual
Directionforward

Duty is the on-time fraction. In the ideal model, Vavg = Vsupply x duty.

Low frequency can whine. Very high frequency can increase switching loss.

Use a supply that matches the motor and driver ratings.

More load needs more torque and current, especially at low speed.

Motor inertia and inductance smooth pulses, but they do not remove current limits.

Waveform View

The waveform view shows high time, low time, average voltage, and the moving point in the current PWM period.

PWM high
Reading: During the high part of the cycle, the driver applies supply voltage to the motor.

Motor Diagnosis

This setting should run smoothly for a small fan because current stays below the driver limit.

ScenarioCooling fan
Period0.50 ms
On time0.28 ms
Direction pathQ1 + Q4
Main warningCheck flyback
VerdictGood setting

Design Log

    Duty Rule

    Ideal average voltage equals supply voltage multiplied by duty cycle.

    At 55% duty from 6.0 V, ideal average voltage is 3.3 V.

    Motor Rule

    Real speed also depends on load, motor constants, friction, inertia, and current limit.

    A loaded motor may stall even when average voltage looks reasonable.

    Driver Rule

    Inductive motors need current control, flyback paths, and dead-time in real H-bridges.

    Average voltage does not prove the driver is protected.
    Beginner Ramp
    • PWM: power is switched on and off quickly instead of using a partly-on transistor as a resistor.
    • Duty cycle: the percent of one period where the output is on.
    • Average voltage: a useful first estimate, not a full motor model.
    • H-bridge: four switches that can reverse current through a DC motor.
    Quick Reference
    • Use duty to request speed, then measure actual speed if the application needs precision.
    • Use a driver rated above expected running and startup current.
    • Use higher frequency to reduce whine, but watch switching heat.
    • Use soft-start and current limiting for pumps, wheels, and actuators.
    Decision Pattern
    1. Pick a motor and driver current limit.
    2. Choose a frequency range that fits noise and efficiency needs.
    3. Test the load at low, normal, and worst-case duty.
    4. Add protection before field testing.
    Common Mistakes
    • Assuming 50% duty always gives 50% speed under load.
    • Ignoring stall current when sizing the motor driver.
    • Changing H-bridge direction without dead-time or braking logic.
    • Forgetting flyback paths when switching an inductive motor.
    Technical Accuracy Notes
    • The speed and current values are teaching estimates. Real motors need datasheets or measurement.
    • The ideal average voltage model is Vavg = Vsupply x duty for a simple drive case.
    • Current ripple is shown as a qualitative risk based on frequency, duty, load, and smoothing.
    • Servo control is not the same as DC motor PWM. Hobby servos use pulse width commands, not average power control.
    Application Notes
    • Fans usually tolerate simple open-loop PWM if airflow is not safety critical.
    • Robot wheels often need feedback because load changes with surface and battery voltage.
    • Pumps and actuators can draw high startup current and may need current limiting.

    Practice 1

    Select Robot wheel. Lower duty below 25% and increase load. Explain why the speed estimate collapses.

    Practice 2

    Select Cooling fan. Compare 200 Hz with 20 kHz and identify which risk changes most.

    Practice 3

    Select Gate actuator. Try reverse direction and high load. Decide which driver protection matters first.