Controllers
Structure of discussion
Basic process control
• • • • • •
• Controllers • • • • • •
Processes Measurement devices Actuators Integration issues Empirical model building PID controller tuning
Introduction – open loop, closed loop control Manual closed loop control Automatic closed loop control – on-off, P, I, D PID control History of PID controllers Some interesting virtual labs/further reading
1
2
Example: Control of turntable speed
1. Introduction ‘Open loop’ control
‘Closed loop’ control
Reference: Dorf, R.C. and Bishop, R.H. (2005). Modern Control Systems, Chapter 1, Pearson-Hall.
3
4
2. Manual closed loop control
Open loop control • With open loop control, the system does not compare the measured value with the desired signal (command value or setpoint). • There is no measuring instrument.
5
6
3. Automatic closed loop control
Reference: VanDoren, V. (2003). “Deadtime hampers process control”, Control Engineering
Manual control is useful if • Important data is not collected automatically • Data has a large amount of noise • Slow adjustments, with “fuzzy”, qualitative decisions are required • The process operation must be stopped or otherwise disrupted to implement the control action. Further learning: Control of water level in a tank 7 http://vlab.ee.nus.edu.sg/vlab/control
Three-axis control system for inspecting individual wafers
8 Control system for a boiler-generator
On-off control
On-off control - example
• On-off or bang-bang control is suitable for systems where changes in load occur slowly and the process is slow acting. • It is a simple form of closed loop control where the control action is related to the sign of the error (the difference between the set-point and the measured value).
On-off control is used in domestic central heating systems. When the temperature is lower than the desired temperature command signal (set point), then the boiler is turned on, and it remains on until the desired temperature is reached. In this application, temperature rises and falls slowly, as the house is physically large (i.e. it has a large thermal capacity). On-off control usually includes a deadband or hysteresis:
Heating element
Room
off on Reference: Duffy, G., Web lecture notes on Control.
9
Action of the on-off controller
on 10
Case study: Control of room temperature Reference: Goodwin, G.C. et al. (2001). Control System Design, Prentice-Hall.
Reference: http://newton.ex.ac.uk/teaching/CDHW/Feedback/ControlTypes.html#OnOffCtl
The measured temperature oscillates around the temperature set-point. When the heater is on, the measured temperature rises. When the heater is switched off, the measured temperature falls. It is interesting to note that when the heater is on, the measured temperature rises quickly, while when the heater is off, the temperature falls slowly. When the temperature set-point is raised from 150oC to 174oC, the measured temperature also rises to oscillate around this new temperature. Note 11 the deadband.
The heater in the room is run at different settings and the output temperature is measured. It takes about 250 minutes for the room to reach a new equilibrium temperature. The heater is set at 2.0. 12
• The response settles to the desired temperature much faster then with open loop control. • The disturbance (applied at 10 minutes) has little effect on the response. • Once the desired temperature is reached, the controller switches on and off rapidly. • Now, change M from 5 to 10 … faster response. • Disadvantage: rapidly switching input – switch would soon wear out.
Now, let the door open after 150 minutes. As expected, the room temperature drops, even though the heater setting is unchanged i.e. open loop control is very sensitive to disturbances. Now, implement an on-off closed loop automatic controller (M = 5).
13
More realistic solution – include hysteresis
14
In conclusion …
Let M = 5, δ = 0.05. Note the less rapid switching and the oscillation (or limit cycle) in the controlled variable.
• Feedback controllers are preferable to open-loop controllers. • Simple on-off controllers are a very basic solution to the control problem, with inherent limitations. • There exists trade-offs between performance (as measured at the controlled variable), and the nature of the control effort (as measured at the manipulated variable).
Let M = 5, δ = 0.1 and M = 5, δ = 0.5.
Further learning: Water temperature and level control – see http://eweb.chemeng.ed.ac.uk/courses/control/course/map/index.html
15
16
Exercise
Proportional (P) control
1) Draw a block diagram of this system. 2) Sketch the time response of the following system variables: actual level, level error and pump current.
Actual level Desired level
The controller output (manipulated variable, MV) is a multiple of the controller input (or error). As before, error is determined by subtracting the controlled variable (also called process variable, PV) from the setpoint (SP). The controller output is given as follows: MV = Kc*error.
Tank Inlet
Float switch
Pump
Tank Outlet Is it a good idea to position the float switch under the water inflow? 17
Example: Toilet cistern. After flushing, the toilet is refilled by a ballcock (a lever operated valve that is connected to a floating ball). When the tank is empty – large error - the ball falls and valve opens fully – large output. As the tank fills – error gets smaller – the valve starts to close – smaller output. Eventually the cistern is refilled – no error – the valve is closed – zero output.
Water Inlet B Valve 50% Open
A Valve Closed
Water Inlet
B
Valve 0% open (closed). Water level rises before the inlet valve is closed. Steady state. Not at setpoint Offset.
Water Inlet Actual level
Tank Outlet Hand Valve
Proportional Band (PB) A B C
Inlet Valve
b
What happens if the pivot point is adjusted so that a is very small relative to b? What happens if the pivot point is moved away from the inlet valve? 18 This is known as adjusting the gain.
Inlet Valve
Valve 50% open. Flow in = Flow out. Steady state. At setpoint (B). No offset.
Inlet Valve a
Desired level
PB
The difference between levels A and C is known as the proportional band (PB).
It is the overall change in level that corresponds to the outlet valve going from fully closed to fully open. If the gain is increased/decreased by adjusting the lever mechanism what will happen to the PB?
Inlet Valve
A Valve Fully Open
B C
Water Inlet
Valve 100% open. The inlet valve opens to let in more water and a new steady state level is reached. Steady state. Not at setpoint. Offset. 19
Reference: Harrold, D. (1999). Process controller tuning guidelines, Control Engineering.
20
In summary ….
Proportional control –
F(t) = Kc.V(t), F(t) = process variable, V(t) = manipulated variable. Now, V( t ) = K c [Fmax − F( t )] , K c = controller gain = A/B. This can also be written as
advantages and disadvantages Advantages • Simple to implement – can be done electrically or mechanically. • Fast response – output changes immediately the error changes. Disadvantages • Offset. Removal of the offset is sometimes called reset. This can be done manually or automatically. Manual reset in the case of the cistern is done by placing a weight on the ballcock so that the valve is not fully closed when the level is at the setpoint. Automatic reset is achieved by adding integral action to the proportional controller. 21
V( t ) = K c [Fset − F( t )]
+ K c [Fmax − Fset ] Problem: Offset. Further learning: Control of water level in a toilet tank http://www.isr.umd.edu/CELS/research/tanksim/index.htm Reference: VanDoren, V. (2000). Understanding PID control, Control Engineering, June, 53-56, 22 http://www.controleng.com/article/CA191338.html
Integral (I) control
Integral windup
With integral control, the controller output (manipulated variable, MV) is the integral of the error (= SP – PV). MV = K i ∫ edt
Integral control should be switched off if it is not possible to correct the error due to, for example, – –
K i = integral gain
If the error is positive, MV increases. If the error is zero, MV is constant. If the error is negative, MV decreases.
–
MV
time e 23
An instrument fault The controlled element (actuator) is disconnected, or faulty, or switched off If the process has a large dead-time i.e. it takes a long time after a change has been made to see the result.
The manipulated variable eventually becomes much bigger than the actuator can deliver i.e. > 100%.
24
Integral settings
Proportional and integral (PI) control MV = K c e + K i ∫ edt = K c e +
P
MV
Reference: Harrold, D. (1999). Process controller tuning guidelines, Control Engineering.
1 Kc e ∫ edt = K c 1 + Ti Ti s Ti = integral time
I P
P
I P
zero error
P I time
e
Integrator action sometimes exists on the process e.g. the earlier flow control system can be transformed into a level control system as follows: F( t ) = ∫ K c V ( t )dt
25
26
P, I and D compared
Derivative (D) control
100
Integral … Past
Proportional … Present
With derivative control, the manipulated variable is the derivative of the error (= SP - PV). de MV = K d K d = derivative gain dt If the error is changing in a positive direction, MV increases. If the error is constant, MV is zero. If the error is changing in a negative direction, MV decreases.
MV =
MV = K c e 100
Kc edt Ti ∫
Derivative … Future
MV = K c Td
Td = derivative time
MV
∞
MV 0 0
Time
Time -∞
e
Error
0 0 Time
27
de dt
Time
28
Other PID controller architectures
4. Proportional, Integral and Derivative control (PID control)
PID (with derivative on the feedback signal)
1 K de de = K c 1 + + Td s e MV = K c e + K i ∫ edt + K d = K c e + c ∫ edt + K c Td dt Ti dt Ti s
The derivative controller is only active while the error is changing. It does not respond to a steady state error. A disadvantage of derivative control is its tendency to amplify noise (in the measurement signal). This can result in rapid changes to the actuator (valve or motor). A related problem is derivative kick (see picture). For this reason derivative control is never used alone but is always combined with proportional and integral controllers. It can be combined with a proportional controller to give PD control. It can be combined with a proportional and integral controller to give PID control. The amount to which each section of the controller contributes to the output depends on the controller parameters. 29 Selecting the correct values of controller parameters is known as tuning.
dy 1 m( t ) = K c e( t ) + ∫ e( t )dt + Td dt T i
A similar advantage is obtained by placing a filter on the derivative term: 1 Ts G c (s) = K c 1 + + d e Ti s 1 + Tf s
Early (pneumatic) PID controllers used the series PID form: 1 G c (s) = K c 1 + (1 + Td s )e
Ti s
or a variation, known as the classical PID controller: 1 1 + Td s e G c (s) = K c 1 + T i s 1 + Tf s
Reference: VanDoren, V.J. (2003). “PID: still the one”, Control Engineering, October, pp. 32-37, 30 http://www.controleng.com/article/CA325983.html
PID controller – discrete time
In summary – features of PID controllers
In continuous time,
m ( t ) = K c e( t ) + Now, i.e.
Kc de( t ) ∫ e( t )dt + K c Td dt Ti
∫0
e( t ) dt ≈ ∆t[e(0) + e(∆t ) + e(2∆t ) + e(3∆t ) + ... + e([k − 1])∆t ]
∞ ∫0
e( t ) dt ≈ ∆t[e 0 + e1 + e 2 + e 3 + ... + e k −1 ]
∞
Also,
‘trapezoidal’ approximation
d e( t ) e k − e k −1 ≈ dt ∆t
‘backward difference’ approximation
Then,
m k ≈ K cek + Reference: Improving the effectiveness of closed loop control systems – www.carbontrust.co.uk
31
K c ∆t [e0 + e1 + ... + ek −1 ] + K cTd [ek − ek −1 ] Ti ∆t ‘position’ algorithm
32
PID controller – discrete time An alternative to the position algorithm is the ‘velocity’ algorithm, derived as follows:
K ∆t KT m k ≈ K c e k + c [e0 + e1 + ... + e k −1 ] + c d [e k − e k −1 ] Ti ∆t K c ∆t m k −1 ≈ K c e k −1 + [e 0 + e1 + ... + e k −2 ] + K c Td [e k −1 − e k −2 ] Ti ∆t
Controller tuning guidelines Controller settings must change if the controller architecture changes. For all PID controller architectures, there are broad ‘ball-park’ settings for common control loops.
Then,
m k − m k −1 ≈ K c (e k − e k −1 ) +
K c ∆t KT e k −1 + c d [e k − 2e k −1 + e k −2 ] Ti ∆t
Variation 1: Eliminates ‘derivative kick’:
m k − m k −1 ≈ K c (e k − e k −1 ) +
K c ∆t KT e k −1 + c d [y k − 2 y k −1 + y k −2 ] Ti ∆t
Variation 2: Eliminates ‘proportional kick’ and ‘derivative kick’:
m k − m k −1 ≈ K c ( y k − y k −1 ) +
K c ∆t KT e k −1 + c d [y k − 2 y k −1 + y k −2 ] 33 Ti ∆t
34
Ultimate cycle tuning
Commercial PID controllers
1. Place the controller in proportional mode only (i.e. set Ti to a maximum and Td to a minimum). 2. Increase K c until the closed loop system output goes “marginally stable”; record K c (calling it K u , the ultimate gain), and the ultimate period, Tu . PI controller settings: K c = 0.45K u
Ti = 0.83Tu
Ideal PID controller settings: K c = 0.6K u
Ti = 0.5Tu
Td = 0.125Tu
Early tuning rule
John Ziegler (1909-1998) Reference: Seborg, D.E. et al. (2004). Process dynamics and control, Wiley – Chapter 8.
35
Reference:Ziegler, J. and Nichols, N. (1942). Optimum settings for automatic controllers, Transactions of the ASME, 64, 759-768.
36
Process reaction curve tuning
Tuning of PID controllers 1935-2005 1,134 tuning rules for 7 PI controller structures and 46 PID controller structures for processes with time delay modelled in 22 different ways!
Open loop method (for the nervous) …. Side benefit: Knowledge of process transfer function. G m (s) =
K m e − sτ 1 + sTm
m
PI controller settings:
Kc =
0.9Tm 111K m τ m ) ( % Ti = 3.33τ m K m τ m PBc = T m
Ideal PID controller settings: 1.2Tm 2Tm , Kc ∈ K m τm K m τm
50K m τ m 83K m τ m PB c ∈ % , Tm Tm
Ti = 2τ m
Td = 0.5τ m
Reference: Tuning rule bonanza, controlglobal.com.
Reference: Ziegler, J. and Nichols, N. (1943). Process lags in automatic control circuits, Transactions of the ASME, July, 433-444.37
Further learning: Closed loop tuning 38 http://eweb.chemeng.ed.ac.uk/courses/control/course/map/closed/index.html
Laboratory
39
40
41
Tutorial question
42
Solution
43
44
45
46
47
48
5. History of PID controllers
Another tutorial question
• 1788: James Watt equips his steam engine with a flyball governor, the first mechanical feedback device with P control.
Reference: http://www.uh.edu/engines/powersir.htm
49
•
• •
1933: The Taylor Instrument Company (now part of ABB www.abb.com) introduces the Model 56R Fulscope, the first pneumatic controller with fully tunable PI capabilities. 1934-1935: Foxboro (www.foxboro.com) introduces the pneumatic Model 40 controller, the first PI controller. 1940: Taylor introduces the Fulscope 100, the first pneumatic controller with full PID control capabilities in a single unit.
•
•
•
• •
• Reference: http://www.nt.ntnu.no/users/skoge/publications/2003/tuningPID/more/hellem-project-2001/hellem1.doc
•
1942: Taylor's John Ziegler and Nathaniel Nichols publish their famous Ziegler51 Nichols tuning rules.
1941-1945: World War II - Pneumatic PID controllers stabilize gun fire control servos as well as the production of synthetic rubber, high-octane aviation fuel, and Uranium 235 for the first atomic bomb. 1951: The Swartwout Company introduce their Autronic line, the first electronic controllers based on vacuum tube technology. 1959: Bailey Meter Co. (now part of ABB) introduces the first fully solid-state electronic controller. 1964: Taylor Instruments demonstrates its first single-loop digital controller . 1969: Honeywell introduces their Vutronik process controller line with the derivative action calculated from the negative of the process variable rather than directly from the error. 1975: Process Systems introduces the P-200 controller, the first microprocessor-based PID controller.
50
Mid 1940’s pneumatic controller Reference: www.peci.org/library/PECI_ControlOverview1_100 2.pdf
1940’s control room. Each circle is a 52 PID controller
• •
1976: Rochester Instrument Systems (www.rochester.com) introduces Media, the first packaged digital implementation of PI and PID control. 1980s to present: A variety of alternative control techniques begin to migrate from academia to industry for use with more difficult control loops. These include artificial intelligence, adaptive control, and model-predictive control. Reference: VanDoren, V. (2003). Techniques for adaptive control, Butterworth-Heinemann.
6. Some interesting virtual laboratories ECOSSE Control Hypercourse Virtual Control Laboratory (http://eweb.chemeng.ed.ac.uk/courses/control/course/map/index.html)
- Introduction to Control Level control (P and PI control)
- Controller Tuning Example: SattCon 200 [www.abb.com] Some features: • 16 separate PLC program modules • advanced alarm handling • ready-to-use PID controllers • autotuner • integrated communication
Introduction to Ziegler-Nichols tuning submenu Closed Loop Tuning (ultimate cycle tuning) Closed Loop Tuning (further examples)
Cheric – Chemical Engineering Research Information Centre, Korea (http://www.cheric.org/education/control/) - Introduction to Process Control. This one covers
53
The elements of a process control system Open loop response of a process Manual and automatic control The basic functions of a PID controller The options of a PID controller The effect of controller parameters on closed loop response Reset windup
54
Other tutorial questions
Further reading Books: 1. Seborg, D.E. et al. (2004). Process dynamics and control, 2nd edition, Chapter 8. 2. Marlin, T.E. (2000). Process Control, Chapter 7.
Trade magazines (e.g. Control Engineering) often have web-accessible tutorial articles on aspects of PID control. Two examples of these articles are: 1.VanDoren, V. (1998). “Tuning fundamentals: basics of PID control”, Control Engineering, http://www.controleng.com/article/CA189611.html 2. VanDoren, V.J. (2003). “Loop tuning fundamentals”, Control Engineering, July, pp. 30-32, http://www.controleng.com/article/CA307745.html
Finally, there are many web based tutorials and discussions on the basics of control. Two good websites: PID algorithms and tuning methods http://www.jashaw.com/pid/tutorial/. Controlguru http://www.controlguru.com/pages/table.html
55
56