**1. Introduction**

The researches of the networked control systems (NCSs) cover a broader, more complex technology, because that networked control systems relate to computer network, communication, control, and other interdisciplinary fields. Networked control systems have become one of the hot spots of international control areas in recent years. The networked control system theoretical research is far behind its application, so the networked control system theory study has important academic value and economic benefits at present.

NCSs performance is not only related with the control algorithms, but also the network environment and the scheduling algorithms. The purpose of network scheduling is to avoid network conflicts and congestion, accordingly reducing the network-induced delay, packet loss rate and so on, which can ensure the better network environment. If the case, where the data cannot be scheduled, appears in the network, the control algorithm has not fundamentally improved the performance of the system, thus only adjusting data transmission priorities and instants over the network by using the scheduling algorithms, in order to make the whole system to achieve the desired performance.

Along with the networked control system further research, people gradually realized that the scheduling performance must be taken into account when they research control algorithms, that is, considering the two aspects of scheduling and control synthetically. The joint design of both scheduling performance and control performance is concerned by the majority of researchers (Gaid M B et al., 2006a,2006b; Arzen K E et al., 2000). Therefore, NCSs resource scheduling algorithms, as well as scheduling and control co-design are the main research directions and research focus.

The generalized predictive control and the EDF (Earliest Deadline First) scheduling algorithm are adopted by the NCSs co-design in this chapter. The co-design method

Predictive Control Applied to Networked Control Systems 69

where *y*ˆ [ ( 1) ( 2) ... ( )] *yk yk yk N* , *Δu* [ ( ) ( 1) ... ( 1)] *uk uk uk M* , *N* is the model time domain while *M* is the control time domain, 1 2 [ ( ) ( ) ... ( )]*<sup>T</sup> <sup>f</sup> <sup>f</sup> <sup>k</sup> <sup>f</sup> <sup>k</sup> fN <sup>k</sup>* , *n n*

0 0

 

1 1

1 1

1 [ ( ) ( )] [ ( ) ( 1)]

2 2

in the general control systems, is the control increment

*T T <sup>Δ</sup>u GG I G <sup>r</sup> y f* (7)

*<sup>T</sup> dd d* .

*T T GG I G* is only necessary to recalculate. So the actual

(6)

*N N NM N M*

0

Let *G EB j j* ,and *j = 1,2 ,N* ,(4) can be written as matrix equation (5):

1 2 1

*g g g*

*G*

and control increment weighting factors are adopted:

0

design of control and scheduling to ensure optimal control.

( )*j* , which is a constant

The optimal control law is as follow:

derived after expanding the formula (7):

strategy, then the first raw of <sup>1</sup> ( )

control action is denoted as (9):

*<sup>i</sup> <sup>d</sup>* is the *th <sup>i</sup>* increment of <sup>1</sup> ( )

**2.2 Rolling optimization** 

steps, 

where *<sup>T</sup>*

*p p*

*P M r j N j*

*gg g*

*gg g*

*J yk j y k j j uk j*

To enhance the robustness of the system, the quadratic performance index with output error

where *N*0 is the minimum prediction horizon, and *N*0≥1, *P* is the maximum prediction horizon, *M* is the control horizon, that means the control value will not be changed after *M* 

weighting factor, but it will be adjusted in real time within the control process in the co-

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

Then the incremental series of open loop control from instant *kth* to instant ( *k*+*M*-1)*th* is

( 1) [ ( 1) ] *<sup>T</sup> Δu d ki k i r y f* (8)

In the real control systems, the first control variable will be used in every period. If the control increment *Δu*( ) *k* of the current instant *th k* is executed, the control increment after *th k* will be recalculated in every period, that is equivalent to achieve a closed loop control

*T T GG I G* , 1 1 [ ] *i i iP <sup>d</sup><sup>i</sup>*

*n nn <sup>n</sup> <sup>j</sup> f kz z g g uk F y kn N* 1 1 , 1 ,0 () [ ] ( ) ( ), 1,2, *<sup>j</sup> G* ,

ˆ( ) ( 1) ( ) *j j y k j EB uk j F y k* (4)

*y G* ˆ *Δu f* (5)

considers both the NCSs scheduling performance and control performance, and then the process of the general co-design method is also given. From the TrueTime simulation results based on NCSs with three loops of DC-motors, NCSs under co-design compared with NCSs without co-design, we can find that the former shows better control performance and scheduling performance, and a better anti-jamming ability and adaptive ability for network, so that the NCSs with co-design can guarantee to operate in an optimal state.

### **2. Brief review of Generalized Predictive Control**

GPC (Generalized Predictive Control) algorithm is proposed by Clarke et al (Calrke & Mohtadi, 1989) in the 80s of last century, as a new class of predictive control algorithm. The algorithm is based on Controlled Auto-Regressive Integrated Moving Average (CARIMA) model, adopts an optimization of the long time indicators combined with the identification and self-correcting mechanism, shows strong robustness and has broad scope of application. The significance of GPC algorithm is that the algorithm can still get sub-optimal solution when mismatch or time-varying occurs in the controlled plant model, so it has strong robustness, but also can eliminate the static error of the system with using CARIMA model., The generalized predictive control, which is optimized control algorithms based on the prediction model, rolling optimization and online feedback correction, have distinct characteristics as a new type of control algorithms. (Wang et al., 1998; Guan & Zhou, 2008; Ding, 2008).

#### **2.1 Prediction model**

Refer to the generalized predictive control; the controlled plant is usually represented by the model of CARIMA:

$$A\mathbf{y}(k) = Bu(k-1) + C\frac{\xi(k)}{\Delta} \tag{1}$$

where *u k*( ) and *y*( ) *k* are control input and system output respectively, ( ) *k* is a white noise with zero mean and standard deviation <sup>2</sup> , 1 1 *z* is a difference operator, 1 <sup>1</sup> <sup>1</sup> *<sup>n</sup> A az azn* , <sup>1</sup> 1 *<sup>n</sup> B bz bzn* , <sup>1</sup> <sup>1</sup> <sup>1</sup> *<sup>n</sup> C cz czn* .

To simplify the inference process of the principle, without loss of generality, let C=1. To derive the optimization prediction value of *y(k + j)* after *j* steps, the Diophantine equation is considered firstly:

$$I = E\_j(z^{-1})A(z^{-1})\Delta + z^{-j}F\_j(z^{-1})\tag{2}$$

where 1 1 <sup>1</sup> ,0 ,1 , 1 ( ) *<sup>j</sup> Ez e e z e z j jj j j* , 1 1 ,0 ,1 , ( ) *<sup>n</sup> Fz f f z f z j jj j n* ,they are multinomial which are decided by the model parameter *A* and prediction length *j* , *j jj* ,0 , 1 *e e* and *j jj* ,0 , 1 *f f* are coefficients.

Using *<sup>j</sup> E z <sup>j</sup>* to multiply both sides of (1), then combining (2), *y*( ) *k j* is derived:

$$y(k+j) = E\_j B \Delta u(k+j-1) + F\_j y(k) + E\_j \xi(k+j) \tag{3}$$

By the expressions *Ej*, can see that *Ej*ξ (*k*+*j*) is an unknown noise starting from instant *th k* , the output prediction value of the futurity *j* steps starting from instant *th k* are derived after deleting the term ( ) *Ekj <sup>j</sup>* :

$$
\hat{y}(k+j) = E\_j B \Delta \mu(k+j-1) + F\_j y(k) \tag{4}
$$

Let *G EB j j* ,and *j = 1,2 ,N* ,(4) can be written as matrix equation (5):

$$
\hat{\mathbf{y}} = \mathbf{G}\boldsymbol{\Delta\mathbf{u}} + \mathbf{f} \tag{5}
$$

where *y*ˆ [ ( 1) ( 2) ... ( )] *yk yk yk N* , *Δu* [ ( ) ( 1) ... ( 1)] *uk uk uk M* , *N* is the model time domain while *M* is the control time domain, 1 2 [ ( ) ( ) ... ( )]*<sup>T</sup> <sup>f</sup> <sup>f</sup> <sup>k</sup> <sup>f</sup> <sup>k</sup> fN <sup>k</sup>* , *n n n nn <sup>n</sup> <sup>j</sup> f kz z g g uk F y kn N* 1 1 , 1 ,0 () [ ] ( ) ( ), 1,2, *<sup>j</sup> G* ,

$$\mathbf{G} = \begin{bmatrix} \mathbf{g}\_1 & \mathbf{0} & \cdots & \mathbf{0} \\ \mathbf{g}\_2 & \mathbf{g}\_1 & \cdots & \mathbf{0} \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{g}\_p & \mathbf{g}\_{p-1} & \cdots & \mathbf{g}\_1 \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{g}\_N & \mathbf{g}\_{N-1} & \cdots & \mathbf{g}\_{N-M+1} \end{bmatrix}\_{N \times M}$$

#### **2.2 Rolling optimization**

68 Frontiers of Model Predictive Control

considers both the NCSs scheduling performance and control performance, and then the process of the general co-design method is also given. From the TrueTime simulation results based on NCSs with three loops of DC-motors, NCSs under co-design compared with NCSs without co-design, we can find that the former shows better control performance and scheduling performance, and a better anti-jamming ability and adaptive ability for network,

GPC (Generalized Predictive Control) algorithm is proposed by Clarke et al (Calrke & Mohtadi, 1989) in the 80s of last century, as a new class of predictive control algorithm. The algorithm is based on Controlled Auto-Regressive Integrated Moving Average (CARIMA) model, adopts an optimization of the long time indicators combined with the identification and self-correcting mechanism, shows strong robustness and has broad scope of application. The significance of GPC algorithm is that the algorithm can still get sub-optimal solution when mismatch or time-varying occurs in the controlled plant model, so it has strong robustness, but also can eliminate the static error of the system with using CARIMA model., The generalized predictive control, which is optimized control algorithms based on the prediction model, rolling optimization and online feedback correction, have distinct characteristics as a new type

Refer to the generalized predictive control; the controlled plant is usually represented by the

( ) ( ) ( 1) *<sup>k</sup> Ay k Bu k C*

To simplify the inference process of the principle, without loss of generality, let C=1. To derive the optimization prediction value of *y(k + j)* after *j* steps, the Diophantine equation is

multinomial which are decided by the model parameter *A* and prediction length *j* ,

to multiply both sides of (1), then combining (2), *y*( ) *k j* is derived:

( ) ( 1) ( ) ( ) *j j <sup>j</sup> y k j EB uk j Fy k E k j*

the output prediction value of the futurity *j* steps starting from instant *th k* are derived after

11 1 ( )( ) ( ) *<sup>j</sup>*

, <sup>1</sup>

, 1 1

ξ

<sup>1</sup> <sup>1</sup> *<sup>n</sup> C cz czn* .

*j j I E z Az z F z* (2)

(*k*+*j*) is an unknown noise starting from instant *th k* ,

,0 ,1 , ( ) *<sup>n</sup> Fz f f z f z j jj j n*

(1)

, 1 1 *z* is a difference operator,

,they are

(3)

( ) *k* is a white

so that the NCSs with co-design can guarantee to operate in an optimal state.

of control algorithms. (Wang et al., 1998; Guan & Zhou, 2008; Ding, 2008).

where *u k*( ) and *y*( ) *k* are control input and system output respectively,

*<sup>n</sup> B bz bzn*

noise with zero mean and standard deviation <sup>2</sup>

1

**2. Brief review of Generalized Predictive Control** 

**2.1 Prediction model** 

model of CARIMA:

1 <sup>1</sup> <sup>1</sup> *<sup>n</sup> A az azn*

considered firstly:

Using *<sup>j</sup> E z <sup>j</sup>*

, <sup>1</sup>

where 1 1 <sup>1</sup> ,0 ,1 , 1 ( ) *<sup>j</sup> Ez e e z e z j jj j j*

*j jj* ,0 , 1 *e e* and *j jj* ,0 , 1 *f f* are coefficients.

By the expressions *Ej*, can see that *Ej*

:

deleting the term ( ) *Ekj <sup>j</sup>*

To enhance the robustness of the system, the quadratic performance index with output error and control increment weighting factors are adopted:

$$J = \sum\_{j=N\_0}^{P} \left[ y(k+j) - y\_r(k+j) \right]^2 + \sum\_{j=1}^{M} [\mathcal{A}(j)\Delta u(k+j-1)]^2 \tag{6}$$

where *N*0 is the minimum prediction horizon, and *N*0≥1, *P* is the maximum prediction horizon, *M* is the control horizon, that means the control value will not be changed after *M*  steps, ( )*j* , which is a constant in the general control systems, is the control increment weighting factor, but it will be adjusted in real time within the control process in the codesign of control and scheduling to ensure optimal control.

The optimal control law is as follow:

$$\mathbf{A}\mathbf{u}(k) = (\mathbf{G}^T\mathbf{G} + \lambda I)^{-1}\mathbf{G}^T[\mathbf{y}\_r(k+1) - f] \tag{7}$$

Then the incremental series of open loop control from instant *kth* to instant ( *k*+*M*-1)*th* is derived after expanding the formula (7):

$$\Delta \mathbf{u}(k+i-1) = \mathbf{d}\_i^\top \left[ \mathbf{y}\_r(k+1) - \mathbf{f} \right] \tag{8}$$

where *<sup>T</sup> <sup>i</sup> <sup>d</sup>* is the *th <sup>i</sup>* increment of <sup>1</sup> ( ) *T T GG I G* , 1 1 [ ] *i i iP <sup>d</sup><sup>i</sup> <sup>T</sup> dd d* .

In the real control systems, the first control variable will be used in every period. If the control increment *Δu*( ) *k* of the current instant *th k* is executed, the control increment after *th k* will be recalculated in every period, that is equivalent to achieve a closed loop control strategy, then the first raw of <sup>1</sup> ( ) *T T GG I G* is only necessary to recalculate. So the actual control action is denoted as (9):

Predictive Control Applied to Networked Control Systems 71

size of *P* has a great effect on the stability and rapidity of the system. If *P* is small, the dynamic performance is good, but with poor stability and robustness. If *P* is big, the robustness is good, but the dynamic performance is bad, so that system's real-time performance is reduced because of increasing of computing time. In the actual application, we can choose the one between the two values previously mentioned to make the closedloop system not only with the desired robustness but also the required dynamic

This is an important parameter. Must *M≤P*, because that the optimal prediction output is affected by *P* control increment values at best. Generally, the *M* is smaller, the tracking performance is worse. To improve the tracking performance, increasing the control steps to improve the control ability for the system, but with the increase of *M*, the control sensitivity is improved while the stability and robustness is degraded. And when *M* increases, the dimension of the matrix and the calculation amount is increased; the real-time performance of the system is decreased, so *M* should be selected taking into account the rapidity and stability.

The effect of the control weighting factor is to limit the drastic change of the control increment, to reduce the large fluctuation to the controlled plant. The control stability is

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

1. can effectively utilize the network bandwidth resources, and improve bandwidth

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:

1

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

1

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

while the control action is weakened (Li, 2009). To select small

is 0 or a smaller number in practice. If the control system is

appropriately

performance (rapidity) (Ding, 2008).

3. Control horizon *M*

4. Control weighting factor

achieved by increasing

utilization;

number

steady but the control increment changes drastically, then can increase

**3. EDF scheduling algorithm and network performance parameters** 

2. can effectively analyze schedulability of information that will be scheduled; 3. is relatively simple to achieve it, and the executed instructions is lessr in the nodes.

until the satisfactory control result is achieved.

generally, firstly let

**3.1 EDF scheduling algorithm** 

general dynamic scheduling algorithm:

$$\mathfrak{u}(k) = \mathfrak{u}(k-1) + \mathfrak{d}\_I^{\;\;I} \left[ \mathfrak{y}\_r(k+1) - \mathcal{f} \right] \tag{9}$$

#### **2.3 Feedback correction**

To overcome the random disturbance, model error and slow time-varying effects, GPC maintains the principle of self-correction which is called the generalized correction, by constantly measuring the actual input and output, estimates the prediction model parameters on-line. Then the control law is corrected.

The plant model can be written as:

$$A\Delta y(k) = B\Delta u(k-1) + \xi(k)$$
 
$$\text{Then we can attain } \qquad \Delta y(k) = -(A-1)\Delta y(k) + B\Delta u(k-1) + \xi(k) \tag{10}$$

Model parameters and data parameters are expressed using vector respectively

$$\theta = [a\_1 \cdots a\_n \dot{\cdot} b\_0 \cdots b\_m] \tag{11}$$

$$\mathfrak{g} = \left[ -\Delta y (k-1) \cdots -\Delta y (k-n) \right] \text{--} \Delta u (k-1) \cdots -\Delta u (k-m+1) \text{]} \tag{12}$$

Then the above equation (10) can be written into the following form:

$$
\Delta \underline{\boldsymbol{y}}(k) = \boldsymbol{\mathfrak{g}}^T(k)\boldsymbol{\theta} + \boldsymbol{\xi}(k) \tag{13}
$$

The model parameters can be estimated by recursive least squares method with forgetting factor. The parameters of polynomial *A* , *B* are obtained by identification. *<sup>T</sup> <sup>i</sup> d* and *f* in control law of equation (9) can be recalculated, and that the optimal control *u*( ) *k* is found.

#### **2.4 Generalized predictive control performance parameters**

Generalized predictive control performance parameters (Ding, 2008; Li, 2009) contain minimum prediction horizon *N*<sup>0</sup> , maximum prediction horizon *P*, control horizon *M*, and control weighting factor .

1. Minimum prediction horizon *N*<sup>0</sup>

When the plant delay *d* is known, then take *N d* <sup>0</sup> . If *N d* <sup>0</sup> , there are some output of *y k*( 1), , *yk P* ( ) without the impact from input *u k*( ), this will waste some computation time. When *d* is unknown or varying, generally let *N*<sup>0</sup> =1, that means the delay may be included in the polynomial <sup>1</sup> *B z*( ) .

2. Maximum prediction horizon *P*

In order to make the rolling optimization meaningfully, *P* should include the actual dynamical part of the plant. Generally to take *P* close to the rise time of the system, or to take *P* greater than the order of <sup>1</sup> *B z*( ) . In practice, it is recommended to use a larger *P*, and make it more than the delay part of the impulse response of the plant or the reverse part caused by the non-minimum phase, and covers the main dynamic response of the plant. The size of *P* has a great effect on the stability and rapidity of the system. If *P* is small, the dynamic performance is good, but with poor stability and robustness. If *P* is big, the robustness is good, but the dynamic performance is bad, so that system's real-time performance is reduced because of increasing of computing time. In the actual application, we can choose the one between the two values previously mentioned to make the closedloop system not only with the desired robustness but also the required dynamic performance (rapidity) (Ding, 2008).

3. Control horizon *M*

70 Frontiers of Model Predictive Control

( ) ( 1) [ ( 1) ] *kk k <sup>T</sup> u u dy f 1 r* (9)

To overcome the random disturbance, model error and slow time-varying effects, GPC maintains the principle of self-correction which is called the generalized correction, by constantly measuring the actual input and output, estimates the prediction model

*A yk B uk k* ( ) ( 1) ( )

*y*() () () *k kk*

The model parameters can be estimated by recursive least squares method with forgetting

control law of equation (9) can be recalculated, and that the optimal control *u*( ) *k* is found.

Generalized predictive control performance parameters (Ding, 2008; Li, 2009) contain minimum prediction horizon *N*<sup>0</sup> , maximum prediction horizon *P*, control horizon *M*, and

When the plant delay *d* is known, then take *N d* <sup>0</sup> . If *N d* <sup>0</sup> , there are some output of *y k*( 1), , *yk P* ( ) without the impact from input *u k*( ), this will waste some computation time. When *d* is unknown or varying, generally let *N*<sup>0</sup> =1, that means the delay may be

In order to make the rolling optimization meaningfully, *P* should include the actual dynamical part of the plant. Generally to take *P* close to the rise time of the system, or to take *P* greater than the order of <sup>1</sup> *B z*( ) . In practice, it is recommended to use a larger *P*, and make it more than the delay part of the impulse response of the plant or the reverse part caused by the non-minimum phase, and covers the main dynamic response of the plant. The

[ ( 1) ( ) ( 1) ( 1)] *yk yk n uk uk m* (12)

 *T* 

1 0 [ ] *θ a ab b n m* (11)

*θ* (13)

(10)

*<sup>i</sup> d* and *f* in

**2.3 Feedback correction** 

The plant model can be written as:

control weighting factor

1. Minimum prediction horizon *N*<sup>0</sup>

included in the polynomial <sup>1</sup> *B z*( ) . 2. Maximum prediction horizon *P*

parameters on-line. Then the control law is corrected.

Then we can attain *y*( ) ( 1) ( ) ( 1) ( ) *k A yk B uk k*

Then the above equation (10) can be written into the following form:

**2.4 Generalized predictive control performance parameters** 

.

Model parameters and data parameters are expressed using vector respectively

factor. The parameters of polynomial *A* , *B* are obtained by identification. *<sup>T</sup>*

This is an important parameter. Must *M≤P*, because that the optimal prediction output is affected by *P* control increment values at best. Generally, the *M* is smaller, the tracking performance is worse. To improve the tracking performance, increasing the control steps to improve the control ability for the system, but with the increase of *M*, the control sensitivity is improved while the stability and robustness is degraded. And when *M* increases, the dimension of the matrix and the calculation amount is increased; the real-time performance of the system is decreased, so *M* should be selected taking into account the rapidity and stability.

4. Control weighting factor 

The effect of the control weighting factor is to limit the drastic change of the control increment, to reduce the large fluctuation to the controlled plant. The control stability is achieved by increasing while the control action is weakened (Li, 2009). To select small number generally, firstly let is 0 or a smaller number in practice. If the control system is steady but the control increment changes drastically, then can increase appropriately until the satisfactory control result is achieved.
