S9 · Lesson 20 · Cascade control
Loops inside loops: why an inner loop helps, bandwidth separation and the outer loop's phase margin, tuning from the inside out, and the current, speed and position loops of a motor drive
Almost every motor drive runs three loops, one inside another: a current loop that makes the motor's torque follow a command, a speed loop that commands the current, and a position loop that commands the speed. Process plants do the same with a flow loop under a temperature or level loop. A single loop from voltage to position could in principle do the job, so why nest them? Because each inner loop deals with its own disturbances and nonlinearities before the outer loop ever sees them, and gives the outer loop a simpler plant to control.
- The curve is the outer loop's phase margin when it crosses over at around an integrating plant, with the inner closed loop acting as a lag of bandwidth : .
- With the inner loop five times faster the outer loop keeps 78.7° of margin; at equal bandwidths only 45°.
- That's the reason for the usual rule: make each inner loop 4 to 10 times faster than the loop around it.
Predict
A servo drive's current loop has a 1 kHz bandwidth. About how fast can its speed loop sensibly be made?
The speed loop sees the current loop as a lag; to keep that lag from eating its phase margin it should cross over 4 to 10 times lower, so 100 to 250 Hz. Typical drives run current loops at 1 to 3 kHz, speed loops at 100 to 300 Hz and position loops at 10 to 50 Hz: each a factor of several below the one inside it.
Name it
The structure
An outer controller acts on the main variable's error and produces the setpoint of an inner loop, whose controller drives the actuator and measures an intermediate variable closer to it. The inner loop is designed first; the outer loop then treats the closed inner loop as part of its plant.
What the inner loop buys
- Disturbance rejection. A disturbance entering inside the inner loop (a supply-voltage change in a motor's current loop, a pressure upset in a valve's flow loop) is attenuated by before it reaches the outer variable, and by after: at frequencies below the inner crossover, .
- Linearization. Friction in a valve, or a motor's back-EMF in the current loop, is hidden by the inner loop's gain, so the outer loop sees instead of the raw actuator.
- Limits. Clamping the inner setpoint limits the intermediate variable: a current limit protects a motor however hard the speed loop demands.
Bandwidth separation
If the inner loop behaves like and the outer plant is an integrator, the outer loop crossing over at has phase margin
A ratio of 4 to 10 costs the outer loop only 6 to 14° and lets it be designed as if the inner loop were perfect.
The motor drive
With torque constant and inertia J, the speed responds to current as , so a proportional speed gain (amperes per rad/s) crosses over at . A position loop with gain (rad/s of speed command per rad of error) crosses over at about , and while following a ramp at speed v it lags by , which velocity feedforward (lesson 19) removes.
Worked example
A servo motor has = 0.05 N·m/A and J = 10⁻⁴ kg·m², under a current loop with 1 kHz bandwidth. Set a proportional speed gain for a 100 Hz crossover, and find the speed loop's phase margin.
Show the solution
- Speed plant.
- Gain for a 100 Hz crossover. It's 1.263 exactly, once the current loop's small lag is included.
- Phase margin. The current loop is fast enough to be almost invisible to the speed loop.
Answer = 1.26 A per rad/s (1.263 with the current loop's lag), with an 84.3° phase margin.
Worked example
A temperature loop crosses over at 0.01 rad/s around a heat exchanger, and the steam valve gets its own flow loop crossing at 1 rad/s. How much does the flow loop attenuate a steam-pressure upset, compared with the temperature loop alone?
Show the solution
- The flow loop's sensitivity. Below the outer crossover,
- At 0.01 rad/s. That's 40 dB of extra attenuation, on top of whatever the temperature loop provides.
- What that means. The upset is corrected in a few seconds at the valve, long before the slow exchanger shows it; without the flow loop the temperature loop would only react after the exchanger's lag let the upset through.
Answer the flow loop adds about 40 dB of attenuation at 0.01 rad/s, on top of the temperature loop's.
Worked example
A position loop with gain = 2π × 10 s⁻¹ commands that speed loop. How far behind does it fall when the target moves at 100 rad/s?
Show the solution
- Loop type. A proportional position loop around the (nearly ideal) speed loop is type 1, with velocity constant
- Following error. a quarter of a turn.
- Remove it with feedforward. Feeding the target's speed forward to the speed loop's setpoint removes almost all of it, leaving the position loop to correct only what the speed loop misses.
Answer it falls 1.59 rad behind, a quarter of a turn.
Check
A motor with = 0.05 N·m/A and J = 1 × 10⁻⁵ kg·m² has a fast current loop; its speed loop should cross over at 300 Hz.
(a)
What proportional speed gain, in amperes per rad/s, does that need, ignoring the current loop's lag?
Write units the way you normally would: 1.5 A/(rad/s), 1500 mA/(rad/s) and 0.0015 kA/(rad/s) are the same answer.
Check
An outer loop around an integrating plant crosses over 4 times below the bandwidth of the first-order inner loop it commands.
(a)
What phase margin does it have?
(b)
How much margin does the inner loop's lag cost?
Check
An outer loop must cross over at 10 rad/s around an integrating plant with at least 70° of phase margin.
(a)
How fast must the inner loop be?
Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.
Check
An inner loop crosses over 10 times faster than the outer loop's 0.1 rad/s crossover.
(a)
How much does the inner loop attenuate a disturbance entering it, at the outer crossover?
Check
A proportional position loop crosses over at 10 Hz around a fast speed loop, following a target moving at 10 rad/s.
(a)
What is the following error?
Write units the way you normally would: 1.5 rad and 1500 mrad are the same answer.
Check
A speed loop's current command is clamped at 10 A; the motor has = 0.03 N·m/A and J = 0.0001 kg·m², and is commanded from rest to 500 rad/s.
(a)
What is the largest acceleration?
Write units the way you normally would: 1.5 rad/s^2 and 1500 mrad/s^2 are the same answer.
(b)
How long does the speed take to get there at least?
Check
Why are cascade loops tuned from the inside out?
Check
An outer loop crosses over at o around an integrating plant; the inner loop is r times faster; separately, a motor has = K and inertia J.
Step 1
What phase margin does the outer loop have, in degrees?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is the inner loop's |S| at the outer crossover?
Step 3
What speed gain makes the motor's speed loop cross over at o?
Check
Write speed_overshoot(K, Kt, J, wi, T, dt): simulate a unit speed step for a motor () whose current follows its command through a first-order loop (), with proportional speed control ; forward Euler, return the overshoot as a fraction.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
What does a cascade structure gain over a single loop from the actuator straight to the main variable?
The inner loop measures a variable close to the actuator, so it can correct disturbances that enter there, such as supply variations or pressure upsets, quickly and before they spread through the slower part of the plant. Its high gain also hides the actuator's nonlinearities and gives the outer loop a simple, nearly ideal plant. Limits placed on the inner setpoint protect the equipment, like a current limit on a motor. The price is that the inner loop must be several times faster than the outer one, so the outer loop's bandwidth is capped by how fast the inner loop can be made, and both loops have to be tuned in order.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.