# DC brushed motor theory

Surprisingly, I did not find a theory that describe behavior of brushed DC motor with PWM control. Common assumptions are:

a. PWM frequency should be high enough to get smooth mechanical movement
b. PWM frequency should be low enough to avoid current loses due to inductance
c. Speed of the motor changes linearly with duty cycle.
d. PWM acts as an averaging of voltage and is similar to the change of voltage of DC power source, similar to e.g. thermostat control with PWM.

I also thought similar, until I faced unexpected curves while testing DC motors (and ). Actually a) is true but not relevant because almost never happens in real life even for small motors; b) is correct but all I found is qualitative analysis; c) and d) are incorrect in general.

So I developed my own theory. Based on this theory  I’ve created online graph tool for PWM-ed brushed motors which described experimental behavior with great accuracy.

DC motor theory

DC motor movement can be described with the set of mechanical and electrical differential equations.

Electrical part:

Kirchhoff’s voltage law: (1)

where , Kemf can be expressed with common Kv(V/rpm) value as Mechanical part: (2)

where M is torque produced by the motor and I is current. (3)

where J is inertia and F is a torque caused by friction

In the case of stationary rotation, the equations become very simple, for simplicity we do not take into account friction and other loses: (4)

and (5)

DC voltage

From (4) and (5)  we can obtain rotation speed vs voltage: (6)

Rotation speed changes linearly with voltage.

PWM control

Assuming that torque is averaged because of inertia we can write (7)

where Iavg is a mean value of current, in the case of pure rectangular PWM signal (8)

Where I0 is an amplitude of PWM signal and d is a duty ratio d=Ton/Tp (where Ton is a time of “on” and Tp is a period of PWM waveform)

But electrical equation (4) is still requires instant values (9)

Where V0 and I0 are amplitudes of PWM signal.

Using (7), (8) and (9) for rotation speed vs PWM duty ratio we can get: (10)

In contrast to the voltage change model (6) the rotation speed changes non-lineary with duty ratio.

Here are plots with the same motor parameters at the constant torque for both voltage regulation and PWM-control: Fig. 1 Rotation speed vs voltage and PWM duty cycle. Obviously, rotation speeds are equal at d=100%

Here what happens with real motor simulation (solving the differential equation for  both mechanical and electrical parts (1) and (2)). The simulation is done with Matlab Simulink model: And the result of the simulation Fig. 3 Simulation result for (top to bottom) voltage at the supply, voltage at the motor’s low side, current and the rotation speed. Spikes at the motor’s voltage are due to inductance of the motor. Dashed lines show range of our interest and zoomed to this range pictures will be used below.

For the simulation we selected M=5e-4 N*m, Kemf=5e-4 V/(rad/s) and R=1 Ohm to get Iavg=1A, and I*R=1V

Motor starts with zero speed and gets accelerated until it reaches stationary rotation speed

Here is what we see in the zoomed region for DC voltage source and PWM-ed control, inductance is set to very low value. Fig. 4 Simulation results for DC voltage=2V, and PWM at duty ratio of 0.5 and 0.3

In full agreement with the above equations, in all cases average current (and torque) is the same, with lowering of duty cycle the amplitude of current increases and Vemf  is ruled by voltage drops of eq (9). Once Vemf is known, the rotation speed is simply w=Vemf/K­emf

Inductance

Before we did not take into account the inductance of the motor’s coil. Current change produces emf voltage at the inductance L*(dI/dt). In this case waveforms look like: Fig.5 Simulation result with inductance L= 0.5mH, as before the average current is 1A and the amplitude (maximum) current depends on the waveform’s shape.

To get analytical expression we do a simple trick: once we know that torque is ruled by the average value of current’s waveform and eq (9) requires amplitude of the current, all we need is to find equation for the dependence of the amplitude on the average value for know shape of the waveform.

In the case of RL circuit, where R and L are active resistance and inductance of the coil we can write for the current after excitation with the step-like voltage: (11)

Where t is time and τ=L/R

We can calculate the average value after excitation by the step of T duration as: (12)

And then express I0 as a function of Iavg, taking into account that T=d*Tp and I=0 at T<t<Tp (13)

Where d is  PWM duty cycle, Tp is PWM period = 1/(PWM frequency), τ=L/R

To get rotation speed we use Iavg=M/Kemf

And the rotation speed is (14)

Where I0(Iavg,d,Tp,τ) is determined by eq (13)

Here is what we get with expression (14) for L=0.1mH and PWM frequencies of 500 Hz, 2.5 kHz, 5 kHz and 10 kHz. Fig.6 Rotation speed in dependence on PWM frequency, when motor inductance is relatively high. Lines are results obtained with analytical equation (14), dots are results obtained with Simulink simulation. Analytical expression (14) gives correct results verified by numerical simulation

Note, the rotation speed is not equal to the rotation speed without inductance even at PWM cycle close to 1. It happens because the inductance gets disconnected every PWM cycle; and the abrupt voltage change produces strong change of current  on every “on” event. Fig.7 Waveforms when PWM duty cycle is 0.99 and the inductance is high