PID Controller Design in Networked Control Systems

March 30, 2018 | Author: Karthikeyan Krishnan | Category: Control Theory, Computer Network, Network Packet, Control System, Simulation


Comments



Description

ABHELSINKI UNIVERSITY OF TECHNOLOGY Department of Automation and Systems Technology Mikael Pohjola PID Controller Design in Networked Control Systems Master’s thesis for the degree of Master of Science in Technology submitted for inspection, Espoo, 9. January, 2006. Supervisor: Prof. Heikki Koivo Instructor: M.Sc. (Tech.) Lasse Eriksson TEKNISKA HÖGSKOLAN Automation och Systemteknik Författare Mikael Pohjola Tittel: PID Controller Design in Networked Control Systems Professur: Systemteknik Övervakare Professor Heikki Koivo Handledare DI Lasse Eriksson DIPLOMARBETE ABSTRAKT Datum: 9.1.2006 Sidor: 81 Kod: AS-74 I styrsystem över nätverk (Networked Control Systems, NCS) är processen och regulatorn separerade av ett datornätverk. Diplomarbetet behandlar olika typer av NCS och sensornätverk och de reglerproblem som uppstår lyfts fram. Traditionella justeringsmetoder för styrsystemet kan inte ta i beaktande den varierande tidsfördröjningen som uppstår p.g.a. nätet. Nya justeringsmetoder behövs. Diplomarbetet består av två delar: 1) Justeringsmetoder för diskret-tids PID regulator i system med varierande tidsfördröjningar, 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 utföras över Internet. Systemet kan användas med en webbläsare med Java-stöd. Styrsystem byggda med MATLAB/Simulink kan snabbt testas på en riktig process med rapid controller prototyping-metodiken. En nätverks-simulator möjliggör studier av styrsystem över nätverk. Den andra delen av diplomarbetet utnyttjar denna möjlighet. Resultat med optimala PID parametrar presenteras för olika typer av fördröjningar i ett allmänt fall med konstant, tids- och tillstånds-beroende eller slumpmässiga fördröjningar. Resultaten ges som funktioner av processens tidskonstant och regulatorns sampeltid. En disktret-tids PID regulatorn är justerad för en exempelprocess och regleringen verifieras med MoCoNet systemet. Optimeringsmetoden visar sig fungera bättre, både i simulationer och i verkligheten med MoCoNet systemet, jämfört med andra traditionella justeringmetoder som undersöks i arbetet. Nyckelord: styrsystem över nätverk, diskret-tid PID regulator, justering, varierande tidsfördröjning, fjärrlaboratorium. i 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 ABSTRACT OF MASTER’S THESIS Date: 9. January, 2006 Pages: 81 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 . worked hard to be clear and precise. funded by TKK2. The presentation was held to an interested audience with tough questions. Czech Republic (Pohjola et al. January 2006. though. Prague.Preface I have worked on-and-off at the Control Engineering Laboratory. with great assistance from my instructor. I am fortunate that my boss suggested that my thesis should incorporate these topics. Effort has been done to form the thesis into a whole from the pieces of my work. funded by TEKES.ja toimilaiteverkot TKK:n opintotoimikunnan hankerahoitus iii . which dealt with optimisation of discrete-time PID controllers for variable time-delay systems.Very Distributed Sensor and Actuator Networks1 project. The next summer I developed the MoCoNet platform. 2005). Writing has been a relatively easy job. and my girlfriend for listening to me and for nodding when I ramble on what I have and haven’t managed to do that particular day. I thank The Finnish Foundation for Economic and Technology Sciences . I must thank my family. The work I have done at the lab has been much assistance in my studies. as I have leaned on my previous work. I have. although they have had nothing to do with the thesis. My first summer job was part of the ERHE . Mikael Pohjola 1 2 Erittäin hajautetut anturi. for doing laboratory experiments from home.KAUTE for granting me a stipend to travel to the congress and present the paper at a session. The MoCoNet platform has been published to the scientific community at the 16th IFAC World Congress. Helsinki University of Technology since 2003. ..................................................................................................................................................... III TABLE OF CONTENTS ........................................ 36 iv ...............................1 2....................2 2..VI 1 2 INTRODUCTION ...........................................2 5........................................................................ 3 2.. 16 PRACTICAL ASPECTS OF THE PID CONTROLLER.................................. 9 3................................................... 35 HARDWARE ................................... 1 VARYING TIME-DELAY SYSTEMS............. 3 2............ 5 2...............................................................................................................................3 4................................................................ 23 INTERNAL MODEL CONTROL.................................................... 4 Traffic..................................................................................................................... 33 SOFTWARE ....................................................... 4 NETWORKS.................... 6 Internet Packet Loss..1 4...................7 Optimisation Criteria ............3 DISTRIBUTED SYSTEMS ................................................................6 4................................................................................................2 3.......2.........1...............................3 5...................................................................................................3 2................................................................................................ 9 SENSOR NETWORKS .............................................................................................................................................................................. 18 ZIEGLER-NICHOLS TUNING .................................................................................................. 12 COMPONENTS OF DELAY ....................................................1 EXAMPLES OF VARYING TIME-DELAY SYSTEMS......................... 8 3 NETWORKED CONTROL .....................................................................................................................................................................................................................................................................................1 5.........................................1.................4...............................................1 3.............................................................................2 4.........................................2.. 24 GAIN SCHEDULING ...................................2 2.....4 RAPID CONTROL PROTOTYPING .......................................................................................................................................1 2................................................. 28 5 MOCONET.....1 4.......................................... 20 OPTIMISATION TUNING ....................................... 4 Tank-Pipe ...... 26 FUSION OF MEASUREMENT PACKETS ..........................................................1..............................................................2 4......................................4............................................................... 21 4.....................IV LIST OF SYMBOLS AND ABBREVIATIONS ............................... 15 4..............Table of Contents PREFACE ..............................2 Transport Belt .................... 31 5................................................................................... 32 USER INTERFACE.............................................................4 DISCRETE-TIME PID CONTROLLER................................ 5 Internet Delay Distribution ......................3 Ethernet and Internet .. 22 Optimisation Criterion Source .........................................................................2.... 13 4 PID CONTROL METHODS.......................5 4............................................................ .....................................................3........................................... 48 6.... 63 7 MOCONET RESULTS...... 62 Results ...............2...............................................................................................................................1......Fully-Distributed System..............................3 GAIN SCHEDULING BY DELAY ................................................................................... 73 REFERENCES ............................................................................ 44 Case 1d ...........2. 47 OPTIMISATION FOR NETWORK DELAYS.....4 6......1 6...... 40 6.................5 6............... 46 Case 2b ...........................................................................Semi-Distributed System ...............................1 6....1 6...............1 DERIVATION OF IMC TUNING FOR EXAMPLE PROCESS .3 7............................................................................................................................................................................. 72 8 9 10 CONCLUSIONS........................................................................................................5............................................5 SENSOR NETWORK ........................................................................................ 69 IMC TUNING ..........................................................................................................................................4 OPTIMISATION TUNING ............... 80 10..................... 50 6.....1...............2 7.............................................................................................Sinusoidal Delay .....1 7.........5 5.............................................. 45 Case 2a ........ 59 6.........................................Constant Delay....................................... 43 Case 1c ........3 6....................... 59 Ziegler-Nichols Tuning ...............................................................Constant Delay................................................................................ 68 ZIEGLER-NICHOLS TUNING ...........................5....................................................... 70 CONCLUSIONS OF TEST RUNS........6 6.........................4 6..........5.............................................................1 6................. 53 Case 4b – Sinusoidal Delay Change ......................2 Case 4a – Step Delay Change ............................................................................................................................. 40 6........................1.................... 51 6...........................2 6.............3...............................................................................................................................Random Delay................ 80 10......................2 6.........................3 6....................1...... 37 EXAMPLE PROCESS ..... 42 Case 1b ..........1....5..... 55 TUNING FOR EXAMPLE PROCESS .......................................................................Random Delay............................................................... 38 OPTIMISATION AND SIMULATION RESULTS ..............................................1.............. 81 v ..................................................6 6 NETWORK SIMULATOR .............. 67 7...............2 Case 3a .....................................2 RESULTS FOR EXAMPLE PROCESS ..................5..................2 Case 1a ...............................4 Optimisation Tuning.............................................................................................................................................. 62 IMC Tuning ......................................1 OPTIMISATION FOR DIFFERENT DELAYS ...................... 54 6......State Delay....... 76 APPENDICES........................................ 48 Case 3b ........................ continuous.and discrete-time Process output.and discrete-time Tuning parameter of IMC controller Time-delay vi . y[k] λ τ Derivative gain of PID controller Error Transfer function of process Transfer function of controller Transfer function of filter Sample time Integration gain of PID controller Cost function Gain of PID controller Time delay Filter coefficient for discrete-time derivative Proportional gain of PID controller Probability distribution Time constant of first order process Derivation time of PID controller Integration time of PID controller Integral part of control signal of PID controller Derivative part of control signal of PID controller Proportional part of control signal of PID controller Control signal.List of Symbols and Abbreviations Symbols D e G(s) Gc(s) Gf(s) h I J Kp L N P P(x) T Td Ti ui ud up u(t). continuous. u[k] y(t). 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 . just new tunings to fit for the varying delay. In networked control systems the network can not offer such a high bandwidth to transmit the measurement and control packets.g. Conventional control design can not take the varying time-delay into account. The thesis investigates optimisation in tuning controllers for varying time-delay systems using simulation. new methods are called upon. As the use of Internet grows rapidly. But still simple tuning rules for varying time-delay systems are needed. With a PID controller adequate performance can nevertheless be achieved. With a more complex controller the delay could be explicitly taken into account in the control algorithm. It is also used extensively in the industry (Åström and Hägglund. 2001).. The problem is that the network induces a varying time-delay into the control loop. The problem is hard because the timedelay in NCS often has a stochastic nature and it is difficult to approach it analytically. A PID controller structure is selected to control the system as it is easy and intuitive to tune. The traditional local control loop is expected to expand to tomorrow’s control over large communication network with variable delay times (Katayama et al. Dynamic programming has been proposed for controlling varying time-delay systems (Lincoln. In some new applications these luxuries are not always available. so that the discrete-time controller approximates a continuous controller. since it does not require new control algorithms. 1995) and there is a benefit of using a well-known and trusted controller in future applications. The idea to extend control loops over the Internet or over standard Ethernet networks has come up and this direction is being researched widely. This is a simple and desirable solution. This is acceptable if there is enough computing power and signalling capacity. The energy source and 1 .1 Introduction Control theory is extending to new areas. Zhang et al. which has to be taken into account in control design. and better results could be possible. 2003). The sampling frequency is set sufficiently high.. In modern industry where discrete-time PID controllers are used the controllers are tuned as if they where continuous controllers. as there usually is. Networked control systems (NCS) are researched and some results have been achieved (e. 2005). more use for it has emerged. including the delay distribution of the Internet. 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. Development and comparison of data fusion methods in NCS. conclusions are offered in Chapter 8. as well as the theory they are based on. Verification of the simulation based tuning with a real process using the MoCoNet system. Then networked control systems are explained in Chapter 3. Tuning rules for a first order system with several varying delays. In these applications one has to enter the true discrete-time domain by lowering the sample frequency. The optimisation tuning method is applied in a general case for a first order system and for a certain example process in Chapter 6. 2 . such as robots and autonomous devices. The main contributions of this thesis are: Modification of the optimisation and simulation based tuning method for discrete-time PID controllers in NCS. and the problems they produce to the control loop are pointed out. Finally. Development and implementation of the MoCoNet system for investigating NCS with rapid control prototyping. As the controller works in the discrete domain the tunings are done as a function of sampling time. The results and methods. These results are finally tested and verified on a real process in Chapter 7 with the developed MoCoNet platform described in Chapter 5. Reijonen’s (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. 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.the computing power are often limited on mobile devices. In most cases such a delay is negligible. computations of the control signal and the limited speed of the measurement sensors.g. Often it is quite small resulting from sampling.or state-dependent. but in some cases they are time. because of the transmission delay.1. A process can have an inherent time-delay. Some simple types of varying time-delay systems are explained in the following sections. These delays can be constant. The nature of the delay depends on the network type. First some physical example systems are given. A time-delay is also introduced into a control loop when the loop is over a network. such as in the examples in the following subsection. On the right: the undelayed process and a delay caused by e. 2. 3 . time. The network can be anything from an industrial control network to even Internet. This complicates the situation from the control design point of view. The control loops are similar.g.or state-dependent or random.1 Examples of Varying Time-Delay Systems Varying time-delays can arise in several ways in control loops. In the following subsections examples of systems with varying time-delays are given. These are usually longer and give the process its particular character. Such delays stem from dead times such as transportation lag. network.1: On the left: the delay as a part of the process.2 Varying Time-Delay Systems In every practical control loop there is a time-delay. but in the latter case one can talk about an undelayed output variable that is to be controlled whereas in the former case the delayed output is to be controlled. Other delays can be caused by the process itself. This delay can be e. and then a network is yr e Controller u Process L(t) y yr e Controller u Process y Reference1 Reference L(t) Figure 2. or the control loop can induce the time delay when controlling a process over a network. both depicted in Figure 2. 2 Tank-Pipe Consider a pipe with length L at the bottom of a fluid filled tank.1. Qin(t) can be considered an outer disturbance. Then the water flow.1 Transport Belt A transport belt transports the inflow of material Qin to the outflow Qout with the speed v. h. If the belt has a variable speed.3) A real example with similar setup is described in de Prada et al. (2005) with a heater in the tank. The input-output relationship can then be described as: Qout (t ) = Qin (t − τ ) . (2. The delays are identified from the example systems and their mathematical formulation is given. 2. due to the pressure difference of the air at the pipe outlet and the water pressure at the pipe inlet. The temperature of the fluid in the tank is controlled by measuring the temperature of the fluid coming out of the outlet pipe. L. Suppose that the tank is filled from above.1. h. the delay is timedependent: τ (t ) = L / v(t ) . Q. (2. The pipe flow.3 Traffic In urban traffic the queue lengths can be expressed as continuums. that is: τ ( L) . 2.2) 2. and the delay is expressed as: τ (h) = LA / Q(h) (2. In the pipe the velocity of the flow is v = Q / A .described as a stochastic varying time-delay system. If the belt has a length L the material at the end of the belt will reach the other end in the time τ = L/v.1. 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.1) where τ is the time-delay. Define un (t ) (≥0) to be the length of the cars 4 . of the fluid in the tank. 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. is a function of the height. The water level in the tank varies with time. where A is the cross section area of the pipe. according to Bernoulli’s law. 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. 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.1 Ethernet and Internet Other networks than industrial can also be used. This eases the design of control algorithms as stable operation can be determined with certainty.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 light’s queue.2. One attractive alternative is to use Ethernet. The delay is managed by token-ring. is then the difference dt between the cars reaching the light from the previous light and passing on green light dLn (t . the timeslot being periodical. The delay is thus state-dependent. The change in queue length. If consecutive collisions occur the fallback time increases exponentially. The information in the networks is transmitted as packets. a function of the system state. dt (2. Ln ) = un −1 (t − τ ( Ln )) − un (t ) .passing a light. The industrial networks used in automation are usually deterministic and they can guarantee certain reliability and time-delay bounds. i. k.e.2 Networks A network can be used to interconnect the components of a control loop. The downside is that Ethernet has an exponential fallback during collision. which is well known. 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. L.5) 2. dLn (at light n). The distance for the cars to travel is D subtracted by the queue length. Special care has to be taken in the control design to ensure stability 5 . The time-delay is then τ ( Ln ) = ( D − Ln ) / v . If two nodes try to transmit simultaneously there is a collision and both wait for a random time. 2. (2. cheap and easy to install because of its wide usage in computer networks. 1998). Either the control loop has to cope with the delays or the Ethernet can be improved to ensure real-time performance (Alves et al. where the packets play the role of the cars and the routers those of the traffic lights. If the link is highly utilised (used by others) the delay distribution approximates an exponential distribution (Cao et al.2 Internet Delay Distribution The control loop can be extended to several Ethernet busses or even to the Internet. The Internet resembles the situation of the traffic lights.because of the exponential fallback. To model a network with correlation a Markov chain can be used (Nilsson.2. so that the queue lengths etc. The delay can rather be modelled by a statistical distribution. (2002) is the Weibull distribution. α (2. Delay at time k is τ (k ) ∝ P( x) and P( x) = λ e− λ x is the exponential distribution function with x being a random variable. It is however not feasible to count the packets. The delay at the router queue is determined by the waiting packets and the router’s throughput. have time to change between the packets. The assumption holds if the packets are transmitted sufficiently far apart.7) 2. 2000). β the scale parameter and x a random variable. given by P( x) = αβ −α x n −1e− ( x / β ) .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. In a Markov chain several delay distributions and a matrix expressing probabilities to change from one distribution to the other are defined. The expected delay for a packet in an Ethernet bus is statistically random.. One statistical model for the delay according to Cao et al. 6 . This is a special case of the Weibull distribution with α = 1 and λ = 1 / β. (2. where α is the shape parameter. 2002). This is not the only requirement since the delay is usually also dependent on the utilisation of the network and the utilisation changes. 8) where Γ is the gamma function Γ(n) = ∫ t n −1e − t dt 0 ∞ (2.11) where Tstatic is the minimum delay for the network and Tstochastic the stochastic delay induced by other traffic. the distribution has to be shifted by this amount to the right to get the correct minimum delay.2 shows the gamma probability distribution function for n = [1. (2. Another assurance of the correct conclusion was that parameters of the gamma distribution could be identified with properties of the network. the delay distribution has been shown to resemble a shifted gamma distribution in a study by Mukherjee (2001). where T is the mean delay. 7 . Figure 2. α = n / T. approximated with the gamma distribution. similar to the gamma distribution.9) and n (the shape parameter) is the number of hops between the first and last node. If a delay distribution is used for characterising a network. The plots showed that the delay data gathered and the statistical model had the same probability distribution. The total network delay consists of a static and a stochastic component Ttot = Tstatic + Tstochastic . (2. Typical network delay distributions have a peak and a long tail. such as the number of hops. The gamma distribution is also a generalization of the Weibull distribution encountered earlier. With n = 1 the distribution becomes exponential and is the distribution of a (one hop) Ethernet bus. The minimum delay thus shifts the graph to the right and results in the total network delay distribution. The variance of the gamma distribution is σ 2 = n /α 2 = T 2 / n . 10] with mean delay T = 1. where the gamma distribution model was statistically verified with quantile-quantile plots.10) Every network has a shortest possible delay.In a network such as the Internet. The gamma probability distribution function is given by P( x) = α Γ ( n) (α x) n −1 e−α x . (2. This probability decreases as the time difference between the packets is increased.4 0. If the first packet is dropped due to a queue overflow.4 1. The assumptions are thought to hold simultaneously.5 3 3.5 1 1.6 0.5 4 Figure 2. consider two packets sent right after one-another.2: Gamma distribution for n = 1. A packet loss can be modelled with an infinite delay.g.5 2 x 2.2. The packet loss is random and independent of the delay according to the investigation of Bolot (1993). 2. 10. This is logical.10 1.2 1 0. …. T = 1. TCP/IP) lost packets are retransmitted.. The 10% constraint is a similar assumption made when modelling networks with delay distributions. In some protocols (e. which causes extra delays.Gamma distribution n = 1. the second packet will probably also be dropped.3 Internet Packet Loss In computer networks such as the Internet the packets can also get lost.8 P(x) 0. if the packets are sent sufficiently far apart and the packets take up less than 10% of the links’ capacity. In practice a packet is lost when the delay exceeds a certain threshold. 2. 8 .2 0 0 0. or is declared lost when the information in the packet is outdated. The loss is due to transmission errors and queue overflow at the routers. 1 Distributed Systems In distributed systems the controller and process are physically separate and connected with a network. as of-the-shelf Ethernet networks and the Internet can be used. 9 .1.1: Fully-distributed NCS where controller. The process variable (y) to be controlled is measured and the measurement is transmitted to the yr e Controller u L(t) Actuator Process y Reference Network L(t) Sensor Figure 3. The measurement and control signals are sent over the network as seen in Figure 3. Work in the field is reviewed in Zhang et al. There are two network induced varying time-delays in the control loop. The properties of the network such as delay and packet loss must be considered when designing the control strategy. 3.3 Networked Control Nowadays there is a trend in the research of control theory to investigate control loops that are stretched over a network. actuator and sensor are distributed and connected with a network. where a fully-distributed NCS is shown. The mentioned properties impose restrictions and difficulties in the control loop that are not present in traditional control loops. In networked control systems (NCS) the process and the controller are connected to each other by a network. (2001) where a more practical view of NCSs is given and results on the control loop stability are presented. The benefits include more flexible control loops and cheaper hardware. In this chapter the general structure of a networked control system is described and the characteristics and problems are illuminated. It is of assistance to design the control strategy by identifying how the control loop is structured and where the network comes into play. controllers and actuators can be scattered in a network to control some large process. In this thesis everything is time driven. 10 . each affecting everything else. right.controller via the network.2: Semi-distributed system where measurements from a sensor are sent over a network to the controller and actuator node. and calculates the control output (u) based on the error signal (e). This leads to a constant sampling time. The control system can also be semi-distributed. where the controller tries to control a process without delay by delayed measurements. The controller output is transmitted over the network to the actuator that acts on the process to adjust the controlled variable. with the controller situated at the actuator as in Figure 3. The measurement is done at a distance. The sensors. The controller compares it with a reference (yr). There can be several control loops in a distributed system. 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.3 illustrates a wireless sensor and actuator network. In this case the actuator is also event driven and is triggered as soon as the control packet arrives at the actuator (Nilsson. In the event driven case the controller calculates a new control value when a packet reaches it.g. This is the situation in Figure 2. possibly at the other end of a large process (e. The network sends the measurement and control signals as packets.2. Figure 3. paper machine). 1998).1. The controller can be event or time driven. The sensor is usually time driven and sends periodically measurement packets to the controller. the desired response. The control signal is calculated locally at the actuator. yr e Controller u Actuator Process y Reference Network L(t) Sensor Figure 3. which contains all the packets travelling in the network (Figure 3. 2001). controllers and actuators in a distributed wireless (ad-hoc) network. The network delay can be thought of.4: Simulation of a network delay with an output variable delay switch. 11 .4).Figure 3. This is how the network is simulated in this thesis. as an output variable delay (Ekanayake et al. and implemented. 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. Delay Line -1 Z Z -1 Z -1 Z -1 Z -1 Delay distribution Delay selector Figure 3. The routes can also vary on the fly in case of an ad-hoc network. in a delay line..3: Sensors. At every time step the packet leaving the network is selected with a selector pointing at a random location. according to a delay distribution. Topics in distributed systems not discussed in this thesis are efficient transmission protocols. The distinction is that they have several sensors measuring the same process variable. 12 . but rather incorporate it indirectly by a design that is robust to the variations. There could. If the delay variations fit inside the sampling time the variation is not noticeable and can be neglected. The varying time-delay from the network can be converted to a constant delay with a sufficiently large buffer..7. 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 measurements are transmitted and fused together before the controller calculations as depicted in Figure 3. Extensive research on sensor networks is done in the fields of control. In this case the controller can be tuned for a constant delay. Figure 3. but the delay raised by the buffer can be too large for a decent control performance. 3. Therefore one is guided to solve the control problem with a variable delay. 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. The fusion can be done in several ways and these are further investigated in Section 4.Old packets are filtered. 2005a and 2005b). This leads to a simpler controller tuning. Intuitively the controller should take the network delays into account or compensate for them in order to have a good closed-loop performance. see Chai (2005) and delay compensation with prediction (Liu et al. but here it is assumed that these phenomena are significant. speed and routing problems.3 illustrates fusion done in a distributed manner in a sensor network. be a protocol that would minimize the packet delay and the drop-out so that they could be neglected in control design. for instance. reliability and security.5. Simpler methods may also result in good performance even if they do not take the explicit delay variance into account. automation and robotics.2 Sensor Networks Sensor networks are similar to the networked control systems described in the previous section. Delays are taken into account in model predictive control (MPC). τs.5: Fully distributed sensor network where measurements from several sensors are sent over a network to a fusion unit and further to the controller. The network delay is variable and can be several sampling times long. which is the delay for the packet to traverse the network.6. The network delay. 3. which incorporates the time it takes to prepare and send a packet. The synchronisation delay.3 Components of Delay The delay in the network (shaded area of figures above) can be separated into three distinct components: The processing delay. τp. τn. The synchronisation delay is only in time-driven systems. In this case the delay can be thought of as infinite. in event-driven systems the packet is processed upon reception and the synchronisation delay is omitted.2. The figure reveals also a lost packet. The different components of the delay are illustrated in Figure 3. such as calculating a new control value in case of a controller or taking a measurement in case of a sensor. The network delay is analysed in more detail in Section 2. 13 .yr e Controller u L(t) Actuator Process y Reference Network L(t) Sensor Fusion L(t) Sensor L(t) Sensor Figure 3. This is the time the packet is queued before the next processing period where it is used. 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 . 14 . (3. 1998).6: Components of delay in time-driven systems. (3. τ cl . The varying delay can change the order of the packets as is the case for the second and third packets in the figure.2) where both τsc and τca incorporate the three delays introduced above (τtot) (Nilsson. This can be done by using timestamps.1) The total delay of the closed loop. The synchronisation delay satisfies τ s < h as it rounds the total delay to the next time-step. It is better not to use the most recently received packet. In other words τ tot = τ p + τ n + τ s = nh . but the most recently sent packet to get the most up to date information.h Sender τtot = ∞ Network Receiver τp τn τtot τs Figure 3. n ∈ ` for time-driven systems. Some work has been done for formulating optimal control for networked systems with long random delays (Lincoln. 2002). Some fusion strategies are presented in Section 4. Networked control systems almost demand algorithms like MPC. model predictive control (MPC) and delay compensation can be used (Chai. 2003). In this chapter the discrete-time PID controller is derived. because the process model has the delay as a dynamic or stochastic component. See references in Tipsuwan and Chow (2004) for other methods. 1995)..g. 2005b). but in practice the control loops turn out to be stable. but it is simple to tune. but in some cases a simple and well performing PID controller can be set up with considerably less effort. Some practical aspects that have to be considered in PID controller design are put forth. Robustness is not taken into account with the tuning rules presented here. For sensor networks the fusion of measurements is also considered for control with a single-input-single-output controller. The system can be analysed with simulation tools such as Jitterbug and TrueTime (Cervin et al. and adequate performance can nevertheless be achieved (Åström and Hägglund. 2005). Stability is not guaranteed. In the case of varying time-delay systems the control strategy is hard to analyse with standard analytic control theory. or MATLAB/Simulink. Analytical tuning methods such as pole placement can not be applied. 2005a. (Liu et al.4 PID Control Methods This thesis aims at investigating PID controller design methods for processes with varying time-delays. The PID controller does not usually take into account the changing delay of a varying time-delay system. Then some tuning methods that can be used for processes with varying time-delays are introduced. For more advanced control algorithms e. The stability and robustness of the control loop is hard to guarantee with unexpected long delays..7. Controller tuning can be done based on simulation. 15 . It is later used to control a distributed system. The controller does not explicitly take the varying time-delay. The weights of the controller’s actions are adjusted with the P. The plant poses some guidelines and restrictions on the controller. I. PID controllers are used extensively in the industry as an all-in-all controller. (4.1) becomes GPID ( s ) =  U (s) 1 = K p 1 + + sTd E ( s) sTi   I  E ( s ) = P + + Ds . into account. s  (4.2) between the reference signal (the set-point). with L(t) = 0.4. Td and P. D are related by: P = Kp I = K p / Ti . the integral part (ui) removes the steady-state error and the derivative part (ud) reduces the overshoot. y(t) of the controlled process as in Figure 2.1) where e(t) is the difference e(t ) = yr (t ) − y (t ) (4. The textbook version of the PID controller in continuous time is t  1 de(t )  u (t ) = K p  e(t ) + ∫ e(τ )dτ + Td  = u p (t ) + ui (t ) + ud (t ) . D = K p Td The controller has three parts: the proportional part (up) is proportional to the error. mostly because it is an intuitive control algorithm (Åström and Hägglund. yr(t) and the output. T dt i 0   (4. which this thesis is dealing with. I and D gains. The choice of controller determines the best possible performance achieved of a well-tuned controller.3) The coefficients Kp.1 Discrete-time PID Controller The controllers used to control processes can have several structures. The choice of the structure determines how well the plant can be controlled.1. In transfer function form Equation (4. it is investigated to see if it nonetheless could be used by selecting a suitable tuning. Since the PID controller is widely used. Ti.4) 16 . 1995). The discretisation is done by computing the error at discrete time-instants. The simplest form is the Euler approximation (forward difference): ud [k ] = K p Td e[k + 1] − e[k ] . ud [k ] .6) is discretised by approximating the integral with a sum ui [k ] = K Ti p ∑ k h e[ n ] .9) which is usually not used since it amplifies random errors. The controller is usually implemented in a computer that does calculations in discrete-time. can be discretised in several ways. tk = kh. (4. In networked control systems a discrete-time version of the controller is needed because the measurements are sent over the network as packets. The integral part (4. (4. with different outcome of the stability and accuracy.7) n=0 This can further be simplified by computing the difference ui [k ] − ui [k − 1] = Kp Ti ∑ he[n] − n =0 k Kp Ti ∑ he[n] n =0 k −1 ⇒ ui [k ] = ui [k − 1] + Kph Ti e[k ] . h (4.5) u i (t ) = K Ti p ∫ e (τ ) d τ 0 t (4.The PID controller is traditionally suitable for second and lower order systems. The proportional part of the controller at time-step k is then u p [k ] = u p (tk ) = K p e(kh) .8) The derivative part. k ∈ ` (with sampling time h). replacing the integral by a sum and the derivative by a difference. 17 . It can also be used for higher order plants with dominant second order behaviour. 10) or in time domain ud (t ) = − Td dud (t ) de(t ) + K p Td . A filtering factor. To avoid this filtering is used. should also be tuned. to smooth out the derivative action of the controller. Traditionally used values range from 1 to 20.13) Other derivative discretisation methods also exist: for example the ramp equivalence (which is more accurate. The filtering constant is often selected on the basis of how much noise there is in the measurements. N.11) A value for N must be chosen. 2002). It has been pointed out that the PID controller with filtered derivative has four degrees of freedom and the filter constant. which leads to ud [ k ] = 2 K p Td N 2Td − Nh ud [k − 1] + ( e[k ] − e[k − 1]) . Td + Nh Td + Nh (4. usually 10 (which is used here) is fine. For the continuous case the filtering derivative is U d (s) = K p Td s E (s) Td 1+ s N (4.4. This is not usually done although better performance can be achieved by tuning N (Isaksson and Graebe. It is clearly seen that with a large N the derivative is reduced to the unfiltered version ( Td N → 0 and with decreasing N the derivative is ) filtered more. where the forward and backward approximations are summed and averaged. 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 ] = K p Td N Td ud [k − 1] + ( e[k ] − e[k − 1]) . 18 . which is present in real systems. 2Td + Nh 2Td + Nh (4.12) Another discretisation method is Tustin’s approximation.2 Practical Aspects of the PID Controller The derivative amplifies noise. but harder to compute). N. N dt dt (4. is introduced. and the derivative is smoothed with a first order filter. In this thesis the backward integral and filtered backward derivative approximations are used (Equations (4. If there are steps in the reference signal the derivative will react unnecessarily on the discontinuity. because then ad becomes negative. Ti 0 dt   (4. A solution to this is to take the derivative of only the process output.1) takes the form t  1 dy (t )  u (t ) = K p  e(t ) + ∫ e(τ )dτ − Td . but it can ring with small values of Td < Nh / 2 .All derivative approximations can be written in the form (Åström and Hägglund. otherwise steady-state error would not be compensated. The PID controller in (4. The backward difference is well behaving. Thus. even with small values of Td. (4. t  1 u (t ) = K p  β yr (t ) − y (t ) + ∫ e(τ )dτ + Td Ti 0   dyr (t ) dy (t )    γ dt − dt   .8) and (4. and is used frequently. 1995) ud [k ] = ad ud [k − 1] + bd ( e[k ] − e[k − 1]) .   (4. Tustin’s algorithm agrees well with the continuous time derivative.15) This can be generalised to set-point weighting where the reference and output are weighted by β and γ before taking the error signal.12)). (4.16) The integral has no weighting. 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 ] .14) The approximations are stable only if a d < 1 .17) K TN Td ud [k − 1] + p d ( e[k ] − e[k − 1]) Td + Nh Td + Nh 19 . A tangent line is drawn at the inflexion point on the response curve. T2.or PID controller is tuned according to a table based on the process response test. Table 1: Ziegler-Nichols tuning table for PID controller.1).125Tu Step response 1.4 Tu 1. and the risetime.1). In the step response test a step is applied on the open-loop system. Method/Parameter Z-N step response Kp 1. Table 1 shows the tuning rules for a PID controller. P and PI controllers have separate tuning rules.5Tu 0.6 u(t) 1.3 Ziegler-Nichols Tuning The Ziegler-Nichols (Z-N) methods rely on open-loop step response or closed-loop frequency response tests. T1.2 t 0 -0. Tu (Figure 4. Ku. In the frequency response method the loop is closed and a pure gain controller is used. The PID tuning is calculated from the Z-N tuning table found in literature such as Åström and Hägglund (1995).6Ku 0. The gain is increased to the ultimate gain. A P-.2 0 1 2 3 4 5 Time (sec) 6 7 8 9 10 Figure 4. when the system exhibits a steady oscillation whereby the oscillation period is measured.2 1 K1 y(t) Amplitude y(t) 0.2 K1 T2 K 2 T1 Ti 2T1 Td 0.1: Ziegler-Nichols tuning with step response test (left) and frequency response test (right).4. The dead-time.4 0.5T1 Z-N frequency response 0. are measured (Figure 4.6 K2 T1 T2 0.8 0. PI. 20 . The optimal tuning parameters. For reference step changes it performs worse and gives for simple systems a damped oscillating response. The optimisation is done here by using a simplex search algorithm for unconstrained optimisation (Mathworks. Load disturbance rejection is achieved with set-point tuning. has its minimum. The tuning is usually bad for higher order systems and can only be considered as a simple first aid tuning. Noise rejection can be incorporated into the tuning by adding noise to the simulation model and penalizing noise in the cost function. There is. 4. such as the Cohen-Coon method.18) The cost function describes how well the system responds to an outer disturbance. however. no discrete Z-N tuning table. The tuning can also be done for load disturbance rejection. Other tuning tables that rely on the same response tests. The disturbance can act on the reference signal. In this thesis a step in the reference signal is the disturbance. is where the criterion or cost function. This measures how well the system follows set-point changes. The cost function is evaluated with simulation. J. There are refinements to the Z-N method to improve the performance of set-point changes proposed by Hang et al. so a simulation model of the process is needed. can also be used to gain better performance. 21 .For a discrete-time PID controller the table should be revised to take the sampling time into account. if the disturbance acts on the process output during optimisation. (1991). Reijonen’s thesis (2003) described how the tuning is done in practice with MATLAB/Simulink and Optimisation Toolbox. where consecutive peaks are ¼ of the previous peak. 2005).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. so Table 1 is used in lack of other. The Z-N method is designed for rejecting load disturbances. so this tuning rule is only used for the shortest sampling times. be a load or measurement disturbance. A discrete-time controller approximates a continuous-time controller at small sampling times. x*. x* = arg min J ( x) (4. but it is not optimal. 20) ITAE J = ∫ t e(t ) dt 0 ∞ (Integral Time Absolute Error). 22 .22) The optimisation criteria are functions of the controller tuning parameters. 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.4. In this thesis only PID controllers are tuned with the optimisation method. The cost is often an integral function of the error. until the system returns to steady-state. The tuning is done in a similar way in Eriksson (2005) with a graphical user interface. where the user can specify a plant. IAE J = ∫ e(t ) dt 0 ∞ (Integral Absolute Error). (4. 4. The integrals are in practice not evaluated to infinity. (4. The optimal tuning is a button click away. The cost can also be a function of rise time. but to large enough time T at which the system has settled down and the error has reached zero. overshoot and settling time or similar measures. whereas the method is applicable to other parameterised controllers as well. (4. can be any. The cost function is consequently modified as in Equation (6. e.21) ITSE J = ∫ te 2 (t )dt 0 ∞ (Integral Time Square Error). select network properties and optimisation criterion.19) ISE J = ∫ e 2 (t )dt 0 ∞ (Integral Square Error). The error. (4.1 Optimisation Criteria The criterion under optimisation can be any measure of the system performance that depends on the controller tuning.1).4. D) . as a disturbance acts on the process. In this thesis they should be written as functions of the PID controller: J ( P. or a combination of those error signals described in Section 4. with the modification that for the varying time-delays many step response tests are performed and the cost is averaged.2. Some well-known cost functions are listed below.The procedure is followed in this thesis. I . The listed cost functions give different optimal results. because the time weight is large in the end.4. The mentioned error integral criteria are minimised. Therefore one can introduce several optimisation constraints that force a given gain and phase margin (Eriksson and Koivo. 4. 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. ITSE) integrals give usually a larger overshoot because they try to minimise the initial large error as fast as possible. right).2. left) and the physical controlled variable is the delayed output. For networked control systems the error cost can be calculated from the output of the process transfer function.2: Different ways of determining the error signal for the cost criteria in varying timedelay systems. The square error (ISE. The delayed output in the feedback loop is simply the process measurements arriving to the controller from the real process at the other end of the e e e Add2 g yr y _ref y (k) u(k+1) Gain Controller Cost num(s) den(s) Transfer Fcn Add Process Cost L(t) Delay Add1 System Cost Reference Controller Figure 4. These error integrals give a slightly longer rise time and a smaller overshoot but also a short settling time. 2005). but no guarantee of the robustness of the response can be made. the “Process cost” block.2 Optimisation Criterion Source The optimisation criterion can be evaluated from several signals as sketched in Figure 4.1. 2005).1. The time integrals (with explicit t in the integral. In the “System cost” block the delay is considered to be a part of the system (Figure 2. Here it is assumed that there is an undelayed physical process which the controller tries to control over the network (Figure 2. (Eriksson. 23 . In this case the control signal must be weighted with the process gain. The optimisation can also include load disturbance rejection. e.5 Internal Model Control The internal model control (IMC) method can be used to select the gains for a PID controller.23) 24 . (2003).3. The IMC method is derived as follows. to compensate for scaling (“Controller cost”block). but they are more complicated. because there are always disturbances and modelling errors. There exist also multiobjective optimisation methods for minimising several cost functions simultaneously. All these cost functions can be summed to one weighted average to form a desired overall cost for the controller tuning. strain on the actuator. A good overview of multiobjective optimisation methods in control systems can be found in Liu et al. The cost functions can depend on overshoot. This is the ideal case and can not work in practise. (4. Additionally. 4. The controller output can also be taken into account in the cost function to penalise excessive control use. Gc ( s ) .g. Therefore a feedback of the error between the model and the process output is introduced as depicted in Figure 4.network. The process to be controlled is denoted by G p ( s ) and a model of it Gm ( s ) . If the controller. integral error criteria and so on. The advantage of the IMC method is that the controller incorporates a model of the process to be controlled. − The process model. is then split into an invertible Gm ( s ) and a non-invertible + ( s ) part. Gm ( s ) . Further studies can be made to investigate tuning with different cost criteria and the resulting optimal responses. The IMC scheme was collected into one framework by Garcia and Morari (1982). g. the model is not always invertible. is set Gc ( s ) = Gm ( s ) −1 and the model is correct then the open-loop response is equal to the setpoint. Gm + − Gm ( s ) = Gm ( s )Gm (s) . because in certain circumstances the IMC controller reduces to a PID controller. These methods may produce better results. settling time. 1) 25 . The controller is then − Gc ( s ) = Gm ( s ) −1 G f ( s ) .25) is a filter with appropriate n to make the controller proper. With elementary block diagram algebra and using Equations (4.24) where G f ( s) = 1 ( λ s + 1) n (4. Gm ( s) .26) This is the IMC controller. λ is a positive tuning parameter that can be manually set to achieve a suitable response.yr e Gc(s) u Gp(s) y Reference Gm(s) ym Figure 4.3 can be transformed into a regular feedback loop (Figure 4.4.23) and (4. With a suitable selection of the filter and approximations of the delay (see Appendix.4) with the model included in the controller (Garcia and Morari.24) one gets GIMC ( s ) = − Gm ( s ) −1 G f ( s ) Gc = . 1982). The non-invertible part is treated as un-modelled dynamics and is handled by the feedback. which 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. Section 10. (4. The block diagram in Figure 4. which is the shaded area of Figure 4. + 1 − GmGc 1 − Gm ( s )G f ( s ) (4. contains all positive zeros and time-delays.3: General concept of internal model control. GIMC(s) yr e Gc(s) u Gp(s) y Reference ym Gm(s) Figure 4. By tuning several controllers for a number of operating points (Figure 4. When the process shifts from one operating point to another a different controller is used.4: Internal model controller with model feedback as part of the controller. which is more difficult to setup and tune. The difficulty is to formulate it as a discrete-time PID controller.5: Linearly approximations around operation points of a nonlinear (static) process. This method can as well be applied to discrete-time systems. output Operating point input Figure 4. The controller will presumably work well near this operating point. 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. 4. 26 . For a survey of gain scheduling techniques see Leith and Leithead (2000).6 Gain Scheduling For a nonlinear process a nonlinear controller is usually needed. the controller can be formulated as a PID controller which is tuned with the IMC method.5) the best suited controller can be used. 2004). The operation point estimator uses usually only the process output. The parameters can be calculated with any tuning method. 1995). 27 .6).In gain scheduling off-line tuned controller parameters are stored in a gain table. An example of using gain scheduling in varying timedelay systems is given in Section 6. such as the optimisation method (Section 4. An operating point estimator estimates the current operating point and the gains of the controller are selected based on the estimation (Figure 4.6: Gain scheduling with operating point estimator that tunes the controller based on the operating point of the process. 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. The gain parameters can be interpolated from the gain table to obtain in-between tuning. or with pole placement with a linearised process model. and the controller parameters are fetched from a look-up table. which indicates directly the operating point.3. 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. Operating point estimator yr e Controller Process y Reference Figure 4.4). (4.4. 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. The weight indicates how trustworthy the measurement is or how well it represents the real value. There are several ways to fuse the incoming measurements from the sensors depending on how much information is available. at different times and sometimes out of order to the fusion block. In that case the measurements are weighted with the maximum-likelihood estimation ˆ= x ∑σ i xi 2 i 2 i ∑σ i 1 . (synchronised) timestamps to order the packets and a process model to perform Kalman filtering.7 Fusion of Measurement Packets In a sensor network described in Section 3. σ2. 28 .27) where xi are the measurements and σ i2 the respective variances.2 the data from the sensors must be fused before a scalar PID controller can be used. The relevant information includes measurement variances or weights. for instance. Table 2b lists various conceivable possibilities for the fusion strategy. The fusion is in the simplest case just a weighted average of the measurements. If the sensors are. the trustworthiness is lower. of the sensor can also be the weight. Since a network is considered here. In a sensor network the measurement packets arrive independently. The estimated variance. spread out and some are in a bad position for measuring. max_t is the highest timestamp and t is the timestamp of the measurement the weight is calculated for. 2 No timestamp 3 Timestamp Every sensor has its own timestamp. The weight is from different sensors calculated as ec (max_ t −t ) . Case Information Description Strategy 1 No information No information available. Measurements can be compared for order. Take one arbitrary measurement as the fused value. 4 Synchronised timestamp The sensor’s timestamps are synchronised. No timestamp available. Take the weighted average of only the newest measurements. Measurements can be compared for order.Table 2: Strategies for fusion. Take a weighted average of the received measurements. Find the most recent measurement(s). Weight or estimate of measurement variance available. from different sensors (highest timestamp) received 5 Synchronised timestamp The sensor’s timestamps are synchronised. where c is a constant that controls how fast the influence of old results should decay. Weight the measurements based on their delay to the newest received measurement. 29 . Take a weighted average of every sensor’s received measurements with highest timestamp. process model timestamps. 30 . Kalman filtering with packet dropouts in sensor networks with two sensors is investigated in Liu and Goldsmith (2004). P (Distributed Kalman Filtering). process model stamps a model of the every sensor and fuse the esti- 7 Synchronised timestamp + Same as above but with synchronised Calculate a weighted average with one of the above methods and use a Kalman filter to estimate the measured variable (Centralised Kalman Filtering).4. Construct a Kalman filter for mates according to their Kalman covariance. 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. Cases 1-5 are compared using simulation in Section 6.6 Timestamp + In addition to timeprocess is available. 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). 5 with the tuning methods presented in Chapter 4 for a process attached to this platform. A student can for example run a process over the Internet from home or on the spot. where one laboratory process is run and studied with the MoCoNet platform. The laboratory course at the Control Engineering Laboratory of Helsinki University of Technology has been upgraded during the past years. Another educational goal is to show the influence of a varying time-delay in control loops. The scientific objective of the platform is to test and validate control algorithms on real processes. Universities could even co-operate to offer their laboratory processes to students all over the world. A network simulator (NetSim) was added to the system to enable the study of network induced delay in control loops. One expansion to the course has been done by the author with the development of the MoCoNet platform. The platform consists of a few server computers located in the laboratory. This feature is used in this thesis in Chapter 7. The platform is described in the following sections and in depth in Pohjola et al. The use of the platform for the laboratory course is that the students can monitor and run educational laboratory processes over the Internet. The MoCoNet platform supports RCP. The testing is done by a methodology called rapid control prototyping (RCP). Other remote laboratories 31 . which is described in the next Section. The educational objectives are to make the laboratory processes easily available to students at anytime and anywhere. where a simulation model of the control algorithm is automatically compiled into executable code and run on real hardware. The control loop can be one of the networked control systems presented in Chapter 3. (2005). with some server software and a graphical user interface applet. Discrete-time PID controllers are tuned and tested in Section 6.5 MoCoNet MoCoNet stands for Monitoring and Controlling Laboratory Processes over Internet With this platform control algorithms for networked control systems can be tested. 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. The key point with RCP is that the controller model can be automatically compiled into executable code to be run on the real system for experimental verification.have also been developed in the academic world. 32 . E.1 Rapid Control Prototyping The concept rapid control prototyping (RCP) is a method for quickly testing new control algorithms or techniques on real hardware.g. as used on the real hardware.1 starts. Several hazardous tests can be done with the simulation model without risk for the hardware. This leads to faster iterations in the design process. If the controller performs well in the simulation model it can be tested on real hardware. 5. Greater understanding of the system can be gained with the simulation model assisting the design of the controller. each with a different mix of techniques. A report how control strategies are developed with RCP using MATLAB in the automotive industry is in Hanselmann (1996). The controller algorithm is first designed. Vallés et al. and then it is tested with a simulation model. (2005) discusses MATLAB based techniques and WinCon software to connect to a real plant. otherwise the controller is revised. In RCP a model of the process to be controlled must first be modelled and validated. The advantages of RCP are that no laborious and error prone coding need to be done and the controller can easily and quickly be tested in a real environment. The controller is first implemented as a model in a simulation environment of the whole system. Exactly the same controller is confirmed to work at least in simulation. After the initial modelling the RCP procedure depicted in Figure 5. 2 User Interface For a user. The MoCoNet platform uses rapid control prototyping for testing controllers on real hardware. 33 . The process is described in detail in Section 5. The user interface is shown in Figure 5. (2004) gives a tutorial for implementing RCP with MATLAB. controller and controller parameters (controller tuning) and network type. The control loop is shown and several setup parameters. may be selected for a run.6. the only visible part of the MoCoNet platform is the graphical user interface (GUI) that is implemented as a web page. The users can upload their controllers implemented with MATLAB/Simulink to the MoCoNet system.Controller design Test Simulation model Good? No Yes Change Real hardware Test Executable Compile Figure 5. The GUI is a Java applet and it works in any Java enabled web browser on any operating 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. With the GUI of MoCoNet it is possible to monitor and control in real-time processes that are connected to the system.2. Hölttä et al.1: Rapid control prototyping design loop. 5. In the tutorial it is shown how RCP can be implemented on the same example process that is used in this thesis. such as: reference signal. a Java applet for MoCoNet. 34 . In Figure 5.2: Graphical user interface.3.Figure 5. Previously performed experiments and collected measurements can be loaded and observed with the GUI’s scope. The process is simple. The figure shows that multiple signals can be tracked at once and that e.g. the results can be saved to a file. a laboratory process is monitored with the scope. but it is difficult to control because of a varying network delay. Figure 5.3: Scope of the MoCoNet user interface. collecting all the data into a database and configuring the network simulator. The measuring and controlling software of the physical process is run on a computer equipped with MATLAB xPC Target real-time operating system (RTOS). All these three programs can be run independently on different computers for scalability. The control permission reservation system is a part of the ProcessServer. A RTOS is required since otherwise it would not be possible to guarantee well-timed sampling times. The SignalServer listens to process measurement and control messages that flow in the local network and transmits them to the remote location applet. The server software consists of two Java programs: ProcessServer and SignalServer.5. This corresponds to the fully-distributed control system shown in Figure 3. and enables the user to control processes from a remote location. but the measurement unit. The SignalServer incorporates a DatabaseServer that stores the measurements in a Microsoft Access database located on the server for recollection of done experiments. 35 . Information of the available processes and the controllers are stored in a database with data of previously done experiments. 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. If the user in control releases the control of the process. running a reservation system for controlling processes (which user can run which process and when).3 Software The server software is responsible for maintaining connections between users and processes. The ProcessServer serves the user interface applet called ProcessControl. the control is passed to the next user on the reservation list.1. 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 reservation system maintains a list of all clients that have requested to control a process.4. The controller is implemented on the same computer as the measurement and actuator unit. This combination of MATLAB toolboxes allows easy prototyping of control software (RCP). which is also used for uploading the process control models with tuned controllers into the xPC Target computer. The host PC can be used for compiling Simulink models into executable code and for uploading the code into the target PC. The computer runs the Java server software. start and stop messages can be transmitted through the MWS to run the real processes. introduced in the previous Section. 5. The physical architecture of the implemented system is presented in Figure 5. The computer is used for executing compiled C code including. The router acts as a gateway and firewall to the Internet. The code is automatically generated from Simulink models using the Real-Time Workshop and the xPC Target Toolbox. controller algorithm. One computer. 36 .4: Control loop separation. It is equipped with an I/O board connected to the process. Once the model is uploaded. because the xPC Target computer can be configured from this host. The server computer is also called the xPC Host. and maintains the system database. all connected to an 100 Mbps Ethernet router. The server side Java programs are connected to MATLAB programs through the MATLAB Web Server (MWS) interface. and I/O functions. The process-end computer called xPC Target runs on the MATLAB xPC Target RTOS.5. UDP packet sending and receiving. acts as a server for the users.4 Hardware The system contains three physical PC’s.NET SIM MEASURE CONTROL NET SIM ACTION P R O C E S S Figure 5. among other things. the xPC Host. . DB xPC Host Process 1 Process 2 . 5. When the network simulator receives a packet.User 1 ProcessControl ProcessMonitor .5 Network Simulator One of the objectives of the MoCoNet platform was to show the control properties of a networked system with varying delays. according to the simulation model. Therefore the network visible to other modules is simulated with a network simulator.5: Physical layout of the MoCoNet server side computers and users connected to the MoCoNet server. All control and measurement packets in the control loop are transmitted via the network simulator. The delay of the used Ethernet network (approximately 1 ms) is considered insignificant with respect to the simulated variables. The network is simulated with a separate desktop PC with the QNX real-time operating system connected to the LAN. The delay for control and measurement signals could be generated using long wires.. For comparison it should also be possible to replicate the delays occurring during the experiments. User N ProcessControl ProcessMonitor Internet Gateway LAN RTOS xPC Target NetSim Server. However. for educational purposes the network properties should be easy to vary in order to show the effect of each property. it is dropped with a certain loss probability. for example in this case the messages could be sent back and forth in the Internet. Process N Figure 5.. If the loss filter is passed. the delay is 37 .. This is because UDP packets have a low latency when compared to TCP communication. Multicast UDP/IP is used for transmitting measurement and control packets in the local network. or the packets could be routed through the Internet for a real test.1) R1 R2 ( C1C2 + C1C3 + C2 C3 ) s 2 + ( R1 (C1 + C3 ) + R2 (C2 + C3 ) ) s + 1 With the component specifications 38 . The transfer function of the circuit can be derived to G ( s) = sR2 C2 + 1 . The circuit diagram is shown in Figure 5. it would be possible to realise all the modules on a single physical computer as separate components or processes. Another thread of the software is responsible for transmitting packets back to the network.6. including the gammadistribution of Section 2. 5. The circuit consists of resistors and capacitors.2.randomized from a selected distribution. Because the network is simulated. The simulated network properties are configured remotely by the xPC Host server computer on the command of the user. The delay distribution can be one of several. (5. It was chosen because the time constants of the process are closest of the available processes to typical internet delay times. It is used in this thesis as an example process. and there is no need to know what other modules belong to the network. the network simulator could be replaced. Test runs are done with the process to verify the tuning methods on a real process in Chapter 7. using a specific UDP port. the modules are separated both in hardware and in software to enable testing of different tools and to allow easy modification of the system. This enables the demonstration of the impact of the network on the control loop with realistic values on the network parameters. a retransmitting timestamp is calculated and the packet is put to queue to wait until the real-time clock reaches the timestamp. However.g.6 Example Process One of the processes attached to the MoCoNet platform is an electric circuit. as multicast messaging is used. e. 228s + 1 (5.2) the numerical transfer function becomes G ( s) = U out ( s ) 0. = U in ( s ) 0.68µ F C3 = 0.3) C2 R1 R2 Uin C1 C3 Uout Figure 5. 39 .311s 2 + 1.R1 = 820k Ω R2 = 680k Ω C1 = 0.33µ F (5.6: Circuit diagram of example process.33µ F C2 = 0.4624 s + 1 . the PID controller is tuned for a real example process by simulating. As the systems are investigated as a function of controller sampling time and process time constant the investigation of step size is not conducted for clarity. They have therefore long sampling times which do not approximate the continuous case. The first cases are a continuation of Reijonen’s work (Reijonen. concentrating on the impact of the sampling time of the controller. as they are implemented on computers or mobile devices with limited computing power and network bandwidth. The main emphasis of the results is on the optimisation method. 6. The total ITAE cost is thus 40 . so they depend also on the size of the step in the step responses. or from a communication network. where she investigated the optimal tuning of a continuous-time PID controller in varying timedelay systems. The impact of sampling time and different delays are investigated in cases 1-3 with the optimisation tuning technique. Several unit-step responses are simulated and the average cost is calculated to even out the randomness of the delay. The tuning is then verified on the real process in the next Chapter using the MoCoNet platform.4 with the ITAE cost criterion. on a step response. These systems were earlier impossible to tune for a tight and fast control loop. tuning with the optimisation method for network delays is presented. Here the optimal tuning for the same processes with a discrete-time PID controller is inspected. Next. 2003). The goal is to assess which tuning is optimal for different cases of varying time-delay systems. Some examples and comparisons of various tuning methods for a discrete-time PID controller are done later in this chapter. Finally. The gain scheduling and other tuning methods are then examined. The controllers are usually discrete-time. Similar results as in Reijonen (2003) are expected.1 Optimisation for Different Delays The PID controller is optimised with the tuning method presented in Section 4. They can either stem from the process itself.6 Optimisation and Simulation Results Processes controlled nowadays can have various delays. such as transport delays.21). Systems with state-dependent varying delays are not linear. Equation (4. The time between the steps is ten seconds (M = 10). I . The PID controller is implemented as in Equation (4. The random delay is uniformly distributed between 0. yr e PID Controller 1 Ts+1 Process L(t) y Delay Reference Figure 6. The step responses are done from 0 to 1 and back down to 0.3) For the constant delay L = 1. D) } dt .2) The process is augmented with a varying time delay. c) time-dependent or d) state-dependent. D ) = 1 nM {( t mod M ) e( P.1. Ts + 1 (6. I .8.2] τ (t ) = sin(t ) τ (t ) = x(t ) (6.1.1) where n is the number of steps and M is the time between the steps. On the step down the delay is the other way round. The delay can be a) constant. b) random. The respective delays used in these cases are described by a) b) c) d) τ (t ) = L τ (t ) = rand [0.2. n ∫ 0 (6.17).8 and 1. first large and then decreasing towards no delay.J ( P. but at the step down sin(t) is in another phase and the delay is nonzero. increasing and approaching one as the process settles down.. 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. as shown in Figure 6. L(t). The time-dependent delay will also be zero in the first step. The delay changes every other sampling period. 41 . The process is a simple first order system with time constant T and transfer function G(s) = 1 ..1: Model of a system with varying time-delay. The first step is at t = 0. 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. 6.1.1 Case 1a - Constant Delay First, the PID controller is optimised for a constant delay in the process. These results, shown in Figure 6.2, are for reference and are compared to the other cases of delay types in the following Sections. G(s)=1/(Ts+1)e-Ls L = 1 6 4 P 2 0 10 5 T 0.2 0.4 h 0.6 0.8 I 0.6 0.4 0.2 0 10 5 T 0.2 0.4 h 0.6 0.8 2 Cost 0.8 D 1 0 10 5 T 0.2 0.4 h 0.6 4 2 0 10 5 T 0.2 0.4 h 0.6 0.8 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. 6.1.2 Case 1b - Random Delay Now the constant delay is turned into a random delay (Equation (6.3) b) with the same mean value as in the constant delay case. The tuning is expected to be somewhat different because of the replaced delay type. G(s)=1/(Ts+1) Delay: L(t) = random[0.8...1.2] 6 P 4 2 0 10 5 T 0.2 0.4 h 0.6 0.8 I 0.6 0.4 0.2 0 10 5 T 0.2 0.4 h 0.6 0.8 2 1 0 10 5 T 0.2 0.4 h 0.6 0.8 Cost D 4 2 0 10 5 T 0.2 0.4 h 0.6 0.8 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. 6.1.3 Case 1c - Sinusoidal Delay In this case the time-delay varies like a sinusoid according to Equation (6.3) c. The results are shown in Figure 6.4. G(s)=1/(Ts+1) Delay: L(t) = |sin(t)| 8 6 4 2 0 10 5 T 0.2 0.4 h 0.6 0.8 P I 0.8 0.6 0.4 0.2 0 10 5 T 0.2 0.4 h 0.6 0.8 3 Cost 0.8 2 D 1 0 10 5 T 0.2 0.4 h 0.6 3 2 1 0 10 5 T 0.2 0.4 h 0.6 0.8 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 8 I 0. With the lowest sampling time all the above results are similar to Reijonen’s work. 6. h.State Delay The same system is now optimised with a state-dependent delay according to Equation (6.6 0 10 5 T 0.2 0.8 Figure 6. P.4 h 0. At the up-steps of the cost the parameters are smaller.Some sampling times suit the system better: the cost goes in steps.6 0.4 Case 1d . which considered the continuous-time case.2 0.2 0. and controller sampling time.2 0. 45 .6 0. I. since with short sampling times the discrete-time PID controller approximates the continuous-time PID controller accurately. The D term is a little larger for small process time constants and varies less than in the constant case. G(s)=1/(Ts+1)e-Ls L = |x(t)| 6 4 P 2 0 10 5 T 0. The tuning is again similar to the constant case. consequently a slower and more cautious response is tuned at those areas.4 h 0.2 0 10 5 T 0.8 4 1 2 D 0 10 5 T 0. This is expected.6 0.4 0.5: Optimal PID controller parameters for the first order system with state dependent delay. D and cost as functions of process time constant.4 h 0.4 h 0.8 2 Cost 0.1.6 0.3) d. The parameters decrease slightly less as functions of sampling time. T. 6.1.5 Case 2a - Constant Delay In the previous cases the impact of the delay type on optimal PID parameters at various sampling times was investigated. Now the length of delay is studied at a constant sampling time of 0.1. Optimal parameters are found for a constant delay in the range [0.3…1.2] (Figure 6.6). In the next case the constant delay is replaced with a random delay. G(s)=1/(Ts+1)e-Ls L = constant, h = 0.1 15 P I 10 5 0 10 5 T 0.4 0.6 L 0.8 1 1.5 1 0.5 0 10 5 T 0.4 0.6 L 0.8 1 2 1 0 10 5 T 0.4 0.6 L 0.8 1 Cost D 1.5 1 0.5 0 10 5 T 0.4 0.6 L 0.8 1 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 6.1.6 Case 2b - Random Delay Next, the constant delay is swapped to a random delay with the same mean as in Case 2a. The random delay is L(t ) = L + rand [−0.2...0.2] . The optimisation is done as a function of the mean of the delay, L, ranging from 0.3 to 1.2. The delay has a mean of 0.3 in the lower end and varies in the range of 0.1 to 0.5. In the upper end the mean is 1.2 ranging from 1.0 to 1.4. G(s)=1/(Ts+1) Delay: L(t) = random, h = 0.1 10 5 P 1 0.5 0 10 5 T 0.4 0.6 h 0.8 1 I 0 10 5 T 0.4 0.6 h 0.8 1 2 Cost 1 D 1 0 10 5 T 0.4 0.6 h 0.8 2 1 0 10 5 T 0.4 0.6 h 0.8 1 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. 6.2 Optimisation for Network Delays In this section networked control examples are studied. The systems are of the type described in Section 3.1 (semi- and fully-distributed systems), with an Internet type delay described in Section 2.2.2. The network properties are n = 3, Tstatic = 0.6 and Tstochastic = 0.4. Old packets are filtered, i.e. if a packet with higher timestamp has already been received the packet is considered outdated and dropped. A sample of the simulated network delay is shown in Figure 6.8. The majority of the delay is around the mean, some are just shorter and a few are significantly longer (the long tail of the gamma distribution). Because the delay is assumed to be in the network only and not in the actual process, the error for the optimisation criteria is taken from the process output, recall Figure 4.2. The optimisation procedure is the same as before. 2 1.5 Delay [s] 1 0.5 0 0 5 10 Time [s] 15 20 25 Figure 6.8: Sample of simulated network delay. 6.2.1 Case 3a - Semi-Distributed System The semi-distributed system (Figure 3.2) is optimised as a function of sampling time and time constant. 48 semi-distributed system with network delay.4 h 0.2 0. The cost is.2 0.4 h 0.6 0. increasing with sampling time. with dips as the delay turns into constant at the larger sample times.8 Figure 6. h. Comparing this and Case 1b (random delay) the results are to some degree similar. T. The cost is smaller because the error signal is not taken after the delay.6 2 1 0 10 5 T 0.2 0.5 Cost 0.6 0. I and D terms are almost the same.6 0. I.4 0.4 h 0.5 0 10 5 T 0.4 h 0. but right from the process output. P. Semi-distributed 6 4 P 2 0 10 5 T 0.2 0 10 5 T 0. The P. D and cost as functions of process time constant. and controller sampling time.6 0.9: Optimal PID controller parameters for the first order.G(s)=1/(Ts+1) Delay: Network.2 0. though in another manner.8 D 1 0.8 1. 49 .8 I 0. 4 h 0. I. D and cost as functions of process time constant.4 h 0. as the delay is between the reference signal and the process output signal.6 5 T 0.8 6 Cost 0.2 I 0.8 0 10 5 T 0.2 0. This leads not only to a larger delay in the control loop. The additional network delay causes the optimal controller tuning to be more cautious.6 0. and controller sampling time.6.4 h 0. 50 .3 P 2 0.1 0 10 5 T 0.4 h 0.6 0. Now there is an additional delay between the controller and the process.2 0. T. the P and I terms are smaller than in the semi-distributed system. P. h.10: Optimal PID controller parameters for the first order. The D term has little similarities with the previous case and varies quite a bit.2 Case 3b .8 4 2 0 10 5 T 0.2 0.2. The cost is higher but behaves similarly as in the previous case. G(s)=1/(Ts+1) Delay: Network. but also to a higher cost.6 0. Fully-distributed 4 0.Fully-Distributed System The system in the previous case is extended to a fully-distributed system.8 2 D 1 0 10 Figure 6.2 0. fully-distributed system with network delay. In Tipsuwan and Chow (2004) a similar strategy is implemented in an IP network. 51 . I and D parameters.6. The measured delay is filtered with a low-pass filter3 to detect the underlying slow variation.11) with the results of Case 2b. The PI controller is parameterised with one variable. The gain scheduler has a low-pass filter for the delay and look-up tables for P. After delay identification off-line tuned parameters are fetched from a look-up table to give the controller the right tuning.num(z) filt1. β. yr y _ref y (k) PID u(k+1) Reference 1 T. From the obtained delay the corresponding PID parameters are selected from look-up tables (inset.den(z) Delay filter 1 delay D Lookup Figure 6. The delay is measured by using timestamps attached to the measurement packets in the delay block.Random Delay one can use gain scheduling to tune the PID controller on-line for a random delay which exhibits changes in the local average delay. The stochastic delay is estimated by taking the median of measured delays and using a look-up table to fetch the optimal β as a function of static and stochastic delay.3 Gain Scheduling by Delay With the results of Case 2b .11: Gain scheduling with PID controller.tf.05π rad. Figure 6. The gain scheduling strategy investigated here is depicted in Figure 6. in practice on a low-pass filtered measured delay. In this case the gain scheduling is based on the current average delay of the system. and optimised by simulation with an exponential distribution as the network model. 3 A second order Chebyshev type II filter with cut-off at 0.s+1 Transfer Fcn Out1 In Out static delay y Tunable Discrete PID Delay Delay generator delay PID delay Gain sheduling P Lookup 1 PID I Lookup filt1. An advantage with gain scheduling was only found with the largest delay variations.tf.11. In the next cases gain scheduling is demonstrated with two types of delay changes and compared to a non-scheduled. 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.8 Delay [s] Delay [s] 0.4 0. The sinusoidal change could be explained as a change in network load. Thin line: measured delay.12: Delay for simulations with gain scheduling.1 rad/s and amplitude 0.4 1.4 (Figure 6. where an increase in load lengthens the delay.2 0 0 10 20 30 40 Time [s] 50 60 70 80 0 0 10 20 30 40 Time [s] 50 60 70 80 Figure 6.4 0. In the second example the delay has a slow sinusoidal variation with a frequency of 0.6 0.2 1 1 0.4 1.2 1.0 at time 40 s.2 0. 1.6 0. but there is a step in the mean delay from 0.12). constant parameter controller.5 to 1. On the right: Slow sinusoidal variation. On the left: Random delay with step change.8 0. bold line: low-pass filtered delay. First the delay is random with the same properties as in Case 2b. 52 . On the left: PID parameters for current identified delay as function of time. whereas the constant controller has overshoot ever after the delay change. but as soon as the delay is identified the steps are normal. It shows up in both the PID parameter plot and the response plot as peaks. the controller is scheduled with appropriate gains for the current delay. Examination of the step responses on the right in Figure 6. 53 .3. On the right: Step responses for system with and without gain scheduling. indeed.4 0. operation.2 1 0. The gain scheduled controller adapts to the situation whereas the constant controller continues its.4 P I D 1.4 1.2 0 -0.2 1 0. 1. It adapts to the changed delay. There is an initial transient period where the delay is estimated.2 0 0 10 20 30 40 Time [s] 50 60 70 80 0 10 20 30 40 Time [s] 50 60 70 80 Figure 6.13: Gain scheduling with step delay change.5. At some stage the state of the system changes and the delay rises to 1. The PID parameters plotted in Figure 6.6 0.13 on the left show that. When the delay changes at time 40 s there is a hiccup with a larger overshoot.1 Case 4a – Step Delay Change The nominal delay of the system is assumed to be 0.8 0.6. now detuned.6 0.13 leads to the conclusion that the gain scheduled controller is better than the non-scheduled controller.4 0.0.8 0.2 Output with gain scheduling Output without gain scheduling 1. The constant controller is tuned for this delay. 54 .4 1.2 1 1 0. The disadvantage of gain scheduling is that one must measure the delay and have a mechanism for changing the PID parameters of the controller online.6 0. On the left: PID parameters as functions of time. The scheduled controller adapts as in the previous case. For the sinusoidal delay the controller tuned for an average variation does perform well sometimes.2 Case 4b – Sinusoidal Delay Change In this case the random delay is assumed to have slow sinusoidal variations with amplitude 0. The result of the sinusoidal changing delay is shown in Figure 6. Once again there is an initial peak until the delay is found.14: Gain scheduling with sinusoidal delay change. The controller must also be tuned for several lengths of delay.3.6 0 0 10 20 30 40 Time [s] 50 60 70 80 0 10 20 30 40 Time [s] 50 60 70 80 Figure 6. The step response of the scheduled controller is similar regardless of the current delay. and performs well enough for small variations in the conditions of the system. The constant controller is tuned for this mean delay.12.14. when the delay changes significantly.8 0.4 0. Right). On the right: Step responses of the system with and without gain scheduling. The non-scheduled controller is easier in this regard to set up.2 0.75 (Figure 6.6 1. but as the delay changes the control loop has overshoots and there is risk of instability.2 0.6.2 Output with gain scheduling Output without gain scheduling 1.4 0.8 0.2 0 -0. These two cases show that a gain scheduled PID controller performs better than a constant controller.4 around a mean delay of 0.4 P I D 1. 1. summed up with the IAE criterion to form the fusion error measure. A sensor network is considered here with the sensor cluster having four sensors with known noise variances.12 1. The results are shown in the following figures and collected in Table 3. The same process as in the other examples (Equation (6.16 Fusion error IAE 3. The controller is hand tuned (P = 1.61 55 .2.85 1.05 1. this is near the optimal tuning for the system) to get a satisfactory step response.36 1. The simulation is run for four step responses. The more advanced strategies with Kalman filters are left to another thesis.7 and D = 0.7 1. and the error integrals are averaged to get a better estimation of them. Table 3: Fusion strategies results.21 3. I = 0.7 are tested in simulations. The strategies simulated are cases 1-5 from Table 2. The network is modelled as a 3-hop network with the same properties as in Case 3 (the network delay case).6. The packets from the sensors are independently delayed on their way to fusion. because of the randomness (noise. delay. The sensors. Case 1 2 3 4 5 Name fusion_no fusion fusion_by_timestamp fusion_by_timestamp2 fusion_with_decay Step response ITAE 1. Figure 6. packet loss) in the network that causes varying performance on the step responses at different times.56 1.4 Sensor Network In this section the first five fusion strategies presented in Section 4. network.33 1.2) is controlled with a discrete-time PID controller. The strategies are evaluated based on their step response ITAE and the fusion error IAE over the whole simulation.16 displays the error between the fused and the real variable. fusion and controller are all time driven. The step responses are similar.16). The noise is further amplified by the derivative term of the controller. since these methods hardly reduce the noise (high fusion error). These methods eliminate the error variance better than the other methods because they always fuse four measurements. regardless of which error is chosen as evaluation criterion.15. the no fusion method being the worst. The worst cases are no fusion (case 1) and fusion with only the most up-to-date measurements (case 4). shown in Figure 6. 56 . The output noise is proportional to the fusion IAE criterion.The best method is the fusion by timestamp (case 3). and thus the fusion by timestamp method has the smoothest response. The second best methods are the fusion regardless of timestamp (case 2) and fusion with decay (case 5). apart from the different noise levels after fusion (Figure 6. 160 fusion_by_timestamp2 ITAE: 1.6 0 2 4 6 8 10 12 14 16 18 20 Control 3 fusion_no fusion 2 fusion_by_timestamp fusion_by_timestamp2 fusion_with_decay 1 0 -1 -2 -3 0 2 4 6 8 10 12 14 16 18 20 Figure 6.206 0.15: Simulated step responses (top) and control signals (bottom) with various fusion strategies.Fused output 1.2 0 -0.8 0.2 -0.4 0.561 fusion ITAE: 1.356 fusion_by_timestamp ITAE: 1.4 1.6 fusion_no ITAE: 1.4 -0.2 1 0. 57 .850 fusion_with_decay ITAE: 1. 12 0. 58 .33 0.fusion_no IAE: 3.4 0 5 10 15 20 fusion IAE: 1.16: Fusion errors for various fusion strategies during a simulation.2 0 -0.05 0.2 -0.7 0.4 0 5 10 15 20 25 30 35 40 fusion_by_timestamp2 IAE: 3.2 -0.2 -0.2 0 -0.2 0 -0.4 0 5 10 15 20 25 30 35 40 Figure 6.4 0 5 10 15 20 25 30 35 40 25 30 35 40 fusion_by_timestamp IAE: 1.2 0 -0.2 -0.61 0.2 0 -0.4 0 5 10 15 20 25 30 35 40 fusion_with_decay IAE: 1.2 -0. Equation (6. Several steps are done and averaged as previously. The D term is constant and nearly zero.2.1 Optimisation Tuning The optimal tuning is done for sampling times ranging from 0. on five unit step responses is used to tune the PID controller for the process. The derived transfer function (Section 5.6. The variance of the stochastic part of the delay is according to Equation (2. 6. The tuning is not as smooth as for the previous first order systems. τstatic 35 ms Stochastic delay. to get rid of optimisation for a particular instance of the random delay. typical Internet parameters. and they are tested in this Section with simulations.25 seconds. The parameter values approximate typical short distance Internet properties (Pohjola et al. The process is supposed to be in a fully-distributed networked control system as described in Section 3.5 Tuning for Example Process The electric circuit described in Section 5. Hops.6) is used as a model for the process in the simulations. The results are collected at the end of this Section.1). τstochastic 100 ms Packet loss 1% The optimisation technique with the average ITAE cost. The parameters for the network are presented in Table 4.10) 3.1. 2005). The network has an Internet delay distribution with packet loss according to Section 2.5. in Table 5. 59 . The tunings are then verified on the real process in Chapter 7.33 ms2. Other tunings (Ziegler-Nichols and IMC) are used as well for comparison. though the results follow the general trend with decreasing PID parameters as sampling time increases. Several PID controllers are tuned with the methods presented in Chapter 4.17. The optimal PID parameters are in Figure 6.6 is used as a real example process. Table 4: Network properties. n 3 Static delay.01 to 0. The comparison is done by the average ITAE and IAE cost of a series of step responses and by visual inspection.. The variation is rather a consequence of the random delay.18 the overshoot is fixed with no significant impact on the speed of the response.3 P I D 2.16 s.2 0. With the sampling time at the local minimum of Figure 6.25 Figure 6. This is the most preferred sampling time. h. with a deep valley at h = 0. With this particular sampling time 85 % of the stochastic time-delay is smaller than the sampling time.1 h [s] 0. This suggests that the PID controller works well when most of the variation of the delay is in the order of the sampling time. At the shortest sampling time there is some overshoot. In Figure 6. but it is far from smooth. as 60 . The cost plotted in Figure 6.5 1 0.1)). The corresponding PID tunings are listed in Table 5.5 2 Parameters 1.18 rises with sampling time. This supports the work that considers the delay variation to be at most one sampling time (Nilsson. P.5 0 0 0.17: Optimal PID controller parameters for example process. At this point the effective delay varies between two values: h and 2h (Equation (3.15 0. but the system has generally a good response.05 0. 1998). I and D as functions of sampling time.19 some step responses are shown as functions of sampling time. Several initial values for the optimisation algorithm have been used to avoid this. The variations in the optimal PID parameters are not a result of the optimisation algorithm being stuck in local minima. 4 0.3 cost.19: Step responses with optimisation tuning.25 seconds.05 0 0.25 0. Output 3 h = 0.2 0.25 Figure 6. h.1 h [s] 0.025 h = 0.16 h = 0.25 Reference 2 1 0 -1 -2 -3 0 5 10 Time [s] 15 20 25 Figure 6. 0.1 0.18: Optimal ITAE cost as a function of sampling time. Sampling times: 0. 0.15 0. The longest sampling time results in a slower response with longer rise time and settling time.2 0.05 0.025.concluded in the previous paragraph. for example process.15 0.16 and 0.35 0. 61 . ITAE 0. With the simulation model both Ziegler-Nichols step. The varying network delay is first approximated with a constant delay and this is further approximated with a first order Taylor series. A low sampling time is used h = 0. The IMC 62 . The Z-N tuning does not take into account the sampling time. for a delay distribution with a large variance. The derivation of the tuning parameters is summarised in the Appendix. where the controller approximates a continuous-time controller to some degree.and frequencyresponse tuning is made.5) consisting of the inverted zeros of the process.1.5.1. The relevant measurements are collected in Table 7 in the Appendix. This pre-filter can be omitted by considering that the model is inaccurate and does not model the zeros. The resulting controller is a PID controller with parameters Kp = a1 λ +τ a2 a1 Ti = a1 Td = (6. I and D parameters using Equation (4.3 IMC Tuning Next IMC tuning is derived. other tuning methods are also tested. This assumption will not hold in every case.2 Ziegler-Nichols Tuning To compare the results of the optimisation based tuning.g.2 in the Appendix. For higher sampling times the control loop becomes unstable. Figure 10.6.5.4). Section 10. From these graphs the required properties are measured and the parameters are calculated according to Table 1 and translated to P. 6.025 s. e. Step response results are shown in Figure 10. It is assumed that in spite of these rough delay approximations they do still lead to a usable controller tuning. The step response and the critical gain tests are shown in the Appendix.4) and with a pre-filter G pf ( s ) = 1 bs + 1 (6. The optimisation method has of course the best ITAE as it minimises the particular criterion. The parameters in Equation (6. Figure 10. This results in a response with little overshoot. λ. Figure 10. which is not the case for measures such as the rise time or overshoot. The Z-N step response method is almost unstable and oscillates heavily: the cost is 6 times larger compared to the optimal tuning. The controller is tested with and without the pre-filter. 6. 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 step response is shown in the Appendix. The ITAE criterion is used to compare how much worse the other tuning methods are in comparison to the optimum. The bad tuning can stem from uncertainties in the determination of the inflexion point of the test step response. 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. Therefore only a short sampling time of h = 0. This is due to the large gains of the tuning.2. 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. It is omitted from the figures below and shown in the Appendix. This measure is chosen because it takes the whole response into account. for the IMC tuning is selected to be 0. therefore also the IAE criterion is displayed.65.concept ensures that the controller will work and compensate for the (artificial) modelling error.3.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.20 are listed in Table 5.025 s is used for the discrete-time PID so that it approximates the continuous-time controller. 63 .5. and with minimum ITAE cost (Figure 10. The ITAE costs of the responses are used to compare the tuning methods.3 of the Appendix). The tuning parameter.4 Results The process responses and the control signals for a series of reference step changes are displayed in the following figures. There is a correlation between the ITAE and IAE costs. Table 5: PID parameters for example process and cost from simulations.034 0.024 0. 64 . not shown) give similar results.42 0.08 1. ITAE Cost.014 0.05 1.072 0.11 0.051 0.50 1. h = 0. Method P I D Cost.48 1.57 2.022 0.20). h = 0.25 IMC (without pre-filter) IMC (with pre-filter) 3.025 Optimisation. The Z-N frequency method is better than the Z-N step response method. The square integral costs (ISE and ITSE.36 2.02 0.3) is smoother and settles down nicely.66 1. The other tuning methods produce reasonable step responses.7 1.027 0.025 0.23 0. The conclusion is that the optimisation tuning method gives the best results among the compared tuning methods.33 0.56 1. h = 0.23 1.13 0. 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 optimisation method has the lowest ITAE and IAE cost.77 1.015 0.25 0.021 Z-N step response Z-N frequency response Optimisation. even though these criteria are not explicitly in the cost function. The version with the pre-filter shown in the Appendix (Figure 10. IAE 0.026 0.025 0. Some conclusions can be done when the step responses are visually compared (Figure 6.046 The optimisation method has a short rise time and settling time with little overshoot. The cost is the same as without the pre-filter.72 5.25 0.56 6.302 0. There are still heavy oscillations and the tuning is aggressive with large PID parameters.16 Optimisation. regardless of the tuning criterion. followed by IMC. it has the smoothest response and settles down in a short time with little overshoot. The control signals (Figure 6. if one considers the error integrals.20: Simulated step responses for example process.025 Optimisation h=0.25 s works almost as well. The tuning for a sampling time of h = 0. It is notable that the IMC tuning (with and without a pre-filter) comes near the same performance as the optimal tuning. The Z-N tuning oscillates strongly. even the larger step is not a problem.The tuning by optimisation is the best. Output 4 Z-N frequency Optimisation h=0. 65 . The optimal tunings have a reliable and precise control signal in comparison to the other methods.21) show that the Z-N and the IMC tuning are aggressive with large control signals. there is only a larger delay and a slower response because of the large sampling time.25 IMC no pre-filter Reference 3 2 1 0 -1 -2 -3 -4 -5 0 5 10 Time [s] 15 20 25 Figure 6. 25 IMC no pre-filter -20 0 5 10 Time [s] 15 20 25 Figure 6.025 Optimisation h=0.21: Control signals for example process. 66 .Control 20 15 10 5 0 -5 -10 -15 Z-N frequency Optimisation h=0. 5 are verified on real hardware.6) connected to the platform. The figure corresponds to the delay of Figure 6. In Figure 7.5 (Table 4).7 MoCoNet Results In this Chapter the example process tunings simulated in Section 6.5. The controller tunings are the same as those in Section 6. The rest of the Chapter shows representative test run results.3 0.1: Sample of real network delay of the network simulator (h = 0. The purpose of these tests is to verify that the tunings work in practice. 0.4 0.1 a sample of the network delay of the network simulator is shown. The settings for the network are the same as in the simulation runs of Section 6.2 0.1 s). The results are collected and compared in Table 6. The delay has the same parameters as in the simulations.1 0 0 5 10 15 20 25 Time [s] Figure 7. The general distribution is the same with some long delays from the tail of the gamma distribution.8 simulated in Simulink as they both are computed in the same way.6 0.7 0. Table 4. The network is simulated with the network simulator presented in Section 5.5.5 0. 67 . The main difference between the figures is that they have different delay parameters. Several test runs were made and the typical cost was estimated. Test runs are done with the MoCoNet platform described in Chapter 5 on the electrical circuit (see Section 5. The results are saved to a text file from the MoCoNet scope and analysed and plotted in MATLAB. and the results are compared to the simulation results. 2. This is only temporary and the closed loop remains stable.16 s. The ITAE cost remains stable from run to run at 0.7.1 Optimisation Tuning The optimisation tuning is run on the MoCoNet system and the result is displayed in Figure 7.038. 68 . The response is stable. If a long delay occurs at the time when a step change is performed the controller overshoots and oscillation can occur. with some overshoot but similar to the simulation result.3 presents the results with sampling time h = 0.025 s.026 to 0. In case of a longer sampling time the system becomes more stable with less overshoot and oscillations. Figure 7. which is higher than the simulated cost. The optimisation method produces some aggressive control signal behaviour. The response varies some from time to time because the tuning is so tight that the variations in the delay affect the closed-loop behaviour more than in the other tuning methods.08. 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. 10 Reference Control Output 8 6 4 2 0 -2 -4 -6 -8 -10 0 5 10 Time [s] 15 20 25 Figure 7.2: Optimisation tuning with h = 0. Test results with example process. The ITAE cost ranges from 0. 10 Reference Control Output 8 6 4 2 0 -2 -4 -6 -8 -10 0 5 10 Time [s] 15 20 25 Figure 7. The response of the Z-N frequency tuning method is shown in Figure 7.16 s. 69 . With the long sampling time the effective time-delay alternates between two values. The ITAE cost is the highest of all the tunings: 0. and the control signal is smoother. 10] which the Z-N tuned controller exceeds. This choice of sampling time is the best according to the conclusions of the valley in Figure 6.2 Ziegler-Nichols Tuning The Ziegler-Nichols step response method is almost unstable and can not be used.4. it oscillates heavily.3. compared to the shorter sampling time (Figure 7. The Ziegler-Nichols tuning is not acceptable. 7. The step response is stabilised. so there is also a problem with control saturation. The large gains are the problem.18. as they were in the simulations. Run of step responses for the example process. The control action is limited to the interval [-10.2).2) with the simulation result.3: Optimisation tuning h = 0. The process test run result is shown in the Appendix (Figure 10. 4: Z-N frequency tuning. The ITAE cost is around 0. 7. The large D term is the only harmful aspect leading to a large control output.10 8 6 4 2 0 -2 -4 -6 -8 -10 Reference Control Output 0 5 10 15 20 25 Time [s] Figure 7. The results of both cases are shown in the following figures. even without the pre-filter. The IMC tuning performs well. take into account when comparing the controllers that this controller has an advantage over the other PID controllers because of its extra degree of freedom: the pre-filter.06. 70 . The resulting response is very smooth and the cost decreases to 0.1. of course. One should.3 IMC Tuning The IMC tuning method is tested with and without the pre-filter. The response is fast with little overshoot. With the pre-filter the derivative problem vanishes. Run of step responses for the example process. 71 . Run of step responses for the example process.10 Reference Control Output 8 6 4 2 0 -2 -4 -6 -8 -10 0 5 10 Time [s] 15 20 25 Figure 7. Run of step responses for the example process.5: IMC tuning without pre-filter. 10 Reference Control Output 8 6 4 2 0 -2 -4 -6 -8 -10 0 5 10 Time [s] 15 20 25 Figure 7.6: IMC tuning with pre-filter. ITAE 0.7.16 s is robust to network delay.014 0. This is mainly because the process is simple to model and the resulting simulation model was sufficiently accurate.4 Conclusions of Test Runs The cost criterion from the test runs are shown in Table 6 with the simulation cost from Table 5. the best results. The optimisation with h = 0. The reasons for the poorer performances are modelling errors. ITAE 0. h = 0.08 0.10 0. and can thus be used to tune a PID controller for practical use.025 0. h = 0.03-0.027 0. As the optimisation method relies on the process model it is expected to give comparable results also in other cases. There are only minor deviations from the simulation results. measurement noise and modelling errors.7-1.3 0. different realisations of the network delay and measurement noise.04 Simulation cost.06 0. but by eye the responses look acceptable. Compared to the simulation results the controllers perform worse in practice based on the ITAE cost. In this case the simulation results gave a good indication of the performance of the real system. as long as the simulation model is reasonable accurate.16 IMC (without prefilter) IMC (with prefilter) Cost. again. Method Z-N step response Z-N frequency response Optimisation.015 0. The optimisation method gave.072 0. Cost and simulation cost. Table 6: MoCoNet run results.026 72 . The cost rises roughly by half a decade.025 Optimisation. All the tuning methods except the Z-N methods give satisfactory results based on the cost.7 0. The MoCoNet system is operational and will be used in the laboratory course at the Control Engineering Laboratory at Helsinki University of Technology. The results gave rules of thumbs to tune the PID controller for different types of time-delays. The optimisation tuning method performed almost equally well in practice as in simulations. It was further shown to perform better than traditional tuning methods. As NCS includes a network. One general result was that with increasing sampling time the P and I terms decrease. The MoCoNet system was developed to enable RCP for educational use in laboratory courses. The tuning results of different time-varying delays were compared to the constant delay case. which transmits measurements as packets. there is an inherit discreteness to the system and therefore only discrete-time PID controllers were studied. namely time. Differences in the optimal tuning with different types of time-delays were 73 . including sensor networks. such as derivative filtering were formulated. The optimisation was done for first-order systems with time-delay. A general study of optimal tuning for varying time-delay systems was conducted.or state-dependent and random. 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 controller tuning was focused on an optimisation by simulation technique. With increasing process time constant the P and D terms increase. as a function of process time constant and controller sampling time. The tuning method was modified to work with discrete-time controllers in the context of NCSs. The discrete-time PID controller was introduced and some practical aspects. because it can take the varying time-delay better into account. The time-delay was a varying time-delay. testing of networked control systems was made possible. With the addition of a network simulator.8 Conclusions This thesis studied the discrete-time PID controller design and tuning for varying time-delay systems and furthermore networked control systems (NCS). Several tuning methods were tested on an example process in simulations. This allows one to tune for any type of processes. In the case of a small random variance in the time-delay and a larger sampling time. as is done in this thesis. such as processes with time-varying delay. Gain scheduling based on delay was also demonstrated with typical delay changes corresponding to falloff of a node and daily network utilisation changes. as the sampling time rounds the delay up to nearly constant. It performs equally well with a short enough sampling time. As the optimisation focused on the time-response only. 74 . Networked control systems and their various layouts. Robustness. the optimal tuning for a random delay with a small variance is virtually the same as in the constant delay case. The optimised tuning results were based on the ITAE cost of the error signal. 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 model can. where the varying time-delay was modelled with the Internet delay distribution. However. 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. 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. be any input-output description and it is not limited to linear and time-invariant systems. however. The optimisation method was applied on networked control systems. The down-side of the optimisation technique is that a process model is needed. The occurrence of a time-delay in the control loop of these systems was analysed. The favourable sampling time is such that the resulting effective delay varies between two values.found. robustness is not guaranteed. constant delay tuning can be used. with the expense of a more active control signal and less robust performance. Sensor fusion methods for sensor network systems were developed and tested in the simulations. including sensor networks were described. Especially the delay distribution in the Internet was described in detail. The tuning can instead be done with the optimisation tuning method using simulation described in this thesis. as long as the variation in the delay is small. 75 . The thesis showed that a PID controller can be used to control a process with varying time-delay. such as Ziegler-Nichols. do not perform well in the new setting of networked control systems.Results were also verified on a real process with the MoCoNet platform. The optimisation tuning performed better than all the other tuning methods when an appropriately long sampling time was chosen. Another conclusion was that with an adequate process model the optimisation tuning results can be used on real processes. even better in practice than with a short sampling time. Traditional tuning methods. The various tunings done with a simulation model were shown to perform satisfactorily in practice. in the order of the sampling time. 9 References Alves. New York. Douligeris. D. L. A PID Tuning Tool for Networked Control Systems. Finland. A. J.M. Internet Traffic Tends Toward Poisson and Independent as the Load Increases. 2005. NY. C. 2001. M. pp. Henriksson. Ethernet Goes Real-time: a Survey on Research and Technological Developments.. K. J. In proc. K. 2005. Arlington. Czech Republic. H. 16th IFAC World Congress. 76 . Issue1. Vasques F.. B. 1995. E. M. PID Controllers: Theory. T. Dec. In proc. 6th IEEE International Symposium on Computational Intelligence in Robotics and Automation. D. Springer Verlag. Lin.. Tovar. 2000. C. Nonlinear Estimation and Classification.. K-E. Sun. VA. L. 2001. American Control Conference. Characterizing End-to-End Packet Delay and Loss in the Internet Journal of High-Speed Networks. S. 2005. WSEAS Transactions on Systems. Stability of Discrete-Time Systems with Time-Varying Delays. Åström. Espoo. Cervin. Chai. 2002. and Tuning. In proc. 2005. Bauer.. Årzén. 2002. Bolot. 4.. Cao.. HURRAY-TR-2K01. Jitterbug and TrueTime: Analysis Tools for RealTime Control Systems. 1995. Ekanayake. 2002. Design. C.. Premaratne. 289 – 298. Copenhagen. D. Tuning of Discrete-Time PID Controllers in Sensor Network based Control Systems. ISSN: 1109-2777. P. Vol. 2005. Prague. 2nd edition.. William S. Sigcomm 1993. Eriksson.. ISBN: 0-38795471-6.. 2nd Workshop on RealTime Tools. 1993. Instrument Society of America. and Hägglund. and Koivo. Eriksson.H. Design and Implementation of Networked Predictive Control Systems. Denmark. 2002. J. Lincoln. Predictive Control of Networked Systems with Random Delays.K. Ho W.D. In proc. Derivative filter is an integral part of PID design.Garcia. 21. V. 2.. Automotive Control: From Concept to Experiment to Product. Rapid Control Prototyping Tutorial with Application Examples. Camp. No. G. 61. 2.. Cassandras C.. Department of Automatic Control. January 2002. 1991.. L.J. Trends in Systems and Signals. Vol.sim-serv. 149. Palmroth. In proc. 2005. Engineering Chemistry Process Design and Development Vol. E.com. 1996. A Unifying Review and Some New Results. Czech Republic. McKelvey T.. No 11. Dearborn. ISSN: 0143-7054..C. 138. 2002. Vol. 2000. Liu. H. M. ISSN: 1350-2379. 2004.. Y. Industrial. Åström. Leith. and Leithead. MI. D. V. IEE Proceedings Part D.F. International Journal of Control. 16th IFAC World Congress. 2005. Ph. 2005.. In proc. C. 1996. A. 2003. H. T. B. K.. M. Control Theory and Applications. 1982. Survey of gain-scheduling analysis and design.E. Sweden. Dynamic programming and Time-Varying Delay Systems. 1982. No.J. Lund institute of Tecnology. and Graebe. 2005a. 2000. Xia. L. C. Refinements of the Ziegler-Nichols tuning formula. Prague. Isaksson. Hanselmann. Hölttä. Rees. W. Katayama. IEE Proceedings. thesis. NO.J.16th IFAC World Congress. Decentralized Kalman Filter in Wireless Sensor Networks – Case Studies. and Koivo. 1. I. Eriksson. 2005. CISSE 2005. and Morari. Prague. March I991. www. Hasu. IEEE International Symposium on Computer-Aided Control System Design. D. Internal Model Control. A. In proc. Sim-Serv. Lincoln. Sano. S. 2003. 73. Czech Republic. Hang. 77 . 2003. Helsinki University of Technology. X. Sweden. Nilsson. Whidborne. Tuning of PID Controller for Varying Time-Delay Systems. Cesar da. Platform for Monitoring and Controlling Educational Laboratory Processes over Internet In proc. Prague. 3. On the Gain Scheduling for Networked PI Controller Over IP Network. Y. Networked Predictive Control Of Systems With Random Network Transmission Delay – A Polynomial Approach. Yang. 2004. In proc.B. Rees. Department of Automatic Control. Reijonen. First ACM SIGCOMM Workshop on Internet Measurement. Real-Time Control Systems with Delays. Prada. Inc... Czech Republic. September 2004. ISSN: 1083-4435. V. Czech Republic. and Goldsmith. IEEE/ASME Transactions On Mechatronics. A. In proc.. Vol. MathWorks. 2004. and Chow. 2005. 2005b. Prague.. Czech Republic. Optimization Toolbox For Use with MATLAB. Multiobjective Optimisation and Control. M-Y. In proc. p: 281 – 293. Prague. J. 2004.F. 2005. Research Studies Press Ltd. Liu G.X. J. Volume: 4. Mukherjee. A. 43rd IEEE Conference on IEEE Decision and Control. Oksanen. 16th IFAC World Congress. S. Master’s thesis. Cristea. D. Tipsuwan. A. 2005. 2005. Finland. No. Mu. ISSN 0280–5316. MathWorks. 16th IFAC World Congress.. G. 9. 2001. J. Kalman filtering with partial observation losses. Keyser.Liu. M. On the Dynamics and Significance of Low Frequency Components of the Internet Load. Hölttä. 16th IFAC World Congress. ISBN:1-58113-435-5. 2003. Department of Automation and Systems Technology. Predictive Control of a Process with Variable Dead-time. T.. R de. Liu. Eriksson. Master’s thesis. 2003... 78 . 1998. ISBN: 0-86380-278-8. Lund Institute of Technology. Pohjola. England. 2005. J. 2005. L.P. Vallés.L. 21. In proc. 79 . Germany. Third European Congress on Intelligent Techniques and Soft Computing. Albertos. Díez...S. Fuzzy logic in PID control gain scheduling. Vol. M. M. S.. Valera. H. P. 927931. ELITE . A. February 2001. P. 1995.. 1995. IEEE Control Systems Magazine. ISSN: 0272-1708. Viljamaa. Czech Republic. Aachen. EUFIT '95. Phillips. 2005. Koivo.. Stability of Networked Control Systems. Branicky. 2001.M. Zhang. A Straightforward Proposal For Low-Cost Development Of Virtual And Remote Control Laboratories. Aachen. W. J.. Germany. N. Prague. Verlag Mainz. Issue 1. 2005. 16th IFAC World Congress.European Laboratory for Intelligent Techniques Engineering. ≈ 1+ (10.7) (10.4) 2 s The filter. according to Equation (4. a2 s + a1 s + 1 2 (10. The controller turns out to be. 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.3) is Gm ( s ) = bs + 1 e − sτ .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 . and after some algebraic manipulation a2 s 2 + a1 s + 1 1 1  1  GIMC ( s ) = =  a1 + + a2 s  .6) 80 .3) τ e −τ s τ (10.1) with the constant τ approximating the varying random delay. λs +1 (10.26).1 Derivation of IMC Tuning for Example Process The model of the process according to Equation (5. bs + 1 (10. G f ( s ) .5) When selecting the first-order Taylor approximation for the delay and the filter given above one can calculate the IMC controller. is chosen as simple as possible with n = 1 G f ( s) = 1 .10 Appendices 10. s ( λ + τ )( bs + 1) s ( bs + 1) ( λ + τ )   This is a PID controller with a pre-filter G pf ( s ) = 1 . but an ultimate gain can be found.2 1 0.5 2 2.5 3 3.8 0.4 0.8 1. 1.6 0.1.5 1 1. 81 . From the step response the dead-time and the rise-time are measured. (10. T2 is difficult to measure because the inflexion point is barely visible.4 0. A greater gain than 4.5 5 0 0 1 2 3 4 5 6 7 8 9 10 Time [s] Time [s] Figure 10.2 0.4 0.5 4 4. There is no gain that produces a regular oscillation.5 was selected as Ku. From the frequency test one can deduct that there is a varying delay: The period and the amplitude vary from cycle to cycle.5 causes the amplitude to increase. An average period at the ultimate gain was estimated from the figure below to get the ultimate period Tu.8) a2 a1 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.6 1 1.2 Results for Example Process The simulation tests for the Z-N tuning methods are shown in Figure 10. 10.and the PID parameters can be identified to be Kp = a1 λ +τ . so 4. The process has a unit gain (K1 = K2).2 0 0.1: Step response (left) and frequency response tests for Ziegler-Nichols tuning.6 0. 5 Tu 0.The Z-N tuning parameters from the simulations are listed in the table below.7 0. 82 . but not significantly.1 T1 T2 0.8 20 Reference Control Output 10 8 Reference Control Output 15 6 10 4 5 2 0 0 -5 -2 -4 10 -6 15 -8 20 0 5 10 15 20 25 -10 0 5 10 15 20 25 Time [s] Time [s] Figure 10. On the right: Test run on real process. The values gained through real test runs are also shown. Gained with simulation and test run on the real process.22 0. Table 7: Properties of system in Z-N tuning.25 0. They do differ a little.97 1.5 Test run 4. On the left: Simulated steps for the example process. Ku Simulation 4.2: Z-N tuning with step response method. 3: IMC tuning with pre-filter. See Chapter 6.3 Reference Control Output 2 1 0 -1 -2 -3 -4 Time [s] 0 5 10 Time [s] 15 20 25 Figure 10. Simulated step responses for the example process.4. 83 .5.
Copyright © 2024 DOKUMEN.SITE Inc.