Professional Documents
Culture Documents
Mikael Pohjola
Masters thesis for the degree of Master of Science in Technology submitted for inspection, Espoo, 9. January, 2006.
Supervisor:
Instructor:
TEKNISKA HGSKOLAN Automation och Systemteknik Frfattare Mikael Pohjola Tittel: PID Controller Design in Networked Control Systems Professur: Systemteknik vervakare Professor Heikki Koivo Handledare DI Lasse Eriksson
Kod: AS-74
I styrsystem ver ntverk (Networked Control Systems, NCS) r processen och regulatorn separerade av ett datorntverk. Diplomarbetet behandlar olika typer av NCS och sensorntverk och de reglerproblem som uppstr lyfts fram. Traditionella justeringsmetoder fr styrsystemet kan inte ta i beaktande den varierande tidsfrdrjningen som uppstr p.g.a. ntet. Nya justeringsmetoder behvs. Diplomarbetet bestr av tv delar: 1) Justeringsmetoder fr diskret-tids PID regulator i system med varierande tidsfrdrjningar, inklusive NCS, och 2) utveckling av MoCoNet systemet. Regulatordesignen fokuserar p en optimering genom simulationsteknik. Regulatorn testas med MoCoNet systemet. Med MoCoNet systemet kan laboratorie-experiment utfras ver Internet. Systemet kan anvndas med en webblsare med Java-std. Styrsystem byggda med MATLAB/Simulink kan snabbt testas p en riktig process med rapid controller prototyping-metodiken. En ntverks-simulator mjliggr studier av styrsystem ver ntverk. Den andra delen av diplomarbetet utnyttjar denna mjlighet. Resultat med optimala PID parametrar presenteras fr olika typer av frdrjningar i ett allmnt fall med konstant, tids- och tillstnds-beroende eller slumpmssiga frdrjningar. Resultaten ges som funktioner av processens tidskonstant och regulatorns sampeltid. En disktret-tids PID regulatorn r justerad fr en exempelprocess och regleringen verifieras med MoCoNet systemet. Optimeringsmetoden visar sig fungera bttre, bde i simulationer och i verkligheten med MoCoNet systemet, jmfrt med andra traditionella justeringmetoder som undersks i arbetet.
Nyckelord: styrsystem ver ntverk, diskret-tid PID regulator, justering, varierande tidsfrdrjning, fjrrlaboratorium.
HELSINKI UNIVERSITY OF TECHNOLOGY Department of Automation and Systems Technology Author Mikael Pohjola Title: PID Controller Design in Networked Control Systems Professorship: Control Engineering Supervisor Professor Heikki Koivo Instructor M.Sc. (Tech.) Lasse Eriksson
Code: AS-74
Networked control systems (NCS) and sensor networks, where the process and the controller are separated by a network, are discussed in this thesis and new problems in control are pointed out. Traditional tuning methods can not handle the varying time-delay in NCS. New controller tuning techniques are needed. The thesis consists of two parts: 1) Discrete-time PID controller tuning for varying time-delay systems, including NCS, and 2) development of the MoCoNet system. The controller design in the thesis focuses on an optimisation by simulation tuning technique. The tuning is tested with the MoCoNet system. The MoCoNet system enables students to conduct remote laboratory experiments over the Internet. The interface is an applet and can be run with any Java enabled browser. The MoCoNet system supports rapid control prototyping, where controllers built with MATLAB/Simulink can be easily tested on a real process. With a network simulator control design of NCS can be investigated in the MoCoNet system with a real process. The other part of the thesis takes advantage of this feature. Optimal PID tuning results are presented for a general process model in different cases of constant, state- and time-dependent or random delays. The results are displayed as functions of process time constant and controller sampling time. A discrete-time PID controller is tuned for an example process and the tuning is verified with the MoCoNet system. The optimisation tuning is shown to perform better, both in simulations and in practice with runs on the MoCoNet system, than other traditional tuning methods investigated in the thesis.
Keywords: networked control systems, discrete-time PID controller, tuning, varying time-delay, remote laboratory. ii
Preface
I have worked on-and-off at the Control Engineering Laboratory, Helsinki University of Technology since 2003. My first summer job was part of the ERHE - Very Distributed Sensor and Actuator Networks1 project, funded by TEKES, which dealt with optimisation of discrete-time PID controllers for variable time-delay systems. The next summer I developed the MoCoNet platform, funded by TKK2, for doing laboratory experiments from home. The work I have done at the lab has been much assistance in my studies. I am fortunate that my boss suggested that my thesis should incorporate these topics. Writing has been a relatively easy job, as I have leaned on my previous work. I have, though, worked hard to be clear and precise, with great assistance from my instructor. Effort has been done to form the thesis into a whole from the pieces of my work. The MoCoNet platform has been published to the scientific community at the 16th IFAC World Congress, Prague, Czech Republic (Pohjola et al., 2005). The presentation was held to an interested audience with tough questions. I thank The Finnish Foundation for Economic and Technology Sciences - KAUTE for granting me a stipend to travel to the congress and present the paper at a session. I must thank my family, although they have had nothing to do with the thesis, and my girlfriend for listening to me and for nodding when I ramble on what I have and havent managed to do that particular day.
1 2
iii
Table of Contents
PREFACE .......................................................................................................................................... III TABLE OF CONTENTS ...................................................................................................................IV LIST OF SYMBOLS AND ABBREVIATIONS ..............................................................................VI 1 2 INTRODUCTION ....................................................................................................................... 1 VARYING TIME-DELAY SYSTEMS...................................................................................... 3 2.1 EXAMPLES OF VARYING TIME-DELAY SYSTEMS.................................................................. 3 2.1.1 2.1.2 2.1.3 2.2 Transport Belt ....................................................................................................... 4 Tank-Pipe .............................................................................................................. 4 Traffic.................................................................................................................... 4
NETWORKS........................................................................................................................... 5 2.2.1 2.2.2 2.2.3 Ethernet and Internet ............................................................................................ 5 Internet Delay Distribution ................................................................................... 6 Internet Packet Loss.............................................................................................. 8
NETWORKED CONTROL ....................................................................................................... 9 3.1 3.2 3.3 DISTRIBUTED SYSTEMS ........................................................................................................ 9 SENSOR NETWORKS ........................................................................................................... 12 COMPONENTS OF DELAY .................................................................................................... 13
PID CONTROL METHODS.................................................................................................... 15 4.1 4.2 4.3 4.4 DISCRETE-TIME PID CONTROLLER..................................................................................... 16 PRACTICAL ASPECTS OF THE PID CONTROLLER................................................................. 18 ZIEGLER-NICHOLS TUNING ................................................................................................ 20 OPTIMISATION TUNING ...................................................................................................... 21 4.4.1 4.4.2 4.5 4.6 4.7 Optimisation Criteria .......................................................................................... 22 Optimisation Criterion Source ............................................................................ 23
INTERNAL MODEL CONTROL.............................................................................................. 24 GAIN SCHEDULING ............................................................................................................. 26 FUSION OF MEASUREMENT PACKETS ................................................................................. 28
MOCONET................................................................................................................................ 31 5.1 5.2 5.3 5.4 RAPID CONTROL PROTOTYPING ......................................................................................... 32 USER INTERFACE................................................................................................................ 33 SOFTWARE ......................................................................................................................... 35 HARDWARE ........................................................................................................................ 36
iv
5.5 5.6 6
OPTIMISATION AND SIMULATION RESULTS ............................................................... 40 6.1 OPTIMISATION FOR DIFFERENT DELAYS ............................................................................ 40 6.1.1 6.1.2 6.1.3 6.1.4 6.1.5 6.1.6 6.2 Case 1a - Constant Delay.................................................................................... 42 Case 1b - Random Delay..................................................................................... 43 Case 1c - Sinusoidal Delay ................................................................................. 44 Case 1d - State Delay.......................................................................................... 45 Case 2a - Constant Delay.................................................................................... 46 Case 2b - Random Delay..................................................................................... 47
OPTIMISATION FOR NETWORK DELAYS.............................................................................. 48 6.2.1 6.2.2 Case 3a - Semi-Distributed System ..................................................................... 48 Case 3b - Fully-Distributed System..................................................................... 50
6.3
GAIN SCHEDULING BY DELAY ........................................................................................... 51 6.3.1 6.3.2 Case 4a Step Delay Change ............................................................................. 53 Case 4b Sinusoidal Delay Change ................................................................... 54
6.4 6.5
SENSOR NETWORK ............................................................................................................. 55 TUNING FOR EXAMPLE PROCESS ........................................................................................ 59 6.5.1 6.5.2 6.5.3 6.5.4 Optimisation Tuning............................................................................................ 59 Ziegler-Nichols Tuning ....................................................................................... 62 IMC Tuning ......................................................................................................... 62 Results ................................................................................................................. 63
MOCONET RESULTS............................................................................................................. 67 7.1 7.2 7.3 7.4 OPTIMISATION TUNING ...................................................................................................... 68 ZIEGLER-NICHOLS TUNING ................................................................................................ 69 IMC TUNING ...................................................................................................................... 70 CONCLUSIONS OF TEST RUNS............................................................................................. 72
8 9 10
CONCLUSIONS........................................................................................................................ 73 REFERENCES .......................................................................................................................... 76 APPENDICES............................................................................................................................ 80 10.1 DERIVATION OF IMC TUNING FOR EXAMPLE PROCESS ...................................................... 80 10.2 RESULTS FOR EXAMPLE PROCESS ...................................................................................... 81
vi
Abbreviations
GUI IAE IMC IP I/O ISE ITAE ITSE LAN MPC NCS PID TDM RCP RTOS Z-N Graphical User Interface Integral Absolute Error Internal Model Control Internet Protocol Input/Output Integral Square Error Integral Time Absolute Error Integral Time Square Error Local Area Network Model Predictive Controller Networked Control System Proportional-Integral-Derivative Time Division Multiplexing Rapid Control Prototyping Real-Time Operating System Ziegler-Nichols
vii
1 Introduction
Control theory is extending to new areas. As the use of Internet grows rapidly, more use for it has emerged. The idea to extend control loops over the Internet or over standard Ethernet networks has come up and this direction is being researched widely. The traditional local control loop is expected to expand to tomorrows control over large communication network with variable delay times (Katayama et al., 2005). The problem is that the network induces a varying time-delay into the control loop, which has to be taken into account in control design. Conventional control design can not take the varying time-delay into account, new methods are called upon. Networked control systems (NCS) are researched and some results have been achieved (e.g. Zhang et al., 2001). Dynamic programming has been proposed for controlling varying time-delay systems (Lincoln, 2003). But still simple tuning rules for varying time-delay systems are needed. The problem is hard because the timedelay in NCS often has a stochastic nature and it is difficult to approach it analytically. The thesis investigates optimisation in tuning controllers for varying time-delay systems using simulation. A PID controller structure is selected to control the system as it is easy and intuitive to tune. It is also used extensively in the industry (strm and Hgglund, 1995) and there is a benefit of using a well-known and trusted controller in future applications. This is a simple and desirable solution, since it does not require new control algorithms, just new tunings to fit for the varying delay. With a more complex controller the delay could be explicitly taken into account in the control algorithm, and better results could be possible. With a PID controller adequate performance can nevertheless be achieved. In modern industry where discrete-time PID controllers are used the controllers are tuned as if they where continuous controllers. The sampling frequency is set sufficiently high, so that the discrete-time controller approximates a continuous controller. This is acceptable if there is enough computing power and signalling capacity, as there usually is. In some new applications these luxuries are not always available. In networked control systems the network can not offer such a high bandwidth to transmit the measurement and control packets. The energy source and 1
the computing power are often limited on mobile devices, such as robots and autonomous devices. In these applications one has to enter the true discrete-time domain by lowering the sample frequency. Reijonens (2003) thesis introduced optimisation tuning for a continuous-time PID controller in varying time-delay systems, and now the work is extended into the framework of NCSs for a discrete-time controller. As the controller works in the discrete domain the tunings are done as a function of sampling time. The main contributions of this thesis are: Modification of the optimisation and simulation based tuning method for discrete-time PID controllers in NCS. Tuning rules for a first order system with several varying delays. Development and comparison of data fusion methods in NCS. Development and implementation of the MoCoNet system for investigating NCS with rapid control prototyping. Verification of the simulation based tuning with a real process using the MoCoNet system. The results and methods, as well as the theory they are based on, are presented in the thesis as follows: First varying time-delay systems are generally introduced and the time-delays in these systems are identified and analysed, including the delay distribution of the Internet. Then networked control systems are explained in Chapter 3, and the problems they produce to the control loop are pointed out. The discretetime PID controller and the optimisation tuning are presented in Chapter 4 among with other PID controller design methods such as internal model control and gain scheduling. The optimisation tuning method is applied in a general case for a first order system and for a certain example process in Chapter 6. These results are finally tested and verified on a real process in Chapter 7 with the developed MoCoNet platform described in Chapter 5. Finally, conclusions are offered in Chapter 8.
yr
Controller
Process
L(t)
yr
Controller
Process
Reference1
Reference
L(t)
Figure 2.1: On the left: the delay as a part of the process. On the right: the undelayed process and a delay caused by e.g. network.
described as a stochastic varying time-delay system. The delays are identified from the example systems and their mathematical formulation is given.
where is the time-delay. If the belt has a variable speed, the delay is timedependent:
(t ) = L / v(t ) .
(2.2)
2.1.2 Tank-Pipe
Consider a pipe with length L at the bottom of a fluid filled tank. In the pipe the velocity of the flow is v = Q / A , where A is the cross section area of the pipe. The pipe flow, Q, is a function of the height, h, of the fluid in the tank, due to the pressure difference of the air at the pipe outlet and the water pressure at the pipe inlet, according to Bernoullis law. Suppose that the tank is filled from above. Then the water flow, Qin(t) can be considered an outer disturbance. The water level in the tank varies with time. The velocity in the pipe and therefore the delay between the fluid entering and exiting the pipe is in other words dependent of the state of the system, h, and the delay is expressed as:
(h) = LA / Q(h)
(2.3)
A real example with similar setup is described in de Prada et al. (2005) with a heater in the tank. The temperature of the fluid in the tank is controlled by measuring the temperature of the fluid coming out of the outlet pipe.
2.1.3 Traffic
In urban traffic the queue lengths can be expressed as continuums. The time-delay for a car to reach the end of the queue from the previous traffic light is a function of the queue length, L, that is: ( L) . Define un (t ) (0) to be the length of the cars
4
dLn (at light n), is then the difference dt between the cars reaching the light from the previous light and passing on green light
dLn (t , Ln ) = un 1 (t ( Ln )) un (t ) . dt
(2.4)
Let D denote the distance between the traffic lights and v the average speed of the cars. The delay from the previous light is the time it takes for the cars to reach the end of this lights queue. The distance for the cars to travel is D subtracted by the queue length. The time-delay is then
( Ln ) = ( D Ln ) / v .
The delay is thus state-dependent, i.e. a function of the system state, L.
(2.5)
2.2 Networks
A network can be used to interconnect the components of a control loop. The industrial networks used in automation are usually deterministic and they can guarantee certain reliability and time-delay bounds. This eases the design of control algorithms as stable operation can be determined with certainty. The delay is managed by token-ring, time division multiplexing (TDM) or similar technology or by having a high enough capacity network for it to deliver the demanded service even during exceptional loads. In a TDM network an upper bound of the delay can be set by letting every node in the network have its timeslot for communication, the timeslot being periodical. The information in the networks is transmitted as packets. Therefore as soon as we transmit a continuous-time variable through a network it is turned into discrete-time and we talk about the delay at certain time-steps, k.
because of the exponential fallback. Either the control loop has to cope with the delays or the Ethernet can be improved to ensure real-time performance (Alves et al., 2000). The expected delay for a packet in an Ethernet bus is statistically random. One statistical model for the delay according to Cao et al. (2002) is the Weibull distribution, given by
P( x) = x n 1e ( x / ) ,
where is the shape parameter, the scale parameter and x a random variable.
(2.6)
The assumption that the network can be described by a delay distribution implies that there is no correlation between consecutive packets sent over the network. The assumption holds if the packets are transmitted sufficiently far apart, so that the queue lengths etc. have time to change between the packets. This is not the only requirement since the delay is usually also dependent on the utilisation of the network and the utilisation changes. To model a network with correlation a Markov chain can be used (Nilsson, 1998). In a Markov chain several delay distributions and a matrix expressing probabilities to change from one distribution to the other are defined. If the link is highly utilised (used by others) the delay distribution approximates an exponential distribution (Cao et al, 2002). This is a special case of the Weibull distribution with = 1 and = 1 / . Delay at time k is (k ) P( x) and P( x) = e x is the exponential distribution function with x being a random variable. (2.7)
In a network such as the Internet, the delay distribution has been shown to resemble a shifted gamma distribution in a study by Mukherjee (2001), where the gamma distribution model was statistically verified with quantile-quantile plots. The plots showed that the delay data gathered and the statistical model had the same probability distribution. Another assurance of the correct conclusion was that parameters of the gamma distribution could be identified with properties of the network, such as the number of hops. The gamma distribution is also a generalization of the Weibull distribution encountered earlier. The gamma probability distribution function is given by P( x) =
( n)
( x) n 1 e x ,
(2.8)
(2.9)
and n (the shape parameter) is the number of hops between the first and last node, = n / T, where T is the mean delay. Figure 2.2 shows the gamma probability distribution function for n = [1, 10] with mean delay T = 1. With n = 1 the distribution becomes exponential and is the distribution of a (one hop) Ethernet bus. The variance of the gamma distribution is
2 = n / 2 = T 2 / n .
(2.10)
Every network has a shortest possible delay. If a delay distribution is used for characterising a network, the distribution has to be shifted by this amount to the right to get the correct minimum delay. Typical network delay distributions have a peak and a long tail, similar to the gamma distribution. The total network delay consists of a static and a stochastic component Ttot = Tstatic + Tstochastic , (2.11)
where Tstatic is the minimum delay for the network and Tstochastic the stochastic delay induced by other traffic, approximated with the gamma distribution. The minimum delay thus shifts the graph to the right and results in the total network delay distribution.
1.2
0.5
1.5
2 x
2.5
3.5
3 Networked Control
Nowadays there is a trend in the research of control theory to investigate control loops that are stretched over a network. The benefits include more flexible control loops and cheaper hardware, as of-the-shelf Ethernet networks and the Internet can be used. In networked control systems (NCS) the process and the controller are connected to each other by a network. The properties of the network such as delay and packet loss must be considered when designing the control strategy. The mentioned properties impose restrictions and difficulties in the control loop that are not present in traditional control loops. It is of assistance to design the control strategy by identifying how the control loop is structured and where the network comes into play. Work in the field is reviewed in Zhang et al. (2001) where a more practical view of NCSs is given and results on the control loop stability are presented. In this chapter the general structure of a networked control system is described and the characteristics and problems are illuminated.
yr
Controller
L(t)
Actuator
Process
Reference
Network
L(t) Sensor
Figure 3.1: Fully-distributed NCS where controller, actuator and sensor are distributed and connected with a network.
controller via the network. The controller compares it with a reference (yr), the desired response, and calculates the control output (u) based on the error signal (e). The controller output is transmitted over the network to the actuator that acts on the process to adjust the controlled variable. The network sends the measurement and control signals as packets. The sensor is usually time driven and sends periodically measurement packets to the controller. The controller can be event or time driven. In the event driven case the controller calculates a new control value when a packet reaches it. In this case the actuator is also event driven and is triggered as soon as the control packet arrives at the actuator (Nilsson, 1998). Both the controller and the actuator can be time driven in which case the calculations are done with the most recently received packet at regular intervals. This leads to a constant sampling time. In this thesis everything is time driven. The control system can also be semi-distributed, with the controller situated at the actuator as in Figure 3.2. The measurement is done at a distance, possibly at the other end of a large process (e.g. paper machine). The control signal is calculated locally at the actuator. This is the situation in Figure 2.1, right, where the controller tries to control a process without delay by delayed measurements. There can be several control loops in a distributed system, each affecting everything else. The sensors, controllers and actuators can be scattered in a network to control some large process. Figure 3.3 illustrates a wireless sensor and actuator network.
yr
Controller
Actuator
Process
Reference
Network
L(t) Sensor
Figure 3.2: Semi-distributed system where measurements from a sensor are sent over a network to the controller and actuator node.
10
Figure 3.3: Sensors, controllers and actuators in a distributed wireless (ad-hoc) network.
Because of the limited range (circles) of the nodes transmission must be done in several hops. This leads to different packet delays in the network depending on the path and utilisation of the network. The routes can also vary on the fly in case of an ad-hoc network. The network delay can be thought of, and implemented, as an output variable delay (Ekanayake et al., 2001). At every time step the packet leaving the network is selected with a selector pointing at a random location, according to a delay distribution, in a delay line, which contains all the packets travelling in the network (Figure 3.4). This is how the network is simulated in this thesis.
Delay Line
-1 Z Z -1 Z -1 Z -1 Z -1
Delay distribution
Delay selector
Figure 3.4: Simulation of a network delay with an output variable delay switch.
11
Old packets are filtered. If a received packet has an older timestamp than the previous packet it is dropped and the previous packet is held as the current one. The varying time-delay from the network can be converted to a constant delay with a sufficiently large buffer. This leads to a simpler controller tuning, but the delay raised by the buffer can be too large for a decent control performance. Therefore one is guided to solve the control problem with a variable delay. Intuitively the controller should take the network delays into account or compensate for them in order to have a good closed-loop performance. Delays are taken into account in model predictive control (MPC), see Chai (2005) and delay compensation with prediction (Liu et al., 2005a and 2005b). Simpler methods may also result in good performance even if they do not take the explicit delay variance into account, but rather incorporate it indirectly by a design that is robust to the variations. Topics in distributed systems not discussed in this thesis are efficient transmission protocols, speed and routing problems, reliability and security. There could, for instance, be a protocol that would minimize the packet delay and the drop-out so that they could be neglected in control design, but here it is assumed that these phenomena are significant. The varying time-delay is only relevant if the variation is in the order of the process time constant and larger than the sampling time. If the delay variations fit inside the sampling time the variation is not noticeable and can be neglected. In this case the controller can be tuned for a constant delay.
12
yr
Controller
L(t)
Actuator
Process
Reference
Network
L(t) Sensor
Fusion
L(t)
Sensor
L(t)
Sensor
Figure 3.5: Fully distributed sensor network where measurements from several sensors are sent over a network to a fusion unit and further to the controller.
13
h Sender
tot =
Network
Receiver
n tot
The varying delay can change the order of the packets as is the case for the second and third packets in the figure. It is better not to use the most recently received packet, but the most recently sent packet to get the most up to date information. This can be done by using timestamps. The synchronisation delay satisfies s < h as it rounds the total delay to the next time-step. In other words
tot = p + n + s = nh , n `
for time-driven systems.
(3.1)
The total delay of the closed loop, cl , in a fully-distributed system is the delay from the sensor to the controller sc and from the controller to the actuator ca:
cl = sa + ca ,
(3.2)
where both sc and ca incorporate the three delays introduced above (tot) (Nilsson, 1998).
14
15
(4.1)
between the reference signal (the set-point), yr(t) and the output, y(t) of the controlled process as in Figure 2.1, with L(t) = 0. In transfer function form Equation (4.1) becomes
GPID ( s ) = U (s) 1 = K p 1 + + sTd E ( s) sTi I E ( s ) = P + + Ds . s
(4.3)
16
The PID controller is traditionally suitable for second and lower order systems. It can also be used for higher order plants with dominant second order behaviour. The controller is usually implemented in a computer that does calculations in discrete-time. In networked control systems a discrete-time version of the controller is needed because the measurements are sent over the network as packets. The discretisation is done by computing the error at discrete time-instants, tk = kh, k ` (with sampling time h), replacing the integral by a sum and the derivative by a difference. The proportional part of the controller at time-step k is then
(4.5)
u i (t ) =
K Ti
e ( ) d
0
(4.6)
ui [k ] =
K Ti
h e[ n ] .
(4.7)
n=0
he[n]
n =0
Kp Ti
he[n]
n =0
k 1
ui [k ] = ui [k 1] +
Kph Ti
e[k ] .
(4.8)
The derivative part, ud [k ] , can be discretised in several ways, with different outcome of the stability and accuracy. The simplest form is the Euler approximation (forward difference):
ud [k ] = K p Td e[k + 1] e[k ] , h (4.9)
17
or in time domain
ud (t ) = Td dud (t ) de(t ) + K p Td . N dt dt
(4.11)
A value for N must be chosen. It is clearly seen that with a large N the derivative is reduced to the unfiltered version
Td N
filtered more. Traditionally used values range from 1 to 20, usually 10 (which is used here) is fine. It has been pointed out that the PID controller with filtered derivative has four degrees of freedom and the filter constant, N, should also be tuned. This is not usually done although better performance can be achieved by tuning N (Isaksson and Graebe, 2002). The filtering constant is often selected on the basis of how much noise there is in the measurements. The discretisation of the filtered derivative part with backward difference gives
ud [ k ] = Td ud [k ] ud [k 1] e[k ] e[k 1] + K p Td N h h
ud [ k ] =
(4.12)
Another discretisation method is Tustins approximation, where the forward and backward approximations are summed and averaged, which leads to ud [ k ] = 2 K p Td N 2Td Nh ud [k 1] + ( e[k ] e[k 1]) . 2Td + Nh 2Td + Nh (4.13)
Other derivative discretisation methods also exist: for example the ramp equivalence (which is more accurate, but harder to compute).
18
All derivative approximations can be written in the form (strm and Hgglund, 1995)
ud [k ] = ad ud [k 1] + bd ( e[k ] e[k 1]) .
(4.14)
The approximations are stable only if a d < 1 . The backward difference is well behaving, even with small values of Td, and is used frequently. Tustins algorithm agrees well with the continuous time derivative, but it can ring with small values of Td < Nh / 2 , because then ad becomes negative. If there are steps in the reference signal the derivative will react unnecessarily on the discontinuity. A solution to this is to take the derivative of only the process output. The PID controller in (4.1) takes the form
t 1 dy (t ) u (t ) = K p e(t ) + e( )d Td . Ti 0 dt
(4.15)
This can be generalised to set-point weighting where the reference and output are weighted by and before taking the error signal.
t 1 u (t ) = K p yr (t ) y (t ) + e( )d + Td Ti 0
dyr (t ) dy (t ) dt dt .
(4.16)
The integral has no weighting, otherwise steady-state error would not be compensated. In this thesis the backward integral and filtered backward derivative approximations are used (Equations (4.8) and (4.12)). Thus, the discrete-time PID controller becomes:
u[k ] = u p [k ] + ui [k ] + ud [k ] u p = K p e[k ] ui [k ] = ui [k 1] + ud [ k ] = K ph Ti e[k ] . (4.17)
19
4.3
Ziegler-Nichols Tuning
The Ziegler-Nichols (Z-N) methods rely on open-loop step response or closed-loop frequency response tests. A P-, PI- or PID controller is tuned according to a table based on the process response test. In the step response test a step is applied on the open-loop system. A tangent line is drawn at the inflexion point on the response curve. The dead-time, T1, and the risetime, T2, are measured (Figure 4.1). In the frequency response method the loop is closed and a pure gain controller is used. The gain is increased to the ultimate gain, Ku, when the system exhibits a steady oscillation whereby the oscillation period is measured, Tu (Figure 4.1). The PID tuning is calculated from the Z-N tuning table found in literature such as strm and Hgglund (1995). Table 1 shows the tuning rules for a PID controller. P and PI controllers have separate tuning rules.
Table 1: Ziegler-Nichols tuning table for PID controller.
Kp
1.2 K1 T2 K 2 T1
Ti 2T1
Td 0.5T1
0.6Ku
0.5Tu
0.125Tu
u(t)
1.4
Tu
1.2
K1
y(t)
Amplitude
y(t)
0.8
0.6
K2 T1 T2
0.4
0.2
-0.2
5 Time (sec)
10
Figure 4.1: Ziegler-Nichols tuning with step response test (left) and frequency response test (right).
20
For a discrete-time PID controller the table should be revised to take the sampling time into account. There is, however, no discrete Z-N tuning table, so Table 1 is used in lack of other. A discrete-time controller approximates a continuous-time controller at small sampling times, so this tuning rule is only used for the shortest sampling times. The Z-N method is designed for rejecting load disturbances. For reference step changes it performs worse and gives for simple systems a damped oscillating response, where consecutive peaks are of the previous peak. The tuning is usually bad for higher order systems and can only be considered as a simple first aid tuning. There are refinements to the Z-N method to improve the performance of set-point changes proposed by Hang et al. (1991). Other tuning tables that rely on the same response tests, such as the Cohen-Coon method, can also be used to gain better performance.
4.4
Optimisation Tuning
In the optimisation tuning method the tuning of a parameterised controller such as a PID controller is based on an optimisation criterion. The optimal tuning parameters, x*, is where the criterion or cost function, J, has its minimum. x* = arg min J ( x) (4.18)
The cost function describes how well the system responds to an outer disturbance. The disturbance can act on the reference signal, be a load or measurement disturbance. In this thesis a step in the reference signal is the disturbance. This measures how well the system follows set-point changes. Load disturbance rejection is achieved with set-point tuning, but it is not optimal. The tuning can also be done for load disturbance rejection, if the disturbance acts on the process output during optimisation. Noise rejection can be incorporated into the tuning by adding noise to the simulation model and penalizing noise in the cost function. The optimisation is done here by using a simplex search algorithm for unconstrained optimisation (Mathworks, 2005). The cost function is evaluated with simulation, so a simulation model of the process is needed. Reijonens thesis (2003) described how the tuning is done in practice with MATLAB/Simulink and Optimisation Toolbox. 21
The procedure is followed in this thesis, with the modification that for the varying time-delays many step response tests are performed and the cost is averaged. The cost function is consequently modified as in Equation (6.1). This restrains the method from optimising for a certain instance of a varying delay and to take into account many possible variations in the delay. The tuning is done in a similar way in Eriksson (2005) with a graphical user interface, where the user can specify a plant, select network properties and optimisation criterion. The optimal tuning is a button click away. In this thesis only PID controllers are tuned with the optimisation method, whereas the method is applicable to other parameterised controllers as well.
(4.19)
ISE
J = e 2 (t )dt
0
(4.20)
ITAE
J = t e(t ) dt
0
(4.21)
ITSE
J = te 2 (t )dt
0
(4.22)
The optimisation criteria are functions of the controller tuning parameters. In this thesis they should be written as functions of the PID controller: J ( P, I , D) . The error, e, can be any, or a combination of those error signals described in Section 4.4.2. The integrals are in practice not evaluated to infinity, but to large enough time T at which the system has settled down and the error has reached zero.
22
The listed cost functions give different optimal results. The square error (ISE, ITSE) integrals give usually a larger overshoot because they try to minimise the initial large error as fast as possible. The time integrals (with explicit t in the integral, which is small in the beginning and large in the end) are meant to compensate for the error that is large in the beginning (in case of a step disturbance) and small in the end. These error integrals give a slightly longer rise time and a smaller overshoot but also a short settling time, because the time weight is large in the end. The mentioned error integral criteria are minimised, but no guarantee of the robustness of the response can be made. Therefore one can introduce several optimisation constraints that force a given gain and phase margin (Eriksson and Koivo, 2005), (Eriksson, 2005).
Add2 g
yr y _ref y (k) u(k+1)
Gain
Add
Add1
System Cost
Reference
Controller
Figure 4.2: Different ways of determining the error signal for the cost criteria in varying timedelay systems.
23
network. The controller output can also be taken into account in the cost function to penalise excessive control use, e.g. strain on the actuator. In this case the control signal must be weighted with the process gain, g, to compensate for scaling (Controller costblock). All these cost functions can be summed to one weighted average to form a desired overall cost for the controller tuning. There exist also multiobjective optimisation methods for minimising several cost functions simultaneously. The cost functions can depend on overshoot, settling time, integral error criteria and so on. The optimisation can also include load disturbance rejection. These methods may produce better results, but they are more complicated. A good overview of multiobjective optimisation methods in control systems can be found in Liu et al. (2003). Further studies can be made to investigate tuning with different cost criteria and the resulting optimal responses.
4.5
The internal model control (IMC) method can be used to select the gains for a PID controller, because in certain circumstances the IMC controller reduces to a PID controller. The IMC scheme was collected into one framework by Garcia and Morari (1982). The advantage of the IMC method is that the controller incorporates a model of the process to be controlled. The IMC method is derived as follows. The process to be controlled is denoted by G p ( s ) and a model of it Gm ( s ) . If the controller, Gc ( s ) , is set Gc ( s ) = Gm ( s ) 1 and
the model is correct then the open-loop response is equal to the setpoint. This is the ideal case and can not work in practise, because there are always disturbances and modelling errors. Additionally, the model is not always invertible. Therefore a feedback of the error between the model and the process output is introduced as depicted in Figure 4.3.
The process model, Gm ( s ) , is then split into an invertible Gm ( s ) and a non-invertible
+ ( s ) part. Gm + Gm ( s ) = Gm ( s )Gm (s) .
(4.23)
24
yr
Gc(s)
Gp(s)
Reference
Gm(s)
ym
upon inverting becomes unstable or non-realisable. The rest of the model consists of the invertible part which is incorporated into the controller. The non-invertible part is treated as un-modelled dynamics and is handled by the feedback. The controller is then
Gc ( s ) = Gm ( s ) 1 G f ( s ) ,
(4.24)
where
G f ( s) =
( s + 1)
(4.25)
is a filter with appropriate n to make the controller proper. is a positive tuning parameter that can be manually set to achieve a suitable response. The block diagram in Figure 4.3 can be transformed into a regular feedback loop (Figure 4.4) with the model included in the controller (Garcia and Morari, 1982). With elementary block diagram algebra and using Equations (4.23) and (4.24) one gets
GIMC ( s ) =
Gm ( s ) 1 G f ( s ) Gc = . + 1 GmGc 1 Gm ( s )G f ( s )
(4.26)
This is the IMC controller, which is the shaded area of Figure 4.4. With a suitable selection of the filter and approximations of the delay (see Appendix, Section 10.1)
25
GIMC(s)
yr e
Gc(s)
Gp(s)
Reference
ym
Gm(s)
Figure 4.4: Internal model controller with model feedback as part of the controller.
the controller can be formulated as a PID controller which is tuned with the IMC method. This method can as well be applied to discrete-time systems. The difficulty is to formulate it as a discrete-time PID controller.
4.6
Gain Scheduling
For a nonlinear process a nonlinear controller is usually needed, which is more difficult to setup and tune. The easier way is to ignore the nonlinearities by linearising the process around some operating point and by tuning a linear controller to this approximation. The controller will presumably work well near this operating point. By tuning several controllers for a number of operating points (Figure 4.5) the best suited controller can be used. When the process shifts from one operating point to another a different controller is used. For a survey of gain scheduling techniques see Leith and Leithead (2000).
output
Operating point
input
Figure 4.5: Linearly approximations around operation points of a nonlinear (static) process.
26
In gain scheduling off-line tuned controller parameters are stored in a gain table. The parameters can be calculated with any tuning method, such as the optimisation method (Section 4.4), or with pole placement with a linearised process model. An operating point estimator estimates the current operating point and the gains of the controller are selected based on the estimation (Figure 4.6). The gain parameters can be interpolated from the gain table to obtain in-between tuning. The operation point estimator uses usually only the process output, which indicates directly the operating point, and the controller parameters are fetched from a look-up table. The estimator and the look-up table can also be implemented with a fuzzy system where a more sophisticated parameter selection can be done (Viljamaa and Koivo, 1995). With gain scheduling simple controllers such as the PID controller can be used with varying time-delay systems without resorting to more elaborate techniques (Tipsuwan and Chow, 2004). An example of using gain scheduling in varying timedelay systems is given in Section 6.3.
yr e
Controller
Process y
Reference
Figure 4.6: Gain scheduling with operating point estimator that tunes the controller based on the operating point of the process.
27
4.7
In a sensor network described in Section 3.2 the data from the sensors must be fused before a scalar PID controller can be used. The fusion is in the simplest case just a weighted average of the measurements. The weight indicates how trustworthy the measurement is or how well it represents the real value. If the sensors are, for instance, spread out and some are in a bad position for measuring, the trustworthiness is lower. The estimated variance, 2, of the sensor can also be the weight. In that case the measurements are weighted with the maximum-likelihood estimation
= x
xi
2 i 2 i
(4.27)
where xi are the measurements and i2 the respective variances. In a sensor network the measurement packets arrive independently, at different times and sometimes out of order to the fusion block. Since a network is considered here, the packets are usually timestamped and they can be ordered. If the timestamps (clocks) are synchronised one can furthermore compare the send time between different sensors. There are several ways to fuse the incoming measurements from the sensors depending on how much information is available. The relevant information includes measurement variances or weights, (synchronised) timestamps to order the packets and a process model to perform Kalman filtering. Table 2b lists various conceivable possibilities for the fusion strategy.
28
Case
Information
Description
Strategy
No information
Take one arbitrary measurement as the fused value. Take a weighted average of the received measurements.
No timestamp
Timestamp
Take a weighted average of every sensors received measurements with highest timestamp.
Synchronised timestamp
The sensors timestamps are synchronised. Measurements can be compared for order.
Find the most recent measurement(s). Take the weighted average of only the newest measurements.
Synchronised timestamp
The sensors timestamps are synchronised. Measurements can be compared for order.
Weight the measurements based on their delay to the newest received measurement. The weight is
from different sensors calculated as ec (max_ t t ) , where c is a constant that controls how fast the influence of old results should decay, max_t is the highest timestamp and t is the timestamp of the measurement the weight is calculated for.
29
Timestamp +
Construct a Kalman filter for mates according to their Kalman covariance, P (Distributed Kalman Filtering).
process model stamps a model of the every sensor and fuse the esti-
Synchronised timestamp +
Calculate a weighted average with one of the above methods and use a Kalman filter to estimate the measured variable (Centralised Kalman Filtering).
Kalman filtering with packet dropouts in sensor networks with two sensors is investigated in Liu and Goldsmith (2004). They give upper and lower bounds of convergence for the Kalman filer as a function of the percent of sensor measurements that are correctly received. Issues related to the decentralised Kalman filter with packets out-of-order in a sensor network are described and simulated in Hasu and Koivo (2005). Cases 1-5 are compared using simulation in Section 6.4.
30
5 MoCoNet
MoCoNet stands for Monitoring and Controlling Laboratory Processes over Internet With this platform control algorithms for networked control systems can be tested. Discrete-time PID controllers are tuned and tested in Section 6.5 with the tuning methods presented in Chapter 4 for a process attached to this platform. The laboratory course at the Control Engineering Laboratory of Helsinki University of Technology has been upgraded during the past years. One expansion to the course has been done by the author with the development of the MoCoNet platform. The use of the platform for the laboratory course is that the students can monitor and run educational laboratory processes over the Internet. The scientific objective of the platform is to test and validate control algorithms on real processes. The testing is done by a methodology called rapid control prototyping (RCP), where a simulation model of the control algorithm is automatically compiled into executable code and run on real hardware. The MoCoNet platform supports RCP, which is described in the next Section. The educational objectives are to make the laboratory processes easily available to students at anytime and anywhere. A student can for example run a process over the Internet from home or on the spot. Universities could even co-operate to offer their laboratory processes to students all over the world. The students can use the same platform for different laboratory processes and the emphasis can be put on the content of the experiments when the platform is familiar: usability is improved. Another educational goal is to show the influence of a varying time-delay in control loops. A network simulator (NetSim) was added to the system to enable the study of network induced delay in control loops. The control loop can be one of the networked control systems presented in Chapter 3. This feature is used in this thesis in Chapter 7, where one laboratory process is run and studied with the MoCoNet platform. The platform consists of a few server computers located in the laboratory, with some server software and a graphical user interface applet. The platform is described in the following sections and in depth in Pohjola et al. (2005). Other remote laboratories 31
have also been developed in the academic world, each with a different mix of techniques. E.g. Valls et al. (2005) discusses MATLAB based techniques and WinCon software to connect to a real plant.
32
Controller design
Test
Simulation model
Good? No
Yes
Change
Real hardware Test Executable Compile
The MoCoNet platform uses rapid control prototyping for testing controllers on real hardware. The users can upload their controllers implemented with MATLAB/Simulink to the MoCoNet system, where the controllers are translated into C code with MATLAB/Real-Time Workshop and compiled with Target Language Compiler into executable code for testing. Hltt et al. (2004) gives a tutorial for implementing RCP with MATLAB. In the tutorial it is shown how RCP can be implemented on the same example process that is used in this thesis. The process is described in detail in Section 5.6.
33
Previously performed experiments and collected measurements can be loaded and observed with the GUIs scope. In Figure 5.3, a laboratory process is monitored with the scope. The process is simple, but it is difficult to control because of a varying network delay. The figure shows that multiple signals can be tracked at once and that e.g. the results can be saved to a file.
34
5.3 Software
The server software is responsible for maintaining connections between users and processes, running a reservation system for controlling processes (which user can run which process and when), collecting all the data into a database and configuring the network simulator. Information of the available processes and the controllers are stored in a database with data of previously done experiments. The server software consists of two Java programs: ProcessServer and SignalServer. The ProcessServer serves the user interface applet called ProcessControl, and enables the user to control processes from a remote location. The SignalServer listens to process measurement and control messages that flow in the local network and transmits them to the remote location applet. The SignalServer incorporates a
DatabaseServer that stores the measurements in a Microsoft Access database located
on the server for recollection of done experiments. All these three programs can be run independently on different computers for scalability. The control permission reservation system is a part of the ProcessServer. The reservation system maintains a list of all clients that have requested to control a process. If the user in control releases the control of the process, the control is passed to the next user on the reservation list. The measuring and controlling software of the physical process is run on a computer equipped with MATLAB xPC Target real-time operating system (RTOS). A RTOS is required since otherwise it would not be possible to guarantee well-timed sampling times. The xPC Target computer is responsible for measuring process variables and for transmitting the measurements into the network (which are passed on to the user). The controller is implemented on the same computer as the measurement and actuator unit, but the measurement unit, controller and actuator can be virtually distributed in a network if the measurement packets are sent via the network simulator as indicated in Figure 5.4. This corresponds to the fully-distributed control system shown in Figure 3.1.
35
The server side Java programs are connected to MATLAB programs through the MATLAB Web Server (MWS) interface, which is also used for uploading the process control models with tuned controllers into the xPC Target computer. Once the model is uploaded, start and stop messages can be transmitted through the MWS to run the real processes.
5.4 Hardware
The system contains three physical PCs, all connected to an 100 Mbps Ethernet router. The router acts as a gateway and firewall to the Internet. The physical architecture of the implemented system is presented in Figure 5.5. One computer, the xPC Host, acts as a server for the users. The computer runs the Java server software, introduced in the previous Section, and maintains the system database. The process-end computer called xPC Target runs on the MATLAB xPC Target RTOS. It is equipped with an I/O board connected to the process. The computer is used for executing compiled C code including, among other things, controller algorithm, UDP packet sending and receiving, and I/O functions. The server computer is also called the xPC Host, because the xPC Target computer can be configured from this host. The host PC can be used for compiling Simulink models into executable code and for uploading the code into the target PC. The code is automatically generated from Simulink models using the Real-Time Workshop and the xPC Target Toolbox. This combination of MATLAB toolboxes allows easy prototyping of control software (RCP).
36
...
Internet
Gateway LAN
NetSim
Process 1
Process 2
...
Process N
Figure 5.5: Physical layout of the MoCoNet server side computers and users connected to the MoCoNet server.
randomized from a selected distribution, a retransmitting timestamp is calculated and the packet is put to queue to wait until the real-time clock reaches the timestamp. Another thread of the software is responsible for transmitting packets back to the network. The delay distribution can be one of several, including the gammadistribution of Section 2.2. Multicast UDP/IP is used for transmitting measurement and control packets in the local network. This is because UDP packets have a low latency when compared to TCP communication, and there is no need to know what other modules belong to the network, as multicast messaging is used. The simulated network properties are configured remotely by the xPC Host server computer on the command of the user, using a specific UDP port. Because the network is simulated, it would be possible to realise all the modules on a single physical computer as separate components or processes. However, the modules are separated both in hardware and in software to enable testing of different tools and to allow easy modification of the system, e.g. the network simulator could be replaced, or the packets could be routed through the Internet for a real test.
38
(5.2)
(5.3)
C2 R1 R2 Uin C1 C3
Uout
39
J ( P, I , D ) =
1 nM {( t mod M ) e( P, I , D) } dt , n 0
(6.1)
where n is the number of steps and M is the time between the steps. The first step is at t = 0. The process is a simple first order system with time constant T and transfer function
G(s) =
1 . Ts + 1
(6.2)
The process is augmented with a varying time delay, L(t), as shown in Figure 6.1. The PID controller is implemented as in Equation (4.17).
yr e
PID Controller
1 Ts+1 Process
L(t)
y Delay
Reference
The delay can be a) constant, b) random, c) time-dependent or d) state-dependent. The respective delays used in these cases are described by a) b) c) d)
(t ) = L (t ) = rand [0.8...1.2]
(t ) = sin(t ) (t ) = x(t )
(6.3)
For the constant delay L = 1. The random delay is uniformly distributed between 0.8 and 1.2. The delay changes every other sampling period. The step responses are done from 0 to 1 and back down to 0. The time between the steps is ten seconds (M = 10), enough for the process to settle down before the next step is done and four steps are done (n = 4). For the state-dependent delay this means that on the step up the delay is zero in the beginning, increasing and approaching one as the process settles down. On the step down the delay is the other way round, first large and then decreasing towards no delay. The time-dependent delay will also be zero in the first step, but at the step down sin(t) is in another phase and the delay is nonzero.
41
The delay is considered to be part of the process (corresponding to Figure 2.1, left), so the cost criterion error is calculated from the reference signal and the output after the delay, i.e. the system cost described in Figure 4.2. The delay is simulated as an output variable delay as described in Ekanayake et al. (2001). The controller is tuned for a process with time constant, T, in the interval [1, 10]. The sampling time of the controller is in the interval h = [0.1, 1]. The results for the various delay types (a-d) are presented in the next Sections.
4 2
Figure 6.2: Optimal PID controller parameters for the first order system with constant delay. P, I, D and cost as functions of process time constant, T, and controller sampling time, h.
For a small sampling time (left side of the plots) the results are similar as in the continuous case done by Reijonen. The P and D terms are linear functions of the time constant, T. The I term is hardly affected by T, but rather by the sampling time. All
42
the terms decrease with increasing sampling time. The controller becomes more cautious as it tracks the output less frequently with increasing sampling time. The optimal controller tuning is more conservative with increasing sampling time as the cost increases also. Some sampling times are relatively better than others, as 0.5 and 1.0, because they fit better the delay of 1. The best sampling time is the lowest, as it enables the controller the shortest response time on output changes.
Figure 6.3: Optimal PID controller parameters for the first order system with random delay. P, I, D and cost as functions of process time constant, T, and controller sampling time, h.
Comparing the result shown in Figure 6.3 and the previous result there are only slight differences. The P and I terms are practically identical. There is some arbitrariness in the controller parameters, especially in the D term. This is caused by the randomness in the delay.
43
As the results are similar to the constant case, one can assume a constant delay (the mean of the random) when tuning a PID controller for this kind of uniformly distributed random delay. This can, however, change with a larger variance of the random delay or with a different distribution. The delay is in-fact similar to the constant case when the sampling time is larger than the delay variation range, as the synchronisation delay (Equation (3.1)) rounds it up to a constant case.
Figure 6.4: Optimal PID controller parameters for the first order system with sinusoidal delay. P, I, D and cost as functions of process time constant, T, and controller sampling time, h.
The P, I and D parameters are larger than in the constant case. The overall tendency of the P and I parameters is similar: decreasing values with increasing sampling time, but they are decreasing faster. The D term goes in waves as a function of sampling time.
44
Some sampling times suit the system better: the cost goes in steps. At the up-steps of the cost the parameters are smaller; consequently a slower and more cautious response is tuned at those areas.
2 Cost 0.8
Figure 6.5: Optimal PID controller parameters for the first order system with state dependent delay. P, I, D and cost as functions of process time constant, T, and controller sampling time, h.
The tuning is again similar to the constant case. The parameters decrease slightly less as functions of sampling time. The D term is a little larger for small process time constants and varies less than in the constant case. With the lowest sampling time all the above results are similar to Reijonens work, which considered the continuous-time case. This is expected, since with short sampling times the discrete-time PID controller approximates the continuous-time PID controller accurately.
45
Figure 6.6: Optimal PID controller parameters for the first order system with constant delay. P, I, D and cost as functions of process time constant, T, and feedback delay, L. Sampling time h = 0.1.
For a given delay length the parameters behave as in the preceding cases with increasing P and D terms as functions of process time constant. The P and I term increase (nonlinearly) with shorter delay. The controller is more aggressive and the response is faster. This is reflected in the cost which decreases with shorter delay.
46
10 5 P
1 0.5
Figure 6.7: Optimal PID controller parameters for the first order system with random delay. P, I, D and cost as functions of process time constant, T, and feedback mean delay, L. Sampling time h = 0.1.
The results are to some extent similar to Case 2a with a constant delay, but the tuning is more conservative and thus the cost is higher for all tunings. The conclusion is that random delay is more difficult to handle, and the optimal tuning can not be as tight as with constant delay. Especially the P and I terms are smaller than in the previous case and they are not as nonlinear as functions of mean delay. With a long delay, where the randomness is proportionally smaller, the results are similar to the constant delay case. The differences in the results are largest, as can be expected, where the random part of the delay is dominating. 47
These results can be used in delay based gain scheduling of a PID controller as is done in Section 6.3.
0.5
10 Time [s]
15
20
25
Figure 6.9: Optimal PID controller parameters for the first order, semi-distributed system with network delay. P, I, D and cost as functions of process time constant, T, and controller sampling time, h.
Comparing this and Case 1b (random delay) the results are to some degree similar. The P, I and D terms are almost the same. The cost is smaller because the error signal is not taken after the delay, but right from the process output. The cost is, though in another manner, increasing with sampling time, with dips as the delay turns into constant at the larger sample times.
49
4 0.3 P 2 0.2 I 0.1 0 10 5 T 0.2 0.4 h 0.6 0.8 0 10 5 T 0.2 0.4 h 0.6 0.8 6 Cost 0.8 4 2 0 10 5 T 0.2 0.4 h 0.6 5 T 0.2 0.4 h 0.6 0.8
2 D 1 0 10
Figure 6.10: Optimal PID controller parameters for the first order, fully-distributed system with network delay. P, I, D and cost as functions of process time constant, T, and controller sampling time, h.
The additional network delay causes the optimal controller tuning to be more cautious; the P and I terms are smaller than in the semi-distributed system. The D term has little similarities with the previous case and varies quite a bit. The cost is higher but behaves similarly as in the previous case.
50
Reference
In
Out
static delay
Delay
Delay generator
delay
PID
delay
Gain sheduling
P Lookup
1 PID I Lookup
1 delay
D Lookup
Figure 6.11: Gain scheduling with PID controller. The gain scheduler has a low-pass filter for the delay and look-up tables for P, I and D parameters.
51
In the next cases gain scheduling is demonstrated with two types of delay changes and compared to a non-scheduled, constant parameter controller. First the delay is random with the same properties as in Case 2b, but there is a step in the mean delay from 0.5 to 1.0 at time 40 s. In the second example the delay has a slow sinusoidal variation with a frequency of 0.1 rad/s and amplitude 0.4 (Figure 6.12). These delay changes could for example originate from a network topology change (the step change) where a node has fallen off or moved in an ad-hoc network and the path (and delay) has become longer. The sinusoidal change could be explained as a change in network load, where an increase in load lengthens the delay.
1.4
1.4
1.2
1.2
0.8
0.6
0.6
0.4
0.4
0.2
0.2
10
20
30
40 Time [s]
50
60
70
80
10
20
30
40 Time [s]
50
60
70
80
Figure 6.12: Delay for simulations with gain scheduling. Thin line: measured delay, bold line: low-pass filtered delay. On the left: Random delay with step change. On the right: Slow sinusoidal variation.
52
1.2
0.2
10
20
30
40 Time [s]
50
60
70
80
10
20
30
40 Time [s]
50
60
70
80
Figure 6.13: Gain scheduling with step delay change. On the left: PID parameters for current identified delay as function of time. On the right: Step responses for system with and without gain scheduling.
53
1.2
0.6
10
20
30
40 Time [s]
50
60
70
80
10
20
30
40 Time [s]
50
60
70
80
Figure 6.14: Gain scheduling with sinusoidal delay change. On the left: PID parameters as functions of time. On the right: Step responses of the system with and without gain scheduling.
54
Case 1 2 3 4 5
1.85 1.21
3.05 1.61
55
The best method is the fusion by timestamp (case 3), regardless of which error is chosen as evaluation criterion. The second best methods are the fusion regardless of timestamp (case 2) and fusion with decay (case 5). These methods eliminate the error variance better than the other methods because they always fuse four measurements. The worst cases are no fusion (case 1) and fusion with only the most up-to-date measurements (case 4), since these methods hardly reduce the noise (high fusion error). The step responses are similar, shown in Figure 6.15, apart from the different noise levels after fusion (Figure 6.16). The noise is further amplified by the derivative term of the controller. The output noise is proportional to the fusion IAE criterion, and thus the fusion by timestamp method has the smoothest response, the no fusion method being the worst.
56
Fused output 1.4 1.2 1 0.8 0.6 fusion_no ITAE: 1.561 fusion ITAE: 1.356 fusion_by_timestamp ITAE: 1.160 fusion_by_timestamp2 ITAE: 1.850 fusion_with_decay ITAE: 1.206
10
12
14
16
18
20
-1
-2
-3
10
12
14
16
18
20
Figure 6.15: Simulated step responses (top) and control signals (bottom) with various fusion strategies.
57
fusion_no IAE: 3.7 0.2 0 -0.2 -0.4 0 5 10 15 20 fusion IAE: 1.33 0.2 0 -0.2 -0.4 0 5 10 15 20 25 30 35 40 25 30 35 40
Figure 6.16: Fusion errors for various fusion strategies during a simulation.
58
Hops, n 3
Packet loss 1%
The optimisation technique with the average ITAE cost, Equation (6.1), on five unit step responses is used to tune the PID controller for the process. Several steps are done and averaged as previously, to get rid of optimisation for a particular instance of the random delay. Other tunings (Ziegler-Nichols and IMC) are used as well for comparison. The comparison is done by the average ITAE and IAE cost of a series of step responses and by visual inspection. The results are collected at the end of this Section, in Table 5.
59
3 P I D 2.5
Parameters
1.5
0.5
0.05
0.1 h [s]
0.15
0.2
0.25
Figure 6.17: Optimal PID controller parameters for example process. P, I and D as functions of sampling time, h.
The variations in the optimal PID parameters are not a result of the optimisation algorithm being stuck in local minima. Several initial values for the optimisation algorithm have been used to avoid this. The variation is rather a consequence of the random delay. The cost plotted in Figure 6.18 rises with sampling time, but it is far from smooth, with a deep valley at h = 0.16 s. At this point the effective delay varies between two values: h and 2h (Equation (3.1)). This suggests that the PID controller works well when most of the variation of the delay is in the order of the sampling time. With this particular sampling time 85 % of the stochastic time-delay is smaller than the sampling time. This supports the work that considers the delay variation to be at most one sampling time (Nilsson, 1998). In Figure 6.19 some step responses are shown as functions of sampling time. The corresponding PID tunings are listed in Table 5. At the shortest sampling time there is some overshoot, but the system has generally a good response. With the sampling time at the local minimum of Figure 6.18 the overshoot is fixed with no significant impact on the speed of the response. This is the most preferred sampling time, as 60
concluded in the previous paragraph. The longest sampling time results in a slower response with longer rise time and settling time.
0.4
0.35
0.3
cost, ITAE
0.25
0.2
0.15
0.1
0.05
0.05
0.1 h [s]
0.15
0.2
0.25
Figure 6.18: Optimal ITAE cost as a function of sampling time, h, for example process.
Output 3 h = 0.025 h = 0.16 h = 0.25 Reference
-1
-2
-3
10 Time [s]
15
20
25
Figure 6.19: Step responses with optimisation tuning. Sampling times: 0.025, 0.16 and 0.25 seconds.
61
Ti = a1 Td =
(6.4)
1 bs + 1
(6.5)
consisting of the inverted zeros of the process. This pre-filter can be omitted by considering that the model is inaccurate and does not model the zeros. The IMC
62
concept ensures that the controller will work and compensate for the (artificial) modelling error. The controller is tested with and without the pre-filter. The parameters in Equation (6.4) are derived in the continuous-time case because an IMC controller derived in discrete-time can not be brought to a PID controller form. Therefore only a short sampling time of h = 0.025 s is used for the discrete-time PID so that it approximates the continuous-time controller. The tuning parameter, , for the IMC tuning is selected to be 0.65. This results in a response with little overshoot, and with minimum ITAE cost (Figure 10.3 of the Appendix).
6.5.4 Results
The process responses and the control signals for a series of reference step changes are displayed in the following figures. The PID parameters obtained with the different tuning methods and the respective average ITAE and IAE costs of the step responses displayed in Figure 6.20 are listed in Table 5. The ITAE costs of the responses are used to compare the tuning methods. This measure is chosen because it takes the whole response into account, which is not the case for measures such as the rise time or overshoot. The optimisation method has of course the best ITAE as it minimises the particular criterion, therefore also the IAE criterion is displayed. The ITAE criterion is used to compare how much worse the other tuning methods are in comparison to the optimum. The Z-N step response method is almost unstable and oscillates heavily: the cost is 6 times larger compared to the optimal tuning. This is due to the large gains of the tuning. It is omitted from the figures below and shown in the Appendix, Figure 10.2. The bad tuning can stem from uncertainties in the determination of the inflexion point of the test step response. The Z-N tuning methods are designed for load disturbance rejection so the poor performances originate partially from the reference step changes in the simulations. The IMC tuning with a pre-filter has a quite different step response compared to the others and does not belong here because of the filtering in addition to the pure PID controller. The step response is shown in the Appendix, Figure 10.3.
63
The optimisation method has the lowest ITAE and IAE cost, followed by IMC. There is a correlation between the ITAE and IAE costs. The square integral costs (ISE and ITSE, not shown) give similar results.
Table 5: PID parameters for example process and cost from simulations.
Method
Cost, ITAE
Z-N step response Z-N frequency response Optimisation, h = 0.025 Optimisation, h = 0.16 Optimisation, h = 0.25 IMC (without pre-filter) IMC (with pre-filter)
0.072 0.027
0.014
The optimisation method has a short rise time and settling time with little overshoot, even though these criteria are not explicitly in the cost function. The conclusion is that the optimisation tuning method gives the best results among the compared tuning methods, regardless of the tuning criterion. Some conclusions can be done when the step responses are visually compared (Figure 6.20). The Z-N frequency method is better than the Z-N step response method. There are still heavy oscillations and the tuning is aggressive with large PID parameters. The other tuning methods produce reasonable step responses. The IMC scheme without a pre-filter has a too large derivation term that over-anticipates the overshoot and the steady-state error disappears slowly. Some part of the slow response is owing to the zero not modelled. The version with the pre-filter shown in the Appendix (Figure 10.3) is smoother and settles down nicely. The cost is the same as without the pre-filter.
64
The tuning by optimisation is the best; it has the smoothest response and settles down in a short time with little overshoot, even the larger step is not a problem. The tuning for a sampling time of h = 0.25 s works almost as well; there is only a larger delay and a slower response because of the large sampling time.
Output 4 Z-N frequency Optimisation h=0.025 Optimisation h=0.25 IMC no pre-filter Reference
-1
-2
-3
-4
-5
10 Time [s]
15
20
25
It is notable that the IMC tuning (with and without a pre-filter) comes near the same performance as the optimal tuning, if one considers the error integrals. The control signals (Figure 6.21) show that the Z-N and the IMC tuning are aggressive with large control signals. The Z-N tuning oscillates strongly. The optimal tunings have a reliable and precise control signal in comparison to the other methods.
65
Control 20
15
10
-5
-10
-15
-20
10 Time [s]
15
20
25
66
7 MoCoNet Results
In this Chapter the example process tunings simulated in Section 6.5 are verified on real hardware. Test runs are done with the MoCoNet platform described in Chapter 5 on the electrical circuit (see Section 5.6) connected to the platform. The network is simulated with the network simulator presented in Section 5.5. The settings for the network are the same as in the simulation runs of Section 6.5 (Table 4). The controller tunings are the same as those in Section 6.5. The purpose of these tests is to verify that the tunings work in practice. The results are saved to a text file from the MoCoNet scope and analysed and plotted in MATLAB. In Figure 7.1 a sample of the network delay of the network simulator is shown. The delay has the same parameters as in the simulations, Table 4. The figure corresponds to the delay of Figure 6.8 simulated in Simulink as they both are computed in the same way. The main difference between the figures is that they have different delay parameters. The general distribution is the same with some long delays from the tail of the gamma distribution. Several test runs were made and the typical cost was estimated. The rest of the Chapter shows representative test run results, and the results are compared to the simulation results. The results are collected and compared in Table 6.
0.7
0.6
0.5
0.4
0.3
0.2
0.1
10
15
20
25
Time [s] Figure 7.1: Sample of real network delay of the network simulator (h = 0.1 s).
67
8 6
0 -2
-4
-6
-8 -10
10 Time [s]
15
20
25
Figure 7.2: Optimisation tuning with h = 0.025 s. Test results with example process.
The ITAE cost ranges from 0.026 to 0.038, which is higher than the simulated cost. There are several reasons for this: the real process is different from the transfer function model and the actual network delay is different from the simulations. Measurement noise also affects the results. The optimisation method produces some aggressive control signal behaviour. If a long delay occurs at the time when a step change is performed the controller overshoots and oscillation can occur. This is only temporary and the closed loop remains stable. In case of a longer sampling time the system becomes more stable with less overshoot and oscillations. Figure 7.3 presents the results with sampling time h = 0.16 s. The ITAE cost remains stable from run to run at 0.08. 68
6 4
-2
-4 -6
-8
-10
10 Time [s]
15
20
25
Figure 7.3: Optimisation tuning h = 0.16 s. Run of step responses for the example process.
With the long sampling time the effective time-delay alternates between two values. The step response is stabilised, compared to the shorter sampling time (Figure 7.2), and the control signal is smoother. This choice of sampling time is the best according to the conclusions of the valley in Figure 6.18.
69
10
15
20
25
Time [s] Figure 7.4: Z-N frequency tuning. Run of step responses for the example process.
70
6 4
-2
-4 -6
-8
-10
10 Time [s]
15
20
25
Figure 7.5: IMC tuning without pre-filter. Run of step responses for the example process.
6 4
-2
-4 -6
-8
-10
10 Time [s]
15
20
25
Figure 7.6: IMC tuning with pre-filter. Run of step responses for the example process.
71
Method Z-N step response Z-N frequency response Optimisation, h = 0.025 Optimisation, h = 0.16 IMC (without prefilter) IMC (with prefilter)
72
8 Conclusions
This thesis studied the discrete-time PID controller design and tuning for varying time-delay systems and furthermore networked control systems (NCS), including sensor networks. The MoCoNet system was developed to enable RCP for educational use in laboratory courses. With the addition of a network simulator, testing of networked control systems was made possible. The MoCoNet system is operational and will be used in the laboratory course at the Control Engineering Laboratory at Helsinki University of Technology. The discrete-time PID controller was introduced and some practical aspects, such as derivative filtering were formulated. As NCS includes a network, which transmits measurements as packets, there is an inherit discreteness to the system and therefore only discrete-time PID controllers were studied. The controller tuning was focused on an optimisation by simulation technique. The tuning method was modified to work with discrete-time controllers in the context of NCSs. Other PID design methods such as Ziegler-Nichols and Internal Model Control were compared to the optimisation method. The tuning methods were tested with simulations and with experiments on a real example process with the MoCoNet system. The optimisation tuning method performed almost equally well in practice as in simulations. It was further shown to perform better than traditional tuning methods, because it can take the varying time-delay better into account. A general study of optimal tuning for varying time-delay systems was conducted. The optimisation was done for first-order systems with time-delay, as a function of process time constant and controller sampling time. The time-delay was a varying time-delay, namely time- or state-dependent and random. The results gave rules of thumbs to tune the PID controller for different types of time-delays. One general result was that with increasing sampling time the P and I terms decrease. With increasing process time constant the P and D terms increase. The tuning results of different time-varying delays were compared to the constant delay case. Differences in the optimal tuning with different types of time-delays were
73
found. However, the optimal tuning for a random delay with a small variance is virtually the same as in the constant delay case. In the case of a small random variance in the time-delay and a larger sampling time, constant delay tuning can be used, as the sampling time rounds the delay up to nearly constant. The PID controller was found to work best when most of the stochastic time-delay was smaller than or equal to the sampling time of the controller. It performs equally well with a short enough sampling time, with the expense of a more active control signal and less robust performance. The optimised tuning results were based on the ITAE cost of the error signal. As the optimisation focused on the time-response only, robustness is not guaranteed. Robustness, load disturbance rejection and noise rejection should and can easily (as outlined in the thesis) be incorporated into the optimisation criteria, and optimisation for a good response and robustness should be considered in further studies. The down-side of the optimisation technique is that a process model is needed. The model can, however, be any input-output description and it is not limited to linear and time-invariant systems. This allows one to tune for any type of processes, such as processes with time-varying delay, as is done in this thesis. Networked control systems and their various layouts, including sensor networks were described. The occurrence of a time-delay in the control loop of these systems was analysed. Especially the delay distribution in the Internet was described in detail. Sensor fusion methods for sensor network systems were developed and tested in the simulations. Gain scheduling based on delay was also demonstrated with typical delay changes corresponding to falloff of a node and daily network utilisation changes. The optimisation method was applied on networked control systems, where the varying time-delay was modelled with the Internet delay distribution. Several tuning methods were tested on an example process in simulations. The optimisation tuning cost as a function of sampling time showed that there is a local minimum at a relatively long sampling time where the performance of the controller good. The favourable sampling time is such that the resulting effective delay varies between two values.
74
Results were also verified on a real process with the MoCoNet platform. The various tunings done with a simulation model were shown to perform satisfactorily in practice. The optimisation tuning performed better than all the other tuning methods when an appropriately long sampling time was chosen, even better in practice than with a short sampling time. Another conclusion was that with an adequate process model the optimisation tuning results can be used on real processes. The thesis showed that a PID controller can be used to control a process with varying time-delay, as long as the variation in the delay is small, in the order of the sampling time. Traditional tuning methods, such as Ziegler-Nichols, do not perform well in the new setting of networked control systems. The tuning can instead be done with the optimisation tuning method using simulation described in this thesis.
75
9 References
Alves, M., Tovar, E., Vasques F. 2000. Ethernet Goes Real-time: a Survey on Research and Technological Developments. HURRAY-TR-2K01. strm, K. J. and Hgglund, T. 1995. PID Controllers: Theory, Design, and Tuning, 2nd edition. Instrument Society of America, 1995. Bolot, J. C. 1993. Characterizing End-to-End Packet Delay and Loss in the Internet Journal of High-Speed Networks. Sigcomm 1993. pp. 289 298. Cao, J., William S. C., Lin, D., Sun, D. 2002. Internet Traffic Tends Toward Poisson and Independent as the Load Increases. Nonlinear Estimation and Classification. Springer Verlag, New York, NY, Dec. 2002. ISBN: 0-38795471-6. Cervin, A., Henriksson, D., Lincoln, B., rzn, K-E. 2002. Jitterbug and TrueTime: Analysis Tools for RealTime Control Systems. 2nd Workshop on RealTime Tools. Copenhagen, Denmark, 2002. Chai, S. 2005. Design and Implementation of Networked Predictive Control Systems. In proc. 16th IFAC World Congress, Prague, Czech Republic, 2005. Ekanayake, M.M., Premaratne, K., Douligeris, C., Bauer, P.H. 2001. Stability of Discrete-Time Systems with Time-Varying Delays. In proc. American Control Conference, Arlington, VA, 2001. Eriksson, L. 2005. A PID Tuning Tool for Networked Control Systems. WSEAS Transactions on Systems, Issue1, Vol. 4. ISSN: 1109-2777. Eriksson, L. and Koivo, H. 2005. Tuning of Discrete-Time PID Controllers in Sensor Network based Control Systems. In proc. 6th IEEE International Symposium on Computational Intelligence in Robotics and Automation, Espoo, Finland. 2005.
76
Garcia, C. E. and Morari, M. 1982. Internal Model Control. 1. A Unifying Review and Some New Results. Industrial, Engineering Chemistry Process Design and Development Vol. 21, No. 2, 1982. Hang, C.C., strm, K.J., Ho W.K. 1991. Refinements of the Ziegler-Nichols tuning formula. IEE Proceedings Part D, Vol. 138, NO. 2, March I991. ISSN: 0143-7054. Hanselmann, H. 1996. Automotive Control: From Concept to Experiment to Product. In proc. IEEE International Symposium on Computer-Aided Control System Design. Dearborn, MI, 1996. Hasu, V. and Koivo, H. 2005. Decentralized Kalman Filter in Wireless Sensor Networks Case Studies. In proc. CISSE 2005. Hltt, V., Palmroth, L., Eriksson, L. 2004. Rapid Control Prototyping Tutorial with Application Examples. Sim-Serv, www.sim-serv.com. Isaksson, A.J. and Graebe, S.F. 2002. Derivative filter is an integral part of PID design. IEE Proceedings. Control Theory and Applications. 61. 149, No. I. January 2002. ISSN: 1350-2379. Katayama, T., McKelvey T, Sano, A., Cassandras C., Camp, M. 2005. Trends in Systems and Signals. In proc. 16th IFAC World Congress, Prague, Czech Republic, 2005. Leith, D.J. and Leithead, W.E. 2000. Survey of gain-scheduling analysis and design. International Journal of Control, Vol. 73, No 11, 2000. Lincoln, B. 2003. Dynamic programming and Time-Varying Delay Systems, Ph.D. thesis. Department of Automatic Control. Lund institute of Tecnology, Sweden, 2003. Liu, G., Xia, Y., Rees, D. 2005a. Predictive Control of Networked Systems with Random Delays. In proc.16th IFAC World Congress, Prague, Czech Republic, 2005.
77
Liu, G., Mu, J.X., Rees, D. 2005b. Networked Predictive Control Of Systems With Random Network Transmission Delay A Polynomial Approach. In proc. 16th IFAC World Congress, Prague, Czech Republic, 2005. Liu G.P., Yang, J.B., Whidborne, J.F. 2003. Multiobjective Optimisation and Control, Research Studies Press Ltd, England. ISBN: 0-86380-278-8. Liu, X. and Goldsmith, A. 2004. Kalman filtering with partial observation losses. 43rd IEEE Conference on IEEE Decision and Control. Volume: 4, 2004. Nilsson, J. 1998. Real-Time Control Systems with Delays. Masters thesis. Department of Automatic Control, Lund Institute of Technology, Sweden. ISSN 02805316. MathWorks. 2005. Optimization Toolbox For Use with MATLAB. MathWorks, Inc. Mukherjee, A. 2001. On the Dynamics and Significance of Low Frequency Components of the Internet Load. In proc. First ACM SIGCOMM Workshop on Internet Measurement. p: 281 293. ISBN:1-58113-435-5. Pohjola, M., Eriksson, L., Hltt, V., Oksanen, T. 2005. Platform for Monitoring and Controlling Educational Laboratory Processes over Internet In proc. 16th IFAC World Congress, Prague, Czech Republic, 2005. Prada, Cesar da, Cristea, S., Keyser, R de. 2005. Predictive Control of a Process with Variable Dead-time. In proc. 16th IFAC World Congress, Prague, Czech Republic, 2005. Reijonen, A. 2003. Tuning of PID Controller for Varying Time-Delay Systems. Masters thesis. Department of Automation and Systems Technology, Helsinki University of Technology, Finland, 2003. Tipsuwan, Y. and Chow, M-Y. 2004. On the Gain Scheduling for Networked PI Controller Over IP Network. IEEE/ASME Transactions On Mechatronics, Vol. 9, No. 3, September 2004. ISSN: 1083-4435. 78
Valls, M., Valera, A., Dez, J.L., Albertos, P. 2005. A Straightforward Proposal For Low-Cost Development Of Virtual And Remote Control Laboratories. In proc. 16th IFAC World Congress, Prague, Czech Republic, 2005. Viljamaa, P., Koivo, H. N. 1995. Fuzzy logic in PID control gain scheduling. Third European Congress on Intelligent Techniques and Soft Computing, EUFIT '95, Aachen, Germany, 1995. Aachen, Germany, Verlag Mainz, ELITE - European Laboratory for Intelligent Techniques Engineering, 927931. Zhang, W., Branicky, M.S., Phillips, S.M. 2001. Stability of Networked Control Systems. IEEE Control Systems Magazine. Vol. 21, Issue 1, February 2001. ISSN: 0272-1708.
79
10 Appendices
10.1 Derivation of IMC Tuning for Example Process
The model of the process according to Equation (5.3) is
Gm ( s ) = bs + 1 e s , a2 s + a1 s + 1
2
(10.1)
with the constant approximating the varying random delay. Splitting this into an invertible and a non-invertible part results in (the numerator is a minimum-phase zero)
Gm (s) =
bs + 1 a2 s + a1 s + 1
2
(10.2)
+ Gm ( s ) = e s
The delay can be approximated with a first-order Taylor series e s 1 s or with a Pade approximation 1 s 2 . 1+ (10.3)
e s
(10.4)
When selecting the first-order Taylor approximation for the delay and the filter given above one can calculate the IMC controller. The controller turns out to be, according to Equation (4.26), and after some algebraic manipulation a2 s 2 + a1 s + 1 1 1 1 GIMC ( s ) = = a1 + + a2 s . s ( + )( bs + 1) s ( bs + 1) ( + ) This is a PID controller with a pre-filter G pf ( s ) = 1 , bs + 1 (10.7) (10.6)
80
Ti = a1 Td =
The pre-filter can be discretised with an appropriate sampling time to get a discretetime filter and the PID parameters are used as they are for the discrete-time PID controller.
0.8
1.2
1 0.6 0.8
0.4
0.6
0 0.5
1.5
2.5
3.5
4.5
10
Time [s]
Time [s]
Figure 10.1: Step response (left) and frequency response tests for Ziegler-Nichols tuning.
81
The Z-N tuning parameters from the simulations are listed in the table below. The values gained through real test runs are also shown. They do differ a little, but not significantly.
Table 7: Properties of system in Z-N tuning. Gained with simulation and test run on the real process.
Tu 0.97 1.1
T1
T2
15
6 10 4 5
2 0
-5
-2
-4 10 -6 15 -8
20
10
15
20
25
-10
10
15
20
25
Time [s]
Time [s]
Figure 10.2: Z-N tuning with step response method. On the left: Simulated steps for the example process. On the right: Test run on real process.
82
-1
-2
-3
-4
Time [s]
0 5 10 Time [s] 15 20 25
Figure 10.3: IMC tuning with pre-filter. Simulated step responses for the example process. See Chapter 6.5.4.
83