INTERNATIONAL JOURNAL OF COMPUTERS COMMUNICATIONS & CONTROL ISSN 1841-9836, 13(2), 251-267, April 2018. Control-Scheduling Codesign for NCS based Fuzzy Systems P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc Paul Erick Mendez-Monroy*, Israel Sanchez Dominguez IIMAS-Merida Universidad Nacional Autonoma de Mexico, Parque Cientifico y Tecnologico de Yucatan, 5.5Km Carretera Sierra Papacal - Chuburna, C.P. 97302 Sierra Papacal, Yucatan, Mexico *Corresponding author: erick.mendez@iimas.unam.mx israel.sanchez@iimas.unam.mx Ali Bassam, Oscar May Tzuc Facultad de Ingenieria, Universidad Autonoma de Yucatan, Av. Industrias no Contaminantes, Apdo. Postal 150 Merida, Yucatan, Mexico baali@correo.uady.mx, maytzuc@gmail.com Abstract: In the present paper, a fuzzy codesign approach is proposed to deal with the controller and scheduler design for a networked control system which is physically distributed with a shared communication network. The proposed fuzzy controller is applied to generate the control with different sampling-actuation periods, the config- uration supposes a strict actuation period disappears the jitter. The proposed fuzzy scheduling is designed to select the sampling-actuation period. So, the fuzzy codesign reduces the rate of transmission when the system is stable through the scheduler while the controller adjusts the control signal. The fuzzy codesign guarantees the stability of all the system if the network uncertainties do not exceed an upper bound and is a low computational cost method implemented with an embedded system. An unstable, nonlinear system is used to evaluate the proposed approach and compared to a hybrid control, the results show greater robustness to multiple lost packets and time delays much larger than the sampling period. This paper is an extension of [20].a Keywords: codesign, dynamic scheduling, fuzzy control, networked control system. aReprinted (partial) and extended, with permission based on License Number 4275590998661 IEEE, from "Electrical Engineering, Computing Science and Automatic Con- trol, 2017 14th International Conference on". 1 Introduction This paper is an extension of [20]. The system model with sampling-actuation periods in [20] is modified using the one-step control input, the network imperfection estimation is improved, the feedback matrices are calculated in a simpler way. Finally, the analysis of stability and the analytical codesign are also presented. Networked control systems (NCSs) are composed of physically distributed agents that can sense the environment, act on it, and communicate with one through a communication network to achieve some common goals. These characteristics have made them a topic of current interest in the control area. By including a communication network within the control loop, considerations are presented for its design. Among these considerations the most important are time delays [13] [27] [11] [12], packet losses [13] [27] [11] [12], signal quantization [14] [21] and scheduling [6] [28]. These have been investigated with results reported in the literature. In addition, because of the advantages of reduced system wiring, simple installation, increased system flexibility and resources sharing, Copyright © 2018 by CC BY-NC 252 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc NCSs have been finding applications in DC motors [5] [9], robot control [28], vehicle robot [25] and ball maglev system [11], among others. Time delays in NCSs are the major cause of system performance deterioration and poten- tial system instability. Time delays have been modelled by using various formulations such as constant delay [22], independently random delay [1] and random delay governed by Markov chain [32]. Sometimes, the time delays are included as time-varying input delays of the sys- tem [30]. Yi, An and Choi performed a control system over a wireless network with communi- cations only in the control channel. They employ a full-order observer to estimate the system states without time delays. The control-actuator time delay is measured at the plant and the observed states are used as a predictor to generate the system state with the expected time delay. Finally, they employ a LQR control to generate the control signal based on the next estimated states. Therefore, the analysis and synthesis of NCSs with both time delays and packet losses is a persistent problem in the challenging but practical problem. In the literature, some important methodologies, such as stochastic control [11], predictive control [5] [10] [30], robust control [12], and state feedback control [31], are proposed to compensate time delays and/or packet losses have been proposed. At the last years, fuzzy logic control has received great attention from academic and industrial communities. More recently, the fuzzy control has developed strategies for NCS, In the work of Peng and Yang [24], a delay distribution-dependent design method for NCS Takagi Sugeno fuzzy systems [26] was proposed taking into consideration of the probabilistic interval distribution of the communication delay. Tong, Qian and Lui [29] used a fuzzy predictive controller to counteract time delays in the feedback channel. Where the fuzzy controller estimates the variations of the control signal based on the differences between the reference error and the control error applied. Chai et al. [4] investigated the state feedback and dynamic output feedback controller design for membership functions and time delays in premise variables into the controller design. The resulting conditions were expressed in terms of SOS-based inequalities. In the case of lost packets, commonly the effect has been modelled by a Bernoulli process and strategies in static/dynamic output feedback and model predictive control problems for discrete- time T-S systems with lost packets were investigated in [7] [34]. In [15], Li, Wu, and Feng used a fuzzy model to describe a nonlinear plant with an output feedback controller H∞ and modelling the lost packets as a Bernoulli random binary distribution. It is noticed that most of the existing control methodologies for NCSs adopt a sampling period regardless of network Quality-of-Services (QoS) variations. In practical circumstances, the network QoS always fluctuates due to changes in the traffic load and available network resources. In regard to QoS, Tipsuwan and Chow [28] proposed a gain scheduling controller for NCSs, where the control parameters were adjusted on-line based on network QoS variations and Chow [6] optimized the control parameters for gain scheduling controller to improve the NCSs performance. However, these works only focused on the controller design. More recently, BenĂtez et al. [3] presented a frequency control of multiple network control systems, this takes into account information from the network transmissions, where asymptotic stability of the systems is ensured when the time delay is bounded. This paper shows a fuzzy NCS codesign controller-scheduler to adapt simultaneously the control signal and sampling period with estimated network imperfections. This introduces a neural model to estimate the time delay and lost packets as a compound time. A fuzzy control with the estimated compound time as the antecedent part is used to minimize the network effects. Finally, a fuzzy scheduler is designed to modify the sampling-actuation period based on the system performance and network utilization. Control-Scheduling Codesign for NCS based Fuzzy Systems 253 The paper is organized as follows: section 2 introduces a dynamic model based on actuation periods and shows a recurrent neural network to estimate some network imperfections. In section 3 the fuzzy model with different actuation periods and the stability analysis is presented. Section 4 summarizes the design of a fuzzy scheduler to modify the actuation period. Section 5 presents an analytical codesign and section 6 presents the experimental case to evaluate the codesign performance, it is compared with a hybrid controller. Finally, the conclusions are provided in section 7. 2 Preliminaries 2.1 Periodic Actuation Model NCS is defined as: A feedback control system closed via a communication channel, it may be shared with other control loops or nodes outside the control system. A spatially distributed system for a single control loop is shown in Figure 1, where the sensor, controller, and actuator nodes exchange information via a communication network. Figure 1: Configuration of NCS with traffic nodes The most general continuous state-space representation of a linear system with m inputs, p outputs and n state variables is written in the following form ẋ(t) = Ax + Bu(t) y(t) = Cx(t) (1) where A ∈ Rnxn, B ∈ Rnxm and C ∈ Rpxn are the system, input and output matrices of the continuous-time state space respectively. xk ∈ Rn is the process state vector, uk ∈ Rm and yk ∈ Rp are the inputs and outputs of the process. The continuous linear system Eq. 1 can be discretized assuming a zero-order hold [2] for the input vector with a sampling period h to xk+1 = Φhxk + Γhuk yk = Cxk (2) where the matrices Φh ∈ Rnxn and Γh ∈ Rnxm are obtained by Φh = e Ah, Γh = ∫h 0 eAsBds (3) 254 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc For standard closed-loop operation of the discrete system (Eq. 2), a controller can be designed using feedback control as follows uk = Kxk, K ∈ Rmxn (4) where K is the state feedback matrix obtained using standard control design methods. The application of the control signal (Eq. 4) to the process forces to computing it with zero time. Nevertheless, this is physically impossible even for processor-based systems due to algorithm computational time. Taking into account this limitation. The discrete model (Eq. 2) can be augmented to cope with a time delay due to the insertion of a network/processor within a control loop, as in the case of NCS [2]. The standard model that incorporates a time delay τ less than one sampling period (τ < h), is xk+1 = Φhxk + Φh−τ Γτuk−1 + Γh−τuk (5) The equation 5 has been often taken as the essential control model for design and analysis of NCS. This model assumes a time reference given by the sampling instants with a fixed time delay from sampling to actuation. However, this model is useless if the time delay is variable and/or greater than one sampling period or the sampling interval is variable. [17]. The task execution model proposed is shown in figure 2. It aims is to use strict periodic sampling and actuation [18] into the space state model decreasing the variability in the time delays and the sampling intervals. This model estimates the states as a function of the actuation periods [16], making only necessary to estimate the compound time in a set of multiples of the actuation period. The model synchronizes the operation of each control loop at the actuation instants. Hence, tk is the actuation instant, the actuation interval is the time elapsed between consecutive actuation instants, named tk−1 and tk, h is the actuation period. Within this actuation interval, the system state is sampled, named xs,k(ts.k) ∈ [tk−1, tk] where ts,k is the sampling time recorded. Eq. 6 represents a time delay τk used to estimate the state at the actuation instant and the Eq. 7 represents the discrete system with periodic actuation. τk = tk − ts,k (6) x̂k = Φτkxs,k + Γτkuk−1 (7) Finally, making use of x̂k, the control command is computed as uk = Kx̂k, K ∈mxn (8) where K is the feedback matrix that is designed in next section. The control command uk is held constant within actuation period with a zero-order Hold (ZOH). At each control cycle the information flow in the NCS, the sensor node begins sampling the process xs,k in time ts,k, the time delay and lost packets are estimated. It sends the data to the codesign node where is used to generate uk (Eq. 6)-(Eq. 8), also the scheduler generates the next actuation period if it is necessary. The control and period are sent to the actuator node applying the control to the process. Finally, the actuator node sends tk and the period to the sensor node to apply the sampling period and calculate the time delay and lost packets. The cycle starts again. With the strict periodic sampling and actuation h, the time delay τ is restricted to multiples of the actuation period and the sampling intervals can be used to control the network bandwidth consumption. The model has several properties for controllers, it is compatible with standard Control-Scheduling Codesign for NCS based Fuzzy Systems 255 Figure 2: Periodic Actuation Model scheduling because does not demand any specific timing constraints. The scheduling jitter is absorbed with a priori knew of time reference tk and the sampling jitter disappears using the periodic actuation model (Eq. 7) absorbs the irregular sampling and variable actuation intervals. The next section presents an approach to estimate the time delay and lost packets with a recurrent neural network. 2.2 Time delay and lost packets estimation One major challenge for NCS design is the effect of time delays and lost packets in a control loop. The time delays occur when the system components exchange data across the network. It can degrade the performance or even destabilize the system. The time delay τk assumes lower and upper bounds. In case of time delays is 0 < τmin ≤ τk ≤ τmax (9) On the other hand, lost packets can be the consequence of a link failure, generated pur- posefully to avoid congestion or guarantee the most recent data to be sent. Normally, feedback controllers can tolerate a certain amount of lost packets. However, consecutive lost packets have an impact of degradation on the overall system performance. Hence, the next actuation period is a compound time υ between time delays and lost packets formed as follows υ ≡ tk+1 − tk = (ξ̄ + 1)h + τk+1 − τk (10) where h denotes the actuation period, tk the actuation instant and ξ̄ the estimated lost packets. Figure 3: Time delays and time elapsed between lost packets with traffic (50 - 80 s). Eq. 10 defines a compound time with the analytic bounds for time delay and lost packets, the aim is to design a recurrent neural network (RNN) using compound time values as input, and 256 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc time delay forecast as output. The collection of time delay data (τk) is analyzed and modelled to achieve the lowest discrepancies between the observed delay and the predicted delay (Fig. 3). Figure 3 illustrates the time delays and time elapsed between consecutive lost packets. Heavy traffic is generated into 50-80 s showing a maximum compound time of 300 ms. The RNN is formed with three layers (Fig. 4), the input layer with 6 delayed inputs, one feedback input and bias, the hidden layer with 10 tansig nonlinear neurons, and the output layer with one linear discriminatory purelin neuron and bias. I = {τk−i, Ôk−1,b1} i = 1 − 6 Hj = tansig [∑7 i=1 IWijIi ] τ̂k+1 = O = purelin [∑10 j=1 OWjHj + b2 ] (11) The Levenberg-Marquardt algorithm was used for training. The number of hidden nodes selected was the RNN with the best validation performance. Figure 4: Structure of recurrent neural Network for time delay estimation 3 Fuzzy control A new modelling method for nonlinear NCS with compound time is presented in this section. The process under consideration is a nonlinear discrete-time system represented by the TSK fuzzy model [26], It has the compound time υ̂ as antecedent input and linear discrete models (Eq. 7) with different sampling periods hj as consequent output. By modelling the system dynamics in function of the compound time. So, defining r fuzzy rules, the j-th rule has form if υ̂ is αj then xj = Φjxs,k + Γjuk−1 (12) where xk ∈ Rn is state vector, uk ∈ Rm is input vector, αj is the j-th membership function. The overall fuzzy model is: x̂k = r∑ j=1 ψj [Φjxs,k + Γjuk−1] (13) with the normalized fire strength ψj as r∑ j=1 ψj = 1 ψj ≥ 0 ψj = αj r∑ s=1 αs (14) Control-Scheduling Codesign for NCS based Fuzzy Systems 257 and αj = exp [ − [υ̂ −ρj]2 σ2j ] (15) αj is a Gaussian membership function with parameters [ρj,σj]. On the other hand, [Φj, Γj] are the matrices of j-th linear discrete model discretized with a sampling period [hj, j = 1 . . .r], the discrete local models are: xj = e [Ahj]xs,k + ∫ hj 0 eAsdsBuk = Φjxs,k + Γjuk−1 (16) So, [hj,ρj,σj] for j = 1, . . . ,r are assigned by user according to range of the compound time. With this fuzzy model, the estimated system state is obtained by compensating the time delays, variable sampling intervals and lost packets. The action is to smoothly switch between discrete models to generate the best estimate of the state according to the estimated compound time υ̂. Once designed the fuzzy model x̂k using the estimated compound time υ̂ a fuzzy controller is proposed. This is a fuzzy feedback control law like: uk = − r∑ j=1 ψjKjx̂k j = 1, . . . ,r (17) where Kj is the feedback matrix of the j-th fuzzy rule. This control law is designed like a LQR (Linear Quadratic Regulator) [33] to minimize a performance index. The control design by LQR for each local model requires the algebraic solution of the Ricatti equation for the Hj matrix. So, the feedback matrices are calculated like: Kj = R −1 j Γ T j Hj j = 1, ...,r (18) The closed loop system is: xk+1 = r∑ i=1 r∑ j=1 αiβj [Ψi − ΓiKj] xk = r∑ i=1 r∑ j=1 αiβjΛijxk (19) with Λij = Φi − ΓiKj i = 1, . . . ,r j = 1, . . . ,r The properties of the antecedent part (Eq. 14) are considered for the stability analysis of fuzzy control uk, the Eq. 20 are complementary properties of fuzzy sets. ψiψj ≥ 0 r∑ i=1 r∑ j=1 ψiψj = 1 r∑ i=1 ψ2i + 2 i 0 ∈ Rnxn, we have 2 r∑ i r∑ j ψiψjATi PBj ≤ r∑ i r∑ j ψi [ ATi PAi + B T i PBi ] (21) where he normalized fire strength ψi has the properties showed in Eq. 20 and Eq. 14. 258 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc So, the stability of the fuzzy model (13) and the fuzzy control (17) can be guaranteed if the following Theorem is fulfilled. Theorem 1. The equilibrium state xe = 0 of closed loop system with control input (19 with two-overlapped fuzzy memberships at most, is asymptotically stable in the large, if there exist µ positive definite matrices Ps = PTs > 0 such that: [Λij + Λji] T Ps [Λij + Λji] − 2Ps < 0 i ∈ Ss s = 1, . . . ,µ (22) ΛTiiPsΛii −Ps < 0 i ∈ Ss j ∈ Ss i < j ∈ Ss (23) Λij = Φ i − ΓiKj where S = {S1,S2, . . . ,Sµ} are µ regions where two fuzzy rules are fired at most (two overlapped fuzzy memberships), where Ss contains the indexes of fired membership functions in s region. Proof: We suppose that there exist µ matrices Ps = PTs > 0 so (22) and (23) are satisfied. Considering a candidate Lyapunov function like: Vk = µ∑ s=1 λs [ xTk Psxk ] (24) where λs [υ̂] = { 1 υ̂ ∈ Ss 0 υ̂ /∈ Ss µ∑ s=1 λs [τ̂] = 1 (25) It can be easily showed that V [0] = 0, Vk > 0 for xk 6= 0, and V [x] →∞ as ‖xk‖→∞, it is only sufficient shows that ∆V [xk] < 0 to prove that Vk is a Lyapunov function and the theorem is fulfilled. 2 So, we have: ∆Vk = Vk+1 −Vk = µ∑ s=1 λs [ xTk+1Psxk+1 ] − µ∑ s=1 λs [ xTk Psxk ] By reordering and set the matrix V sk = x T k Psxk ∆Vk = µ∑ s=1 λsLs Ls = V s k+1 −V s k (26) It is enough to show that: Ls < 0 s = 1, ...,µ (27) Substituting V sk+1 and V s k in (26) we have: Ls = [ ∑ i∈Ss ∑ j∈Ss ψiψjΛijx ]T Ps [ ∑ i∈Ss ∑ j∈Ss ψiψjΛijx ] −xTPsx (28) Ls ≤ xT [ ∑ i∈Ss ∑ j∈Ss ψiψj [ ΛTijPsΛji −Ps ]] x (29) ≤ xT   ∑ i∈Ss ψ2i [ [Λii + Λii] T Ps [Λii + Λii] −Ps ] + ∑ i∈Ss j hmax} + ξ ∆h = m δ ∑ k∈n hk (31) The deadline rate as a controlled variable is a common metric for the quality of service (QoS). from a real-time point of view is also an important factor that degrades the quality of control (QoC). The QoS controls the number of lost deadlines at an acceptable low level. In addition, The ∆h as a controlled variable can simultaneously address the problems of variable time delays and lost packets. When ∆h is kept at a low level, the delays of most packets are less than the deadline and the number of packets lost is limited. As a consequence, the impact of the delay and the lost packets in the QoC is minimized. The sampling period affects the lost deadline rate, with short sampling periods increasing network utilization, which inherently causes that the network imperfections increase and vice versa. With heavy traffic load, the probability of collisions between nodes is greater, which potentially increases both the time delay and the lost packets and at the same time the lost 260 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc deadline rate. On the other hand, a largely lost deadline rate can generally be reduced by increasing the sampling period, particularly when the network is overloaded. According to the control theory of sampled data, short sampling periods generate better QoC. In this context, QoC can be improved by increasing the utilization efficiency by adjusting the sampling period. This justifies the choice of the sampling period as a manipulated variable that is adjusted with respect to the network conditions, where variations in the unpredictable and dynamic traffic load in the NCS can be effectively compensated. With the metric of the QoC (∆e) and QoS (∆h), the fuzzy scheduler is designed as a con- trol problem, where the metrics form the antecedent part and the consequent part are parallel feedback matrices. The i-th fuzzy rule has the form of: if ∆e is β1j and ∆h is β2j then h̄ = Fz (32) where β are the membership functions and z ∈ R2 with z = [∆e ∆h], F is the feedback scheduling matrix. the overall fuzzy scheduler is: h̄ = M∑ i=1 2∏ j=1 βijFiz (33) where M is the number of fuzzy rules. The new sampling period is assigned in the interval: h+ = {hmin ≤ h̄ ≤ hmax} (34) Given the absence of a mathematical model that describes the relationship between the lost deadline rate, the EAM and the sampling period, the bounds and the fuzzy scheduler are determined based on experimentation. 4.1 Analytical codesign If the fuzzy model is locally controllable, i.e. (Φi, Γi), i = 1, ..., l, are controllable pairs, the feedback control matrices Ki, (i = 1, 2, ..., l) can be calculated using eq. (18), with matrices Ri and Qi to get a desired performance. The procedure of the fuzzy codesign is as follows: Step 1: Define the intervals of the compound time based on the measurements of the network to define the bounds of the compound time. Step 2: For the plant (eq. 1), define the hi actuation periods for each Fi matrix in the fuzzy scheduler. Define the membership functions for the control error ∆e and deadline rate ∆h. Step 3: Discretize the model (eq. 1) for each hi to set Γi and Φi in the fuzzy controller. Step 3: Verify that all local discrete systems are controllable. That is, rank(Γi, ΦiΓi, ..., Φ n−1 i Γi) = n, i = 1, ..., l. Step 4: Calculate the feedback matrices Ki of each local system via LQR assigning the matrices Ri and Qi according to the desired performance (Eq. 18). Step 5: Find all the µ regions with almost two overlap rules and apply Theorem 4.1 to check the stability of the closed-loop. If the system is not stable, go back to step 4 to reassign the matrices Ri and Qi. 5 Experiments and results The fuzzy codesign approach is tested in a nonlinear MIMO system with an Ethernet network, the experiment generated variable traffic into the network with external nodes. The performance is compared with a Hybrid controller [11]. Control-Scheduling Codesign for NCS based Fuzzy Systems 261 5.1 Case study The case study is a MIMO nonlinear, open-loop unstable and time-varying system. It is a 2-DOF helicopter system integrated to an Ethernet network (Figure 5), detailed information can be found in [19]. The sensor and actuator nodes are Pentium 4 with 1028 Mb RAM with an INTEL 10/100 Mb Ethernet card, each has an XPC target operative systems and are connected through a switch, the controller is an embedded system with a microcontroller board based on the ATmega32u4 and the Atheros AR9331. The Atheros processor uses Linino OS a Linux distribution. The board has built-in Ethernet slot, a 16 MHz crystal oscillator. The sensor node has an A/D 10 bits resolution and the actuator has a D/A 8 bits resolution. The tasks for the NCS are set as follows, 5 ms as minimum sampling period of sensor and actuator nodes, the controller node is driven by event. The experiment consists of a 2D helicopter simulator mounted on a fixed base with two propellers that are driven by DC motors as is shown in Figure 5. The front propeller controls the elevation of the helicopter nose about the pitch axis and the back propeller controls the motion about the yaw axis. The pitch and yaw angles are measured using high-resolution encoders. Figure 5: Networked Control System with workload The Euler-Lagrange method is used to derive the nonlinear equations describing the motions of the helicopter [19]. From its nonlinear equations of motions, the linear continuous state space models with x = [θ ψ θ̇ ψ̇] and u = [Vp Vy] are ẋ = Ax + Bu y = Cx (35) 262 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc A =   0 0 1 0 0 0 0 1 0 0 − Bp Jp+ml2 0 0 0 0 − By Jy+ml2   B =   0 0 0 0 Kpp Jp+ml2 Kpy Jp+ml2 Kyp Jy+ml2 Kyy Jy+ml2   C = [ 1 0 0 0 0 1 0 0 ] (36) where Kpp is the thrust torque acting on pitch axis from pitch motor, Kpy the thrust torque acting on yaw axis from pitch motor, Kyp the thrust torque acting on pitch axis from yaw motor, Kyy the thrust torque acting on yaw axis from yaw motor, Bp the viscous damping coefficient about pitch axis, Bp the viscous damping coefficient about yaw axis, l the center of mass length along helicopter bod, g the gravity constant, m the total moving mass of the helicopter, Jp the total moment of inertia about pitch pivot, Jy the total moment of inertia about yaw pivot, Vp the voltage of pitch motor, Vy voltage of yaw motor, θ the angle about pitch axis and ψ the angle about yaw axis. 5.2 Results The fuzzy model is obtained discretizing the helicopter model (Eqs. (35)-(36)) with different sampling-actuation periods hj = [5, 10, 15, 20] ms, the compound time is previously analyzed generating the bounds υ = [5 − 300] ms. The fuzzy model has four rules with the antecedent parameters ρ = [5, 10, 15, 20]x10−3 σ = [12, 24, 30, 30]x10−4 The fuzzy controller is designed by LQR method and the Lyapunov conditions are fulfilled (22)-(23). K = [ 15.4 1.53 4.91 0.677 12.2 0.718 −1.97 17.3 −0.241 6.2 −1.24 7.03 ] The fuzzy scheduler is designed with the sampling-actuation periods hj = [5, 10, 15, 20] ms. The range of the lost deadlines is ∆e = [0, 1], the MAE is ∆h = [0, 1.4] and the scheduling period δ = 1 s. The network imperfections and the system performance were measured to show the codesign approach with a square reference. The overall system performance is compared with a hybrid control designed to be stable in the compound time range. The network behaviour with medium traffic generates a peculiar behaviour in the delay and the loss of deadlines (6). The time delay increases at the start of traffic with a maximum of 31 ms and average of 5 ms, but as the traffic increases, delays become deadlines with a 5.8% and average of 132 ms between missed deadlines. The upper graph shows the time delay where the average traffic starts in 50 s, however, the effect starts seconds later and decreases around the second 55, giving rise to an increase in the lost deadlines (80 s), but its effect extends to the 85s because the switch continues to empty the queue. In this case, the fuzzy scheduler change the assignment policy for the sampling-actuation period (7) (inf.), When medium traffic appears, the EAM (sup.) had variations greater than 0.1, Control-Scheduling Codesign for NCS based Fuzzy Systems 263 Figure 6: Time delays and time elapsed between lost packets with medium traffic (50 - 80 s). which represents an error in steady state greater than 2% , and added to the presence of 5.8 of lost deadlines (med.), the fuzzy scheduler decides to decrease the sampling period slowly but without overloading the network and gradually improve the performance of the system. Figure 7: MAE, lost deadlines and the sampling-actuation period with medium traffic. With medium traffic, the fuzzy codesign and the hybrid control remain stable (Fig. 8), but the fuzzy codesign (sup.) is the one that fulfils the control criteria. The codesign (sup.) with medium traffic has an overshoot of ζ = 15◦, with a stable steady error ess = 0.5 and an setting time Ts = 4 s.; while the hybrid control (inf.) degrades its performance against average traffic with an overshoot of ζ = 34◦, with a stable steady error ess = 6 and with oscillations. At this level of traffic, the hybrid control ensures system stability but with poor performance. In the case of heavy traffic (Figure 3), the time delay and the lost deadlines were increased, the maximum delay was 30 ms, with an average of 12 ms, and deadlines were 7.3% and the average time of 122 ms between lost deadlines. The heavy traffic started at 50 s, however, its effect was visible until the 85 s even when the traffic was finished in the 80 s. Figure 9 shows the pitch position for both the fuzzy codesign and the hybrid controller. In case of the heavy traffic measured (Figure 3), the hybrid controller has an erratic behavior with an overshoot ζ = 36◦, a steady stable error ess = 10 and setting time Ts > 9 s. While, the fuzzy codesign curves indicate a stable behavior with an overshoot ζ = 30◦, a steady stable error 264 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc Figure 8: Comparison between the codesign and an hybrid controller with medium traffic. ess = 0.8 and setting time Ts = 2 s. Figure 9: Comparison between the codesign and an hybrid controller with heavy traffic. The fuzzy scheduler changes the sampling period (Figure 10), Because the MAE (sup.) has variations greater than 0.25 representing a steady-state error greater than 5%, And added to the presence of 7.8% of lost deadlines (med.), The fuzzy scheduler decides to slow down the sampling period in order to correct the error even when traffic on the network increases. This demonstrates that the fuzzy codesign can apply a dynamic control dependent on the network behaviour with a stable design in all the range of υ. 6 Conclusion A fuzzy codesign approach was presented to minimize the effects of the network-induced imperfections. The approach was designed with a controller and scheduler together in function of the network imperfection measurements and the continuous model of the system. The fuzzy controller is designed to select the control signal depending on the compound time estimation, with multiple discrete model that represents the process in function of the actuation periods dis- Control-Scheduling Codesign for NCS based Fuzzy Systems 265 Figure 10: MAE, lost deadlines and the sampling-actuation period with heavy traffic. appeared the sampling and communication jitter. The fuzzy scheduler was designed to control the sampling-actuation period in function of the system performance and the behaviour of the network. The codesign approach is applied to a nonlinear, time-varying MIMO system intercon- nected with an Ethernet network and employing an embedded system as the controller-scheduler. The codesign performance was compared with a hybrid control designed to counteract the effects of delay in the same range as codesign. The fuzzy codesign had the best performance within the entire range of compound time. Acknowledgement The authors would like to thank DCC-IIMAS-UNAM for the support and for their technical support to Sandra Sauza Escoto and Joaquin Morales Rosales. This work was supported by UNAM-PAPIIT IA104218. Bibliography [1] Albertos, P.; Crespo, A. (1999); Real-time control of non-uniformly sampled systems, Con- trol Engineering Practice, 7(4), 445-458, 1999. [2] Aström, K.J. (2007); Event Based Control, In Analysis and Design of Nonlinear Control Systems: In Honor of Alberto Isidori, Springer Verlag, 2007. [3] Benitez-Perez, H. et al. (2016); A Fuzzy Networked Control System Following Frequency Transmission Strategy, International Journal of Computers Communications & Control, 11(1), 11-25, 2016. [4] Chae, S.; Nguang, S. K. (2014); SOS based robust H∞ fuzzy dynamic output feedback control of nonlinear networked control systems, IEEE Trans. Cybern., 44(7), 1204-1213, 2014. [5] Chai, S.; Liu, G.P.; Rees, D.; Xia Y. (2008); Design and practical implementation of internet- based predictive control of a servo system, IEEE Trans. on Control Systems Technology, 16(1), 158-168, 2008. 266 P.E. Mendez-Monroy, I. Sanchez Dominguez, A. Bassam, O. May Tzuc [6] Chow, M.-Y.; Tipsuwan, Y. (2003); Gain adaptation of networked DC motor controllers based on QoS variations, IEEE Trans. on Industrial Electronics, 50(5), 936-943, 2003. [7] Du, D. (2012); Reliable H∞ control for Takagi-Sugeno fuzzy systems with intermittent measurements, Nonlinear Analysis: Hybrid Systems, 6(4), 930-941, 2012. [8] Guan, X.P.; Chen, C. L. (2004); Delay-dependent guaranteed cost control for TS fuzzy systems with time delays, IEEE transactions on fuzzy systems, 12(2), 236-249, 2004. [9] Hespanha, J.; Naghshtabrizi, P.; Xu, Y. (2007); A survey of recent results in networked control systems, Proc. IEEE, 138-162, 2007. [10] Hu, H.; Liu, G.; Rees, D. (2007); Event-driven networked predictive control, IEEE Trans- actions on Industrial Electronics, 54(3), 1603- 1613, 2007. [11] Ji, K.; Kim, W.J. (2007); Stochastic optimal control and network co-design for networked control systems, International Journal of Control, Automation and Systems, 5(5), 515-525, 2007. [12] Ji, K.; Kim, W.J. (2007); Robust control for networked control systems with admissible parameter uncertainties, International Journal of Control, Automation and Systems, 5(4), 372-378, 2007. [13] Li, H.; Sun, Z.; Liu, H.; Chow, M.Y. (2008); Predictive observer-based control for networked control systems with network-induced delay and packet dropout, Asian Journal of Control, 10(6), 1-3, 2008. [14] Li, K.; Baillieul, J. (2004); Robust quantization for digital finite communication bandwidth (DFCB) control, IEEE Trans. on Automatic Control, 49(9), 1573-1584, 2004. [15] Li, H.; Wu, C.; Feng, Z. (2015); Fuzzy dynamic output-feedback control of non-linear net- worked discrete-time system with missing measurements, IET Control Theory and Applica- tions, 9(3), 327-335, 2015. [16] Lozoya, C.; Marti, P.; Velasco, M.; Fuertes, J.M. (2008); Control Performance Evaluation of Selected Methods of Feedback Scheduling of Real-time Control Tasks, 17th IFAC World Congress, July, 2008. [17] Marti, P.; Velasco, M. (2007); Toward Flexible Scheduling of Real-Time Control Tasks: Reviewing Basic Control Models, 10th International Conference on Hybrid Systems, Com- putation and Control, LNCS, 2007. [18] Mendez-Monroy, P.E.; Velasco, M.; Fuertes, J.M.; Benitez-Perez, H. (2012); Fuzzy observer based Fault Detection for Network Control Systems with Periodic Actuation Tasks, 8th IFAC Symposium on Fault Detection, Supervision and Safety of Technical Processes (SafeProcess 2012), 2012. [19] Mendez-Monroy, P. E.; Benitez-Perez, H. (2011); Fuzzy control with estimated variable sampling period for non-linear networked control systems: 2-DOF helicopter as case study, Transactions of the Institute of Measurement and Control, 34(7), 802-814, 2011. [20] Mendez-Monroy, P. E. (2017); Fuzzy codesign for networked control systems, 14th Inter- national Conference on Electrical Engineering, Computing Science and Automatic Control, DOI: 10.1109/ICEEE.2017.8108887, 2017. Control-Scheduling Codesign for NCS based Fuzzy Systems 267 [21] Montestruque, L.A.; Antsaklis, P.K. (2007); Static and dynamic quantization in model-based networked control systems, International Journal of Control, 80(1), 87-101, 2007. [22] Nilsson, J.; Bernhardsson, B.; Wittenmark, B. (1998); Stochastic analysis and control of real-time systems with random time delays, Automatica, 34(5), 57-64, 1998. [23] Park, J.; Kim, J.; Park, D. (2001); LMI-based design of stabilizing fuzzy controllers for nonlinear systems described by Takagi-Sugeno fuzzy model, Fuzzy Sets and Systems, 122, 73-82, 2001. [24] Peng, C.; Yang, T.C. (2010); Communication-delay-distribution-dependent networked con- trol for a class of T-S fuzzy systems, IEEE Transaction on Fuzzy Systems, 18(2), 326-335, 2010. [25] Seiler, P.; Sengupta, R. (2005); An H∞ approach to networked control, IEEE Transaction on Automatic Control, 50(3), 356-364, 2005. [26] Tanaka, K.; Wang, H. O. (2001); Fuzzy Control Systems Design and Analysis: A Linear Matrix Inequality Approach, Wiley & Sons, Inc., 2001. [27] Tipsuwan, Y.; Chow, M.Y. (2003); Control methodologies in networked control systems, Control Engineering Practice, 11, 1099-1111, 2003. [28] Tipsuwan, Y.; Chow, M. Y. (2004); On the Gain Scheduling for Networked PI Controller Over IP Network, IEEE/ASME Transaction Mechatronics, 9(3), 491-498, 2004. [29] Tong, S.W.; Qian, D.W.; Liu, G.P. (2014); Networked Predictive Fuzzy Control of Systems with Forward Channel Delays Based on a Linear Model Predictor, International Journal of Computers Comnunications & Control, 9(4), 471-481, 2014. [30] Yi, H.C.; An C.J.; Choi J.Y. (2017); Compensation of Time-Varying Delay in Networked Control System over Wi-Fi Network, International Journal of Computers Comnunications & Control, 12(3), 415-428, 2017. [31] Yu, M.; Wang, L.; Chu, T.G., Xie, G.M. (2004); Stabilization of networked control systems with data packet dropout and network delays via switching system approach, Proc. of the 43th IEEE Conference on Decision and Control, 3539-3544, 2004. [32] Zhang, W.; Branicky, M.S.; Phillips, S.M. (2001); Stability of networked control systems, IEEE Cont. Sys. Mag., 21(1), 84-99, 2001. [33] Zhang, H.; Duan, G.; Xie, L. (2007); Linear quadratic regulation for linear time-varying systems with multiple input delays, Automatica, 42(9), 1465-1476, 2007. [34] Zhao, Y.; Gao, H.; Chen, T. (2010); Fuzzy constrained predictive control of non-linear systems with packet dropouts, IET control theory and applications, 4(9), 1665-1677, 2010.