PWM Motor Speed Control
Watch duty cycle, PWM frequency, load, and H-bridge direction change a DC motor control decision.
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.
Separate PWM duty, ideal average voltage, real motor response, and driver protection.
Set the robot wheel to heavy load and low duty. Notice that duty can rise while speed still stalls.
The moving marker, pulse width, rotor, active H-bridge switches, and warning badges update together.
Motor PWM is not just a slider. Frequency, load, current limit, and switching protection decide whether it works reliably.
Waveform View
The waveform view shows high time, low time, average voltage, and the moving point in the current PWM period.
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
- Pick a motor and driver current limit.
- Choose a frequency range that fits noise and efficiency needs.
- Test the load at low, normal, and worst-case duty.
- 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.