PID Control with Servo Motors

PID Control with Servo Motors: What the Drive Is Actually Controlling
A servo axis can arrive at the correct position and still be badly tuned. It may hunt while standing still, lag behind the command during acceleration, overshoot at the end of travel or become noisy only at one particular speed. These are different problems, and treating all of them as a single “PID problem” usually leads to poor tuning.
In an industrial servo motion system, the controller, servo drive, motor and feedback device work as a closed-loop system. The requested motion is continuously compared with what the axis is actually doing. The correction may involve proportional, integral or derivative action, but a modern servo drive should not be imagined as one large PID block connected directly to the motor.
A servo drive normally works with nested control loops
Position-controlled servo systems commonly use a cascade of control loops. The outer loop deals with position, the next loop deals with velocity, and the innermost loop regulates motor current or torque. Each inner loop operates faster than the loop outside it.
Position loop: compares commanded position with measured position and determines how quickly the axis should move to remove the position error. For a more detailed discussion of this part of the system, see PID control for position.
Velocity loop: compares commanded speed with actual motor speed and produces the torque demand required to accelerate, decelerate or hold the requested motion. The related PID speed control page examines the speed loop separately.
Current / torque loop: regulates motor current so that the motor develops the requested torque. Torque control is therefore not simply another name for position control. A motor may produce the requested torque without being commanded to stop at any particular position. See PID control for torque for this distinction.
This matters when tuning. A change made to the velocity loop does not have the same effect as the same numeric change made to the position loop. Their gains can even have different units. Copying Kp, Ki or Kd values from another drive, another loop or another machine is not a valid tuning method.
Does every servo loop use P, I and D?
No. The letters PID describe a family of control actions; they do not mean that every industrial servo axis must use all three terms in every loop. A drive may use proportional control in one loop, PI control in another, additional feedforward terms, filters and internal motor-control algorithms that are not exposed to the user as ordinary PID parameters.
The basic functions are still useful to understand:
Proportional action — P: reacts to the present error. Increasing proportional gain generally makes the loop respond more strongly, but excessive gain can create oscillation, audible noise or instability.
Integral action — I: acts on error that persists over time. It is useful for removing steady-state error, but too much integral action can produce overshoot and slow oscillation. If the output is already limited while the integrator continues to accumulate error, integral windup can occur.
Derivative action — D: reacts to how quickly the relevant signal is changing. It can contribute damping in suitable control structures, but it does not literally predict the future position of the motor. Derivative action is also sensitive to measurement noise and is therefore not something to increase blindly whenever an axis overshoots.
The general behaviour of these terms is covered in the P, I and D components of PID control.
The encoder closes the loop — but only where it is measuring
A servo drive needs reliable feedback. Depending on the motor and drive, this may come from an incremental encoder, absolute encoder, resolver or another supported feedback device. Our rotary encoder section covers the wider family of encoder technologies used in automation.
One practical point is often missed: the encoder normally reports motor-shaft position, not necessarily the final position of the machine load. If the system contains a gearbox, coupling, belt, ball screw or another mechanical transmission, backlash and elasticity can exist between the motor and the load.
A drive can therefore report that the motor has reached its target while the table, carriage or tool is still slightly displaced. In machines where this error matters, a linear scale or second load-side feedback device may be used in a full-closed-loop arrangement, provided that the controller and servo drive support that architecture.
The same rule applies to fault finding: if the motor encoder looks healthy but the machine position drifts, do not immediately increase servo gain. Check the mechanics first.
What should be checked before servo tuning?
Good tuning starts before any gain is changed. Confirm the motor and drive combination, feedback type, motor direction, electronic gearing or command scaling, travel limits and brake operation. On a vertical axis, the holding brake and machine safety arrangement deserve particular attention before any automatic movement is allowed.
Mechanical condition is equally important. A loose coupling, damaged bearing, excessive belt compliance, dry linear guide or badly adjusted ball screw can all look like a control problem on the drive monitor.
A controller cannot tune out a loose mechanical connection.
If the servo drive provides motor identification or automatic tuning, follow the manufacturer's procedure and safety requirements. Auto-tuning is useful, but it is not the final proof that an axis is ready for production. The axis should still be checked with its real payload, normal acceleration, normal travel distance and repeated direction changes.
Watch the traces, not just the motor sound
Most professional servo drives provide monitoring or oscilloscope functions. These are far more useful than adjusting gains only by listening to the motor.
Useful signals include:
• Commanded position and actual position
• Following error
• Commanded velocity and actual velocity
• Torque or motor current
• Output limitation or saturation status
If following error rises sharply only during acceleration, the machine may simply be asking for more torque than the motor can deliver. Increasing loop gain cannot create additional motor torque.
If the axis oscillates while stationary, excessive gain is one possibility, but so are encoder noise, mechanical resonance, friction and backlash.
If the axis is smooth at low speed but noisy in a narrow speed range, the problem may be a mechanical resonance rather than an incorrectly chosen integral gain. Servo drives often provide notch, low-pass or other filters for such cases, but the resonance should be identified before filtering is applied.
Following error tells a story
Consider a packaging machine with a servo-driven indexing axis. The command asks the carriage to travel 250 mm, settle, wait for a process operation and return.
If the carriage reaches 250 mm but oscillates around the target before settling, the problem is primarily a settling behaviour issue.
If it remains several millimetres behind the command throughout acceleration and catches up only after the axis reaches constant speed, the torque demand, acceleration profile, velocity loop and feedforward settings deserve attention.
If the drive reports the correct final motor position while the carriage repeatedly stops at a slightly different physical location, investigate the transmission, coupling, backlash and load-side measurement before blaming the PID controller.
This is why following error should be examined throughout the motion, not only after the axis has stopped.
Feedforward is not the same as PID feedback
Fast motion systems frequently use velocity or acceleration feedforward in addition to feedback control. Feedback waits for an error to appear and then corrects it. Feedforward uses the commanded motion to anticipate the effort that will be required.
For example, acceleration feedforward can reduce the amount of following error created when a heavy axis accelerates. Velocity feedforward can compensate for effects related to motion at speed. These functions complement the feedback loops; they do not eliminate the need for a stable servo controller.
Where does the PLC fit into the servo system?
A PLC or motion controller may generate position commands, motion profiles, machine sequences and synchronization between axes. The servo drive then performs the high-speed motor-control functions required to make the motor follow those commands.
Exactly where the position loop is closed depends on the architecture. Some systems close the position loop inside the servo drive; others use a dedicated motion controller while the drive closes the velocity and current loops.
This distinction is important when troubleshooting. If the position loop is running in the drive, changing an unused position parameter in the PLC will achieve nothing. Likewise, inserting an ordinary process PID block into a PLC program does not automatically turn it into a high-performance servo motion controller.
For the PLC side of the subject, see PID control with PLCs.
Servo PID and VFD process PID are different jobs
The word PID also appears in variable-frequency drives, but the controlled process can be very different. In a pump application, for example, a pressure transmitter may provide process feedback and the PID controller changes motor speed to maintain a pressure setpoint. This is explained in PID control with a VFD.
Servo motion control deals with much faster position, velocity and torque loops. A pressure-control tuning value from a pump application therefore has no direct meaning in a servo position loop, even though both systems may use familiar terms such as proportional and integral gain.
Common symptoms and what to investigate first
Axis buzzes or shakes while stopped: check excessive loop gain, encoder quality, resonance, mechanical looseness and friction.
Axis overshoots the target: examine loop tuning, integral action, deceleration profile, load inertia and torque limits.
Axis follows well at low speed but falls behind during acceleration: examine acceleration demand, available motor torque, current limits and feedforward.
Position is repeatable at the motor but not at the machine: check backlash, coupling movement, gearbox play and load-side mechanics.
Performance changes substantially with payload: check the inertia ratio and whether the chosen tuning is appropriate for the complete load range.
Noise appears only in a narrow frequency range: investigate mechanical resonance before adding filters or reducing every gain indiscriminately.
For broader control-loop fault finding, see common PID control problems and troubleshooting.
Related PID and Motion Control Topics
PID fundamentals: PID Control FAQ · What is PID? · PID Gain and Tuning
Servo and motion loops: Position Control · Speed Control · Torque Control
Controller applications: PID with PLCs · PID with VFDs · Real-Time PID Control
Servo system reference: Basic Components of a Servo System · Speed, Torque and Position Control with Servo Drives · Rotary Encoders
Servo-drive parameter names, loop structures and tuning procedures vary by manufacturer and model. Always verify the motor data, feedback configuration, safety conditions and tuning procedure in the relevant drive manual before changing control parameters.