BITS Pilani
PID Controller: Design, Tunin uning g and and Trou rouble ble shooting
Pilani Campus
Pratik N Sheth Department of Chemical Engineering
Contents • Perfo Perform rman ance ce Cr Crite iteri ria a for for Cl Clos osed ed lo loop op sy syst stem ems s • Model ba based design me methods • •
Dire irect Synthe thesis sis Me Method Inte Intern rna al mo model Con ontr tro ol (IM (IMC C)
Contents • Perfo Perform rman ance ce Cr Crite iteri ria a for for Cl Clos osed ed lo loop op sy syst stem ems s • Model ba based design me methods • •
Dire irect Synthe thesis sis Me Method Inte Intern rna al mo model Con ontr tro ol (IM (IMC C)
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Controller Tuning: A Motivational Example
Controller Tuning: A Motivational Example
Fig. 12.1. Unit-step disturbance responses for the candidate controllers (FOPTD Model: K = 1,θ = 4, τ = 20). 3
Performance Criteria For Closed-Loop Systems • The function of a feedback control system is to ensure that the closed loop system has desirable dynamic and steady-state response characteristics. • Ideally, we would like the closed-loop system to satisfy the following performance criteria: 1. The closed-loop system must be stable. 2. The effects of disturbances are minimized, providing good disturbance rejection . 3. Rapid, smooth responses to set-point changes are obtained, that is, good set-
Performance Criteria For Closed-Loop Systems • The function of a feedback control system is to ensure that the closed loop system has desirable dynamic and steady-state response characteristics. • Ideally, we would like the closed-loop system to satisfy the following performance criteria: 1. The closed-loop system must be stable. 2. The effects of disturbances are minimized, providing good disturbance rejection . 3. Rapid, smooth responses to set-point changes are obtained, that is, good set- point tracking . 4. Steady-state error (offset) is eliminated. 5. Excessive control action is avoided. 6. The control system is robust, that is, insensitive to changes in process conditions and to inaccuracies in the process model. Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Alternative Techniques 1. Direct Synthesis (DS) method 2. Internal Model Control (IMC) method 3. Controller tuning relations 4. Frequency response techniques 5. Computer simulation 6. On-line tuning after the control system is installed.
Alternative Techniques 1. Direct Synthesis (DS) method 2. Internal Model Control (IMC) method 3. Controller tuning relations 4. Frequency response techniques 5. Computer simulation 6. On-line tuning after the control system is installed.
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Direct Synthesis method • In the Direct Synthesis (DS) method, the controller design is based on a process model and a desired closed-loop transfer function. • The latter is usually specified for set-point changes, but responses to disturbances can also be utilized (Chen and Seborg, 2002). • Although these feedback controllers do not always have a PID structure, the DS method does produce PI or PID controllers for common process models. • As a starting point for the analysis, consider the block diagram of a feedback control system in Figure. • The closed-loop transfer function for set-point changes is given by
Direct Synthesis method • In the Direct Synthesis (DS) method, the controller design is based on a process model and a desired closed-loop transfer function. • The latter is usually specified for set-point changes, but responses to disturbances can also be utilized (Chen and Seborg, 2002). • Although these feedback controllers do not always have a PID structure, the DS method does produce PI or PID controllers for common process models. • As a starting point for the analysis, consider the block diagram of a feedback control system in Figure. • The closed-loop transfer function for set-point changes is given by
Y Ysp
=
K mGc GvG p
1 + Gc Gv G p Gm
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Direct Synthesis method For simplicity, let G Gv G p Gm reduces to
Y
and assume that G m = K m . Then Eq. 12-1
=
Gc G
1 + Gc G
Ysp
(12-2)
Rearranging and solving for G c gives an expression for the feedback controller:
Gc
=
1 Y / Y sp
G 1 − Y / Y sp
(12-3a)
• Equation 12-3a cannot be used for controller design because the closed-loop
Direct Synthesis method For simplicity, let G Gv G p Gm reduces to
Y
and assume that G m = K m . Then Eq. 12-1
=
Gc G
(12-2)
1 + Gc G
Ysp
Rearranging and solving for G c gives an expression for the feedback controller:
Gc
=
1 Y / Y sp
G 1 − Y / Y sp
(12-3a)
• Equation 12-3a cannot be used for controller design because the closed-loop transfer function Y / Y sp is not known a priori . • Also, it is useful to distinguish between the actual process G and the model, G% , that provides an approximation of the process behavior. • A practical design equation can be derived by replacing the unknown G by G% , and Y / Ysp / Y sp )d : by a desired closed-loop transfer function, (Y Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Gc
=
1 (Y / Y sp )d G% 1 − (Y / Y sp )
(12-3b)
d
• The specification of (Y / Ysp )d is the key design decision and will be considered later in this section. • Note that the controller transfer function in (12-3b) contains the inverse of the process model owing to the 1/ G% term. • This feature is a distinguishing characteristic of model-based control.
Desired Closed-Loop Transfer Function
Gc
=
1 (Y / Y sp )d G% 1 − (Y / Y sp )
(12-3b)
d
• The specification of (Y / Ysp )d is the key design decision and will be considered later in this section. • Note that the controller transfer function in (12-3b) contains the inverse of the process model owing to the 1/ G% term. • This feature is a distinguishing characteristic of model-based control.
Desired Closed-Loop Transfer Function For processes without time delays, the first-order model in Eq. 12-4 is a reasonable choice,
Y Ysp
1 = d τ c s + 1
(12-4) 8
• The model has a settling time of ~ 4 τ c • Because the steady-state gain is one, no offset occurs for set-point changes. • By substituting (12-4) into (12-3b) and solving for G c , the controller design equation becomes:
Gc
=
1 1 G% τc s
(12-5)
• The 1/ τc s term provides integral control action and thus eliminates offset. • Design parameter τc provides a convenient controller tuning parameter that can be used to make the controller more aggressive (small τc ) or less aggressive (large τc ).
• The model has a settling time of ~ 4 τ c • Because the steady-state gain is one, no offset occurs for set-point changes. • By substituting (12-4) into (12-3b) and solving for G c , the controller design equation becomes:
Gc
=
1 1 G% τc s
(12-5)
• The 1/ τc s term provides integral control action and thus eliminates offset. • Design parameter τc provides a convenient controller tuning parameter that can be used to make the controller more aggressive (small τc ) or less aggressive (large τc ).
9
• If the process transfer function contains a known time delay θ, a reasonable choice for the desired closed-loop transfer function is:
Y Ysp
− θs e = d τc s + 1
(12-6)
• The time-delay term in (12-6) is essential because it is physically impossible for the controlled variable to respond to a set-point change at t = 0, before t = θ . • If the time delay is unknown, θ must be replaced by an estimate. • Combining Eqs. 12-6 and 12-3b gives:
• If the process transfer function contains a known time delay θ, a reasonable choice for the desired closed-loop transfer function is:
Y Ysp
− θs e = d τc s + 1
(12-6)
• The time-delay term in (12-6) is essential because it is physically impossible for the controlled variable to respond to a set-point change at t = 0, before t = θ . • If the time delay is unknown, θ must be replaced by an estimate. • Combining Eqs. 12-6 and 12-3b gives:
Gc (Y / Y sp ) d Gc = G% 1 − (Y / Y sp ) d 1
=
e − θs
1 G%
τc s + 1 − e
− θs
(12-7)
(12-3b) 10
• Although this controller is not in a standard PID form, it is physically realizable. • Next, we show that the design equation in Eq. 12-7 can be used to derive PID controllers for simple process models. • The following derivation is based on approximating the time-delay term in the denominator of (12-7) with a truncated Taylor series expansion:
e
− θs
≈ 1 − θs
(12-8)
Substituting (12-8) into the denominator of Eq. 12-7 and rearranging gives
Gc
=
e−
1 %
(
θs
)
s
(12-9)
• Although this controller is not in a standard PID form, it is physically realizable. • Next, we show that the design equation in Eq. 12-7 can be used to derive PID controllers for simple process models. • The following derivation is based on approximating the time-delay term in the denominator of (12-7) with a truncated Taylor series expansion:
e
− θs
≈ 1 − θs
(12-8)
Substituting (12-8) into the denominator of Eq. 12-7 and rearranging gives
Gc
e−
1
=
G%
θs
s
( τc + θ ) S
(12-9)
Note that this controller also contains integral control action.
11
First-Order-plus-Time-Delay (FOPTD) Model Consider the standard FOPTD model,
G% ( s ) =
Ke
− θs
τs + 1
(12-10)
Substituting Eq. 12-10 into Eq. 12-9 and rearranging gives a PI controller, with the following controller settings:
G
K (1 + 1/
)
First-Order-plus-Time-Delay (FOPTD) Model Consider the standard FOPTD model,
G% ( s ) =
Ke
− θs
(12-10)
τs + 1
Substituting Eq. 12-10 into Eq. 12-9 and rearranging gives a PI controller, with the following controller settings:
Gc
=
K c (1 + 1/ τ I s ) ,
K c
=
τ
1
K θ + τ c
τ I = τ
,
(12-11)
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Second-Order-plus-Time-Delay (SOPTD) Model Consider a SOPTD model,
G% ( s ) =
Ke
− θs
( τ1s + 1)( τ2 s + 1)
(12-12)
Substitution into Eq. 12-9 and rearrangement gives a PID controller in parallel form,
G
1
1
(12-13)
Second-Order-plus-Time-Delay (SOPTD) Model Consider a SOPTD model,
G% ( s ) =
Ke
− θs
(12-12)
( τ1s + 1)( τ2 s + 1)
Substitution into Eq. 12-9 and rearrangement gives a PID controller in parallel form,
1 Gc = K c 1 + + τDs τ I s
where:
K c
=
1
τ1 + τ 2
K
τ c + θ
,
τ I = τ1 + τ 2 ,
τD =
(12-13) τ1τ 2 τ1 + τ 2
(12-14)
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Example 12.1
Use the DS design method to calculate PID controller settings for the process:
G=
2e − s
(10s + 1)( 5s + 1)
Consider three values of the desired closed-loop time constant: τ c = 1, 3, and 10 . Evaluate the controllers for unit step changes in both the set point and the disturbance, assuming that G d = G . Repeat the evaluation for two cases:
Example 12.1
Use the DS design method to calculate PID controller settings for the process:
G=
2e − s
(10s + 1)( 5s + 1)
Consider three values of the desired closed-loop time constant: τ c = 1, 3, and 10 . Evaluate the controllers for unit step changes in both the set point and the disturbance, assuming that G d = G . Repeat the evaluation for two cases: a. The process model is perfect ( G% = G ). % b. The model gain is K = 0.9, instead of the actual value, K = 2. Thus,
G% =
0.9e− s
(10 s + 1)( 5s + 1) Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
The controller settings for this example are: τc = 1
τc = 3
τ c = 10
% =2 K c ( K )
3.75
1.88
0.682
% = 0.9 K c ( K )
8.33
4.17
1.51
τ I τ D
15 3.33
15 3.33
15 3.33
The controller settings for this example are: τc = 1
τc = 3
τ c = 10
% =2 K c ( K )
3.75
1.88
0.682
% = 0.9 K c ( K )
8.33
4.17
1.51
τ I τ D
15 3.33
15 3.33
15 3.33
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
The values of K c decrease as τ c increases, but the values of and τ D do not change, as indicated by Eq. 12-14.
2 1 r e t p a h C
τ I
The values of K c decrease as τ c increases, but the values of and τ D do not change, as indicated by Eq. 12-14.
τ I
2 1 r e t p a h C
Figure 12.3 Simulation results for Example 12.1 (a): correct model gain. 16
2 1 r e t p a h C
2 1 r e t p a h C
Fig. 12.4 Simulation results for Example 12.1 (b): incorrect model gain. 17
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus
Internal Model Control (IMC) • A more comprehensive model-based design method, Internal Model Control ( IMC ), was developed by Morari and coworkers (Garcia and Morari, 1982; Rivera et al., 1986). 2 • The IMC method, like the DS method, is based on an assumed 1 process model and leads to analytical expressions for the r e controller settings. t p a • These two design methods are closely related and produce h identical controllers if the design parameters are specified in a C consistent manner.
Internal Model Control (IMC) • A more comprehensive model-based design method, Internal Model Control ( IMC ), was developed by Morari and coworkers (Garcia and Morari, 1982; Rivera et al., 1986). 2 • The IMC method, like the DS method, is based on an assumed 1 process model and leads to analytical expressions for the r e controller settings. t p a • These two design methods are closely related and produce h identical controllers if the design parameters are specified in a C consistent manner.
• The IMC method is based on the simplified block diagram shown in Fig. 12.6b. A process model G% and the controller %. output P are used to calculate the model response, Y
19
2 1 r e t p a h C
Figure 12.6. Feedback control strategies
• The model response is subtracted from the actual response Y , % is used as the input signal to the IMC and the difference, Y − Y controller, G*.
2 1 r e t p a h C
Figure 12.6. Feedback control strategies
• The model response is subtracted from the actual response Y , % is used as the input signal to the IMC and the difference, Y − Y controller, Gc*. % due to modeling errors G • In general, Y ≠ Y ( % ≠ G ) and unknown disturbances ( D ≠ 0 ) that are not accounted for in the model.
• The block diagrams for conventional feedback control and IMC are compared in Fig. 12.6. 20
• It can be shown that the two block diagrams are identical if controllers Gc and Gc* satisfy the relation *
Gc
=
Gc
1 − Gc*G%
(12-16)
2 1 r • Thus, any IMC controller G* is equivalent to a standard c e t feedback controller Gc, and vice versa. p a h • The following closed-loop relation for IMC can be derived from Fig. 12.6b using the block diagram algebra of Chapter 11: C
• It can be shown that the two block diagrams are identical if controllers Gc and Gc* satisfy the relation *
Gc
=
Gc
(12-16)
1 − Gc*G%
2 1 r • Thus, any IMC controller G* is equivalent to a standard c e t feedback controller Gc, and vice versa. p a h • The following closed-loop relation for IMC can be derived from Fig. 12.6b using the block diagram algebra of Chapter 11: C *
Y
=
Gc G
1 + Gc*
(
G − G%
)
Ysp
+
1 − Gc*G% 1 + Gc*
(
G − G%
)
D
(12-17)
21
For the special case of a perfect model, G% = G , (12-17) reduces to Y
=
*
Gc GYsp
+
(
)
1 − Gc*G D
(12-18)
The IMC controller is designed in two steps: 2 1 r e t p a h C
Step 1. The process model is factored as G% = G% + G% −
(12-19)
where G% + contains any time delays and right-half plane zeros. • In addition, G% is required to have a steady-state gain equal
For the special case of a perfect model, G% = G , (12-17) reduces to Y
=
*
Gc GYsp
+
(
)
1 − Gc*G D
(12-18)
The IMC controller is designed in two steps: 2 1 r e t p a h C
Step 1. The process model is factored as G% = G% + G% −
(12-19)
where G% + contains any time delays and right-half plane zeros. • In addition, G% + is required to have a steady-state gain equal to one in order to ensure that the two factors in Eq. 12-19 are unique.
22
Step 2. The controller is specified as
1 * Gc = G%
f
(12-20)
−
where f is a low-pass filter with a steady-state gain of one. It typically has the form:
2 1 r 1 e (12-21) f = t r p ( τc s + 1) a h C In analogy with the DS method, is the desired closed-loop time τc
Step 2. The controller is specified as
1 * Gc = G%
(12-20)
f
−
where f is a low-pass filter with a steady-state gain of one. It typically has the form:
2 1 r 1 e (12-21) f = t r p ( τc s + 1) a h C In analogy with the DS method, is the desired closed-loop time τc constant. Parameter r is a positive integer. The usual choice is r = 1.
23
For the ideal situation where the process model is perfect ( G% = G ) , substituting Eq. 12-20 into (12-18) gives the closed-loop expression Y
=
G% + fYsp
+
(1 − fG% ) D +
(12-22)
2 Thus, the closed-loop transfer function for set-point changes is 1 r Y % f e =G (12-23) + t Y sp p a h C Selection of τ c
For the ideal situation where the process model is perfect ( G% = G ) , substituting Eq. 12-20 into (12-18) gives the closed-loop expression Y
=
G% + fYsp
+
(1 − fG% ) D +
(12-22)
2 Thus, the closed-loop transfer function for set-point changes is 1 r Y % f e =G (12-23) + t Y sp p a h C Selection of τ c
• The choice of design parameter DS and IMC design methods.
τc
is a key decision in both the
• In general, increasing τc produces a more conservative controller because K c decreases while τ I increases. 24
• Several IMC guidelines for model in Eq. 12-10:
2 1 r e t p a h C
> 0.8 and
τc
have been published for the
1.
τ c / θ
2.
τ > τc > θ
(Chien and Fruehauf, 1990)
3.
τc = θ
(Skogestad, 2003)
τ c > 0.1τ
(Rivera et al., 1986)
• Several IMC guidelines for model in Eq. 12-10:
2 1 r e t p a h C
> 0.8 and
τc
have been published for the
1.
τ c / θ
2.
τ > τc > θ
(Chien and Fruehauf, 1990)
3.
τc = θ
(Skogestad, 2003)
τ c > 0.1τ
(Rivera et al., 1986)
25
Chapter 12 1 2 . 2
Chapter 12 1 2 . 2
2 6