Pulse width modulation (PWM) motor control is the standard method for varying the speed and torque of DC motors by rapidly switching the supply voltage on and off. The direct answer to sizing a PWM system is this: your motor driver must be rated for at least 1.5 to 2 times the motor’s stall current (not its nominal running current), your PWM frequency should sit between 1 kHz and 20 kHz to avoid audible whine and excessive switching losses, and you must always provide a path for inductive flyback current.
Selecting the right combination of motor and driver requires looking past the marketing labels on hobby modules and examining the electrical realities of inductive loads. Below is a bench-tested framework for matching motors to PWM drivers, sizing the silicon, and wiring the system without burning out your microcontroller.
Motor Type Selection for PWM Loads
Not every motor accepts raw PWM signals for speed control. While pulse width modulation motor control is native to brushed DC architectures, applying it blindly to other motor types will result in stuttering, overheating, or immediate driver failure. Here is how the three most common motor types respond to PWM-driven loads.
| Motor Type | Torque Curve & Load Profile | Control Needs & PWM Compatibility | Relative Cost & Complexity |
|---|---|---|---|
| Brushed DC (BDC) | Linear torque-to-current curve. High starting (stall) torque, drops as RPM increases. | Ideal for raw PWM. Single H-bridge controls speed (duty cycle) and direction (polarity). | Low ($). Simple 2-wire connection. Brushes require eventual mechanical replacement. |
| Brushless DC (BLDC) | High efficiency, flat torque curve across a wide RPM band. Excellent for continuous high-speed loads. | Rejects raw PWM for direct speed control. Requires a 3-phase Electronic Speed Controller (ESC) with Hall sensors or sensorless back-EMF commutation. | High ($$$). Requires complex 3-phase drivers and commutation logic. |
| Stepper | High holding torque at zero RPM. Torque drops sharply at high speeds due to winding inductance. | Do not use raw PWM for speed. Requires a step/direction indexer and a chopper driver (like the TMC2209) that internally uses micro-stepping PWM to regulate coil current. | Medium ($$). 4-wire minimum. Requires precise timing pulses, not just voltage chopping. |
Sizing the PWM Driver: Rules of Thumb and Worked Examples
The most common mistake in motor control is sizing the driver based on the motor’s "nominal" or "running" current. When a DC motor is at a dead stop (stalled) or just starting up, it has zero back-EMF. At that exact moment, the only thing limiting current is the DC resistance of the copper windings, which is typically a fraction of an ohm. The motor acts as a near-dead short across your power supply.
The Sizing Rule of Thumb
Your PWM driver’s continuous current rating must exceed the motor’s nominal current, but its peak current rating must survive the motor's stall current for at least 2 to 3 seconds without triggering thermal shutdown or melting the silicon die. A safe engineering multiplier is to select a driver with a continuous rating equal to 1.5x the motor's stall current if the load has high inertia, or at least match the stall current if the load spins up quickly.
Worked Load Example: 12V Planetary Gearmotor
- Motor Specs: 12V nominal, 5A continuous running current, 0.48Ω winding resistance.
- Stall Current Calculation: I = V / R → 12V / 0.48Ω = 25 Amps.
- The Wrong Choice: The ubiquitous L298N dual H-bridge. It is rated for 2A continuous (3A peak). Hitting it with a 25A inrush will instantly fry the internal bipolar transistors or trip its thermal protection, stalling your project.
- The Right Choice: A modern MOSFET-based driver like the Texas Instruments DRV8871 (rated for 3.6A continuous, but handles higher peaks with proper PCB copper pours) for smaller loads, or for this specific 25A stall scenario, an IBT-2 module based on the BTS7960 half-bridges (rated for 43A peak). Alternatively, a Pololu VNH5019 (12A continuous, 30A peak) will work if you implement software current limiting to prevent prolonged stalls.
Practical Wiring and Terminal Identification
When moving beyond 5A, the physical wiring and terminal identification of your PWM driver become critical. High-current PWM generates massive electromagnetic interference (EMI) and voltage spikes. Let's look at the terminal identification for the industry-standard BTS7960 high-power H-bridge module, which is widely used for 12V/24V DC gearmotors.
| Terminal Label | Function | Connection Target & Wire Gauge Recommendation |
|---|---|---|
| B+ / M+ | Motor Positive Output / Power Input | Connect to Motor (+). Use minimum 12 AWG silicone wire for loads >15A. |
| B- / M- | Motor Negative Output / Power Ground | Connect to Motor (-). Keep this wire exactly the same length as B+ to balance inductance. |
| PWM / R_PWM | Right/Forward PWM Logic Input | Connect to MCU GPIO (e.g., ESP32 Pin 18). 3.3V or 5V logic compatible. |
| DIR / L_PWM | Left/Reverse PWM or Direction Input | Connect to MCU GPIO. Pull HIGH for reverse, or use as second PWM for bidirectional speed. |
| VCC / 5V | Logic Power Supply | Connect to MCU 5V or 3.3V (check module optocoupler specs). Do NOT connect to motor 12V/24V. |
| GND | Logic and Power Common Ground | CRITICAL: Must share a common ground with the MCU and the main battery negative terminal. |
A motor is an inductor. When the PWM signal switches OFF, the collapsing magnetic field generates a high-voltage reverse spike (inductive kickback). While many modern ICs (like the VNH5019 or DRV8871) include internal clamp diodes, high-current discrete modules like older BTS7960 boards often lack sufficient internal snubber protection for heavy inductive loads. If your driver datasheet does not explicitly guarantee internal freewheeling diodes for your specific load inductance, you must solder external Schottky diodes (e.g., 100V, 30A) in reverse-parallel across the motor terminals.
Failure Signatures: Hum, Overheat, and Stall
When a PWM motor control circuit fails, it rarely does so silently. The physical symptoms at the bench will tell you exactly which parameter is out of bounds.
1. The Audible Whine or Hum
Symptom: The motor emits a high-pitched squeal or a low, vibrating hum, even when spinning smoothly.
Cause: Your PWM frequency is poorly tuned. If the frequency is below 1 kHz, the motor windings and laminations physically vibrate at the switching rate, creating acoustic noise. If the frequency is too high (e.g., >25 kHz), you incur massive switching losses in the MOSFETs due to gate charge/discharge times.
Fix: Set your microcontroller's PWM timer to a frequency between 4 kHz and 16 kHz. For ESP32 users using the LEDC peripheral, ledcSetup(channel, 8000, 8) (8 kHz, 8-bit resolution) is the acoustic sweet spot for most brushed DC motors.
2. Driver Overheat and Thermal Shutdown
Symptom: The motor runs fine for 30 seconds, then abruptly stops. The driver IC is too hot to touch. It resumes after cooling down.
Cause: Conduction losses (I²R) or switching losses. If the driver is undersized for the continuous current, the internal Rds(on) of the MOSFETs generates excessive heat. Alternatively, if you are using a 3.3V microcontroller to drive a driver that requires 5V logic for full gate enhancement, the MOSFETs are operating in their linear (high-resistance) region instead of fully saturating.
Fix: Verify your logic voltage matches the driver's VCC requirement. Add a heatsink to the driver IC, or upgrade to a driver with a lower Rds(on) specification. Ensure your PCB traces or wiring can handle the continuous current without voltage drop.
3. Low-Speed Stall and Jitter
Symptom: At low duty cycles (e.g., 10% to 20%), the motor refuses to turn, hums loudly, or stutters violently. It only moves when the PWM is pushed above 40%.
Cause: Static friction and cogging torque. At low duty cycles, the average voltage is too low to overcome the motor's mechanical static friction, even though the peak voltage during the "ON" pulse is high.
Fix: Implement a software "kickstart" routine. Command 100% duty cycle for 50 to 100 milliseconds to break static friction, then immediately drop to your desired low-speed duty cycle. This is a standard technique in industrial motor controllers to ensure smooth low-speed operation without requiring expensive closed-loop encoders.






