A closed loop servo system measures what the motor actually does, with an encoder, resolver or current sensor, and continuously corrects the difference from the command. Industrial servo drives nest three loops: a fast PI current (torque) loop inside a PI velocity loop, inside a proportional position loop. Each inner loop should be 5–10 times faster than the loop around it. Tune from the inside out, and add feed-forward when following error must be small.
Open Loop vs Closed Loop Servo Control
A closed-loop controller feeds measured output back to the controller; an open-loop controller runs in a pre-arranged way without that feedback. Wikipedia lists the closed-loop advantages: disturbance rejection, performance despite model errors, the ability to stabilize unstable processes, lower sensitivity to parameter changes and better reference tracking. A servomechanism is by definition closed-loop. Wikipedia notes a power window is not a servo, because no automatic feedback controls position, but cruise control is.
| Open loop | Closed loop servo | |
|---|---|---|
| Feedback | None; assumes the motor followed the command | Encoder, resolver, tachometer or potentiometer |
| Disturbances | Not detected or corrected | Corrected automatically |
| Tuning | Little or none | Gains must be tuned for stability and response |
| Typical use | Simple positioning, fixed-speed drives | CNC axes, robots, packaging, high-dynamic motion |
The Three Servo Control Loops
Current (torque) loop
The innermost loop controls motor current, and therefore torque, which drives speed and position. It is typically PI, and its gains are often set by the drive manufacturer so users rarely tune it (Motion Control Tips).
Velocity loop
The most common servo loop. It compares commanded and actual speed from a tachometer or encoder and is usually PI, with proportional gain Kvp and integral gain Kvi. The integral term pushes the motor to zero error at the end of a move. The velocity loop also resists high-frequency load disturbances, but alone it cannot hold a position over long periods.
Position loop
Wrapped around the velocity loop, the position loop calculates following error and issues a velocity command to remove it. In a cascaded system it is usually proportional only (Kp). A position loop used without a velocity loop is normally a full PID controller, but velocity feedback adds stiffness and counters high-frequency disturbances. For PID terms and general tuning methods, see PID tuning.
Loop Bandwidth and the 5–10× Rule
Bandwidth is the frequency at which the closed-loop response falls by 3 dB, to 70.7% of the input amplitude (ADVANCED Motion Controls). In a cascade, each inner loop must respond faster than its outer loop or it has little effect: velocity 5–10× the position loop, current 5–10× the velocity loop. Raising position bandwidth raises the velocity bandwidth needed, and so on inward. Pushing an outer loop beyond what the inner loop can support gains nothing (Motion Control Tips).
ADVANCED Motion Controls notes that inertia, friction and gear ratio all limit bandwidth, and phase and gain margin set the stable maximum. It cites standard servo systems below 15 Hz, large systems around 1–2 Hz and direct-drive systems up to 50 Hz.
Servo Loop Calculator
How to Tune a Closed Loop Servo
- Confirm the current loop: most drives set it automatically from the motor data; change it only if the manufacturer says so.
- Set the drive to velocity mode. Use a medium target speed with a fairly high acceleration to make the response visible.
- Raise Kvp until just before overshoot (or to overshoot, then back off).
- Raise Kvi until a small overshoot of about 5–15% appears.
- Switch to position mode. Start with a low Kp and raise it slowly to just before overshoot.
- Repeat moves at higher speeds and adjust so the gains work across the full speed range.
- If following error is still too high, add velocity (and acceleration) feed-forward, lowering Kp as needed.
Steps from Motion Control Tips. Velocity feed-forward calculates the speed the profile needs and feeds it directly to the velocity loop, so the axis no longer waits for error to build. The cost is that Kp must usually be reduced, lowering stiffness.
For speed conversion from drive frequency, see Hz and RPM. For analog speed references on simpler drives, see potentiometer speed control.
Most of these loops close through an encoder: see our guide to the incremental encoder for quadrature, PPR and wiring.
Frequently Asked Questions
What is a closed loop servo system?
A motor, drive and controller that measure the actual position, speed or torque with a feedback device and continuously correct the error from the command. The drive compares feedback with the command and adjusts voltage, frequency or pulse width to remove the difference (Motion Control Tips; Wikipedia).
What is the difference between open loop and closed loop control?
Open-loop control runs a pre-arranged command without measuring the result. Closed-loop control measures the output and feeds it back, which rejects disturbances, tolerates model errors, can stabilize unstable processes and improves tracking (Wikipedia).
What are the three servo control loops?
The current (torque) loop innermost, the velocity loop in the middle and the position loop outermost. Each loop’s output is the command for the loop inside it.
Which servo loop uses PID?
In a cascaded system the position loop is usually proportional only, while the velocity and current loops are PI. A position loop used alone, without a velocity loop, is usually a full PID controller.
How much faster should the inner loop be?
The general rule is 5 to 10 times the bandwidth of the loop outside it: velocity loop 5–10× the position loop, current loop 5–10× the velocity loop.
In what order should servo loops be tuned?
Fastest first. The current loop is usually set by the manufacturer; tune the velocity loop next, then the position loop.
How do you tune a servo velocity loop?
Raise Kvp to just before overshoot, then raise Kvi until about 5–15% overshoot appears, using a medium speed and a fairly high acceleration to make the response visible (Motion Control Tips).
What is following error?
The difference between commanded and actual position while moving. With a proportional position loop and no feed-forward, it is about speed ÷ Kp.
What does velocity feed-forward do?
It sends the velocity the move needs straight to the velocity loop instead of waiting for position error, sharply cutting following error. The trade-off is that Kp usually has to be lowered, reducing stiffness.
What limits servo bandwidth?
Inertia, friction, gear ratio, mechanical resonance and stability margins. Bandwidth is usually defined at the −3 dB point, where output falls to 70.7% of the input amplitude (ADVANCED Motion Controls).
Sources and Further Reading
- Motion Control Tips: Servo motor current, velocity and position loops and bandwidths.
- Motion Control Tips: How are servo system velocity control loops tuned?.
- ADVANCED Motion Controls: What is servo bandwidth?: −3 dB definition and limits.
- Wikipedia: Closed-loop controller, Servomechanism and Servo drive.
