# How to tune PID loops

## Servo-motor applications and temperature-control applications often need training after the auto-tune.

A Control Design reader wrote to us: I often have difficulty tuning PID loops, especially for temperature control applications and servo-motor motion applications. If I use a temperature controller, the auto-tune built into the device often works well if I follow the manufacturer’s recommendations. However, if the temperature control or motion control is through a PLC or other advanced controller, it's often a long training process to find the optimum coefficients for the proportional, integral and derivative of the control loop.

Whether I am controlling the temperature of my medical cleaning process skid or moving my servo-controlled three-axis gantry, if the process variable, such as temperature or position, needs to change slowly, it's easy. As soon as I need better performance, such as a fast change in temperature or position, or if dynamic loads are involved, my PID loops become unstable and oscillate or the process variable overshoots or undershoots the setpoint. I can’t afford to burn up the medical device I'm cleaning or have a spongy motion-control system that can't snap to a position.

How do I achieve a quick-responding PID control loop that can handle dynamic changes to the process variable without chasing PID coefficients for days? What are some rules when designing the control system for these closed-loop control applications?

Where do I start and what are some best practices to get stability and optimal control in process-skid and motion-control applications from both a hardware and a PID tuning standpoint? What are some procedures to follow to help reduce PID-loop-tuning time? Any suggestions are appreciated.

P is for proportional band

First, determine what engineering units the tuning parameters use. This allows you to understand if increasing or decreasing a parameter has a positive or negative effect.

The P in PID is for proportional band. It is also known as gain. Increasing the proportional-band setting decreases its effect on the loop. Whereas increasing the gain parameter increases the effect. Proportional band = 100/gain.

I is for integral. This is the time parameter. It is also known as reset. Increasing integral parameter increases the effect; decreasing reset parameter increases the effect. Integral = 1/reset.

D is for the derivative parameter. It is also referred to as rate. These terms act the same: Increasing the value will increase the effect on the loop.

For both integral and derivative, the units of time must be understood, as well (milliseconds or seconds).

A reasonably quick method to create a stable loop requires a process upset through heat loss. This method is used without the process actually being in operation.

Before beginning, adjust the set point to about 80% of the normal process setting.

1. Start with the proportional band at whatever the default value is, or 50% of setting range.

2. Set both the integral and derivative parameters to zero.

Wait a few minutes for the temperature to stabilize. Note that it will not be at the set point, generally lower.

Upset the loop by introducing loss either by raising the set point 10% or removing heat through whatever method is practical. I have used air guns, opened doors of furnaces, sprayed cold water from a garden hose, turned off main-burner gas-supply valves, tripped circuit breakers and even shoveled snow onto rotary kiln infeed conveyors in an attempt to simulate process heat loss.

Observe the response, if the output slowly increases and the temperature does not oscillate, decrease (increase the effect) the proportional band and repeat the upset. Do this several times until you see a pronounced oscillation of the process variable; it still will not be at set point.

Now, without disturbing the process, increase the integral term one step at a time, waiting a reasonable length of time after making a change until the temperature is now oscillating around the set point. This oscillation may not be very noticeable, but remember you are in a steady state condition at this time.

Next upset the loop using whatever method available and observe the response. You can now add in a small amount of derivative term one step at a time after upsetting the process, until there is acceptable performance. Decent enough control should now be occurring, allowing you to run the system under real process conditions.

Further fine tuning is now performed with small changes to one parameter at a time and allowing sufficient time for the change to be observed. Try to operate the loop in as many different process conditions as practical. Record all changes along with performance notes to aid in solving future problems.

— Mike Krummey, electrical engineering manager, Matrix Packaging Machinery