Keywords

1 Introduction

In contrast with traditional dedicated control systems, wireless network is now being utilized in control systems making the systems distributed. These novel distributed systems are known as wireless networked control system (WNCS) [13]. Practical examples of such systems include smart power grid, network enabled manufacturing, water distribution, traffic, and so on. In WNCS, wireless communication packets carry sensed data and control commands from different physical systems (or plant) and remote controllers. Although WNCS can reduce system wiring, ease of system diagnosis and maintenance, and increase agility, the uncertainty caused by shared wireless network and its protocols and practical natural of control systems bring many challenging issues for both wireless network protocol and controller designs.

The issues for control design [2] include wireless network latency and packet loss [3] which dependent on wireless communication channel quality and the network protocol design respectively. In general, wireless network latency and packet losses can destabilize the real-time control system and in many cases can result in safety concerns. However, the recent literature [13] only focused on stability or optimal controller design by assuming wireless network latency and packet losses to be a constant or random ignoring the real behavior of the wireless network component. By contrast, the current wireless network protocol designs [4, 5] ignore the effects of the real-time nature of the control system or the application making them unsuitable for real-time control applications. Thus, a truly cross-layer WNCS co-design which not only optimizes the performance of the wireless network but also controlled system is necessary. Towards this end, the distributed scheduling scheme is critical in wireless network protocol design [4]. Compared with traditional centralized scheduling [5], the main advantage with distributed scheduling is that it does not need a central processor to deliver the schedules after collecting information from all the users. In IEEE 802.11 standard [4], carrier sense multiple access (CSMA) protocol is introduced to schedule wireless users in a distributed manner where a wireless node wishing to transmit does so only if it does not hear an on-going transmission. Meanwhile, fairness is a non-negligible factor in distributed scheduling design. In [6], authors proposed distributed fairness scheduling in packet switched network and wireless LAN network respectively. Different users wishing to share wireless channel can be allocated bandwidth in proportion to their weights, which ensured the fairness among different users [6]. However, since random access scheme is used in most CSMA-based distributed scheduling [6, 7] and these schemes [6, 8, 9] focus on improving the performance of link layer alone which in turn increases wireless network latency, these protocols are both not optimal and unsuitable for WNCS since they can cause degradation in the performance of WNCS.

Thus, this paper proposes a novel cross-layer approach which considers controller information from application layer and wireless network performance from MAC layer to derive a stochastic optimal controller and distributed scheduling schemes for WNCS. Proposed stochastic control design can generate the optimal control inputs through value function estimator by relaxing system dynamics, wireless network latency and packet losses. On the other hand, proposed cross-layer distributed scheduling protocol optimizes not only the wireless network performance but also the controlled plant (or system) performance by maximizing utility function generated from both the wireless network and the plant.

2 Background of Wireless Networked Control System

The basic structure of WNCS with multiple users is shown in Fig. 1 where users include controller-plant pair (or system) sharing a common wireless network. Each WNCS pair includes five main components: (1) Real-time physical system or plant to be controlled; (2) A sensor measures the system outputs from the plant; (3) A controller that generates commands in order to maintain a desired plant performance; (4) A wireless network to facilitate communication among plants with their controllers and (5) the actuators which change plant states based on commands received from the controller. Figure 2 illustrates the structure of a WNCS pair. It is important to note that \(\tau _{sc}(t)\) represents wireless network latency between the sensor and the controller, \(\tau _{ca}(t)\) is wireless latency between the controller and actuator and \(\gamma (t)\)is the packet loss indicator.

Fig. 1
figure 1

Multiple WNCS pairs

Fig. 2
figure 2

Structure of one WNCS pair

Fig. 3
figure 3

Network structure for cross-layer design

Since control system and wireless network can affect each other, a co-design approach is introduced in the next section to jointly optimize the control system and wireless network based on the information from both controlled plant information from application layer and shared wireless network information in MAC layer via the cross-layer approach. The proposed WNCS co-design includes two tasks: (1) stochastic optimal control design in application layer; and (2) a novel optimal cross-layer distributed scheduling algorithm design for MAC layer.

3 Wireless Networked Control System (WNCS) Co-Design

3.1 Overview

In our algorithm, the control design and scheduling protocols are implemented into all WNCS pairs which are sharing the wireless network. Each WNCS pair tunes its stochastic optimal controller under wireless imperfections (e.g. wireless network latency and packet losses) caused by current distributed scheduling design, estimates its value function [10] based on tuned control design, and transmits that information (i.e. value function) to the link layer. The link layer tunes user’s distributed scheduling scheme based on throughput from the link-layer and the value function value received from the application layer (i.e. controlled plant). The cross-layer WNCS co-design framework is shown in Fig. 3.

3.2 Plant Model

Suppose each WNCS pair is described as a linear time-invariant continuous-time system \(\dot{x}^{l} (t) = A^{l} x(t) + B^{l} u^{l} (t)\forall l = 1,2,...,N\) with system dynamics \(A^{l},B^{l}\) for \(l\)th WNCS pair, and sampling interval is \(T_{s}\). For stochastic optimal control design, the wireless network latency for every WNCS pair has to be bounded as \(\tau ^{l}\le \bar{d}T_{s},\forall l = 1,\ldots ,N\) which needs to be ensured by the proposed cross-layer distributed scheduling protocol. Considering wireless network latency and packet losses, the \(l\)th WNCS pair dynamics can be represented as [11]:

$$\begin{aligned} x_{k + 1}^{l}&= A_{s}^{l}x_{k}^{l} + B_{k}^{l1} u_{k - 1}^{la} + B_{k}^{l2} u_{k - 2}^{la} + \cdots B_{k}^{l\bar{d}} u_{k -\bar{d}}^{la}\, + B_{k}^{i0} u_{k}^{la}\\ u_{k - i}^{la}&= \gamma _{k - i}^{l} u_{k - i}^{l}\qquad \forall i = 0,1,2,...,\bar{d},\forall k = 0,1,2.... \nonumber \end{aligned}$$
(1)

where \(u_{k}^{la}\) is the actual control input received by \(l\)th WNCS actuator at time \(kT_{s}, u_{k}^{l}\) is the control input computed by \(l\)th WNCS controller at time \(kT_{s}\), and stochastic variables \(\gamma _ {k}^{l} \) models the packet losses for \(l\)th WNCS at time \(kT_{s}\)which follows Bernoulli distribution with \(P(\gamma _{k}^{l} = 1) = \bar{\gamma }^{l}\). \(A_{s}^{l} ,B_{k}^{l1} ,...,B_{k}^{l\bar{d}}\) are the augment system model dynamics caused by wireless network latency and packet losses for \(l\)th WNCS at time \(kT_{s}\) (Note: the definition of these dynamics is given in our previous paper [11], due to page limitation details are neglected here). By defining the augment state \(z_{k}^{l} = [(x_{k}^{l})^T (u_{k - 1}^{l})^{T} (u_{k - 2}^{l})^{T} \cdots (u_{k - \bar{d}}^{l} )^{T} ]^{T}\)of \(l\)th WNCS pair at time \(kT_{s}\), the plant dynamics (1) can be rewritten as

$$\begin{aligned} z_{k + 1}^{l} = A_{zk}^{l} z_{k}^{l} + B_{zk}^{l} u_{k}^{l} \end{aligned}$$
(2)

where the time-varying augmented system matrices are given

$$\begin{aligned} A_{zk}^{l} = \left[\begin{array}{cccccc} A_{s}^{l}&\gamma _{k - 1}^{l} B_{k}^{l1}&\cdots&\gamma _{k - i}^{l} B_{k}^{lk}&\cdots&\gamma _{k - \bar{d}}^{l} B_{k}^{l\bar{d}}\\ 0&0&\cdots&\cdots&\cdots&0 \\ 0&{I_{m}}&\cdots&\cdots&0&0 \\ \vdots&0&{I_{m}}&\cdots&\cdots&0\\ \vdots&\vdots&\,&\ddots&\,&\vdots \\ 0&0&\cdots&\cdots&{I_{m}}&0 \end{array}\right] ,B_{zk}^{l} = \left[\begin{array}{c} \gamma _{k}^{l} B_{k}^{l0}\\ {I_{m}}\\ 0 \\ 0 \\ \vdots \\ 0 \end{array}\right]. \end{aligned}$$

It is important to note that there are two main challenges in (2) for the co-design. In practical WNCS, since wireless imperfections are not known before hand, system representation (2) is uncertain, and optimal control for WNCS has to be designed without knowing the system dynamics which is the first challenge for the control part of the co-design. Second, stochastic optimal control is designed based on the constraints of wireless imperfections. However, these wireless imperfections depend upon wireless network protocol and scheduling scheme. Therefore designing an optimal distributed scheduling protocol which not only optimizes wireless network performance but also satisfies wireless network imperfection constraints from different WNCS pairs is another challenge for the co-design.

Based on these challenges, stochastic optimal controller and cross-layer distributed scheduling schemes are proposed.

3.3 Stochastic Optimal Control

In this part, a novel stochastic optimal control is proposed for uncertain plant dynamics and wireless imperfections. Without loss of generality, \(l\)th WNCS pair is chosen for convenience for the optimal control development.

Based on optimal control theory [11], \(l\)th WNCS stochastic value function can be defined as

$$\begin{aligned} V_{k}^{l} = \mathop {E}\limits _{\tau ,\gamma } \{(z_{k}^{l})^{T} P_{k}^{l} z_{k}^{l}\} \end{aligned}$$
(3)

where \(P_{k}^{l}\ge 0\) is the solution of Stochastic Riccati Equation (SRE) for \(l\)th WNCS pair and \(\mathop {E}\limits _{\tau ,\gamma }\{\bullet \}\) is expect operator (in this case the mean value) of \(\{(z_{k}^{l} )^{T} P_{k}^{l} z_{k}^{l}\)}. Stochastic optimal control for \(l\)th WNCS pair at time \(kT_{s} \) can be solved by minimizing value function, i.e. \((u_{k}^{l})^{*} = {\text{ arg}} \min V_{k}^{l} \forall k = 1,2,....\) Similar to [11], the value function (3) can be expressed as

$$\begin{aligned} V_{k}^{l} = \mathop {E}\limits _{\tau ,\gamma } \{ [(z_{k}^{l})^{T},u_{k}^{lT}]H_{k}^{l} [(z_{k}^{l})^{T},u_{k}^{lT} ]^{T}\} = (\bar{h}_{k}^{l} )^{T} \bar{\chi }_{k}^{l} \end{aligned}$$
(4)

where

$$\begin{aligned} \bar{H}_{k}^{l} = \mathop {E}\limits _{\tau ,\gamma } (H_{k}^{l} )&= \, \left[\begin{array}{cc} \bar{H}_{k}^{lzz}&\bar{H}_{k}^{lzu}\\ \bar{H}_{k}^{luz}&\bar{H}_{k}^{luu} \end{array}\right]\\&= \left[\begin{array}{cc} S_{z}^{l} + \mathop {E}\limits _{\tau ,\gamma } [(A_{zk}^{l} )^{T} P_{k + 1}^{l} A_{zk}^{l} ]&\mathop {E}\limits _{\tau ,\gamma } [(A_{zk}^{l} )^{T} P_{k + 1}^{l} B_{zk}^{l} ]\\ \mathop {E}\limits _{\tau ,\gamma } [(B_{zk}^{l} )^{T} P_{k + 1}^{l} A_{zk}^{l} ]&R_{z}^{l} + \mathop {E}\limits _{\tau ,\gamma } [(B_{zk}^{l} )^{T} P_{k + 1}^{l} B_{zk}^{l} ] \end{array}\right] \end{aligned}$$

\(\bar{h}_{k}^{\,l} = vec(\bar{H}_{k}^{\,l}),\chi _{k}^{\,l} = [(z_{k}^{\,l} )^{T} u^{T} (z_{k}^{\,l} )]^{T}\) and \(\bar{\chi }_{k}^{\,l} \) is the Kronecker product quadratic polynomial basis vector of \(l\)th WNCS pair and \(\bar{h}_{k}^{\,l} = vec(\bar{H}_{k}^{\,l})\) with the vector function acting on a square matrices thus yielding a column vector (Note: the \(vec (\bullet )\) function is constructed by stacking the columns of the matrix into one column vector with the off-diagonal elements which can be combined as \(H_{mn}^{l} + H_{nm}^{l}\) [11]). According to [10], the optimal control of \(l\)th WNCS pair can be expressed by using \(H^{l} \)matrix as

$$\begin{aligned} (u_{k}^{l} )^{*} = - [R_{z}^{l} +\mathop {E}\limits _{\tau ,\gamma } (B_{zk}^{lT} P_{k + 1}^{l} B_{zk}^{l} )]^{ - 1} \mathop {E}\limits _{\tau ,\gamma } (B_{zk}^{lT} P_{k + 1}^{l} A_{zk}^{l})z_{k}^ {l} = - (\bar{H}_{k}^{luu} )^{ - 1} \bar{H}_{k}^{luz} z_{k}^{l}. \end{aligned}$$
(5)

Therefore, if \(H^{l}\) matrix is obtained for \(l\)th WNCS pair, then stochastic optimal control is solved. However, since system dynamics is unknown, \(H^{l}\) matrix cannot be solved directly. Similar to [11], we adaptively estimate the value function \(H^{l}\) matrix and obtain the optimal control. Value function estimation error \(e_{hk}^{l}\) of \(l\)th WNCS pair at time \(kT_{s}\) can be defined and expressed as \(\hat{V}_{k}^{\,l} - \hat{V}_{k - 1}^{l} + z_{k}^{lT} S_{z}^{l} z_{k}^{\,l} + u_{k}^{lT} R_{z}^{l} u_{k}^{\,l} = e_{hk}^{l}\), where \(\hat{V}_{l} \) is the estimated stochastic value function of \(l\)th WNCS pair at time \(kT_{s}\), and \(S_{z}^{l} ,R_{z}^{l} \) are positive definite matrix and positive semi-definite matrix of \(l\)th WNCS pair respectively. Then, update law for parameter vector for the value function can be given as

$$\begin{aligned} \hat{\bar{h}}_{k + 1}^{\,l} = \hat{\bar{h}}_{k}^{\,l} + \alpha _{h}^{l} \frac{\Delta \bar{\chi }_{k}^{\,l} (e_{hk}^{l} - z_{k}^{lT} S_{z}^{l} z_{k}^{\,l} - u_{k}^{lT} R_{z}^{l} u_{k}^{\,l} )^{T}}{\Delta \bar{\chi }_{k}^{lT} \Delta \bar{\chi }_{k}^{\,l} + 1} \end{aligned}$$
(6)

where \(\bar{\chi }_{k}^{\,l} \) is regression function of \(l\)th WNCS pair, \(\Delta \bar{\chi }_{k}^{\,l}\) is defined as \(\Delta \bar{\chi }_{k}^{\,l} = \bar{\chi }_{k}^{\,l} -\bar{\chi }_{k - 1}^{\,l}\) and \(\alpha _{h}^{l}\) is the learning rate of value function estimator for \(l\)th WNCS pair respectively.

Based on estimated \(H^{l} \) matrix, the stochastic optimal control for \(l\)th WNCS pair can be expressed as

$$\begin{aligned} \hat{u}_{k}^{\,l} = - (\hat{\bar{H}}_{k}^{\;luu} )^{ - 1} \hat{\bar{H}}_{k}^{\;luz} z_{k}^{\,l}. \end{aligned}$$
(7)

Algorithms 1 and 2 represent the proposed stochastic optimal control design while Theorem 1 shows that the value function estimation errors are asymptotically stable. Further, the estimated control inputs will also converge to the optimal control signal asymptotically.

figure a1
figure a2

Theorem 1

Given the initial state \(z_{0}^{l}\) for \(l\)th WNCS pair, estimated value function and value function vector \(\hat{\bar{h}}_{k}^{\;l}\) of \(l\)th WNCS pair be bounded in the set \(\mathbf {S}\), let \(u_{0k}^{l} \) be any initial admissible control policy for \(l\)th WNCS pair at the time \(kT_{s}\) (1) with wireless imperfections satisfying latency constraints (i.e. \(\tau < \bar{d}T_{s}\) ) caused by distributed scheduling protocol. Let value function parameters be tuned and the estimated control policy be provided by (6) and (7) respectively. Then, there exists positive constant \(\alpha _{h}^{l}\) such that the system state \(z_{k}^{\,l}\) and stochastic value function parameter estimation errors \(\tilde{\bar{h}}_{k}^{\;l}\) are all asymptotically stable. In other words, as \( k \rightarrow \infty ,z_{k}^{\,l} \rightarrow 0,\tilde{\bar{h}}_{k}^{\;l} \rightarrow 0,\hat{V}_{k}^{\,l} \rightarrow V_{k}^{\,l} \) and \(\hat{u}_{k}^{\,l}\rightarrow (u_{k}^{\,l} )^{*} \forall l\).

3.4 Novel Optimal Cross-Layer Distributed Scheduling Scheme

In this section, we focus on novel utility-optimal distributed scheduling design which is mainly at the link layer. Therefore, without loss of generality, traditional wireless ad-hoc network protocol [12] is applied to the other layers. For optimizing the performance of WNCS and satisfying the constraints from proposed stochastic optimal control design in the application layer, a novel optimal cross-layer distributed scheduling algorithm is proposed here by using controlled plane information from application layer.

First, the utility function for \(l\)th WNCS pair is defined as

$$\begin{aligned} Utility_{k}^{\,l} = 2^{(R_{l} + \Delta V_{k}^{\,l} )}. \end{aligned}$$
(8)

Since performance of controlled plant and wireless network are considered in wireless network protocol design, utility function includes two parts: (1) a value function from \(l\)th WNCS pair’s controlled plant at time \(kT_{s}\) is \(\Delta V_{k}^{\,l} = (z_{k}^{lT} S_{z}^{l} z_{k}^{\,l} + u_{k}^{lT} R_{z}^{l} u_{k}^{\,l} ) - (z_{k}^{lT} S_{z}^{l} z_{k}^{\,l} + u_{k}^{lT} R_{z}^{l} u_{k}^{\,l}\) ); (2) Throughput of \(l\)th WNCS pair, \(R_{l}\), which can be represented as (9) by using Shannon theory as

$$\begin{aligned} R_{l} = B_{wncs} \log _{2} (1 +\frac{P_{l} d_{l}^{ - 2}}{n_{0}^{l} B_{wncs}}) \end{aligned}$$
(9)

where \(B_{wncs}\) is the bandwidth of the entire wireless network, \(P_{l} \) is the transmitting power of \(l\)th WNCS pair, \(d_{l}\) is the distance between plant and controller of \(l\)th WNCS pair and \(n_{0}^{l}\) is the constant noise dense of \(l\)th WNCS pair.

Next, the optimal distributed scheduling problem can be formulated as maximizing the following utility function

$$\begin{aligned}&\mathrm{{maxmize}}\sum _{l = 1}^{N} Utility_{k}^{\,l} = \mathrm{{maxmize}}\sum _{l = 1}^{N} 2^{(R_{l} + \Delta V_{k}^{\,l} )}\nonumber \\&\mathrm{{subject\;to}}:\tau _{k}^{\,l} \le \bar{d}T_{s}\qquad \forall l = 1,2,...,N; \forall k = 0,1,2,... \end{aligned}$$
(10)

where \(\tau _{k}^{\,l}\) is wireless network latency of \(l\)th WNCS pair at \(kT_{s}\) .

It is important to note that wireless network latency constraints in (10) represent the proposed optimal control design constraints. Cross-layer distributed scheduling is not only maximizes the sum of all WNCS pairs but also satisfies the wireless network latency requirement for every plant-controller pair which in turn ensures that the proposed control design can optimize the controlled plant properly.

The main idea of proposed distributed scheduling scheme is to separate transmission time of different WNCS pairs by using backoff interval (BI) [12] based on utility function in a distributed manner. The proposed distributed scheduling framework is shown in Fig. 4. For solving optimal scheduling problem (10) by different WNCS pairs, the BI is designed as

$$\begin{aligned} BI_{k}^{\,l} = \xi ^{*}\frac{\sum \limits _{j = 1}^{N}2^{(R_{j} +\Delta V_{k}^{j} )}}{\beta _{k}^{\,l}\sum \limits _{j = 1}^{N}2^{(R_{j} + \Delta V_{k}^{j} )} + 2^{(R_{l} + \Delta V_{k}^{\,l} )}}\forall l = 1,2,...,N \end{aligned}$$
(11)

where \(\xi \) is scaling factor and \(\beta _{k}^{\,l}\) is the balancing parameter of \(l\)th WNCS pair at time \(kT_{s} \) which is equal to the index of first unsent packet stored in transmission buffer of \(l\)th WNCS pair. It is important to note balancing parameter is used to satisfy latency constraints in (10), which is illustrated in Theorem 2.

figure a3
Fig. 4
figure 4

The proposed cross-layer distributed scheduling framework

Remark 1

Since every WNCS pair decides its schedule by using local information, proposed novel optimal cross-layer scheduling scheme is distributed. In this paper, we assume that every WNCS pair broadcasts its utility function periodically in order to calculate entire wireless network utility.

Remark 2

Compared with other distributed scheduling schemes [68], proposed algorithm designs the backoff interval intelligently by optimizing utility function instead of selecting it randomly [68].

Theorem 2

The proposed distributed scheduling protocol based on cross-layer design delivers the desired performance in terms of satisfying the delay constraints \(\tau _{k}^{\,l}\le \bar{d}T_{s} \forall l = 1,2,...,N;\forall k = 0,1,2,... \) (i.e. during\( [kT_{s} ,(k + \bar{d})T_{s}\) ), every WNCS pair should be scheduled at least once).

Proof

Omitted due to page limitation.

Theorem 3

When priorities of different WNCS pairs are equal, proposed scheduling protocol can render best performance schedules for each WNCS pair.

Proof

Based on the definition of BI design (11), the priority term is \(\beta _{k}^{i}\sum \limits _{j = 1}^{N}2^{(R_{j} + \Delta V_{k}^{j} )}\). If it is same for any WNCS pairs, it indicates

$$\begin{aligned} \beta _{k}^{i} \sum _{j = 1}^{N}2^{(R_{j} + \Delta V_{k}^{j} )} = \beta _{k}^{\,l}\sum _{j = 1}^{N}2^{(R_{j} + \Delta V_{k}^{j} )}\quad \forall i,l \in [1,N] \;\mathrm{{and}}\;\ne l \end{aligned}$$
(12)

Therefore, for \(\forall i,l \in [1,N] \;\mathrm{{and}}\; i \ne l\), the BI of different WNCS pair should satisfy

$$\begin{aligned} \frac{BI_{k}^{i}}{BI_{k}^{\,l}} = \frac{\beta _{k}^{\,l} \sum \limits _{j = 1}^{N}2^{(R_{j} + \Delta V_{k}^{j} )} + 2^{(R_{l} + \Delta V_{k}^{\,l} )}}{\beta _{k}^{i}\sum \limits _{j = 1}^{N}2^{(R_{j} + \Delta V_{k}^{j} )} + 2^{(R_{i} +\Delta V_{k}^{i} )}}> 1 \end{aligned}$$
(13)

If and only if

$$\begin{aligned} 2^{(R_{l} + \Delta V_{k}^{\,l} )} > 2^{(R_{i} +\Delta V_{k}^{i} )} \end{aligned}$$
(14)

Next, proof for proposed cross-layer distributed scheduling algorithm is given. First of all, utility function of whole WNCS is defined as

$$\begin{aligned} Utility^{tot} = \sum _{j = 1}^{N} 2^{(R_{j} + \Delta V_{k}^{j} )} \end{aligned}$$
(15)

Assume set \(\mathbf{{S}}_{1}\) is the unscheduled WNCS pairs set, and \(\mathbf{{S}}_{2}\) is scheduled WNCS pairs set. \(\forall l \in \mathbf{{S}}_{1} ,\forall n \in \mathbf{{S}}_{2}\) such that \(BI_{k}^{\,l} > BI_{k}^{n}\) and \(2^{(R_{l} + \Delta V_{k}^{\,l} )}< 2^{(R_{n} +\Delta V_{k}^{n} )}\) .

Therefore, \(U_{S2} = \sum \limits _{j \,=\, \mathbf{S}_{2}}2^{(R_{j} +\Delta V_{k}^{j} )}\) and \(U_{S2}^{1}\) can be derived as

$$\begin{aligned} U_{S2}^{1}&= \sum _{j = \mathbf{{S}}_{2} ,j \ne n}2^{(R_{j} + \Delta V_{k}^{j} )} + 2^{(R_{l} + \Delta V_{k}^{\,l} )}\nonumber \\&= \sum _{j = \mathbf {S}_{2}}2^{(R_{j} + \Delta V_{k}^{j} )} + \big [2^{(R_{l} + \Delta V_{k}^{\,l} )} - (2^{(R_{n} + \Delta V_{k}^{n} )} )\big ] \sum _{j = \mathbf {S}_2} 2^{(R_{j} +\Delta V_{k}^{j} )} = U_{S2} \end{aligned}$$
(16)

Thus, when all WNCS pairs’ priorities are same, the utility function of WNCS pairs based on proposed scheduling algorithm achieves maximum which illustrates the optimality.

Remark 3

Fairness is an important factor to evaluate the performance of scheduling algorithm. For proposed cross-layer distributed scheduling, a fairness index (FI) [9] is defined as \(FI =\left( \sum \limits _{i = 1}^{N} \frac{R_{i}}{2^{(R_{i} + \Delta V^{l} )}}\right)^{2}\left. \left[ N * \sum \limits _{i = 1}^{N} \left(\frac{R_{i}}{2^{(R_{i} + \Delta V^{l} )}}\right)^{2}\right]\right.\) to measure the fairness among different WNCS pairs.

4 Numerical Simulations

To evaluate the cross-layer co-design, the wireless network includes 10 pairs of physical plant and remote controllers which are located within 150 m*150 m square area randomly. Since batch reactor is considered as a benchmark example for WNCS [11], all 10 pairs use it. The continuous-time model is

$$\begin{aligned} \dot{x} = \left[\begin{array}{l@{}l@{}l@{}l} 1.38&- 0.2077&6.715&- 5.676\\ - 0.5814&- 4.29&0&0.675\\ 1.067&4.273&- 6.654&5.893\\ 0.048&4.273&1.343&- 2.104 \end{array}\right] x + \left[ \begin{array}{cc} 0&0 \\ 5.679&0 \\ 1.136&- 3.146\\ 1.136&0 \end{array}\right]u \end{aligned}$$
(17)

First, the performance of proposed stochastic optimal control algorithm is shown in Fig. 4. Due to page limitation, and without loss of generality, an average value of 10 different state regulation errors is shown in Fig. 5. The results indicates that the stochastic optimal control under wireless network latency with unknown dynamics and can make the state regulation errors converge to zero quickly while ensuring all WNCS stable. Note that there are some overshoots observed at the beginning because the optimal control tuning needs time.

Fig. 5
figure 5

State regulation errors

Fig. 6
figure 6

Wireless network latency

Fig. 7
figure 7

Utility comparison

Second, the performance of the proposed cross-layer distributed scheduling is evaluated. For comparison embedded round robin (ERR) [12] and Greedy scheduling [5] have been added. In Fig. 6, wireless network latency of each WNCS pair is shown. At the beginning, based on the different value of utility function defined in (8), one WNCS pair contends the wireless resource to communicate. Meantime, since unscheduled WNCS pairs have to wait, the wireless network latency of the other WNCS pairs have been increased. However, with wireless network latencies increasing, their BI values have to be decreased and scheduled WNCS pair’s BI need to be increased based on proposed cross-layer distributed algorithm (11). Therefore, when the BI of unscheduled WNCS pair is smaller than scheduled BI, it can access the wireless resource to transmit. It is important to note that wireless network latency of all 10 WNCS pairs have never been increased beyond \(\bar{d}T_{s}\) (Note: \(\bar{d} = 2,T_{s} = 0.034\) s) which indicates wireless network latency constraints of all 10 WNCS pairs have been satisfied.

Third, utility function of WNCS with three different scheduling schemes is compared. As shown in Fig. 7, proposed cross-layer scheduling maintains a high value while utilities of WNCS with ERR and Greedy scheduling are much less than proposed scheduling. It indicates proposed scheduling scheme can improve the performance of WNCS better than ERR and Greedy scheduling. It is important to note since Greedy scheduling only optimize the link layer performance and utility function of WNCS is defined from both link layer and application layer, it cannot optimize the WNCS performance.

Fig. 8
figure 8

Fairness comparison

Eventually, fairness of different scheduling algorithms with different number of WNCS pairs has been compared. As shown in Fig. 8, fairness indices of proposed cross-layer distributed scheduling and ERR scheduling schemes are close and equal to one, whereas that of Greedy scheduling is much less than one thus indicating fair allocation of wireless resource for the proposed one. According to above results, the proposed cross-layer WNCS co-design optimizes the performance of both wireless network and plant.

5 Conclusion

In this work through a novel utility-optimal cross-layer co-design, it is demonstrated that the proposed algorithm can optimize not only the performance of the controller, but also the wireless network. The stochastic optimal control does not require system dynamics and wireless network latency and packet losses which are quite useful for hardware implementation, and scheduling algorithm is utility-optimal and distributed which is simpler and requires less computation than centralized scheduling algorithms.