O RIGINS OF PID C ONTROL

O RIGINS OF PID C ONTROL

In this section, we will explain why the PID controller is the perfect controller for a typical process. To illustrate the relationship between a PID controller and a process, we will examine a typical second-order process system. For computational purposes, a second-order system can be thought of as including a first-order system, in order to determine what type of controller will make the process in an open-loop system have a transfer function equal to one. We will discuss this in more detail shortly.

It is very difficult to determine the exact transfer function (Hp (s) ) of a real-life process (i.e., a manufacturing process). However, it can be approximated by

a second-order system with two lag times and a dead time delay. In Laplace form, this transfer function is defined as:

–t s The d e term, the dead time delay, can be omitted from this equation, since we know that this term only indicates that there is a shift in time in the

response. For practical purposes, the dead time will cause the response to behave in the same manner, only displaced in time by the delay. So, for

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Process Process Controllers C HAPTER 4 Applications

and Loop Tuning 15

(a) Parallel PID controller

Hc K P E

Standard

Derivative SP +

PV ( t) = K P E + K I ∫ 0 Edt + K D dt + PV ( t=0)

PV ( t) = K P E + K I ∫ 0 Edt – K D dt + PV ( t=0)

(b) Serial PID controller

Derivative t – K

PV ( t) = K P E + K P K I ∫ 0 Edt + K P K D dt + PV ( t=0)

dPV PV ( t) = K P E + K P K I ∫ 0 Edt – K P K D dt + PV ( t=0)

Figure 15-64. (a) Parallel and (b) serial PID controllers.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Process Process Controllers C HAPTER 4 Applications

and Loop Tuning 15

purposes of obtaining an equation for the best controller to govern this system, the delay can be omitted during the initial controller calculations. However, we should remember that there is a dead time response in the system.

The A term in the second-order system transfer function indicates the process gain and the τ 1 and τ 2 terms are the two lag times (see Figure 15-65). This second-order system is said to be inclusive of a first-order system, meaning that if one of the lag times is zero, the second-order equation will represent a first-order system. The ideal transfer function of a perfect process control system ( PV SP ) should equal one, indicating that the output of the process (PV) immediately follows any changes in the set point without requiring negative feedback to correct the error since there is no error. In other words, if there is

a step change in the set point from 0 to 1, the process will respond immediately with a change from 0 to 1. The controller-process relationship in a perfect system is such that they complement each other perfectly. Therefore, the transfer function of the process variable over the set point will be one. Accord- ingly, the equation for a perfect open-loop system is (see Figure 15-66):

A d CV ( e ( ) s) ( τ 1 s+1)( τ 1 s+1) ( τ 1 s+1)( τ 1 s+2)

CV ( s) Hc ( s) =

E ( s)

Figure 15-65. Second-order system.

–t d e s delay

Figure 15-66. Perfect open-loop system.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Process Process Controllers C HAPTER 4 Applications

and Loop Tuning 15

So, for a perfect system, the controller’s transfer function should be the inverse of the processor’s transfer function. Therefore, the controller’s transfer function in a perfect system using a typical process approximation is:

Hc () s =

Hp () s

( ( τ 1 s + 1 )( τ 2 s + 1 ) )

1 s + 1 ) ( τ 2 s + 1 =  )

2 ( ττ 12 s + τ 1 s + τ 2 s + =  1 A  )

12 s =  + ( ττ 1 + 2 ) s + 1

The term 1 A is a constant; therefore, it can be renamed as A 1 :

() Hc s = A 1 [ ττ 12 s + ( ττ 1 + 2 ) s + 1 ]

Dividing each term in the bracket by s yields:

( ττ 1 + 2 ) s 1 

Hc () s = A 1 

12 s

A 1 ττ 12 s + ( ττ + +  1 2 )

s 

Multiplying the A 1 term and rearranging the equation produces:

Hc () s = A 1 ( ττ 1 + 2 ) + + A 112 ττ s

12 s 4 4 3 { 123

The terms in this equation indicate that the controller has a proportional gain, an integral action ( 1 s ), and a derivative component (s). Therefore, the perfect system controller exhibits proportional, integral, and derivative actions. Note that the constant gain term in this equation does not imply that the gains should be the same for each of the PID actions. Rather, it indicates that these gains must be present and specified. Because a PID-type controller is the natural derivation from a perfect system, PID is considered a universal

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Process Process Controllers C HAPTER 4 Applications

and Loop Tuning 15

type of control for manufacturing processes. In fact, of all the PID configu- rations shown in Figure 15-64, perhaps the most commonly used in PLCs is the serial, modified derivative, PID configuration.

D I G I TA L I M P L E M E N TAT I O N OF PID IN A PLC

A programmable controller system implements the PID control action using a discrete, or digital, algorithm to update the control variable (CV). For example, a modified serial PID controller may use the following digital algorithm, where the current control variable output (CV n ) is repre- sented as:

CV n = CV ( n − 1 ) + KE P ( n − E ( n − 1 ) ) + KKTE P Is n −

( PV n − 2 PV ( n − 1 ) + PV ( n − 2 T ) )

 KK P D 

 s  where:

CV n = the controller output at the th update n

CV ( n − 1 ) = the controller output at the th minus one update n K P = the proportional gain (in seconds, where appropriate) K I = the integral gain (in seconds, where appropriate) K D = the derivative gain (in seconds, where appropriate)

E n = the error at the th update n E ( n − 1 ) = the error at the th minus one update n

T s = the loop sample time in seconds PV n = the process variable at the th n update update

PV ( n − 1 ) = the process variable at the th minus one update n PV ( n − 2 ) = the process variable at the th minus two update n

The loop sample time (T s ) is the frequency of how often the PLC reads and executes the integration and derivative terms in the algorithm equation. In PLCs, this time can be selected from a range of 0.1 seconds to several hundred seconds (e.g., 600 seconds, or 10 minutes) Figure 15-67 illustrates several sampling rates. A small value of T s (fast update time) is desirable in a process application where the process variable responds rapidly to control variable changes. However, because large values of T s are necessary to evoke a stable derivative action, the trade-off between a low and high T s value must be balanced carefully to ensure a correct system response. Otherwise, the derivative action can produce a bumpy action.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Process Process Controllers C HAPTER 4 Applications

and Loop Tuning 15

Figure 15-67. Loop sample rates.

The digital PID algorithm implemented in PLC systems calculates the error by approximating the area between the process variable and the set point (see Figure 15-68). This area calculation provides an approximate value of error.

PV Error is approximated by

the shaded sampled area SP

t t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 t 11

Update or Sampling Points

Figure 15-68. Error approximation using loop sample times.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Process Process Controllers C HAPTER 4 Applications

and Loop Tuning 15