D1310 of 14
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

D13 · Lesson 10 · Motor controller

Controlling a motor with two nested loops, a fast current loop whose PI gains cancel the winding's pole, a slower speed loop that commands current, limits on current and voltage, integrator windup and conditional integration, and a simulated drive that meets its specifications

Industrial drives almost all use the same structure: an inner loop that controls the motor's current, and therefore its torque, and an outer loop that controls speed by asking for current. The inner loop is fast and protects the hardware, since limiting the current demand limits the torque and the heat; the outer loop is slower and sees a simple plant, an inertia driven by a torque it can command. Limits make the loops nonlinear, and a PI controller that ignores its limits winds up its integral and overshoots badly. This lab builds the whole drive and makes it meet a specification.

  • The speed loop's response to a step in demand, assuming the current loop is perfect and nothing saturates, for a speed-loop bandwidth fs and a PI zero placed at ωs/r.
  • Pushing the zero closer to the bandwidth (smaller r) gives stronger integral action, which rejects load torque faster, but at the cost of overshoot.
  • The readout shows the current this linear design would ask for at the start of a 250 rad/s step. It's far above the motor's 8 A limit, so in practice the drive saturates, which the linear picture can't show and the lab can.

Predict

The drive's current is limited to 8 A, the motor's K is 0.05 N·m/A and its inertia 2 × 10⁻⁵ kg·m². At best, how long does it take to reach 250 rad/s from rest?

Name it

The current loop

Seen from the voltage, the winding is 1/(Ls+R), with the back-EMF as a slowly changing disturbance. A PI controller kp+ki/s with

kp=Lωc,ki=Rωc

has its zero at R/L, exactly on the winding's pole, so the closed current loop is a first-order lag of bandwidth ωc, here 2π × 1 kHz, a time constant of 0.16 ms.

The speed loop

With the current loop much faster, the speed plant is K/(Js+B): a commanded current makes torque Ki. A PI with kp=Jωs/K crosses over near ωs, and ki=kpωs/r puts its zero r times lower. The bandwidths are separated by a factor of 20 (50 Hz against 1 kHz), so each loop sees the other as nearly ideal.

Limits and windup

The speed controller's output is clamped to ±8 A and the current controller's to the 24 V supply. While a controller is clamped, its integral keeps growing if nothing stops it: windup. When the speed finally arrives, the oversized integral holds the current high and the speed overshoots. Conditional integration stops the integral whenever the output is clamped, so the controller leaves the limit with a sensible integral. The lab compares the two: about 3% overshoot with it, over 30% without.

Worked example

What PI gains does the lab use?

Show the solution
  1. Current loop, proportional gain. kp=Lωc: kp=1mH×2π×1000=6.28V/A
  2. Current loop, integral gain. ki=Rωc: ki=1Ω×2π×1000=6283V/(A·s)
  3. Speed loop, proportional gain. kp=Jωs/K, with ωs=2π×50: kp=2×10−5×2π×500.05=0.126A per rad/s
  4. Speed loop, integral gain. ki=kpωs5=2×10−5(2π×50)25×0.05=7.90A/rad

Answer the current loop uses kp = 6.28 V/A and ki = 6283 V/(A·s); the speed loop uses kp = 0.126 A per rad/s and ki = 7.90 A/rad.

Worked example

A 0.1 N·m load lands while the motor holds 250 rad/s. What current must the drive add, and what did the lab's drive do?

Show the solution
  1. Extra current. 0.10.05=2A more.
  2. What the lab's drive did. The speed dips to about 237.7 rad/s while the speed loop's integral builds up that 2 A, and it's back within 1% about 30 ms after the step.
  3. Without the integral. A proportional loop would settle with an error of 2A0.126A per rad/s=16rad/s

Answer 2 A more; the lab's drive dipped to about 237.7 rad/s and was back within 1% about 30 ms later.

Check

Build the drive: two PI loops with limits and anti-windup, meeting the specification.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

A current loop for a 1 mH winding should have a 500 Hz bandwidth. What proportional gain cancels the winding's pole?

Write units the way you normally would: 1.5 V/A, 1500 mV/A and 0.0015 kV/A are the same answer.

Check

A drive limited to 8 A spins a rotor of 10 × 10⁻⁵ kg·m² with K = 0.02 N·m/A. Ignoring friction and load, what's the shortest time to reach 250 rad/s from rest?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

A proportional-only speed loop with gain 0.5 A per rad/s carries a load of 0.1 N·m on a motor with K = 0.02. What steady speed error does it leave?

Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.

Check

A current loop around a motor winding (L = 1 mH, R = 0.5 Ω) uses a PI controller whose zero cancels the winding's pole, for a 2000 Hz crossover.

(a)

What proportional gain (V/A) does it need?

Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.

(b)

What integral gain (V/(A·s)) puts the zero on the pole?

Check

A cascaded drive's current loop crosses over at 1000 Hz. The speed loop is set 5 times slower so the loops don't interact. What is the speed loop's crossover?

Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.

Explain why

Why does a PI speed controller overshoot after a large step if its integral isn't stopped while the current is limited?

Practice

Keep practicing

7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.