Integrated Synthesis of Control and Bandwidth Scheduling on Networked Control Systems

Many Networked Control Systems (NCS) comprise several control loops that are closed over a network of computation nodes. In those systems, periodic, sporadic and non-periodic packets share the network bandwidth, complex timing behavior and communication lead to delay and jitter, which both degrade the control performance. That is to say the performance of NCS is determined not only by control algorithms


Introduction
The design of NCSs involves two main activities.Ones focus on designing control algorithms, the others focus on implementation of the control applications on a given execution platform.In the controller synthesis, to make the plant be controlled, a sampling period and a control law which accounts for a constant sampling -actuation delay are chosen.In implementation of control applications, the synthesized controllers are implemented as a set of periodic tasks that read sensors, compute control signals, and write to actuators; the tasks can also implement other operations (e.g., emergency signal processing or data of field state uploading).Those tasks can execute in several computation nodes which communicate on a network system.But, in addition to the computation delay of a control application itself, resource sharing and communication contribute to the delay in the control loop.The network loads generated by controller synthesis may lead to networked overload or bandwidth waste, which results in non-constant delay and sampling period and it is well known that delay and jitter degrade the control performance.
Therefore, in resent years, the co-design of control algorithms and bandwidth schedule is proposed to resolve the problems above.Those domains consider integrate control algorithms and network bandwidth scheduling in order to optimize the overall performance of NCSs.

Related works
Recent years, some issues about control and scheduling co-design for NCS have been researched.Seto (D. Seto, J. P. Lehoczky, & L. Sha.1998) firstly treated the co-design problem as a single objective programming.The sample periods of control loops were calculated to optimize the whole performance of NCS under the resource scheduling constraints.Assuming that each NCS can be associated with a performance measure function, the control cost was treated as a function of sample period and optimize the sample periods of control loops which subject to RM (rate monotonic) schedulability constraints (Michael S.B., Stephen M. P. & Wei Zhang. 2002).A control-scheduling co-design method is proposed which integrates controller design with both static and priority-based scheduling of the tasks and messages (Samii, S., Cervin, A. 2009).L. Luo proposed a rule of dynamic allocation priorities to different nodes according to the performance index of integral absolute value error (IAE) (L.Luo, C. Chuan, & H. Cai 2004).Based on the window model of the network bandwidth resources, a new bandwidth allocation scheme of dynamic sharing the time windows was proposed (Bai Tao,Wu Zhi-Ming & Yang Gen-Ke 2004).In the proposed scheme, the bandwidth was allocated to period data according to network load, and the time windows were shared dynamically by non-periodic data.To take data packet network-induced delay into account a discrete model of NCS presented (P.M. Colom 2002), and then designed control algorithms to compensate the delay.Based on the research results, Peng Chen utilized the discrete linear quadratic regulator to guarantee the control performance of NCS under given network QoS, but the resource schedulability was not considered (Peng Chen, Yue Dong 2007).Aiming at the data transmission jitter of CAN bus, the transmission periods and phases of control data were calculated subjecting to control system stability and RM schedulability constraint based on genetic algorithms, but the design of controller was not mentioned in their researches (Bai Tao, Wu Zhi-Ming, Yang Gen-Ke 2005).Considering power consumption, Li Zu-xin presented multi-objective programming with a set of constraints to optimize control performance and bandwidth consumption.To solve the optimal problem, a feed-forward neural network as optimal is employed.However the disturb of the transmission of non-periodic packets were not considered in their researches (Li Zu-xin, Wang Wan-liang & Cheng Xin-min 2009).
Overall, the researches on co-design of control performance and resource scheduling have received considerable attention, but they are still unilateral.In those researches, either certain parameters of bandwidth scheduling were not integrated into the co-design, or the design of controller based on network QoS was not considered insufficiently.The researches of control and scheduling co-design of NCS to guarantee both control and scheduling performance are still insufficient and have room to be further explored.This paper is organized as follows.Section 2 analyzes the related works about control and scheduling co-design.Section 3 introduces the system models used in our research.Section 4 presents the details of the co-design method of control and scheduling which comprises calculating resource utilization of sporadic and non-periodic packets, scheduling optimization for periodic packets, harmonization of transmission intervals of packets, estimation of the delay of control packets, and controller design based on bandwidth scheduling.Section 5 presents simulation results based on Truetime toolbox.Conclusions are discussed in section 6.

Discrete Model of NCS Considering Packets Delay
The topology of NCS our researched is shown as figure 1.A control loop our researched is composed of remote controller, local actor and sensor.The sensor samples the status of controlled plant and transmits them to remote controller through the network; the remote controller calculates the controlled output and sends them to the local actor; the actor adjusts the status of the controlled plant according to the controlled output.All the control loops share the network bandwidth.The i th close loop transmission delay of packets ( ( ) Based on equation (3), the discrete status equations of NCS can be described by (4). ( x u be the augmented state vector, the equation ( 4) can be rewritten as follows (Peng Chen, Yue Dong 2007):

Model of Packets Transmission in NCS
The packets in NCS can be divided into periodic packets and sporadic packets and non-periodic packets.The period packets carry the sample data, control output data, the sporadic packets carry the alarm or emergency data as well as instructions and the non-periodic packets carry the status data of NCS.In NCS, once a packet is transmitted, it is never be interrupted by new packet even if the packet has higher prior.Therefore, the bandwidth scheduling algorithm must be based on non-preemptive kernel.Based on the result above, in our research, the deferrable server (DS) and polling server (PS) (Jane W.S. Liu. 2002) are used in every node to control the phase and interval of sporadic and non-periodic packets respectively.It is proved that the packets controlled by DS or PS can be treated as special periodic packets which makes the RM suitable for non-periodic packets scheduling.
The temporal characters of packets transmitted in NCS can be described as follows.
, The running rules of DS and PS are stated in details in document (Jane W.S. Liu. 2002).

Integrated control and scheduling
The process of our method can be divided into five steps as follows.
Step1: Calculate the resource utilization of DS and PS, according to the probability distributions of the data stream and requests of respond time.
Step2: Assign the transmission periods of control data to optimize the overall performance under the schedulability constraints.If there is no solution, it means that worst control performance can not be satisfied, go back to step 1 to adjust the resource utilization of DS and PS and do the co-design process again.
Step3: Harmonize transmission periods of packets to improve the resource utilization.
Step4: Estimate the close loop transmission delay of packets.
Step5: According the results above, design the controllers for each control loop based on equation ( 5).
The details of each step above are stated in following sections.

Calculate Resource Utilization of DS and PS
In our research, the transmission of sporadic and non-periodic packets is managed by DS and PS respectively.If the server is schedulable (the transmission of budget can be finished before the end of the budget complement period), according to the results in (Jane W.S. Liu. 2002) and (Tang Ying-hui, Tang Xiao-wo 2006), the transmission process mentioned above can be treat as a kind of M/G/1/  queue system with single vacation of servers assuming that the network buffer is infinite.
Assume that the arrival interval of the sporadic or non-periodic packets in one node obeys Poisson distribution with the parameter of  , and the length of the packet which denoted as i  obeys exponent distribution with parameter of  .Let B represent the bandwidth of NCS, and U represent the density of DS or PS, then according to queue model with single vacation of servers (Tang Ying-hui, Tang Xiao-wo 2006), the probability distributions function of the data stream is shown by equation ( 12).
( ) Let the arrival interval distribution parameter of the i th sporadic data stream be , s i  , the average length distribution parameter of the stream be ,  , the up bound of deadline miss radio be , s i  , according to equation ( 8) and ( 12), we have: And then the range of the resource utilization of DS is: To guarantee the average transmission delay requests of the non-periodic packets, the range of the resource utilization of PS can be calculated by equation ( 14). , , , , ,

Scheduling Optimization for Periodic Packets
Considering that the NCS composes of n p control loops.Each control loop composes of a senor and actor, and all the control loops share a remote controller.The number of nodes which need to transmit sporadic or non-period packets is assumed to be n s , n a respectively.The transmission periods of packets in NCS can be calculated by solving the optimization problem (15) subject to (16~19): , 1 , min ( ) U assigns the lower bound in equation ( 13), ( 14).
When the architecture of control system and control law is fixed, J i (p p,i ) can be described by polynomial of p p,I (P.M. Colom 2002) .i b means the worst-case blocking time of control packet i induced by the lower priority on-gonging transmission which can be described by equation (20).
Condition (16~17) are the schedulability constraints of NPRM which takes DS and PS into account.The details of the certification for the schedulability constraints above are discussed in document (Jane W.S. Liu. 2002).Condition ( 18) is used to guarantee the transmission periods of control packets not exceed their respective upper bounds ( , stab i p ) which can be identified by the method stated in (Li Zu-xin, Wang Wan-liang & Cheng Xin-min 2009).Condition ( 19) is used to guarantee the non-descending order of the transmission periods.
The minimization process above may then be carried out using MATLAB function fmincon.

Harmonization of Transmission Periods of Packets
The transmission periods of packets can be calculated based on equation (15~19) to optimize the overall performance of NCS, but the schedulable utilization condition in the optimal process above is too conservative to make full use of bandwidth.It is proved that the schedulable utilization of NPRM algorithm can approach 1 when the transmission periods of packets in the system are harmonic which means that , 1, 2, ... ( ) Liu. 2002).The transmission of packets is presented by tasks in the following state.When given a packet transmission task set { ( , ) | 1,..., } , where i w means transmission time of control packet or the budget of PS and DS, i p means the periods of DS, PS and control packets, a specialization operation transforms the tasks into accelerated tasks . The parameters of the accelerated task ' i T should be related to the parameters of the corresponding original task i T and other accelerated tasks as follows: 1.The execution time (or length of packet) of ' i T is the same as the T i .

Transmission periods have the relation that
The accelerated tasks are schedulable under NPRM algorithm, in other words,.1996).The goal of the algorithm is to find a set of transmission periods which satisfies relations 1~4 above and gives the accelerated tasks with the highest resource utilization.
Algorithm 1. harmonization of periods Line 2~4 of the algorithm 1 are used to calculate all the possible bases.Line 5 is used to remove duplicated bases and u in line 6 means the number of different bases.Line 6~12 are used to choose the base b which yields the highest schedulable resource utilization of accelerated tasks, where line 8 computed the period of the accelerated task T j ' from base b i , line 10 calculates resource utilization of accelerated tasks from base b i .The accelerated tasks as an output (line 13) obtained by algorithm 1 are specialized with respect to b according to the equation in line 8.
It is proved that algorithm 1 can find a feasible accelerated set of tasks with harmonic periods if the total resource utilization of the given system of n tasks satisfies that: which can be guaranteed by equations ( 16)~( 17).

Estimation of the Delay of Control Packets
The critical parameters of the model of NCS presented in section 3.1 are not only transmission periods of control packets but also the delay of control packets.Therefore, a method based on time-demand analysis (Jane W.S. Liu. 2002) to estimate the delay is proposed in this section.Because the scheduling process is non-preemptive, the close loop transmission delay of the i th control packets can be calculated by the following equation.
, ( ) W n represent the waiting time for transmission which is a iterated equation shown as ( which assuming that the smaller the node index is, the higher prior is.Therefore, the equation ( 22) means that from the release time to the beginning of the transmission process of control packets in the i th control loop, at most  packets with higher prior become ready for transmission.b l,i means control packet i' s worst-case blocking time induced by the lower priority on-gonging transmission.

Controller Design Based on Bandwidth Scheduling
If the periods and delays of the control packets can be estimated, lots of algorithms can be used to design the controller to guarantee the performance of NCS, based on the model of NCS presented in the section 3.In our work, a discrete LQR is designed to minimize the quadratic cost function.The cost function we used is shown as follows. 0 where the matrix Q, R, N are the parameter of control performance.
The problem of controller design is treated as a optimal problem as follows min . .( 5) The solution of ( 24) can be obtained by solve a Riccati equation and the optimal feedback gain can be calculated by Discrete Linear Quadratic Regular (DLQR).

Experiments
To verify the proposed control and scheduling integrated method, serial numerical simulations are carried out based on Truetime toolbox (Martin Andersson, Dan Henriksson & Anton Cervin 2006).The integrated method proposed is called Optimal Integrated Scheduler: OIS.In our research, there are three control loops sharing the network, each control loop is composed of a local sensor, a local actor and the shared remote controller as shown in figure 1.The sensors are triggered by timer, the controller and actors are triggered events.The control and sample packets are transmitted by network.The control plants in our experiments are invert pendulums whose model is indicated by where 2 9.81 / g m s  and l means the length of the pendulum.0 / g l   is also called the natural frequency of the pendulum.Beside the control packets, there are also three sporadic data flows (signed as s1, s2, s3 in table 1) and three non-periodic data flows (signed as a1, a2, a3 in table 1) in our NCS.Because most of NCSs work based on field bus, the Medium Access Control (MAC) protocols of network used in our research is based on static prior such as CSMA/CD+AMP, and the OIS is used as bandwidth scheduling algorithm.Table 1 shows the parameters of our experiment in details.The proposed method of integrated control and scheduling can be executed based on those parameters.
According to the temporal requests of sporadic and non-periodic packets, the resource utilization and budget of DS and PS can be calculated by equation ( 13), ( 14).The results are shown in table 2.
As state in section 3.2, the deferrable server (DS) and polling server (PS) are used to control the phase and interval of sporadic and non-periodic packets respectively.Figure 2 shows the transmission time of sporadic packets (generated by s1).The intervals of budget complement of DS in figure 2 (a) are calculated by equation ( 13) according to the bound of deadline miss ratio of sporadic packets but they are not harmonized (the first column in table 3).There are serial packets missing their deadlines, but the miss ratio of deadline is lower than the bound (10%).therefore the equation ( 13) can assigned enough resource to the DS to guarantee the deadline miss ratio.The intervals of budget complement of DS in figure 2 (b) are harmonized, which assigns more bandwidth to s1, therefore the transmission time is short than the ones in figure 2 (a). Figure 3 shows that the average transmission time of the non-periodic packets (generated by a1) is around 1 sec., which also satisfied their temporal requirements.
Table3 shows the schedule results of OIS.P 0 , P 0 ', D, CA means optimal periods, harmonic periods, estimated transmission delay and control laws respectively.P 0 describes the solution of the linear programming problem described by equation ( 15)-( 19).P 0 ' describes the result of algorithm 1 which treats P 0 as input parameters.The transmission periods described by P 0 ' are harmonic.D describes the estimated worst transmission delays of control packets which can be calculated based on time-demand analysis.It is impossible and unnecessary to estimate the worst transmission delay of sporadic and non-periodic packets because of their randomness.CA describes the discrete LQRs which designed based on the model of NCS presented in the section 3. P 0 ' and D are used as parameters of period and delay in the model described by equation 5.
Using the corresponding system parameters shown in table 3, the quadratic performance of the control systems with impulse input is shown by figure 4. To compare the advantage of OIS, the quadratic performance of the co-design method based on the original RM scheduler (Li Zu-xin, Wang Wan-liang & Cheng Xin-min 2009) is also shown in figure 5.It is obviously that our algorithm can make sampling periods of control systems shorter, which improve the utilization of network bandwidth (shown in figure.6).Therefore, our OIS gets better performance.Furthermore, the scheduling of sporadic and non-periodic packets is not considered in their researches.

Conclusions
Aiming at the integrated control and scheduling for the NCS, a control-scheduling co-design method is proposed for the transmission of both control and non-control messages.The resource utilizations of non-periodic packets are controlled by the resource reservation server running on each node to limit the effect on the transmission of periodic control packets.The queue model with single vacation of servers is used to reserve adequate bandwidth for the server to guarantee the temporal requirements of those data.The transmission periods of control packets are calculated to optimize the overall performance of control systems.An algorithm of period harmonization is also used to improve the bandwidth utilization.Experiments based on Truetime show that our scheduler can guarantee all the temporal requirements of data and get better control performance and resource utilization than the former ones.
We now describe an algorithm (Algorithm 1) for harmonization proposed by (C. C. Han, K.J. Lin & C. J. Hou

x( ) = Ax( ) + Bu( ) y( ) Cx( )
, a n means the number of periodic packets, sporadic packets and non-periodic packets respectively and the periodic, sporadic and non-periodic data can be represented by tuple (7), (8) and (9) , p , d means transmission phase, time-consuming, interval and deadline for period and sporadic data (or average response time for non-period data) of packet in NCS respectively.The DS or PS running at node i can be described by tuple (10) or (11).
 means weight coefficient.To obtain better control performance, the resource reserved for DS or PS should be as little as possible, therefore, i means the performance index of control loop i. i

Table 1 .
Parameters used in experiments