Engineering » Industrial Engineering and Management » "Factory Automation", book edited by Javier Silvestre-Blanes, ISBN 978-953-307-024-7, Published: March 1, 2010 under CC BY-NC-SA 3.0 license

Chapter 21

Implementation of the Delay Compensator Approach

By Ana Antunes, Fernando Dias, Jose Vieira and Alexandre Mota
DOI: 10.5772/9519

Article top

Overview

Block diagram of a distributed real-time controller.
Figure 1. Block diagram of a distributed real-time controller.
Representation of the time between the sampling and the actuation instants.
Figure 2. Representation of the time between the sampling and the actuation instants.
Block diagram of the delay compensator approach.
Figure 3. Block diagram of the delay compensator approach.
Block of the fuzzy implementation of the delay compensator approach.
Figure 4. Block of the fuzzy implementation of the delay compensator approach.
Method used to calculate the output of the model.
Figure 5. Method used to calculate the output of the model.
Block of the neural network implementation of the delay compensator approach.
Figure 6. Block of the neural network implementation of the delay compensator approach.
Block of the neuro-fuzzy implementation of the delay compensator approach.
Figure 7. Block of the neuro-fuzzy implementation of the delay compensator approach.
Block of the test system.
Figure 8. Block of the test system.
Histogram of the sampling to actuation delay for test 2.
Figure 9. Histogram of the sampling to actuation delay for test 2.
Histogram of the sampling to actuation delay for test 3.
Figure 10. Histogram of the sampling to actuation delay for test 3.
Block diagram of the delay compensator implementation.
Figure 11. Block diagram of the delay compensator implementation.
Control results for test 1 (reference test) without the delay compensator.
Figure 12. Control results for test 1 (reference test) without the delay compensator.
Control results for test 2 without the delay compensator.
Figure 13. Control results for test 2 without the delay compensator.
Control results for test 2 with the FZ delay compensator.
Figure 14. Control results for test 2 with the FZ delay compensator.
Control results for test 2 with the NN delay compensator.
Figure 15. Control results for test 2 with the NN delay compensator.
Control results for test 2 with the NF delay compensator.
Figure 16. Control results for test 2 with the NF delay compensator.
Control results for test 3 without the delay compensator.
Figure 17. Control results for test 3 without the delay compensator.
Control results for test 3 with the FZ delay compensator.
Figure 18. Control results for test 3 with the FZ delay compensator.
Control results for test 3 with the NN delay compensator.
Figure 19. Control results for test 3 with the NN delay compensator.
Control results for test 3 with the NF delay compensator.
Figure 20. Control results for test 3 with the NF delay compensator.

Implementation of the delay compensator approach

Ana Antunes1, Fernando Dias2, José Vieira3 and Alexandre Mota4

1. Introduction

Modern distributed embedded control systems need to be highly distributed, highly integrated and should support operational flexibility (Årzén et al., 2005). The distribution of control systems induces delays in the control loop that degrade the control performance. These delays are usually variable from iteration to iteration of the control loop and depend on several factors as the scheduling of the processes in the network nodes or the scheduling of traffic in the network.

Classic control solutions do not account for the effect of such variable delays. The delay compensator principle was recently proposed in order to deal with the variable sampling to actuation delay effect in real-time distributed control systems.

The delay compensator principle proposes the addition of a compensator to an existing distributed control system to overcome the effect of the variable sampling to actuation delay introduced in the loop, allowing the achievement of a better control performance.

The compensator action is based on the knowledge of the sampling to actuation delay that affects the control loop and it can have any other input needed to generate the correction output that will be added to the output of the existing controller.

This approach can be applied to any distributed control system provided that the sampling to actuation delay is known for each control cycle. The delay compensator principle is generic and can be implemented using different techniques.

In this chapter the delay compensator approach is presented in detail and several implementations are proposed based on non-linear modelling strategies, namely fuzzy logic, neural networks and neuro-fuzzy techniques.

Simulation results are presented for each one of the implementations proposed and the results obtained are compared.

The remainder of this chapter is organized as follows: section 2 presents the problem description, section 3 presents the delay compensator approach, section 4 proposes the fuzzy implementation of the compensator, section 5 presents the neural network implementation of the compensator, section 6 proposes the neuro-fuzzy implementation of the compensator, section 7 describes the test system and the tests, section 8 presents the simulation results obtained and compares the implementations and section 9 concludes this chapter.

2. Problem Formulation

Networked control systems are widely used in embedded applications. Figure 1 presents the block diagram of a distributed real-time control system. In this kind of systems the sensor, the controller and the actuator are implemented in separated nodes that are connected through a communication network, usually a fieldbus.

media/image1.jpg

Figure 1.

Block diagram of a distributed real-time controller.

The distribution of the controller and the use of a communication network to connect the nodes of the control loop induce variable delay between the sampling instant and the actuation instant as can be seen in fig. 2.

media/image2.jpg

Figure 2.

Representation of the time between the sampling and the actuation instants.

The sampling to actuation delay (tsa) can be derived from fig. 2 as

tsa= tsc+ tca
(1)

where, from fig. 1

tsc= tps+ tmac1
(2)
and
tca= tpc+ tmac2+ tpa
(3)

The delays are introduced due to the Medium Access Control (MAC) and the scheduling mechanism used to schedule the bus time at the network level (tmac) and the processing time and scheduling at the node level (tps, tpc and tpa). These delays are usually variable from iteration to iteration of the control loop.

In this work the sampling to actuation delay is considered to be less than or equal to the sampling period, since the system is implemented in a real-time framework, where the transmission of the messages is bounded by a hard deadline.

The variable delays introduced in the control loop by the distribution degrade the performance of the control system and can even destabilize the system (Cervin, 2003a), (Tipsuwan and Chow, 2003), (Colom, 2002), (Sanfridson, 2000), (Antunes et al., 2004a) and (Antunes et al., 2004b). Since the destabilization of the control system is not acceptable and the degradation of the control performance is not desirable, it is necessary to search for solutions to overcome this problem.

There are several ways to deal with the variable sampling to actuation delay in distributed control systems including the use of linear and non-linear modeling techniques. In this work we only consider the use of non-linear techniques.

In the framework of non-linear techniques the use of compensators to improve the control performance of the loop is common. Different kinds of compensators have been used to improve the control performance of networked control systems.

(Almutairi et. al., 2001) proposed a fuzzy modulator to use with a PI controller. The modulator produces a multiplying factor that is applied to the control signal coming from the PI controller. The modulator’s output is based on the error and the control signal, making it unclear whether the compensation is related to the delay effect or to the need to improve the PI controller output.

(Lin et al., 2008) proposed a fuzzy-PID controller to work with a neural net-based Smith predictor in order to compensate for the delay effect in a non real-time implementation. This compensation scheme is used in an Ethernet based networked control system with random delays that can be longer than the sampling period with the aim of maintaining the stability of the system.

The delay compensator approach was presented in (Antunes et al., 2006) where a fuzzy implementation of the compensator was proposed. The fuzzy compensator was able to improve the control performance but did not achieve the same performance obtained in the system in the absence of delays.

Since it is well known that the effect of the delays introduced are difficult to model due to its complexity (Cervin, 2003a), (Colom, 2002) the next step was the use of neural network and neuro-fuzzy techniques to implement the compensator.

3. The Delay Compensator Approach

The delay compensator approach proposes to add a delay compensator to an existing controller that does not take into account the effect of the variable sampling to actuation delay in the loop.

The compensator proposes a correction to the control action in order to reduce the effect of the sampling to actuation delay.

Figure 3 shows the block diagram of the delay compensator approach.

media/image6.jpg

Figure 3.

Block diagram of the delay compensator approach.

The compensator action is based on the sampling to actuation delay that affects the system at each control cycle but it can have any other input.

This principle can be applied to any distributed control system provided that the sampling to actuation delay is known for each control cycle.

The determination of the sampling to actuation delay can be done either by an online measurement or by off-line computations depending on the a priori knowledge of the overall system operation conditions. The online measurement of the sampling to actuation delay provides a more generic and flexible solution that does not require the knowledge of the details of the operation conditions of the global system in which the distributed controller is inserted.

In order for the compensator to operate with the correct value of the delay affecting the network, the controller and the actuator must be implemented in the same network node.

The delay compensator principle is generic and can be implemented using different techniques.

Since the compensator output is added to the output signal from the existing controller, the compensator can easily be turned on or off and the control loop will be closed by the existing controller.

4 Fuzzy Implementation of the Delay Compensator Approach

In (Antunes et al., 2006) a fuzzy (FZ) implementation of the delay compensator was proposed based in the empirical knowledge about the delay effect on the distributed control system. A linear approximation was used to model the delay effect. The linear approximation is based on the simple fact that when there is sampling to actuation delay there is less time for the control signal to act on the controlled system. This can be compensated by increasing or decreasing the control action depending on the previous values of the control action and on the amount of the sampling to actuation delay. It is also known that small amounts of delay do not need to be accounted because they do not affect significantly the control performance (Cervin, 2003a).

The fuzzy (FZ) compensator is based on this linear approximation of the sampling to actuation delay effect. The compensator action is achieved by increasing or decreasing the control output according to the delay amount and the previous value of the control output in order to compensate for the delays introduced in the loop.

The fuzzy compensator block is presented in figure 4.

media/image7.jpg

Figure 4.

Block of the fuzzy implementation of the delay compensator approach.

The fuzzy module uses a Mamdani type function (Mamdani and Assilian, 1975) with two inputs (the sampling to actuation delay and the previous value of the control signal from the existing controller), one output (the compensation value) and six rules.

The rules state that if the difference between the previous two samples of the control signal is “null” then the contribution of the compensator is “null”. If the delay is “low” then the contribution is “null”. Otherwise if the delay is medium or high, the contribution of the compensator will also be medium or high, with a sign given by the difference between the previous two samples of the control signal: if the control signal is decreasing then the contribution of the compensator is negative and if the control signal is increasing then the contribution is positive. This corresponds to a linear approach of the effect of the sampling to actuation delay. The membership functions for the inputs and the output are bell shaped. As described in (Antunes et al., 2006) the fuzzy delay compensator allowed the improvement of the control performance of the loop but was not able to overcome all the performance degradation induced by the delays.

5. Neural Network Implementation of the Delay Compensator

This section describes the neural network (NN) implementation of the delay compensator to further improve the control performance. This implementation was first proposed in (Antunes et al., 2008a).

The model for the NN delay compensator is not a regular model. The information available to train the model is the output of a certain system with (yd(k)) and without (y(k)) the effect of sampling to actuation delay. The objective is to produce a model that can compensate the effect of this delay (knowing the delay for the iteration) in order to correct the control signal to avoid the degradation of the performance. It is necessary to find a way to produce a model that can perform the requested task.

The authors considered two possibilities:

  • - calculating the error between the two outputs: ey(k)=y(k)-yd(k) and reporting this error to the input through an inverse model or,

  • - calculating the equivalent input of a system without sampling to actuation delay that would have resulted in the output yd(k). This is also obtained through an inverse model. The second approach is illustrated in figure 5.

media/image8.jpg

Figure 5.

Method used to calculate the output of the model.

The first alternative would only be valid in the case of a linear system, since for non-linear systems there is no guarantee that the output error could be reported to the corresponding input, since the error range (y- yd) is very different from the output signal range. Using the difference between y and yd and applying it to the inverse model could result in a distortion due to the non-linearity.

The study of the lag space and the use of the method proposed in fig. 5 resulted in the model represented in fig. 6.

media/image9.jpg

Figure 6.

Block of the neural network implementation of the delay compensator approach.

This model has, as inputs, a past sample of the output of the compensator, two past samples of the control signal and two past samples of the delay information. The model is composed of ten neurons with hyperbolic tangents in the hidden layer and one neuron in the output layer with linear activation function and was trained for 15000 iterations with the Levenberg-Marquardt algorithm (Levenberg, 1944), (Marquardt, 1963).

6. Neuro-fuzzy Implementation of the Delay Compensator

The use of neuro-fuzzy techniques to implement the delay compensator was first proposed in (Antunes et al., 2008b).

The model needed to implement the neuro-fuzzy delay compensator approach is similar to the one describded in the previous section. Using the method from fig. 5 and studying the lag space results in the model represented in figure 7.

media/image10.jpg

Figure 7.

Block of the neuro-fuzzy implementation of the delay compensator approach.

This model inputs’ are: a past sample of the output, two past samples of the control signal and two past samples of the delay information.

The ANFIS structure used to obtain the model contains five layers and 243 rules. It has five inputs with three membership functions each (bell shaped with three non-linear parameters) and one output. The total number of fitting parameters is 774, including 45 premise parameters (3*3*5 non-linear) and 729 consequent parameters (3*243 linear). The neuro-fuzzy (NF) model was trained for 100 iterations with the ANFIS function of MATLAB toolbox (MATLAB, 1996).

7. The Test System

The architecture of the test system, the tests and the existing controller will be presented in the following subsections.

7.1. Architecture of the distributed system

The test system is composed of 2 nodes: the sensor node and the controller and actuator node connected through the Controller Area Network (CAN) bus (Bosch, 1991). The controller and the actuator have to share the same node in order to be possible to measure accurately the value of the sampling to actuation delay that affects the control loop at each control cycle. The block diagram of the distributed system is presented in figure 8.

Message M1 is used to transport the sampled value from the sensor node to the controller and actuator node.

The transfer function of the plant is presented in (4).

U(s)Y(s)=0.5s+0.5
(4)

The system was simulated using TrueTime, a MATLAB/Simulink based simulator for real-time distributed control systems (Cervin et al., 2003b).

media/image12.jpg

Figure 8.

Block of the test system.

7.2. Description of the tests

Three different situations were simulated.

Test 1 is the reference test, where the sampling to actuation delay is constant and equal to 4 ms. It corresponds to the minimum value of the MAC and processing delays obtained when the bus is used only by message M1.

In tests 2 and 3 additional delay was introduced to simulate a loaded network. The sampling to actuation delay introduced follows a random distribution over the interval [0,h] for test 2 and a sequence based in the gamma distribution that concentrates the values in the interval [h/2, h] for test 3.

The sampling to actuation delay obtained for tests 2 and 3 is depicted in figure 9 and 10.

media/image13.jpg

Figure 9.

Histogram of the sampling to actuation delay for test 2.

media/image14.jpg

Figure 10.

Histogram of the sampling to actuation delay for test 3.

The delay compensator was implemented in the controller and actuator node according with the block diagram from fig. 11.

media/image15.jpg

Figure 11.

Block diagram of the delay compensator implementation.

The tests were made for the system with and without the delay compensator.

7.3. Existing controller

The existing controller is a pole-placement (PP) controller (Ǻström and Wittenmark, 1997). It does not take into account the sampling to actuation delay. The controller parameters are constant and computed based on the discrete-time model given by equation (5).

G(q1)=bq11aq1
(5)

The pole-placement technique allows the complete specification of the closed-loop response of the system by the appropriate choice of the poles of the closed-loop transfer function. In this case the closed-loop pole is placed at m=2 Hz. An observer was also used with 0=4 Hz.

The sampling period (h) is equal to 280 ms and was chosen according to the rule of thumb proposed by (Ǻström and Wittenmark, 1997).

The identification of the system was based in the discrete model in (5) and the parameters were computed off-line.

The parameters of the control function were obtained by directly solving the Diophantine equation for the system. The resulting control function is given by (6).

uc(k)=t0(r(k)a0r(k1))s0y(k)s1y(k1)+uc(k1)
(6)

where t0=3.2832, ao= 0.3263, s0=7.4419 and s1= -5.2299.

8. The Simulation Results

The results obtained for test 1 (reference test) with only the existing pole-placement (PP) controller are presented in figure 12.

media/image18.jpg

Figure 12.

Control results for test 1 (reference test) without the delay compensator.

The tests were performed for the system with only the PP controller (reference test) and for the system with the fuzzy (FZDC), the neural network (NNDC) and neuro-fuzzy (NFDC) implementations of the delay compensator.

The control performance was assessed by the computation of the Integral of the Squared Error (ISE) between t= 5 s and 29 s. The results obtained for ISE are presented in Table 1.

TestPPFZDCNNDCNFDC
13.33.33.33.3
23.83.63.43.6
34.84.13.74.0

Table 1.

ISE report.

The percentage of improvement obtained compared to the reference test (test 1) for ISE is presented in Table 2.

TestFZDCNNDCNFDC
240%80%40%
347%73%53%

Table 2.

Improvement report.

The improvement is calculated as the amount of error induced by the sampling to actuation delay that the FZDC, NNDC or NFDC compensators were able to reduce. The formula used for the computation of the improvement is presented in (7).

Iprv(%)=(1ISEDCISEDCRefISEPPISEPPRef)*100
(7)

where ISEDC represents the ISE value obtained with the delay compensator and ISEPP represents the ISE value obtained with only the PP controller.

The control results for tests 2 and 3 with and without the delay compensator are presented in figures 13 to 20.

media/image20.jpg

Figure 13.

Control results for test 2 without the delay compensator.

media/image21.jpg

Figure 14.

Control results for test 2 with the FZ delay compensator.

media/image22.jpg

Figure 15.

Control results for test 2 with the NN delay compensator.

The results show the effectiveness of the delay compensator. For tests 2 and 3 the control performance obtained using the delay compensator is better than the ones obtained without compensation.

The NN implementation of the delay compenator achieved the best results. For test 2 the NN compensator was able to reduced by 80% the effect of the variable sampling to actuation delay and for test 3 the reduction is equal to 73%. The FZ compensator was able to improve the control performance in 40% for test 2 and 47% for test 3. The results obtained for the NF compensator (40% for test 2, 53% for test 3) are similar to the ones obtained with the FZ compensator.

Against our expectations the NF compensator is not able to improve the control performance as much as the NN compensator.

media/image23.jpg

Figure 16.

Control results for test 2 with the NF delay compensator.

media/image24.jpg

Figure 17.

Control results for test 3 without the delay compensator.

media/image25.jpg

Figure 18.

Control results for test 3 with the FZ delay compensator.

media/image26.jpg

Figure 19.

Control results for test 3 with the NN delay compensator.

The control signals show that the fuzzy and the neuro-fuzzy compensators are not able to prevent the oscillations of the output of the plant, while the neural network compensator is.

Nevertheless the other techniques are also able to improve the control performance and are easier and faster to implement because they do not need the expertise required to train the neural network model.

In conclusion, neural network seem to be better suited for modelling the effect of the variable sampling to actuation delays in distributed control systems.

media/image27.jpg

Figure 20.

Control results for test 3 with the NF delay compensator.

9. Conclusion

This chapter presents several implementations of the delay compensator approach using non-linear techniques. The delay compensator can be added to any existing distributed control system provided that the sampling to actuation delay can be determined for each control cycle. The delay compensator is implemented through a model that describes the effect of the sampling to actuation delay in terms of the control signal. This model is then used to compensate the control signal according to the delay at the actuation moment.

All the implementations proposed were able to improve the control performance in the distributed control system.

The fuzzy implementation is based in a linear approximation of the delay effect. It is simple to design and implement but is not able to prevent oscillations on the output of the plant.

The neuro-fuzzy implementation is easier to train than the neural network approach and achieves results similar to the ones obtained with fuzzy logic.

The neural network compensator was able to model effectively the effect of the sampling to actuation delay on the distributed control system and it achieved the best results. This approach requires the use of some expertise in produce the model needed to implement the compensator.

Future work includes the test of these implementations of the delay compensator approach using real prototypes and different plants.

References

1 - N. B. Almutairi, M. Y. Chow, Y. Tipsuwan, 2001 Networked-based controlled DC motor with fuzzy compensation, Proceedings of the. 27th Annual Conf. of the IEEE Industrial Electronics Society, 1844 1849 .
2 - A. Antunes, F. M. Dias, A. M. Mota, 2004a Influence of the sampling period in the performance of a real-time adaptive distributed system under jitter conditions., WSEAS Transactions on Communications, 3 248 253 .
3 - A. Antunes, A. M. Mota, 2004b Control Performance of a Real-time Adaptive Distributed Control System under Jitter Conditions, Proceedings of the Conference. Control 2004, Bath, UK, September 2004.
4 - A. Antunes, F. M. Dias, J. Vieira, A. Mota, 2006 Delay Compensator: an approach to reduce the variable sampling to actuation delay effect in distributed real-time control systems, Proceedings of the 11th IEEE International Conference on Emerging Technologies and Factory Automation, Prague, Czech Republic.
5 - A. Antunes, F. M. Dias, A. Mota, 2008a A neural network delay compensator for networked control systems. Proceedings of the. IEEE Int. Conf. on Emerging Technologies and Factory Automation, Hamburg, Germany, September, 2008, 1271 1276 .
6 - A. Antunes, F. M. Dias, J. Vieira, A. Mota, 2008b A neuro-fuzzy delay compensator for distributed control systems.. Proceedings of the IEEE Int. Conf. on Emerging Technologies and Factory Automation, Hamburg, Germany, September, 2008, 1088 1091 .
7 - K. Årzén-E, A. Cervin, D. Henriksson, 2005 Implementation-aware embedded control systems, In: Handbook of networked and embedded control systems, D. Hristu-Varsakelis and W. S. Levine (Ed.), Birkhäuser.
8 - K. J. Åström, B. Wittenmark, 1997 Computer Controlled Systems, Prentice Hall.
9 - Bosch. 1991 CAN specification version 2.0. Tech. Report, Robert Bosch GmbH, Stuttgart, Germany.
10 - A. Cervin, 2003a Integrated control and real-time scheduling, Ph.D. dissertation, Lund Institute of Technology, Sweden.
11 - A. Cervin, D. Henriksson, B. Lincoln, J. Eker, K. Arzen, E. , 2003b How does control timing affect performance?, IEEE Control System Magazine, 23 16 30 .
12 - P. M. Colom, 2002 Analysis and design of real-time control systems with varying control timing constraints, Ph.D. dissertation, Universitat Politecnica de Catalunya, Spain.
13 - K. Levenberg, 1944 A method for the solution of certain problems in least squares. Quarterly of applied mathematics, 2 164 168 .
14 - C. L. Lin, C. H. Chen, H. C. Huang, 2008 Stabilizing control of networks with uncertain time varying communication delays., Control Engineering Practice, 16 56 66 .
15 - E. H. Mamdani, S. Assilian, 1975 An experimental in linguistic synthesis with a fuzzy logic controller, International Journal of Man-Machine Studies, 7 1 13 .
16 - D. Marquardt, 1963 An algorithm for least-squares estimation of non-linear parameters. SIAM Journal on applied mathematics, 11 431 441 .
17 - MATLAB. 2006 Fuzzy Logic Toolbox for MATLAB, Tech. Report.
18 - M. Sanfridson, 2000 Timing problems in distributed real-time computer control systems, Tech. Rep., Royal Institute of Technology, 1400-1179 1400 1179 , Sweden.
19 - Y. Tipsuwan, M. . Chow, 2003 Control methodologies in networked control systems., Control Engineering Practice, 11 1099 1111 .