Understanding the real factors limiting servo gains, and system performance, makes it easier to devise counteracting strategies.
Curt Wilson • Vice President of Engineering • Omron Delta Tau
Here’s a piece of conventional controls wisdom – if you want to increase system performance, raise the gains.
For non-specialists in industry who are trying to optimize a servo system, this is often the extent of their control theory knowledge when they start a project. But of course, in practice it’s not possible to raise the feedback gains arbitrarily high to achieve a given desired level of performance, and knowledge of control theory at just an introductory level doesn’t provide much useful guidance as to the real reasons for the practical limits on these gains.
The ideal case
To understand the sources of these limits, we’ll start with an idealized case of basic “PID” feedback position control, then introduce real-world conditions that introduce limitations. Our idealized physical plant is a rigid body “lump of mass” (m) that can move in one horizontal direction without friction. (Those used to working with rotary systems can substitute rotary moment of inertia J for mass m in this analysis.) This is shown in Figure 1.
Our idealized controller is a delay-free continuous (“analog”) controller using feedback from a noise-free position sensor of infinite resolution and outputting a force acting on the mass. This controller has proportional (Kp), integral (Ki), and derivative (Kd) gains that act on the error between the desired and actual positions for the mass. The block diagram for this control loop is shown in Figure 2.
In this idealized case, there are few limitations to increasing the gain terms to achieve any desired level of performance. The proportional gain term Kp applies a restoring force to the mass m proportional to the magnitude of the error. The higher the value of Kp, the stiffer the system is in response to any disturbances or desired position changes.
But the dynamic equations of proportional gain feedback alone are those of an undamped spring. Increasing Kp increases the frequency of oscillation (√( Kp /m) rad/sec) of the mass-spring system, but it doesn’t reduce the overshoot from this oscillation.
The derivative gain term Kd provides a counteracting force proportional to the rate of change of the error. Its dynamics are those of a damper. The higher the value of Kd, the greater the damping effect. Together, the Kp and Kd terms act like the spring and shock absorber of a car’s suspension. Most users want to set Kd high enough to prevent overshoot from the Kp reaction to a step change in error. In the idealized system, this is always possible.
In the idealized system as we have defined it so far, there is not even a need for an integral gain term Ki. But if we consider a vertically moving mass instead, then with just Kp and Kd, there would be a steady-state error where the upward force from the proportional term (Kp * err) just matched the downward force from gravity (m * g). This is shown in Figure 3.
The Ki term accumulates the error over time to contribute to the control force. In the case of the vertically moving mass, it would reduce the steady-state error to zero, with higher values of Ki reducing it faster.
In response to a step change in desired position, the error accumulated while the actual position moves toward the new desired position causes the integrator to “charge up”, and this must be “discharged” by overshooting the new set point before settling. Higher values of Ki result in higher and faster overshoot and more tendency toward oscillatory behavior before settling at zero error.
Real-World Limitation #1: Measurement and Other Noise
In the idealized case, the position measurements were perfect. Of course, in reality, they fall short of this. Two key imperfections are measurement noise (usually electrical noise), and in digital systems, “quantization noise” stemming from the limited resolution of digitization. The higher the digitized resolution, the lower the resulting quantization noise (±½ increment).
When noise of either type is present, the feedback gain terms react to the noise, leading to spurious variation in the force commands. The nature of integration means that the noise cancels out over time, so there is not much effect on Ki action. However, the instantaneous nature of the Kp action means that it responds directly to the noise, and the higher the value of Kp, the greater the reaction to a given level of noise.
The problem is particularly severe with the derivative gain term Kd. The differentiation of a noisy signal, whether done with analog circuitry or by digital differencing, results in a significant amplification of the noise, with higher values of Kd increasing the amplification and its contribution to the control effort. It’s common for users to fail to achieve the level of damping they want without making the control effort noisier than they can tolerate.
Plots of actual system performance illustrate this point. Figure 4 shows the response (green) to a commanded position step (red) of a system with a certain feedback resolution. Response is quick, but smooth throughout.
Figure 5 shows the response of the same system to an identically sized physical step command with the feedback resolution reduced by a factor of 4 (increment size 4 times larger) using the same effective PID gains (numerical values increased by a factor of 4 to have the same physical effect). Note the roughness and “hunting” action at rest.
Quantization noise can also be introduced by the limited resolution of command values. In some applications, inadequate resolution of torque/force commands can be the limiting factor in control-loop performance.
Quantization noise in commanded position values can also be problematic, even if no bigger than the quantization in the measured position values. This is particularly true if “feedforward” gains are used to improve trajectory tracking. Commonly used velocity and acceleration feedforward gain terms use the first and second derivatives, respectively, of commanded position values. If they do not start from position values with sufficient resolution (which usually means finer resolution than the feedback), then otherwise optimal gain values will introduce too much noise into the servo loop.
Real-World Limitation #2: Sampling Delays
In the idealized case, the feedback controller could respond instantaneously. In the real world, this can’t happen. This is especially true in the case of “discrete-time” sampled-data control systems (commonly known as “digital controllers”), which constitute the vast majority of position controllers today.
There are many good reasons why digital control systems predominate here, but it’s vital to understand the limitations they impose. First, they sample the feedback sensors, and possibly compute new trajectory set points, at discrete time intervals, typically called servo cycles. These values are used to compute a control effort that will be used for a full servo cycle.
The ramification of this is that the control loop is on average one-half servo cycle behind in time. This delay in controller reaction reduces the stability of the closed-loop response because the effort is in response to “old” data. This means that the controller can continually be overcorrecting, resulting in “limit cycling” behavior with gains that would be reasonable with lower delays.
The problem is magnified if you use data from previous samples to compute a cycle’s control effort. For example, it’s common for the derivative action in cycle n to be computed as Kd * (errn – errn-1). This estimate of the derivative is one-half cycle old, so its use in the control effort is in total a full cycle old.
Advanced control techniques such as the use of state estimators to calculate the derivative states can improve performance, but these are considerably more difficult to set up, requiring accurate mathematical models of the plant for the estimator.
The higher the servo update frequency, the lower these sampling delays are. The huge increase in affordable computing power over the last several decades has permitted many systems to substantially reduce the control limitations resulting from sampling delays.
However, faster sampling increases the quantization noise from digital differencing, as for derivative action, for a given digitized position resolution. The resulting overall control action can be worse than with slower sampling. Recently, it’s common for people to update to a faster controller, but keep their low-resolution position sensors, and wonder why they cannot get higher performance.
Real-World Limitation #3: Additional Delays
An introductory digital control course accounts for the effect of these sampling delays. However, at this level of analysis, it doesn’t properly account for the interaction with finite sensor resolution. In addition, the basic analysis presented in a first course implicitly assumes that the feedback sampling, control computation, and command effort output all occur instantaneously.
In real systems, of course, these processes do not happen instantly; the required times are known as calculation and transport delays. While sampling delays have generally been decreasing in recent years, other technology trends have caused these other delays, particularly transport delays, to be actually increasing in some cases. These additional delays exacerbate the limit cycling problems mentioned earlier.
Serial-data position encoders have become increasingly common recently. They can provide high resolution, and often absolute, position data to the controller with just a few wires. However, in contrast to the use incremental quadrature encoders, where the controller’s counter value can be sampled and used with virtually no delay, it takes significant time to shift the serial data from the encoder to the controller. Typically, the actual sampling of the position encoder takes place one-half or a full cycle ahead of the start of the servo cycle in which it’s used.
Many high-resolution serial encoders perform interpolation on internal analog sinusoidal waveforms to obtain this resolution. This calculation-intensive process adds to the delays, meaning that the encoder is often not ready even to start reporting the present position when the controller requests this – it must report an earlier processed position. It’s often difficult to get the information from the encoder provider as to how long this added delay is.
Networked servo drives are also becoming more common. This trend has been driven mainly by the wiring simplicity, usually comprising a chain or ring of Ethernet cabling between the controller and drives. In these systems, digital command values are sent serially from controller to drives across the network, and digital feedback values are serially returned the same way. But this serial transmission introduces significant delays – typically one servo cycle for command transmission, one or two servo cycles for processing in the drive, and one servo cycle for return feedback transmission.
If the central controller is closing the servo loop and transmitting force/torque commands, these times constitute transport delays inside the servo loop, which can introduce severe performance limitations. A good rule of thumb is that the servo update frequency in such network-based control must be twice that for directly connected control, which does not have these delays, in order to get equivalent performance.
If instead, the drive is closing the servo loop, with the controller sending commanded position values, these transport delays are outside the servo loop and so do not compromise loop performance. However, in many network protocols, the commanded position values don’t have sufficient resolution to permit optimal feedforward gains without introducing too much quantization noise.
Real-World Limitation #4: Compliance
In the ideal system, the plant was a rigid body in which all parts moved together with perfect stiffness. In real-world systems, there is always some compliance. In many systems, the most significant compliance is in the coupling between motor and load.
This compliance typically results in a “resonant” frequency and a lower “anti-resonant” frequency in the control loop. The resonant frequency can be problematic because the system wants to oscillate at this frequency. The anti-resonant frequency can be an issue because it causes the system not to respond to commanded trajectory components in that frequency range.
For a rotary system with a compliance of stiffness k between a motor with inertia Jm and a load with inertia Jl, the anti-resonant frequency (in rad/sec) is:
The resonant frequency is:
(To convert these frequencies to Hertz, divide by 2π.)
If these frequencies are significantly higher than the required bandwidth frequency of the system, they often can be ignored. In high-precision systems where even slight ringing at the resonant frequency cannot be tolerated, it’s common to add a low-pass filter to the output of the servo loop so as to reduce the excitement of this frequency.
But in systems where these frequencies are closer to the needed bandwidth, or especially within it, the problems are more severe. With high servo gains, the resonant frequency mode can cause significant oscillations, or even outright instability. With basic algorithms, gains must be reduced to avoid these issues. In more sophisticated algorithms, “notch” (band-reject) filters can be added to counteract the resonance.
If the anti-resonant frequency is within the needed bandwidth, it will inhibit the ability of the system to track the commanded trajectory. Servo gains higher than those required for a stiffer system would be needed to improve the tracking performance, but these would often cause other problems.
Real-World Limitation #5: Stick/Slip Friction
Most systems exhibit dry running (Coulomb) friction and higher static friction. These effects can be difficult to compensate for, particularly if the static friction is substantially greater than the running friction, leading to “stick/slip” phenomena. Here, the integrator “charges up” enough to break loose from static friction, then overshoots the commanded position due to the lower running friction, eventually “sticking” on the other side, when the pattern repeats itself. Gains often have to be reduced to eliminate this action.
Air bearings or hydrostatic bearings can do away with this behavior, but introduce another phenomenon. With friction virtually eliminated, its natural damping effect is lost, and this must be made up by increased derivative action from the controller. It’s easy for small corrections to cause overshoot and hunting. High-resolution feedback and high servo update rates are typically required for these systems.
It’s often advantageous to select feedback resolution substantially higher than is required to achieve the requisite positioning precision. This permits the gains to be set higher, yielding better performance metrics, before getting undesirable behaviors. The cost increment for additional resolution is much less now than in earlier decades.
Using servo update frequencies higher than traditionally recommended can provide important performance improvements. Frequencies of 5 to 10 kHz are now commonly used, even for systems without unusually high performance requirements.
While more sophisticated control algorithms can improve performance with lower resolution and frequency, it often makes sense now to “throw speed and resolution at the problem”, permitting easier and faster system setup. The additional equipment cost often can easily be offset by reduced development cost.
While auto-tuning algorithms are steadily increasing in sophistication and performance, they’re still typically somewhat conservative in their settings, preferring safe sub-optimal performance to possible problems from trying to get too much performance. Many users get started with auto-tuning, then try to optimize performance manually, increasing gains until one or more of the problems noted here is encountered, then backing off somewhat. These guidelines can help users understand why they reach these limits, and so suggest what can be done to mitigate the issues.
Omron Delta Tau