**3.1 EDF scheduling algorithm**

EDF scheduling algorithm is based on the length of the task assigned from deadline for the priority of the task: the task is nearer from the required deadline and will obtain the higher priority. EDF scheduling algorithm is a dynamic scheduling algorithm, the priority of the task is not fixed, but changes over time; that is, the priority of the task is uncertain. EDF scheduling algorithm also has the following advantages except the advantages of the general dynamic scheduling algorithm:


For *N* mutual independent real-time periodic tasks, when the EDF algorithm is used, the schedulability condition is that the total utilization of the tasks meets the following inequality:

$$\mathcal{U}I = \sum\_{i=1}^{N} \frac{c\_i}{T\_i} \le 1 \tag{14}$$

Predictive Control Applied to Networked Control Systems 73

the required instant of feedback signal over network will jointly determine control system

Although the controller requires sampling period as small as possible for getting feedback signal more timely, the smaller sampling period means the more times frequently need to send data in network, so that the conflict occurs easily between tasks, data transmission time

However, sampling period cannot too large in the network, because that larger sampling period can decrease the transmission time of the feedback signal in the network, but will not fully utilize network resources. Therefore, the appropriate sampling period must be selected in the practical design in order to meet both the control requirements and the data transmission stability in the network, and finding the best tradeoff point of sampling period to use of network resources as full as possible, thereby enhancing the control system

Fig.1 shows the relationship between the sampling period and control performance (Li et al., 2001), it clearly illustrates the effect of sampling period on continuous control system, digital control system and networked control system, the meanings of *TA* , *TB* and *TC* are also

By analyzing the impact of sampling period for the control system performance, we see that changing the sampling period is very important to the networked control system performance. According to the different requirements for loops of NCSs, it has great significance for improving the system performance by changing the network utility rate of

In NCSs, sampling period has effect on both control and scheduling, the selection of sampling period in NCSs is different from the general computer control system. Considering both the control performance and network scheduling performance indicators

will increase in the network, and even the loss of data may occur.

Fig. 1. The impact of Sampling period on control system performance

each loop and further changing the sampling period of each loop.

**4.2 Joint optimization of the sampling periods** 

performance.

performance (Li, 2009).

defined.

where *<sup>i</sup> c* is the task execution time, *Ti* is the task period. In NCSs, *<sup>i</sup> c* is the data packet the sampling time, *Ti* is the data sampling period.

EDF scheduling algorithm can achieve high utilization from the point of resource utilization, and meet the conditions for more information needs under the same condition of resource, thus it will increase the utilization of resources. Furthermore, EDF is a dynamic scheduling algorithm, and it can dynamically adjust the priority of the message, and lets the limited resources make a more rational allocation under the case of heavy load of information, and makes some soft real-time scheduling system can achieve the desired performance under the condition of non-scheduling.

Suppose there are two concurrent real-time periodic tasks need to be addressed, the execution time of the two messages is 5ms, and the sampling periods are 8ms and 10ms respectively, and suppose the deadline for all information equal to their sampling period. The total utilization of the information is:

$$U = \frac{5}{8} + \frac{5}{10} = 1.125 > 1$$

By the schedulability conditions (14) of EDF, we know that EDF scheduling algorithm is not scheduled; in this case, co-design of scheduling and control is potential to research and solve this type of problem.

#### **3.2 Network performance parameters**

Network performance parameters include: network-induced delay, network bandwidth, network utilization, packet transmission time. The EDF scheduling algorithm is also related to the sampling period, priority, and deadline. The greater the network-induced delay is, the poorer is the network environment; data transmission queue and the latency are longer, whereas the contrary is the shorter. The network bandwidth is that the amount of information flows from one end to the other within the specified time, is the same as the data transfer rate, and network bandwidth is an important indicator for the measure of network usage. The network bandwidth is limited in a general way. When the data transmitted per unit time is greater than the amount of information of network bandwidth, network congestion will occur and network-induced delay is larger, thus impacting on the data in real time. The sampling period is an important parameter of network scheduling, but also associated to control performance of the system; the specific content will be described in the next section.

### **4. Co-design optimization method**

#### **4.1 Relationship between sampling period and control performances**

In networked control system, which is a special class of digital control system, the feedback signal received by the controller is still periodic sampling data obtained from sensor, but these data transmitted over the network, rather than the point to point connection. The network can only be occupied by a task in certain instant, because that network resources are shared by multiple tasks; in other words, when one task is over the network, the other ones will wait until the network is free. In this case, the feedback signal sampling period and 72 Frontiers of Model Predictive Control

where *<sup>i</sup> c* is the task execution time, *Ti* is the task period. In NCSs, *<sup>i</sup> c* is the data packet the

EDF scheduling algorithm can achieve high utilization from the point of resource utilization, and meet the conditions for more information needs under the same condition of resource, thus it will increase the utilization of resources. Furthermore, EDF is a dynamic scheduling algorithm, and it can dynamically adjust the priority of the message, and lets the limited resources make a more rational allocation under the case of heavy load of information, and makes some soft real-time scheduling system can achieve the desired performance under

Suppose there are two concurrent real-time periodic tasks need to be addressed, the execution time of the two messages is 5ms, and the sampling periods are 8ms and 10ms respectively, and suppose the deadline for all information equal to their sampling period.

5 5 1.125 1

By the schedulability conditions (14) of EDF, we know that EDF scheduling algorithm is not scheduled; in this case, co-design of scheduling and control is potential to research and solve

Network performance parameters include: network-induced delay, network bandwidth, network utilization, packet transmission time. The EDF scheduling algorithm is also related to the sampling period, priority, and deadline. The greater the network-induced delay is, the poorer is the network environment; data transmission queue and the latency are longer, whereas the contrary is the shorter. The network bandwidth is that the amount of information flows from one end to the other within the specified time, is the same as the data transfer rate, and network bandwidth is an important indicator for the measure of network usage. The network bandwidth is limited in a general way. When the data transmitted per unit time is greater than the amount of information of network bandwidth, network congestion will occur and network-induced delay is larger, thus impacting on the data in real time. The sampling period is an important parameter of network scheduling, but also associated to control performance of the system; the specific content will be described in

In networked control system, which is a special class of digital control system, the feedback signal received by the controller is still periodic sampling data obtained from sensor, but these data transmitted over the network, rather than the point to point connection. The network can only be occupied by a task in certain instant, because that network resources are shared by multiple tasks; in other words, when one task is over the network, the other ones will wait until the network is free. In this case, the feedback signal sampling period and

8 10 *U*

sampling time, *Ti* is the data sampling period.

the condition of non-scheduling.

this type of problem.

the next section.

The total utilization of the information is:

**3.2 Network performance parameters** 

**4. Co-design optimization method** 

**4.1 Relationship between sampling period and control performances** 

the required instant of feedback signal over network will jointly determine control system performance.

Although the controller requires sampling period as small as possible for getting feedback signal more timely, the smaller sampling period means the more times frequently need to send data in network, so that the conflict occurs easily between tasks, data transmission time will increase in the network, and even the loss of data may occur.

However, sampling period cannot too large in the network, because that larger sampling period can decrease the transmission time of the feedback signal in the network, but will not fully utilize network resources. Therefore, the appropriate sampling period must be selected in the practical design in order to meet both the control requirements and the data transmission stability in the network, and finding the best tradeoff point of sampling period to use of network resources as full as possible, thereby enhancing the control system performance (Li, 2009).

Fig.1 shows the relationship between the sampling period and control performance (Li et al., 2001), it clearly illustrates the effect of sampling period on continuous control system, digital control system and networked control system, the meanings of *TA* , *TB* and *TC* are also defined.

Fig. 1. The impact of Sampling period on control system performance

By analyzing the impact of sampling period for the control system performance, we see that changing the sampling period is very important to the networked control system performance. According to the different requirements for loops of NCSs, it has great significance for improving the system performance by changing the network utility rate of each loop and further changing the sampling period of each loop.

#### **4.2 Joint optimization of the sampling periods**

In NCSs, sampling period has effect on both control and scheduling, the selection of sampling period in NCSs is different from the general computer control system. Considering both the control performance and network scheduling performance indicators

Predictive Control Applied to Networked Control Systems 75

where*Ti* , *<sup>i</sup> c* and *bl i*, are the sampling period, transmission time and congestion time of *th i*

For dynamic scheduling, such as EDF algorithm, the following scheduling constraints can be

1

*Ti* , *<sup>i</sup> c* are the sampling period and the data packet transmission time of *th i* control loop

The upper limit of the sampling period of networked control systems with delay (Mayne et

<sup>20</sup>

*bw max <sup>i</sup>*

 is the network induce delay of loop *i* . EDF scheduling algorithm is used in this chapter, the optimization process of the compromised sampling period of overall performance of the NCSs can be viewed as an

min

1

2 <sup>20</sup>

1

*i J pJ* 

 *bw max <sup>i</sup> <sup>T</sup> <sup>T</sup>*

1

The constraints of network performance and control performance are added in the problem above simultaneously. They ensure the system to run on a good performance under a

However, the optimal design method takes into account the relatively simple elements of the networked control system, and the involved performance parameters are less. So adding more network scheduling parameters and system control parameters is necessary to optimize the design jointly. An optimization method of taking both scheduling performance and control performance is proposed for system optimization operation. The core idea of the

*N i i i <sup>c</sup> <sup>U</sup> <sup>T</sup>*

*N i i*

*N i i i <sup>c</sup> <sup>U</sup>*

1

2

... (2 1) *l i <sup>i</sup> <sup>i</sup> i i*

, 1 2

*cc b <sup>c</sup> <sup>i</sup> TT TT*

1 2

*l i* max *<sup>j</sup> ji N b c*

means the current task is blocked by the low priority task.

where *Tmax* is the maximum value of the sampling period,

control loop respectively. , 1,...,

chosen (Pedreiras P & Almenida L, 2002):

3. Stability conditions of the system

*bw* , *<sup>i</sup>* 

respectively.

al.,2003) is:

*Tbw* is derived by

optimization problem. Objective function:

Constraint condition:

certain extent.

1

(16)

is the congestion time of the worst time which

*<sup>T</sup>* (17)

*<sup>T</sup> <sup>T</sup>* (18)

*bw* is the system bandwidth,

to optimize the sampling period of NCSs is the main way to achieve the co-design of control and scheduling (Zhang & Kong, 2008).

In NCSs, in order to ensure the control performance of the plant, generally the smaller sampling period is needed, but the decreased sampling period can lead the increased transmission frequency of the packets, and increase the burden of the network scheduling, therefore, control and scheduling are contradictory for the requirements of sampling period. The sampling periods of sensors on each network node not only bound by the stability of the plant but also the network schedulability. The way to solve this problem is to compromise the control performance and scheduling performance under certain of constraint conditions, and then to achieve the overall optimal performance of NCSs (Guan & Zhou, 2008; Zhang & Kong, 2008).

1. The selection of the objective function

Sampling period is too large or too small can cause deterioration of the system output performance, therefore, to determine the optimal sampling period is very important for the co-design of control and scheduling in NCSs. From the perspective of control performance, the smaller the sampling period of NCSs is, the better is its performance; from the perspective of scheduling performance, it will have to limit the decrease of the sampling period due to network communication bandwidth limitations. Optimization problem of the sampling period can be attributed to obtain the minimum summation of each control loop performance index function (objective function) under the conditions that the network is scheduling and the system is stable.

Suppose the networked control system optimal objective function is min *J* , then

$$J\_{\min} = \sum\_{i=1}^{N} p\_i I\_i \tag{15}$$

where *<sup>i</sup> p* is weight, the greater the priority weight value of the network system is, the more priority is the data transmission . *<sup>i</sup> J* is the performance index function of loop *i*, *N* is the total number of control loops.

2. Scheduling constraints

In order to make control information of networked control system transmit over the network effectively, meet the real-time requirements of period and control tasks, network resources allocation and scheduling are necessary. It ensures the information of control tasks to complete the transfer within a certain period of time to ensure the timeliness of the data and improve the network utilization. In this chapter, single packet transmission of information is analyzed, and the scheduling is non-priority.

Different scheduling algorithms correspond to the different schedulability and sampling period constraints. Currently, the commonly used network scheduling algorithms are: static scheduling algorithm, dynamic scheduling, mixed scheduling algorithm, and so on.

For static scheduling algorithm, such as *RM* algorithm, the following scheduling constraints can be chosen (Guan & Zhou, 2008):

74 Frontiers of Model Predictive Control

to optimize the sampling period of NCSs is the main way to achieve the co-design of control

In NCSs, in order to ensure the control performance of the plant, generally the smaller sampling period is needed, but the decreased sampling period can lead the increased transmission frequency of the packets, and increase the burden of the network scheduling, therefore, control and scheduling are contradictory for the requirements of sampling period. The sampling periods of sensors on each network node not only bound by the stability of the plant but also the network schedulability. The way to solve this problem is to compromise the control performance and scheduling performance under certain of constraint conditions, and then to achieve the overall optimal performance of NCSs (Guan &

Sampling period is too large or too small can cause deterioration of the system output performance, therefore, to determine the optimal sampling period is very important for the co-design of control and scheduling in NCSs. From the perspective of control performance, the smaller the sampling period of NCSs is, the better is its performance; from the perspective of scheduling performance, it will have to limit the decrease of the sampling period due to network communication bandwidth limitations. Optimization problem of the sampling period can be attributed to obtain the minimum summation of each control loop performance index function (objective function) under the conditions that the network is

Suppose the networked control system optimal objective function is min *J* , then

information is analyzed, and the scheduling is non-priority.

min

1

*i J pJ* 

where *<sup>i</sup> p* is weight, the greater the priority weight value of the network system is, the more priority is the data transmission . *<sup>i</sup> J* is the performance index function of loop *i*, *N* is the

In order to make control information of networked control system transmit over the network effectively, meet the real-time requirements of period and control tasks, network resources allocation and scheduling are necessary. It ensures the information of control tasks to complete the transfer within a certain period of time to ensure the timeliness of the data and improve the network utilization. In this chapter, single packet transmission of

Different scheduling algorithms correspond to the different schedulability and sampling period constraints. Currently, the commonly used network scheduling algorithms are: static

For static scheduling algorithm, such as *RM* algorithm, the following scheduling constraints

scheduling algorithm, dynamic scheduling, mixed scheduling algorithm, and so on.

*i i*

(15)

*N*

and scheduling (Zhang & Kong, 2008).

Zhou, 2008; Zhang & Kong, 2008).

scheduling and the system is stable.

total number of control loops. 2. Scheduling constraints

can be chosen (Guan & Zhou, 2008):

1. The selection of the objective function

$$\frac{c\_1}{T\_1} + \frac{c\_2}{T\_2} + \dots + \frac{c\_i}{T\_i} + \frac{\overline{b}\_{l,i}}{T\_i} \le i(2^{\frac{1}{i}} - 1) \tag{16}$$

where*Ti* , *<sup>i</sup> c* and *bl i*, are the sampling period, transmission time and congestion time of *th i* control loop respectively. , 1,..., *l i* max *<sup>j</sup> ji N b c* is the congestion time of the worst time which means the current task is blocked by the low priority task.

For dynamic scheduling, such as EDF algorithm, the following scheduling constraints can be chosen (Pedreiras P & Almenida L, 2002):

$$\mathcal{U} = \sum\_{i=1}^{N} \frac{c\_i}{T\_i} \le 1 \tag{17}$$

*Ti* , *<sup>i</sup> c* are the sampling period and the data packet transmission time of *th i* control loop respectively.

#### 3. Stability conditions of the system

The upper limit of the sampling period of networked control systems with delay (Mayne et al.,2003) is:

$$T\_{\text{max}} = \frac{T\_{bw}}{20} - 2\tau\_i \tag{18}$$

where *Tmax* is the maximum value of the sampling period, *bw* is the system bandwidth, *Tbw* is derived by *bw* , *<sup>i</sup>* is the network induce delay of loop *i* .

EDF scheduling algorithm is used in this chapter, the optimization process of the compromised sampling period of overall performance of the NCSs can be viewed as an optimization problem.

Objective function:

$$J\_{\min} = \sum\_{i=1}^{N} p\_i J\_i$$

Constraint condition:

$$T\_{\max} = \frac{T\_{bw}}{20} - 2\tau\_i$$

$$\mathcal{U} = \sum\_{i=1}^{N} \frac{c\_i}{T\_i} \le 1$$

The constraints of network performance and control performance are added in the problem above simultaneously. They ensure the system to run on a good performance under a certain extent.

However, the optimal design method takes into account the relatively simple elements of the networked control system, and the involved performance parameters are less. So adding more network scheduling parameters and system control parameters is necessary to optimize the design jointly. An optimization method of taking both scheduling performance and control performance is proposed for system optimization operation. The core idea of the

Predictive Control Applied to Networked Control Systems 77

This design, which considers factors of system control and network scheduling, will guarantee the optimization operation under the comprehensive performance of NCSs. From section 3.1, we can find that it is very important to improve the control performance of the whole system by dynamically change the network utilization in every loop and furthermore change the sampling period based on the different requirements in every loop. It adapts the system control in network environment and achieves the purpose of co-design by combined network scheduling parameters and changes the control parameters of prediction control

2. Adopting GPC and EDF algorithm, defining the GPC control performance parameters

3. According to the control parameters and scheduling parameters impact on system performance, design a reasonable optimization with balance between control

4. Use Truetime simulator to verify the system performance, then repeat the steps above if

Co-design optimization Scheduling parameters Control parameters

TrueTime simulation

Meet the performance ?

Design completion

Parameter optimization

Y

N

algorithm reasonably.

**4.4 General process of co-design methods** 

The general process of the co-design methods is (see Fig. 2):

Control indexes Network indexes Plant

Fig. 2. General method of co-design of NCS scheduling and control

1. Determine the plant and its parameters of NCSs.

and EDF scheduling parameters respectively.

performance and scheduling performance.

it has not meet the requirements.

proposed methods is to make the interaction between the two performance indicators of networked control system---network scheduling performance and control performance, which affect on the system stable and efficient operation, so as to ensure network performance and control performance in NCSs.

#### **4.3 Joint optimization of predictive control parameters**

The preferences of GPC can be considered from two aspects. For general process control, let *N*0=1 , *P* is the rise time of the plant, *M =1*, then the better control performance is achieved. For the higher performance requirements of the plant, such as the plant in NCS, needs a bigger *P* based on the actual environment. A large number of computer simulation studies (Mayne et al., 2003; Hu et al., 2000; Chen et al., 2003)have shown that *P* and are the two important parameters affecting GPC control performance. When *P* increases, the same as , the smaller and the bigger *P* will affect the stability of the close loop system. The increase of the two parameters and *P* will slow down the system response speed, on the contrary, *P* less than a certain value will result in the system overshoot and oscillation.

When network induce delay *<sup>i</sup> T* (*T* is the sampling period), based on the above analysis of control and network parameters affecting on NCSs performance, network environment parameters will be considered in the follows: network induce delay, network utilization and data packet transmission time. The optimal rules of prediction control parameters are determined by the following three equations of loop *i* :

$$M\_i(k+1) = M\_i(k) + [(\frac{\Delta \tau\_i}{\tau\_i} + \frac{\Delta Ul}{\mathcal{U}})\alpha\_1] \tag{19a}$$

$$P\_i(k+1) = P\_i(k) + \left[ (\frac{\Delta U}{U} - \frac{\Delta \tau\_i}{\tau\_i} + \frac{\Delta c\_i}{c\_i}) \phi \nu\_2 \right] \tag{19b}$$

$$\mathcal{A}\_{i}(k+1) = \mathcal{A}\_{i}(k) + \left[ (\frac{\Delta \tau\_{i}}{\tau\_{i}} + \frac{\Delta U}{U}) o \rho\_{3} \right] \tag{19c}$$

where ( ) *Mi k* is the control domain of loop *i* at sampling instant *th k* , ( ) *P k <sup>i</sup>* is the minimum prediction domain of loop *i* at sampling instant *th k ,* ( ) *<sup>i</sup> k* is the control coefficient of loop *i* at sampling instant *th k* , 123 {,,} is the quantization weight, *U* is the network utilization, *<sup>i</sup>* is the network induce delay of loop *i , i c* is the data transmission time of loop *i* , *<sup>i</sup>* is the error change of network induce delay, *<sup>i</sup> c* is the error change of transmission time, *U* is the error change of network utilization.

As the control domain and the maximum prediction horizon are integers, the rounding of (19a) and (19b) is needed. That is the nearest integer value of the operating parameters (in actual MATLAB simulation, x is the parameter rounded: round(x)).

The role of quantization weight is quantificationally to convert the change values in parentheses of "round(x)" to the adjustment of parameters, in this section, the order of magnitude of prediction domain *P*, control domain M and control coefficient is adopted, for example, *M*=4, *P*=25, =0.2, the corresponding quantization weight are 12 3 1, 10, 0.1 .

76 Frontiers of Model Predictive Control

proposed methods is to make the interaction between the two performance indicators of networked control system---network scheduling performance and control performance, which affect on the system stable and efficient operation, so as to ensure network

The preferences of GPC can be considered from two aspects. For general process control, let *N*0=1 , *P* is the rise time of the plant, *M =1*, then the better control performance is achieved. For the higher performance requirements of the plant, such as the plant in NCS, needs a bigger *P* based on the actual environment. A large number of computer simulation studies

important parameters affecting GPC control performance. When *P* increases, the same as

of control and network parameters affecting on NCSs performance, network environment parameters will be considered in the follows: network induce delay, network utilization and data packet transmission time. The optimal rules of prediction control parameters are

<sup>1</sup> ( 1) ( ) [( ) ] *<sup>i</sup>*

<sup>2</sup> ( 1) ( ) [( ) ] *i i*

<sup>3</sup> ( 1) ( ) [( ) ] *<sup>i</sup>*

where ( ) *Mi k* is the control domain of loop *i* at sampling instant *th k* , ( ) *P k <sup>i</sup>* is the minimum

As the control domain and the maximum prediction horizon are integers, the rounding of (19a) and (19b) is needed. That is the nearest integer value of the operating parameters (in

The role of quantization weight is quantificationally to convert the change values in parentheses of "round(x)" to the adjustment of parameters, in this section, the order of

*<sup>U</sup> k k*

*<sup>U</sup> Mk Mk*

*<sup>U</sup> <sup>c</sup> Pk Pk*

*i*

*U c* 

is the network induce delay of loop *i , i c* is the data transmission time of

is the error change of network induce delay, *<sup>i</sup> c* is the error change of

*i*

*U*

*i i*

*U*

 

(19a)

(19b)

(19c)

=0.2, the corresponding quantization weight

is the quantization weight, *U* is the network

*k* is the control coefficient of

is adopted,

and the bigger *P* will affect the stability of the close loop system. The increase

and *P* will slow down the system response speed, on the contrary,

*<sup>i</sup> T* (*T* is the sampling period), based on the above analysis

are the two

,

(Mayne et al., 2003; Hu et al., 2000; Chen et al., 2003)have shown that *P* and

*P* less than a certain value will result in the system overshoot and oscillation.

*i i*

*i i*

*i i*

prediction domain of loop *i* at sampling instant *th k ,* ( ) *<sup>i</sup>*

 

transmission time, *U* is the error change of network utilization.

actual MATLAB simulation, x is the parameter rounded: round(x)).

magnitude of prediction domain *P*, control domain M and control coefficient

loop *i* at sampling instant *th k* , 123 {,,}

performance and control performance in NCSs.

the smaller

utilization, *<sup>i</sup>*

loop *i* , *<sup>i</sup>*

for example, *M*=4, *P*=25,

 .

 1, 10, 0.1 

are 12 3

When network induce delay

of the two parameters

**4.3 Joint optimization of predictive control parameters** 

determined by the following three equations of loop *i* :

This design, which considers factors of system control and network scheduling, will guarantee the optimization operation under the comprehensive performance of NCSs. From section 3.1, we can find that it is very important to improve the control performance of the whole system by dynamically change the network utilization in every loop and furthermore change the sampling period based on the different requirements in every loop. It adapts the system control in network environment and achieves the purpose of co-design by combined network scheduling parameters and changes the control parameters of prediction control algorithm reasonably.
