TExcelTAD
Home › Control Systems & Automation › Electromechanical Systems: Modelling a DC Motor

Electromechanical Systems: Modelling a DC Motor

The roadmap's first practical project is "model a DC motor", and for good reason: a permanent-magnet DC motor is the smallest system that has everything a control engineer meets later. It has an electrical part and a mechanical part coupled by a physical constant, two time constants nearly a factor of twenty apart, a large current at start-up, and parameters you can measure on the bench with a supply, a multimeter and a tachometer. This lesson derives the model, puts the course's reference motor into numbers, and shows how to identify a real motor. Its speed loop is built in Motor Control; the machine itself is the subject of Electrical Machines.

The two equations

+ - v Ra = 2 Ohm La = 1 mH + - e = k w (back-EMF) i J b (bearings) rotor J = 2e-6 kg m^2 b = 1e-6 N m s torque k i load torque w (shaft speed) k = 0.02 V s/rad = 0.02 N m/A

Electrical side (Kirchhoff's voltage law around the armature): the supply drives current through the winding resistance and inductance against the back-EMF, a voltage the spinning rotor generates in proportion to its speed:

v=Rai+Ladidt+e,e=ke ωv = R_a i + L_a \frac{di}{dt} + e, \qquad e = k_e\,\omega

Mechanical side (Newton's law for rotation): the current produces a torque that accelerates the rotor against friction and the load:

Jdωdt=kt i−b ω−τLJ\frac{d\omega}{dt} = k_t\, i - b\,\omega - \tau_L

In SI units the torque constant ktk_t (N·m/A) and the back-EMF constant kek_e (V·s/rad) are the same number kk: the electrical power absorbed by the back-EMF, e i=keωie\,i = k_e\omega i, must equal the mechanical power produced, kti ωk_t i\,\omega. Datasheets often give kek_e in V per 1000 rpm; convert with 1 V/krpm=9.549 mV⋅s/rad1\ \text{V/krpm} = 9.549\ \text{mV} \cdot \text{s/rad}.

Laplace-transform both (zero initial state) and eliminate I(s)I(s):

Ω(s)V(s)=k(Las+Ra)(Js+b)+k2,Θ(s)V(s)=1s Ω(s)V(s)\frac{\Omega(s)}{V(s)} = \frac{k}{(L_a s + R_a)(J s + b) + k^2}, \qquad \frac{\Theta(s)}{V(s)} = \frac{1}{s}\,\frac{\Omega(s)}{V(s)}

Two energy stores (inductance and inertia) give a second-order speed model; the position adds an integrator. Because La/RaL_a/R_a is usually much shorter than the mechanical time, a common reduction drops LaL_a:

Ω(s)V(s)≈Kmτms+1,Km=kRab+k2,τm=RaJRab+k2\frac{\Omega(s)}{V(s)} \approx \frac{K_m}{\tau_m s + 1}, \qquad K_m = \frac{k}{R_a b + k^2}, \quad \tau_m = \frac{R_a J}{R_a b + k^2}

The term k2/Rak^2/R_a acts like extra damping: the back-EMF opposes any change of speed. That is why the mechanical time constant is set mostly by RaJ/k2R_a J/k^2, not by the bearing friction.

Worked example: the reference motor

Given: Ra=2 ΩR_a = 2\ \Omega, La=1 mHL_a = 1\ \text{mH}, k=0.02 V⋅s/radk = 0.02\ \text{V} \cdot \text{s/rad}, J=2×10−6 kg⋅m2J = 2 \times 10^{-6}\ \text{kg} \cdot \text{m}^2, b=1×10−6 N⋅m⋅sb = 1 \times 10^{-6}\ \text{N} \cdot \text{m} \cdot \text{s}, supply 12 V12\ \text{V}.

Find: the speed transfer function and its poles, the no-load speed, the no-load and stall currents, the stall torque, and the reduced first-order model.

Solve:

  • Denominator: (10−3s+2)(2×10−6s+10−6)+4×10−4=2×10−9s2+4.001×10−6s+4.02×10−4(10^{-3}s + 2)(2 \times 10^{-6}s + 10^{-6}) + 4 \times 10^{-4} = 2 \times 10^{-9}s^2 + 4.001 \times 10^{-6}s + 4.02 \times 10^{-4}. Poles at −106.1-106.1 and −1894 rad/s-1894\ \text{rad/s}: time constants 9.42 ms9.42\ \text{ms} (mechanical) and 0.528 ms0.528\ \text{ms} (electrical).
  • DC gain Km=0.02/(2×10−6+4×10−4)=49.75 rad/(s⋅V)K_m = 0.02/(2 \times 10^{-6} + 4 \times 10^{-4}) = 49.75\ \text{rad/(s} \cdot \text{V)}; at 12 V12\ \text{V} the no-load speed is 597.0 rad/s=5701 rpm597.0\ \text{rad/s} = 5701\ \text{rpm}.
  • No-load current: in steady state ki=bωk i = b\omega, so i0=10−6×597/0.02=29.9 mAi_0 = 10^{-6} \times 597/0.02 = 29.9\ \text{mA}.
  • Stall (shaft held, ω=0\omega = 0): i=12/2=6 Ai = 12/2 = 6\ \text{A}, torque 0.02×6=0.12 N⋅m0.02 \times 6 = 0.12\ \text{N} \cdot \text{m}. At switch-on the motor is at standstill, so the start current heads towards this value, limited only by LaL_a.
  • Reduced model: τm=2×2×10−6/4.02×10−4=9.95 ms\tau_m = 2 \times 2 \times 10^{-6}/4.02 \times 10^{-4} = 9.95\ \text{ms}, close to the exact 9.42 ms9.42\ \text{ms} dominant pole.

Check: the program builds the state-space model with the current as a second output and compares the full and reduced step responses.

python · try it yourself
import numpy as np
import control as ct

Ra, La, k, J, b, V = 2.0, 1e-3, 0.02, 2e-6, 1e-6, 12.0
# states x = [i, w]; input v; outputs [w, i]
A = [[-Ra / La, -k / La], [k / J, -b / J]]
B = [[1 / La], [0]]
C = [[0, 1], [1, 0]]
motor = ct.ss(A, B, C, 0)
print("poles (rad/s):", np.round(np.sort(ct.poles(motor).real), 1))

t = np.linspace(0, 0.1, 100001)
resp = ct.step_response(V * motor, T=t)
w, i = resp.outputs[0][0], resp.outputs[1][0]
print(f"no-load speed {w[-1]:.1f} rad/s = {w[-1] * 60 / (2 * np.pi):.0f} rpm, no-load current {1e3 * i[-1]:.1f} mA")
print(f"start-up current peak {i.max():.3f} A at {1e3 * t[np.argmax(i)]:.2f} ms (stall current {V / Ra:.1f} A)")

Km, tm = k / (Ra * b + k**2), Ra * J / (Ra * b + k**2)
reduced = ct.tf([Km], [tm, 1])
wr = ct.step_response(V * reduced, T=t).outputs
for tq in (0.002, 0.01, 0.03):
    n = int(round(tq / 1e-6))
    print(f"t = {1e3 * tq:4.0f} ms: full {w[n]:6.1f} rad/s, reduced {wr[n]:6.1f} rad/s")
poles (rad/s): [-1894.4  -106.1]
no-load speed 597.0 rad/s = 5701 rpm, no-load current 30.0 mA
start-up current peak 5.342 A at 1.61 ms (stall current 6.0 A)
t =    2 ms: full   86.3 rad/s, reduced  108.7 rad/s
t =   10 ms: full  378.1 rad/s, reduced  378.5 rad/s
t =   30 ms: full  570.8 rad/s, reduced  567.7 rad/s

The start current peaks at 5.34 A5.34\ \text{A} after 1.6 ms1.6\ \text{ms}, short of the 6 A6\ \text{A} stall value because the rotor is already turning by then. The reduced model runs about 22 rad/s22\ \text{rad/s} ahead at 2 ms2\ \text{ms}, while the current is still building up through LaL_a, and agrees within 1 %1\,\% from 10 ms10\ \text{ms} on. (The program's 30.0 mA30.0\ \text{mA} is the current at 100 ms100\ \text{ms}, still settling towards 29.9 mA29.9\ \text{mA}.) For a speed loop with a bandwidth well below 1900 rad/s1900\ \text{rad/s} it is enough; for a current loop (the inner loop of a drive) LaL_a is the whole story.

In the lab: the motor as a circuit

Using the analogy of the previous lesson, the mechanical side becomes a circuit: the node voltage V(w)V(w) is the speed in rad/s, a capacitor of 2 μF2\ \mu\text{F} is the inertia JJ, a 1 MΩ1\ \text{M}\Omega resistor is 1/b1/b, a voltage-controlled current source injects the torque k ik\,i (it senses the current as the voltage across RaR_a, so its gain is k/Ra=0.01k/R_a = 0.01), and a controlled voltage source E1=k⋅V(w)E1 = k \cdot V(w) is the back-EMF. The netlist lab solves it: at t=1 mst = 1\ \text{ms} it shows V(w)=33.54V(w) = 33.54 and I(R1)=5.033 AI(R1) = 5.033\ \text{A}, at 10 ms10\ \text{ms} 378.1378.1 and 2.341 A2.341\ \text{A}, at 100 ms100\ \text{ms} 597.0597.0 (rad/s) and 30.02 mA30.02\ \text{mA}. Drag the supply slider: the final speed scales with the voltage, the no-load current does not change.

0200400600020406080100t (ms)V0 A2.0 A4.0 AI (A)V(w)I(R1)at t = 100.0 msV(in)12.0 VV(a)11.9 VV(b)11.9 VV(w)597 VI(V1)-30.0 mAI(R1)30.0 mAI(L1)30.0 mAI(E1)30.0 mAI(G1)600 uAI(C1)3.31 uAI(R2)597 uA

Guided lab: identify a small DC motor

This is the roadmap project. Use a small brushed motor rated 6–12 V6\text{–}12\ \text{V} and a few watts.

Hand calculation. Plan four tests and what each gives: (1) stalled at low voltage: Ra=v/iR_a = v/i; (2) no-load at several voltages: k=(v−Rai0)/ωk = (v - R_a i_0)/\omega and b=ki0/ωb = k i_0/\omega; (3) coast-down (supply disconnected, open circuit, so no current): ω\omega decays with τ=J/b\tau = J/b, or better (4) a step of voltage with the speed logged: τm=RaJ/(Rab+k2)\tau_m = R_a J/(R_a b + k^2) gives JJ. For the reference motor you would read Ra=2 ΩR_a = 2\ \Omega, i0=29.9 mAi_0 = 29.9\ \text{mA} and 597 rad/s597\ \text{rad/s} at 12 V12\ \text{V}, so k=(12−0.06)/597=0.0200k = (12 - 0.06)/597 = 0.0200.

Simulation. Change Ra, k, J, b in the program to the values you measure and compare its step response with your logged speed.

What you would measure. For the stall test set the bench supply to 0.5–1 V0.5\text{–}1\ \text{V} with a 1 A1\ \text{A} limit and hold the shaft with a clamp (not your fingers); measure at several rotor angles and average, because brush contact varies (±10–20 %\pm 10\text{–}20\,\%). Measure speed with an optical tachometer, a slotted-disc encoder read by a microcontroller, or the commutator ripple frequency on a scope (ripples per revolution = the least common multiple of the brush and segment counts, so 66 for the common two-brush, three-segment motor). Expect kk to within about 3 %3\,\% from the no-load test, and JJ only to ±20 %\pm 20\,\% from a step test because friction is partly dry. Log the start current with a 0.1 Ω0.1\ \Omega shunt on the scope: the peak approaches v/Rav/R_a only if La/RaL_a/R_a is much shorter than τm\tau_m.

Hazards and safe setup. Current-limited supply at no more than the motor's rated voltage (and never above 24 V24\ \text{V}); clamp the motor body, guard or remove anything on the shaft, keep hair and loose sleeves away; a stalled motor heats quickly, so keep stall tests to a few seconds. When the supply is cut, the spinning motor becomes a generator and the inductance can kick: put a flyback diode across a motor that is switched by a transistor.

Pitfalls

  • Using kek_e in V/krpm and ktk_t in N·m/A as if they were different constants, or mixing rpm and rad/s.
  • Measuring RaR_a with an ohmmeter on a free shaft: the meter's tiny current and the brush film make it read high; use the stalled test at rated-ish current.
  • Treating the stall current as safe because the supply provides it: most small motors are rated for a fraction of it continuously.
  • Dropping LaL_a when designing a current loop or a fast PWM drive, where it is the dominant element.

Practice

  1. A motor has Ra=4 ΩR_a = 4\ \Omega, k=0.05 V⋅s/radk = 0.05\ \text{V} \cdot \text{s/rad}, negligible bb. What is its no-load speed at 24 V24\ \text{V}, and its stall torque?
  2. With J=1×10−5 kg⋅m2J = 1 \times 10^{-5}\ \text{kg} \cdot \text{m}^2, what is its mechanical time constant?
  3. A datasheet gives ke=2.1 V/krpmk_e = 2.1\ \text{V/krpm}. Convert to V·s/rad.
Answer
  1. ω=24/0.05=480 rad/s\omega = 24/0.05 = 480\ \text{rad/s} (4584 rpm4584\ \text{rpm}); stall current 6 A6\ \text{A}, torque 0.30 N⋅m0.30\ \text{N} \cdot \text{m}.
  2. τm=RaJ/k2=4×10−5/0.0025=16 ms\tau_m = R_a J/k^2 = 4 \times 10^{-5}/0.0025 = 16\ \text{ms}.
  3. 2.1×9.549 mV⋅s/rad=0.0201 V⋅s/rad2.1 \times 9.549\ \text{mV} \cdot \text{s/rad} = 0.0201\ \text{V} \cdot \text{s/rad}.

Test yourself

Why are the torque constant (N·m/A) and back-EMF constant (V·s/rad) equal in SI units?

  1. by definition of the ampere
  2. energy conservation: e i=kti ωe\,i = k_t i\,\omega
  3. only for brushless motors
  4. they are not equal

The reference motor's speed model has poles at about −106-106 and −1894 rad/s-1894\ \text{rad/s}. Which one comes from the armature inductance?

  1. −106 rad/s-106\ \text{rad/s}
  2. −1894 rad/s-1894\ \text{rad/s}
  3. both equally
  4. neither

Dropping LaL_a, the reference motor's mechanical time constant RaJRab+k2\frac{R_a J}{R_a b + k^2} is

  1. 2 s2\ \text{s}
  2. 9.95 ms9.95\ \text{ms}
  3. 0.5 ms0.5\ \text{ms}
  4. 99.5 ms99.5\ \text{ms}

Which test gives the armature resistance most reliably?

  1. ohmmeter on the free shaft
  2. no-load run at rated voltage
  3. stalled rotor at low voltage with a current limit, averaged over rotor positions
  4. coast-down