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
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:
Mechanical side (Newton's law for rotation): the current produces a torque that accelerates the rotor against friction and the load:
In SI units the torque constant (N·m/A) and the back-EMF constant (V·s/rad) are the same number : the electrical power absorbed by the back-EMF, , must equal the mechanical power produced, . Datasheets often give in V per 1000 rpm; convert with .
Laplace-transform both (zero initial state) and eliminate :
Two energy stores (inductance and inertia) give a second-order speed model; the position adds an integrator. Because is usually much shorter than the mechanical time, a common reduction drops :
The term acts like extra damping: the back-EMF opposes any change of speed. That is why the mechanical time constant is set mostly by , not by the bearing friction.
Worked example: the reference motor
Given: , , , , , supply .
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: . Poles at and : time constants (mechanical) and (electrical).
- DC gain ; at the no-load speed is .
- No-load current: in steady state , so .
- Stall (shaft held, ): , torque . At switch-on the motor is at standstill, so the start current heads towards this value, limited only by .
- Reduced model: , close to the exact 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.
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 after , short of the stall value because the rotor is already turning by then. The reduced model runs about ahead at , while the current is still building up through , and agrees within from on. (The program's is the current at , still settling towards .) For a speed loop with a bandwidth well below it is enough; for a current loop (the inner loop of a drive) 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 is the speed in rad/s, a capacitor of is the inertia , a resistor is , a voltage-controlled current source injects the torque (it senses the current as the voltage across , so its gain is ), and a controlled voltage source is the back-EMF. The netlist lab solves it: at it shows and , at and , at (rad/s) and . Drag the supply slider: the final speed scales with the voltage, the no-load current does not change.
Guided lab: identify a small DC motor
This is the roadmap project. Use a small brushed motor rated and a few watts.
Hand calculation. Plan four tests and what each gives: (1) stalled at low voltage: ; (2) no-load at several voltages: and ; (3) coast-down (supply disconnected, open circuit, so no current): decays with , or better (4) a step of voltage with the speed logged: gives . For the reference motor you would read , and at , so .
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 with a limit and hold the shaft with a clamp (not your fingers); measure at several rotor angles and average, because brush contact varies (). 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 for the common two-brush, three-segment motor). Expect to within about from the no-load test, and only to from a step test because friction is partly dry. Log the start current with a shunt on the scope: the peak approaches only if is much shorter than .
Hazards and safe setup. Current-limited supply at no more than the motor's rated voltage (and never above ); 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 in V/krpm and in N·m/A as if they were different constants, or mixing rpm and rad/s.
- Measuring 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 when designing a current loop or a fast PWM drive, where it is the dominant element.
Practice
- A motor has , , negligible . What is its no-load speed at , and its stall torque?
- With , what is its mechanical time constant?
- A datasheet gives . Convert to V·s/rad.
Answer
- (); stall current , torque .
- .
- .
Test yourself
Why are the torque constant (N·m/A) and back-EMF constant (V·s/rad) equal in SI units?
- by definition of the ampere
- energy conservation:
- only for brushless motors
- they are not equal
The reference motor's speed model has poles at about and . Which one comes from the armature inductance?
- both equally
- neither
Dropping , the reference motor's mechanical time constant is
Which test gives the armature resistance most reliably?
- ohmmeter on the free shaft
- no-load run at rated voltage
- stalled rotor at low voltage with a current limit, averaged over rotor positions
- coast-down