Open access

Implementation of the Delay Compensator Approach

Written By

Ana Antunes, Fernando Dias, Jose Vieira and Alexandre Mota

Published: 01 March 2010

DOI: 10.5772/9519

From the Edited Volume

Factory Automation

Edited by Javier Silvestre-Blanes

Chapter metrics overview

2,455 Chapter Downloads

View Full Metrics

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.

Advertisement

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.

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.

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

t sa =  t sc +  t ca E1

where, from fig. 1

t sc =  t ps +  t mac1 E2
and
t ca =  t pc +  t mac2 +  t pa E3

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.

Advertisement

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.

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.

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.

Advertisement

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:

  1. - 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,

  2. - 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.

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.

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).

Advertisement

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.

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).

Advertisement

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.5 s + 0.5 E4

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

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.

Figure 9.

Histogram of the sampling to actuation delay for test 2.

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.

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 ( q 1 ) = b q 1 1 a q 1 E5

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).

u c ( k ) = t 0 ( r ( k ) a 0 r ( k 1 ) ) s 0 y ( k ) s 1 y ( k 1 ) + u c ( k 1 ) E6

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

Advertisement

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.

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.

Test PP FZDC NNDC NFDC
1 3.3 3.3 3.3 3.3
2 3.8 3.6 3.4 3.6
3 4.8 4.1 3.7 4.0

Table 1.

ISE report.

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

Test FZDC NNDC NFDC
2 40% 80% 40%
3 47% 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).

I p r v ( % ) = ( 1 I S E D C I S E D C Re f I S E P P I S E P P Re f ) * 100 E7

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.

Figure 13.

Control results for test 2 without the delay compensator.

Figure 14.

Control results for test 2 with the FZ delay compensator.

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.

Figure 16.

Control results for test 2 with the NF delay compensator.

Figure 17.

Control results for test 3 without the delay compensator.

Figure 18.

Control results for test 3 with the FZ delay compensator.

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.

Figure 20.

Control results for test 3 with the NF delay compensator.

Advertisement

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. 1. Almutairi N. B. Chow M. Y. Tipsuwan Y. 2001 Networked-based controlled DC motor with fuzzy compensation, Proceedings of the. 27th Annual Conf. of the IEEE Industrial Electronics Society, 1844 1849 .
  2. 2. Antunes A. Dias F. M. Mota A. M. 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. 3. Antunes A. Mota A. M. 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. 4. Antunes A. Dias F. M. Vieira J. Mota A. 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. 5. Antunes A. Dias F. M. Mota A. 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. 6. Antunes A. Dias F. M. Vieira J. Mota A. 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. 7. Årzén-E K. Cervin A. Henriksson D. 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. 8. Åström K. J. Wittenmark B. 1997 Computer Controlled Systems, Prentice Hall.
  9. 9. Bosch. 1991 CAN specification version 2.0. Tech. Report, Robert Bosch GmbH, Stuttgart, Germany.
  10. 10. Cervin A. 2003a Integrated control and real-time scheduling, Ph.D. dissertation, Lund Institute of Technology, Sweden.
  11. 11. Cervin A. Henriksson D. Lincoln B. Eker J. Arzen K. E. 2003b How does control timing affect performance?, IEEE Control System Magazine, 23 16 30 .
  12. 12. Colom P. M. 2002 Analysis and design of real-time control systems with varying control timing constraints, Ph.D. dissertation, Universitat Politecnica de Catalunya, Spain.
  13. 13. Levenberg K. 1944 A method for the solution of certain problems in least squares. Quarterly of applied mathematics, 2 164 168 .
  14. 14. Lin C. L. Chen C. H. Huang H. C. 2008 Stabilizing control of networks with uncertain time varying communication delays., Control Engineering Practice, 16 56 66 .
  15. 15. Mamdani E. H. Assilian S. 1975 An experimental in linguistic synthesis with a fuzzy logic controller, International Journal of Man-Machine Studies, 7 1 13 .
  16. 16. Marquardt D. 1963 An algorithm for least-squares estimation of non-linear parameters. SIAM Journal on applied mathematics, 11 431 441 .
  17. 17. MATLAB. 2006 Fuzzy Logic Toolbox for MATLAB, Tech. Report.
  18. 18. Sanfridson M. 2000 Timing problems in distributed real-time computer control systems, Tech. Rep., Royal Institute of Technology, 1400-1179 1400 1179 , Sweden.
  19. 19. Tipsuwan Y. Chow M. . 2003 Control methodologies in networked control systems., Control Engineering Practice, 11 1099 1111 .

Written By

Ana Antunes, Fernando Dias, Jose Vieira and Alexandre Mota

Published: 01 March 2010