# PID Tips

```PID Tips
29/9/05
General Background: How PID Works ...................................................................................................................... 1
About PID and Process Control.............................................................................................................................. 1
Inside the PID Function.......................................................................................................................................... 2
Proportional Band ............................................................................................................................................. 2
Integral Action .................................................................................................................................................. 3
Derivative Action.............................................................................................................................................. 4
PID Tips ..................................................................................................................................................................... 5
Background: the Proportional Band and PV .......................................................................................................... 5
PID Range Settings: PV Low and PV High limits............................................................................................ 5
PID via Digital Output (Contactor, Solenoid Valve, SSR)..................................................................................... 7
Manual Loop Tuning.............................................................................................................................................. 7
i
General Background: How PID Works
The PID function uses system feedback to continuously control a dynamic process. The purpose of PID control
is to keep a process running as close as possible to a desired Set Point.
A common type of control is On-Off control. Many heating systems work on this principle. The heater is off
when the temperature is above the Set Point, and turns on when the temperature is below the Set Point. The lag
in the system response time causes the temperature to overshoot and oscillate around the Set Point.
PID control enables you to minimize overshoot and damp the resulting oscillations.
1.
Taking the output signal from the process, called the Process Variable (PV),
2.
Comparing this output value with the process Set Point. The difference between the output Process
Variable and the Set Point is called the Error signal.
3.
Using the Error signal to regulate the controller output signal, called the Control Variable (CV), to keep
the process running at the Set Point. Note that this output signal may be an analog or time-proportional
variable value.
In the figure below, a system is regulated according to temperature.
1
PID Tips
Inside the PID Function
The PID function is based on 3 actions, Proportional, Integral, and Derivative. The PID output is the combined
output of all 3 actions.
All of the PID functions are activated by changes in the process Error, the difference between the Process Value
and the process Set Point value (E = SP – PV).
Proportional Band
The proportional band is a range defined around the Set Point. It is expressed as a percentage of the total
Process Value (PV). When the PV is within this range, the PID function is active.
Note ♦ The proportional band may exceed 100%. In this case, PID control is applied over the entire system
range.
Proportional Action
Proportional action begins after the PV enters the proportional band; at this point, the Error is 100%. The action
outputs a value that is in direct linear proportion to the size of the Error value.
A broad proportional band causes a more gradual initial response from the controller. Typically, Set Point
overshoot is low; but when the system stabilizes, oscillations around the Set Point tend to be greater.
2
General background How PID Works
A narrow band causes a rapid response that typically overshoots the Set Point by a greater margin. However,
the system does tend to stabilize closer to the set point. Note that a proportional band set at 0.0% actually forces
the controller into On-Off mode.
The drawback of proportional control is that it can cause the system to stabilize below set point. This occurs
because when the system is at set point, Error is zero and the control value output is therefore pegged at zero as
well. The majority of systems require continuous power to run at set point. This is achieved by integrating
integral and derivative control into the system.
Direct and Reverse Action
Direct action causes the output to change in the same direction as the change in Error, meaning that a positive
change in Error causes a positive change in the proportional band’s output. Reverse action creates an inverse
change in the output, meaning that a positive change in Error causes a negative change in output.
Integral Action
Integral action responds to the rate of change in the controller’s CV output relative to the change in Error. The
integral time you set is the amount of time, as calculated by the controller, required to bring the process to Set
Point. Note that if you set a short integral time, the function will respond very quickly and may overshoot the
Set Point. Setting a larger integral time value will cause a slower response. Integral time is sometimes called
Reset.
The controller’s CV output may reach and remain at 100%, a condition called saturation. This may occur, for
example, if the process is unable to reach Set Point. This causes the Error signal to remain stuck in either the
positive or negative range. In this situation, the integral action will grow larger and larger as the Error
accumulates over time. This is called integral "wind up", which can cause the controller to overshoot the set
point by a wide margin.
This situation can be prevented by setting an MB to clear the accumulated Integral error when saturation is
occurs.
3
PID Tips
Derivative Action
Derivative action responds to the rate and direction of change in the Error. This means that a fast change in
error causes a strong response from the controller.
The derivative action ‘anticipates’ the PV’s value in relation to the Set Point and adjusts the controller’s CV
output accordingly, thus shortening the PID function’s response time.
4
PID Tips
Background: the Proportional Band and PV
The proportional band is a range defined around the Set Point. It is expressed as a percentage of the total Process
Value (PV). When the PV is within this range, the PID function is active.
Note ♦
♦
The proportional band may exceed 100%. In this case, PID control is applied over the entire
system range.
The PV and Setpoint must be the same unit type.
You can set PV limits by assigning Power up values as shown below.
Note ♦
♦
A broad proportional band increases the stability of the system, but also increases fluctuations
during the stable phase.
A proportional band that is too narrow will cause the system to react as though to ON-OFF
control, and greatly overshoot and undershoot the setpoint.
You can increase the proportional band or the integral time to decrease overshooting and
stabilize the system.
PID Range Settings: PV Low and PV High limits.
If your PID PV is based on an analog input using current or voltage, you can use the analog range units to set the
PV low and PV high limits. If this is done, you must also 'normalize' the setpoint to this range.
5
PID Tips
In general, it is
recommended that you
linearize the ranges to
Engineering Units
(EU). In this case use
ranges for X1 and X2,
and use engineering
units for Y1 and Y2.
Note ♦
Input resolution
10 bit, (0 to 10V, 020mA)
0-1023 units
10 bit (4-20mA)
205 to 1023
12 bit (0 to 10V, 020mA)
0-4095
12 bit (-20mA)
818-4095
14 bit (0 to 10V, 020mA)
0-16383 unit
14 bit (4-20mA )
3277-16383
If you are using a PT100 or Thermocouple input, the values do not have to be linearized.
This is because the input value is already in degrees Celsius or Fahrenheit ( 0.1° resolution)
according to the Hardware Configuration.
Example: If the MI that is linked to a temperature input, set to Celsius, contains the value 385,
Example: Temperature, Thermocouple type 'J'
Example: Linearizing to bars (pressure EU)
Assume that you are using a 14-bit input, 4-20mA with a pressure transducer with a range of 0-10 bars. Set
Linearization parameters as shown below.
Although you can set the PV limits to the input range, this may not produce accurate results.
6
PID Tips
Example 1: Assume that the 14-bit pressure transducer mentioned above is in a system with range limits of 0-5
bars. If you set the PV Low to 0 and the PV high to 1000 (10.00 bars), this is the range that will be used by the
PID function. PID will work properly.
However, you can achieve better PID control by setting the PV Low to 0 and the PV High to 600 ( 6 bars). Since
the error is a function of the PID working band, Example 2 will run with approximately 40% greater accuracy
than Example 1.
Example 2: Thermocouple type 'J' has as range of -200 to 760°C. Assume that this is the input for a PID system
with an ambient temperature that can reach a low of 10°C to a maximum setpoint of 250°C. If you set the PV
Low to 0 and the PV High to 300°C, PID control will function with approximately 3 times greater accuracy than
if you set the PV range to cover the entire -200 to 760 input range.
PID via Digital Output (Contactor, Solenoid Valve, SSR)
You can use the PWM (Pulse Width Modulation) FB to control a PID system. PWM FB enables you to control
the ratio between the ON and OFF status of a selected MB (Duty Cycle) within the defined cycle time, which is
given as ticks of 2.5 milliseconds. The ratio is given as an ON pulse percentage on the range of 0-1000 (0100%).
In order to control PID with the PWM FB, you must set the PID CV range to 0-1000 (0-100.0%).
Since the PWM cycle time is set in ticks of 2.5 ms, e.g. 1 s = 400. If the output is a relay/contactor/solenoid
valve, the recommended cycle time range is between 2000 and 12000 (5 to 30 sec).
Example: As the PWM output MB pulses ON and OFF, the pulse ON time is proportional to the CV. If the
cycle time is = 4000 (10 sec), and the CV is 100 (10.0%), the output bit will be ON for 1 second and OFF for 9
seconds, thereby supplying 10% of the energy to the system.
If the switch is an SSR, the recommended cycle time range is between 200 and 1000 (0.5 to 2.5 sec). Transistor
outputs are preferable.
If you use an SSR, you can use a Unitronics PLC that supports a high-speed output. In Hardware Configuration,
set the Frequency (F=1/CT) parameter's Power-up Value to 5 to 10Hz ( which is 0.2 -0.1s cycle time). Link the
PWM Duty Cycle MI to the CV. Note that in order to activate the output pulses, you must SET the RUN MB
linked to the HSO in Hardware Configuration.
Manual Loop Tuning
In certain cases, you may already have the PID values required by you application. However, you should still
perform Autotune in order to ensure proper PID function.
This is because during the Autotune process, the PID function collects certain essential data. Unitronics'
proprietary PID algorithm uses this data to run smooth, accurate PID.
7
A
Auto tune ..................................................................5
C
CV ............................................................................5
E
Error .........................................................................5
F
FB ............................................................................ 5
P
PID....................................................................... 1, 5
8
9
```