Héctor Benítez-Pérez, Jorge L. Ortega-Arjona, Paul E. Méndez-Monroy, Ernesto Rubio-Acosta and Oscar A. Esquivel-FloresControl Strategies and Co-Design of Networked Control Systems Modeling and Optimization in Science and Technologies13https://doi.org/10.1007/978-3-319-97044-8_2
2. Modelling of Networked Control Systems
Héctor Benítez-Pérez1, Jorge L. Ortega-Arjona2, Paul E. Méndez-Monroy3, Ernesto Rubio-Acosta1 and Oscar A. Esquivel-Flores1
(1)
Departamento de Ingeniería de Sistemas Computacionales y Automatización, IIMAS—National Autonomous University of Mexico, Mexico City, Mexico
(2)
Departamento de Matemáticas Facultad de Ciencias, National Autonomous University of Mexico, Mexico City, Mexico
(3)
Departamento de Ciencias de la Computación, IIMAS Mérida—National Autonomous University of Mexico, Mérida, Yucatán, Mexico
This chapter shows models for time delays and others network imperfections generated into NCS and how they are integrated into control, scheduling or codesign algorithms. First, a time delay model is presented using a generalized exponential distribution based function with data collect from non-deterministic networks. After, three NCS models are presented, each incorporates information about the network imperfections with the ultimate aim of generating a corrective action. We present models based on control, communication and codesign methodologies. Finally, a neuro-fuzzy identification is presented to model the system states and estimate the parameters of the NCS based on multi-sampling periods.
2.1 Time Delay Model
Most of the nature of time delays has not been completely defined, therefore, it is a possibility to define these as uncertainties for several applications. Since there is not a unique nature of time delays, novel approaches become an affordable and competitive issue on course.
Generally, in common configurations of a NCS (Fig. 2.1), the Round Trip Time (RTT) is defined as the time it takes a package to go from a sensor node to an actuator node. The sensor node sends an information package to the controller node, and then, the controller node computes the control signal and sends it to the actuator node. Thus, the RTT is divided into two kinds of time delays: from the sensor node to controller node (), and from controller node to actuator node ().
If the sensor and actuator nodes are the same as case A or all the nodes are completely distributed as case B, the controller node normally is able to measure the , and estimate . In case C, if the sensor and controller nodes are the same, , and is estimated. Finally, the case D if the controller and actuator nodes are the same, the RTT is simply computed since can be directly measured and .
From previous configurations, the first two cases present both time delays and , and thus, the case B is the one to be used to apply the methodologies proposed in this book. As stated before, only this configuration allows to measure , but it is necessary to estimate .
The occurrence of time delays on the nondeterministic networks are generally unknown and time varying and sometimes modelled as a random process with independent distribution. In real NCS implemented over IP networks exhibit time-varying time delays depending on the propagation distance, querying and congestion conditions, etc. This variability may be evaluated and taken into account in the modelling. Figure 2.2 illustrates real RTT delays measured between two x86 PCs interconected with an Ethernet network in the distributed control lab at National Autonomous University of Mexico (UNAM) campus Ciudad Universitaria. It shows the random behaviour in a short time [1].
Figure 2.3 shows a histogram of the RTT time delays from an Ethernet network at UNAM, the histogram is skew to the left indicating a higher probability to have delays shorter than the mean and with a much lower probability to have delays much longer than the mean. This shape of the histogram can be modelled by a random probability distribution.
We use the generalized exponential distribution to describe the RTT delays, this statistical model has the advantage of being simple to compute and easy to implement for real-time prediction. Besides, the parameters can be dynamically adapted, depending on the kind of network and different traffic conditions, significantly reducing the prediction error [2]. These are sufficient reasons to use the generalised exponential distribution as follow:
(2.1)
where is a location parameter defining by the median of the time delay and is a scale parameter defining by the standard deviation. The sample space is defined by the minimum RTT delay and the maximum allowable time delay bound (MATI) [3].
This distribution is computed for a time window with w previous measurements of time delay (), where a expected time delay value for RTT is with variance [4].
The design of the model starts by choosing . The median of the window is a feasible election, since it represents an expected time delay within the window. The distribution is obtained for each one of the values in the time window (). represents the time delay with the maximum probability. Using this value, the expected time delay values of the median and standard deviation are computed, and hence:
(2.2)
(2.3)
Being the estimated RTT:
(2.4)
2.2 Adaptive Fuzzy Model
The strategies for control systems with static time delays is common in literature. Nevertheless, strategies considering variable time delays are uncommon. Among this kind of strategies, it is used optimal control (LQR, LQG) [5, 6], robust control () [7, 8], vanishing perturbation [9], and others. These strategies aim to keep a control input resilient to variations of time delays, no matter whether this is an optimal input for the NCS.
In this section, an proposed method is introduced using a fuzzy controller, its advantage is to generate optimal control signals for each time delay value. While, it is robust to variations in such time delays. First, the time delays are analyzed an modeled as Sect. 2.1.
The fuzzy control strategy based on TSK considers a variable structure system representation, this shows as:
(2.5)
where is the ith state, n is the number of states, r is the number of fuzzy rules, and is the related membership function. Thus:
(2.6)
(2.7)
(2.8)
where are the system states (fuzzy inputs), n is the number of states, are the system inputs, m is the number of system inputs, are the system outputs, q is the number of system outputs. Also, , , and are the plant representation per scenario according to current time delays, where n is the number of states, m is the number of inputs of the system, and r is the number of fuzzy rules, as shown in Fig. 2.4.
Let us define a fuzzy model for the plant. The Eq. 2.9 models some kinds of faults using a vector . So, masks the plant faults and the model (2.9) is considering a local variable structure when faults occur and incorporating the time delays and . Remember, the nature of fault is out of the scope of this book. Notice that is the relation of a fault presence through the event.
(2.9)
where the subindex p corresponds to the dynamics of the plant.
From [10], the time delay representation in terms of discrete system in the range is:
(2.10)
where is the input matrix and is the state matrix of the continuous model of the plant. Remember that is the total number of local time delays that appears per scenario, and they respectively are the source of and . Suppose that the system is in a stable equilibrium point. Thus, the only perturbations are the time delays, and hence, it is possible to assume the outputs of the plant.
Since there is no external perturbation, and the dynamics of actuators and sensors are transparent, that is, they do not modify the control and state signals respectively, the outputs are gathered as follows:
(2.11)
From this equation, substituting in Eq. 2.9, a complete representation of plant is obtained in terms of a system in equilibrium, given as:
(2.12)
where is the feedback state for control.
Since the observed states need to be guaranteed, it is necessary to define a group of observers. The proposal of a control law in Sect. 4.2 use a group of observers to guarantee as well the system structure and the local time delays are integrated into the dynamic structure. Therefore, stability, in terms of time delays and misleading structure, should be accomplished. A review of the control law is developed through the following chapters. The related observer states are presented as z(k). In this case and are the observer parameters, to be defined in Sect. 4.2 [11].
2.3 Sampling Frequency Model
One of the strategies implemented for NCS control is feedback scheduling, where the goal is to know the performance of the communication network to modify the transmission of each node and improve the performance of the whole system.
The proposal for feedback scheduling into a real-time distributed system modifies the transmission frequency of each node into a region where the performance in each node is acceptable. This approach is a representation of the transmission frequencies using a time-invariant space state system, whose state variables are the desired transmission frequencies with of the n nodes involved in the NCS.
The objective of the space state system is to obtain the next desired frequencies. Each node i is bounded into a minimum and maximum transmission frequency computed offline. The are defined by the steady-state stability requirements associated to the node i and the are defined by the capacity of the node i itself without generating an excessive transmission cost into the network i.e. in a distributed system with n nodes, each one performing a task with a maximum frequency and consumption time per transmission packet , for the following computational constraint needs to be accomplished:
(2.13)
This equation implies that consumptions due to message transmission with the maximum frequencies should not exceed the network utilisation in order to avoid packet losses and time delays.
So, the state variables are the desired frequencies of the n nodes in the network control system. The objective of the proposed controller is to stabilize the current frequency of the system to the desired reference frequency , through an optimal trajectory using a LQR controller.
By defining a discrete state space model as
(2.14)
where is the matrix of relationships between frequencies of the nodes, is the weighted frequency matrix, is the output matrix, is a real frequency vector, and is the next frequency vector.
Let be given by a function of minimal frequencies and given by a function of maximal frequencies , where , and n nodes:
(2.15)
(2.16)
The elements and in Eq. 2.14 are defined as follows:
(2.17)
(2.18)
(2.19)
This will provide a model to modify the transmission frequency of each node depending on the current frequency. It is a reconfigurable system where indirectly the behaviours of the network imperfections and the NCS system are modified.
2.4 Control-Scheduling Codesign Model
Another approach for controlling NCSs with variable time delays is to take into consideration actuation periods. Here, the objective is to bound the variation space of the time delay to discrete values, making use of an estimated time delay with values that are multiples of the actuation period, and generate optimal control signals for such an estimated time delay. The configuration of a NCS takes into consideration the sensor node driven in time, whereas the controller and actuator nodes are event-driven. Using a space-state model of a discrete time linear system in invariant discrete time, with a sampling period h [12]:
(2.20)
where x(k) is the state of the plant, u(k) and y(k) are respectively the inputs and outputs of the plant, matrix is the output matrix, and matrices y are obtained using:
(2.21)
with and as the matrices of the system and input of the model in continuous form:
(2.22)
In the specific case of NCS, I/O latencies result from computing the control algorithm or due to the insertion of the network in the control loop. The standard model that comprises the time delay , with , is [12]:
(2.23)
The model in Eq. 2.23 is the simplest form used for analyzing and designing controllers for NCS. This model assumes a reference time, given by the sampling instants with a fixed time delay, starting at sampling, and until actuation. But if the time delay is variant and larger than the sampling period and/or the sampling interval is variant, then this model is not very feasible for NCS [13].
Here, a execution time of control tasks that synchronizes the operation of each control loop at the instant of actuation is proposed (Fig. 2.5). The sampling instants are labelled by t(s, k) where the system states are obtained, and the instants of actuation are labelled by t(k) where the control signals u(k) are applied. Hence, the time elapsed between consecutive instants of actuation , has a actuating period h. The difference between the sampling instant t(s, k) and the following actuation instant t(k) is a variable time delay:
(2.24)
and it is used for estimating the state in the actuation instant:
(2.25)
A control strategy relies on the time reference given by the instant of actuation. In addition, samples are not required to be strictly periodic, because in Eq. 2.24 can vary at each closed-loop operation. The interested reader is referred to [14] for further reading on this control model.
Each instant of actuation, the actuator node generates the next actuation instant t(k), which is sent to the sensor after applying the control signal to the plant. Upon reception of this message or next sampling period, the sensor samples the plant x(s, k), and records the absolute sampling time t(s, k). The latter, together with t(k), is used to compute . Both x(s, k) and are sent to the controller node. Upon reception of this message, the controller node estimates the plant state that applies at (Eq. 2.25) with the next estimated time delay , and computes a control command u(k) designed in Chap. 4. This is sent to the actuator that applies it to the plant at the synchronised actuation instant.
The NCS architecture (Fig. 2.6) has four types of nodes connected to an Ethernet network: sensor, controller, actuator, and traffic nodes. A control loop comprises communication between sensor-controller and controller-actuator nodes. Traffic nodes send periodic or sporadic packets into network, like for example, other control loops or monitoring.
All nodes send User Datagram Protocol (UDP) packets to avoid double traffic into network. However, it is not possible to know whether there is packets loss or a maximum time delay since there is no acknowledgement that the sent packet has been received.
Here, network-induced time delays and variable sampling intervals smaller than a sampling period are compensated by the one-shot model, and the fuzzy model compensates time delays longer than such a sampling period.
The time delay is estimated in the controller using Eqs. (2.1–2.4) (Fig. 2.7). When the control node receives a new packet, this contains the state x(s, k) and the time delay . Once the time delay is received, an exponential distribution algorithm [15] is used to estimate the next time delay . This algorithm is widely used to estimate delays in real time, where an offline statistical analysis characterises mean and standard deviation of time delays data with multiple scenarios of traffic. Those are used to form a generalized exponential distribution with a probability density function (Eq. 2.1).
Once the next time delay of the system is estimated, it is used to generate a control signal. This controller starts with a fuzzy model of the NCS, designed as follows.
The fuzzy model (Eq. 2.25) is TSK type [16], with the time delay as input of the antecedent part, and linear discrete models with different sampling periods as consequent part. Thus, defining r fuzzy rules, the jth rule has the form:
(2.26)
where is the state vector of system, is the input vector of process, is the jth membership function of the estimated time delay .
The overall fuzzy model is:
(2.27)
where the normalized fire strength is:
(2.28)
and is a Gaussian membership function with parameters . are the matrices of jth linear discrete model discretised with a sampling period (). The discrete local models are:
(2.29)
so, for are assigned by user according to offline time delay measurement.
With this fuzzy model, the estimated state of a system is obtained by compensating the time delays and variable sampling intervals. The action is to smoothly switch between discrete models, to generate the best estimate of state, according to the estimated time delay . Once designed the fuzzy model (2.26) using the estimated time delay , a fuzzy controller is proposed in Chap. 4.
2.5 Neuro-Fuzzy Identification
The objective of the neuro-fuzzy model is to define the best linear model for each sampling period representing the system. This model estimates the system states according to the possible time delay calculated by an exponential distribution function defined in Sect. 2.1.
The neuro fuzzy model (Eq. 2.30) is TSK type [17] with variable sampling period as antecedent input, and discrete models with different sampling periods T as consequent part. So, defining r fuzzy rules, the jth rule has the form:
(2.30)
where is the state vector of the system, is the input vector of the plant, is the jth membership function of variable sampling period .
The overall fuzzy model is:
(2.31)
where the normalized fire strength is:
(2.32)
where is a Gaussian membership function with parameters , and and are the matrices of jth linear model, with m outputs and periods .
The system states are approximated with this fuzzy model. The objective is to smoothly switch between discrete models, to generate the best estimate of states according to the variable sampling period. However, there are some parameters such as that need to be tuned using a neuro-fuzzy approach [18, 19]. This section uses data of the simulated system with some specific time delays to get the model parameters, although, alternatively techniques like LMI may be used and reviewed in other works as [20]. The neuro-fuzzy model (Eq. 2.30) is identified using inputs-states data with measured variable sampling period , obtained from a Truetime simulation of the system [21], with a PID controller and a traffic node on an Ethernet network.
The identification procedure has two algorithms: a clustering algorithm, to create new rules, and a training algorithm, to update the model’s parameters. The procedure is repeated -epochs. M is maximum firing strength of all rules for variable sampling period and is its threshold. is a threshold of maximum model error. J is the performance index to update the matrices .
Procedure: The first fuzzy rule is created with the discrete model, with sampling period , which is the variable sampling period mean, and is the predetermined width. So, matrices and of the first rule are:
(2.33)
(2.34)
(2.35)
A new rule is created using the -completeness criterion, which states that, for any input within operation range, there is a rule with fire strength greater than a threshold [22]. So, if maximum firing strength M of all rules is less than then a new rule is created.
(2.36)
(2.37)
With this clustering algorithm, it is ensured that all variable sampling periods of the training data are represented by the antecedent part of the neuro-fuzzy model.
In the training algorithm, the parameters of local models are estimated using error criterion. It says that, if an output error e is less than a threshold (Eq. 2.40), the parameters should be adjusted. The threshold is decreased according to the current epoch f.
(2.38)
(2.39)
(2.40)
where is the final error expected at the end of training, is the initial error obtained in the first epoch without training, f is the current training epoch, and is the total of epochs.
The backpropagation approach is used for the adjustment of the parameters. So, a performance index J is used to adjust the model with objective to minimise J (modelled error).
(2.41)
The coefficients and of the system and control matrices, respectively, as well as the centres and standard deviations are adjusted by:
(2.42)
(2.43)
(2.44)
(2.45)
where is the learning rate for each parameter, , ; and . The data used in here is the result of analysis of general scenarios considering local time delays and ethernet channel communication.
Once designed and identified, the fuzzy model (Eqs. 2.30, 2.31, 2.32) is presented a fuzzy controller in Chap. 4, using estimated variable sampling period .
2.6 Concluding Remarks
This chapter presents a statistical model of the time delay through an exponential probability density function that allows estimating the time delay for compensation purposes, the model assumes a variable time delay and greater than the sampling period of the system, Model is validated using experimental data. Three design methodologies are also presented.
The first method presents a model using fuzzy theory to incorporate the estimated time delay with several space-state models. This allows improving the state estimation to be used in the controller with minimal computational cost.
The second method presents a sampling frequency model through a state-space model that represents the dynamic behaviour of the transmission frequency as a function of the actual transmission frequency into the network with longer time delays or lost deadlines.
The third method presents a methodology of codesign where through two fuzzy models are trade-off the control and scheduling performance. The first model incorporates linear models with different sampling periods obtaining delay-dependent system states. The second model uses QsC and QsS to schedule the next stable actuation period and minimise the system error and the effect of network uncertainties.
Finally, a neural strategy is presented to obtain the fuzzy rules that allow to identify the complete NCS system and to improve the estimation of the states of the system.