# Discrete-Time Sliding Mode Controller for NCS with Deterministic Fractional Delay: A Non-switching Type Algorithm

• Dipesh H. Shah
• Axaykumar Mehta
Chapter
Part of the Studies in Systems, Decision and Control book series (SSDC, volume 132)

## Abstract

In this chapter, the design of discrete-time sliding mode controller using Thiran’s delay approximation is extended for non-switching type algorithm. The effect of sensor to controller delay is compensated using Thiran’s delay approximation technique in the sliding surface. Further, Lyapunov approach is used to determine the stability of closed-loop NCSs with the proposed controller. The efficacy of the control methodology is endowed by simulation and experimental results in the presence of networked delay. The performance of the proposed control algorithm is further validated in the presence of real-time networks such as CAN and Switched Ethernet using true time simulator.

## Keywords

Deterministic network delay Thiran’s approximation True time simulator CAN Switched Ethernet Discrete-time sliding mode control Stability

## 4.1 Network-Induced Fractional Delay Compensation

Figure 4.1 portrays the block diagram of NCS with network-induced time delay compensation scheme. It can be noticed that the state information as well as control information is transmitted to the controller and actuator through the network medium. During data transmission, the state information will experience sensor to controller delay, while the control information will suffer from controller to actuator delay. These delays are broadly defined as the amount of time required for the data packets to travel within the network [1, 2]. Thus, in order to avoid the degradation, it is necessary to compensate these network delays at the controller end as well as at actuator end. Moreover, apart from these network delays, it is necessary to consider the system delays.

## 4.2 Problem Statement

Consider the linear time invariant SISO system with network delay as:
\begin{aligned} \dot{x}(t)= & {} Ax(t)+Bu(t-\tau )+Dd(t),\end{aligned}
(4.1)
\begin{aligned} y(t)= & {} Cx(t), \end{aligned}
(4.2)
where $$x\in R^{n}$$ is system state vector, $$u\in R^{m}$$ is control input, $$y\in R^{p}$$ is system output, $$A\in R^{n\times n}$$, $$B\in R^{n\times m}$$, $$C\in R^{p\times n}$$, $$D\in R^{n\times m}$$ are the matrices of appropriate dimensions, d(t) is the matched bounded disturbance with $$|d(t)|\le d_{max}$$, and $$\tau$$ is the deterministic total networked induced delay in continuous-time domain.
The discrete form of system (4.1) and (4.2) is:
\begin{aligned} x(k+1)= & {} Fx(k)+Gu(k-\tau ')+d(k),\end{aligned}
(4.3)
\begin{aligned} y(k)= & {} Cx(k), \end{aligned}
(4.4)
where $$\tau '$$ is the deterministic total fractional network-induced delay in discrete-time domain, $$F=e^{Ah}$$, $$G=\int _{0}^{h}e^{At}Bdt$$, $$d(k)=\int _{0}^{h}e^{At}Dd((k+1)h-t)dt\in O(h)$$. Since $$|d(t)|\le d_{max}$$, it can be inferred that d(k) is also bounded and O(h) [3]. For simplicity, it is assumed that d(k) is slowly varying and remain constant over the interval $$kh\le t \le (k+1)h$$ [3].
The deterministic total fractional network-induced delay ($$\tau '$$) is denoted as,
\begin{aligned} \tau '=\frac{\tau }{h}, \end{aligned}
where h is the sampling interval.

### Remark 5

It is considered that network-induced fractional delay ($$\tau '$$) in discrete-time has non-integer values so it is required to compensate the delay at each sampling instants.

### Assumption 3

The total network-induced delay $$(\tau )$$ is deterministic in nature satisfying,

\begin{aligned} \tau \prec h, \end{aligned}
(4.5)

### Remark 6

The above condition (4.5) indicates that the values of total fractional network-induced delay ($$\tau '$$) in discrete-time domain will be less than unity.

The total fractional network-induced delay ($$\tau '$$) is the combination of sensor to controller fractional delay ($$\tau '_{sc}$$) and controller to actuator fractional delay ($$\tau '_{ca}$$) which is given as,
\begin{aligned} \tau '=\tau '_{sc}+\tau '_{ca}, \end{aligned}
(4.6)
where $$\tau '_{sc}=\frac{\tau _{sc}}{h}$$ and $$\tau '_{ca}=\frac{\tau _{ca}}{h}$$.

### Assumption 4

The disturbance d(k) is bounded by upper and lower bounds as:
\begin{aligned} d_{l}\le d(k)\le d_{u}, \end{aligned}
(4.7)
where $$d_{l}$$ and $$d_{u}$$ denotes lower and upper bounds of disturbance.

### Remark 7

Without loss of generality, the sensor processing delay ($$\tau _{sp}$$), controller computational delay ($$\tau _{cp}$$) and actuator processing delay ($$\tau _{ap}$$) are neglected as their values are negligible compared to network-induced delay ($$\tau$$).

Now, we are ready to define the problem statement with above assumptions and conditions.

Problem Statement: To design robust discrete-time sliding mode controller for the system (4.3, 4.4) in the presence of deterministic fractional network delays $$\tau '_{sc}$$ and $$\tau '_{ca}$$ under the Assumptions (3) and (4).

The sliding mode controller design involves the sliding surface design and the control law that computes the control sequences and steers the states towards the surface.

The next section proposes the design of sliding surface that compensates the effect of fractional delay occurring from sensor to controller.

## 4.3 Sliding Surface Design

There are two widely used approaches namely Tustin approximation and bilinear transformation for time delay compensation in discrete-time domain. However, the limitation of both the approaches is that they cannot approximate fractional delay which is of main concern here. The Thiran approximation [4] technique approximates the non-integer types of delays in discrete-time domain. Thiran has proposed the time delay approximation algorithm for maximally flat group of fractional delays occurring in signal processing applications. Hence, it is proper candidate for fractional delay compensation for discrete-time SMC design.

The fractional delay in discrete-time can be approximated by Thiran’s approximation as under:
\begin{aligned} z^{-\nu }=\varSigma _{k=0}^{l}(-1)^k \left( {\begin{array}{c}l\\ k\end{array}}\right) \varPi _{i=0}^{l} \frac{2\tau '_{sc}+i}{2\tau '_{sc}+k+i}z^{-k}, \end{aligned}
(4.8)
where l indicates the order of approximation and $$\nu =\frac{\delta }{h}$$ indicates the fractional part of delay, $$\delta$$ is the delay occurring during signal transmission, and h is the sampling interval.
The order of approximation is given by:
\begin{aligned} l=ceil(\nu ), \end{aligned}
(4.9)
where ceil operator rounds the nearest positive integer greater than or equal to $$\nu$$.

Next, the sliding surface using above approximation is proposed as Lemma 2 given below.

### Lemma 2

The compensated sliding variable s(k) for the given system (4.3, 4.4) with sensor to controller network-induced fractional delay ($$\tau '_{sc}$$) satisfying condition (4.5) and under the Assumptions (3) and (4) is given as:
\begin{aligned} s(k)=C_{s}x(k)-\alpha C_{s}(x(k-1)), \end{aligned}
(4.10)
where

$$\alpha =\frac{{\tau '_{sc}}}{{\tau '_{sc}}+1}$$ and $$C_{s}$$ is the sliding gain.

### Proof

The sliding variable with the delayed state vector at the receiving end of controller is given by:
\begin{aligned} s(k)=C_{s}x(k-\tau '_{sc}), \end{aligned}
(4.11)
where $$\tau '_{sc}$$ is the sensor to controller fractional delay. The sliding gain $$C_{s}$$ is calculated using discrete LQR method through proper selection of Q and R matrices [5].
Applying z-transform to Eq. (4.11), we get
\begin{aligned} s(z)=C_{s}x(z)z^{-\tau '_{sc}}, \end{aligned}
(4.12)
where $$\tau '_{sc}=\frac{\tau _{sc}}{h}$$.
$$z^{-\tau '_{sc}}$$ can be approximated as [4],
\begin{aligned} z^{-\tau '_{sc}}=\varSigma _{k=0}^{1}(-1)^k \left( {\begin{array}{c}l\\ k\end{array}}\right) \varPi _{i=0}^{1} \frac{2\tau '_{sc}+i}{2\tau '_{sc}+k+i}z^{-k}. \end{aligned}
(4.13)
The above Eq. (4.13) can be further expanded as,
\begin{aligned} z^{-{\tau '_{sc}}}=[(-1)^0 \left( {\begin{array}{c}1\\ 0\end{array}}\right) \left\{ \frac{2{\tau '_{sc}}}{2{\tau '_{sc}}}*\frac{2{\tau '_{sc}}+1}{2{\tau '_{sc}}+1}\right\} z^{0}+(-1)^{1} \left( {\begin{array}{c}1\\ 1\end{array}}\right) \\ \nonumber \left\{ \frac{2{\tau '_{sc}}}{2{\tau '_{sc}}+1}*\frac{2{\tau '_{sc}}+1}{2{\tau '_{sc}}+2}\right\} z^{-1}]. \end{aligned}
(4.14)
On simplifying, we get
\begin{aligned} z^{-\tau '_{sc}}=1-\alpha z^{-1}, \end{aligned}
(4.15)
where $$\alpha =\frac{\tau '_{sc}}{\tau '_{sc}+1}$$.
Thus, substituting Eq. (4.15) into (4.12),
\begin{aligned} s(z)=C_{s}x(z)[1-\alpha z^{-1}]. \end{aligned}
(4.16)
Further expanding, we may get
\begin{aligned} s(z)=C_{s}x(z)-\alpha C_{s}z^{-1}x(z). \end{aligned}
(4.17)
Applying inverse z-transform, we may have
\begin{aligned} s(k)=C_{s}x(k)-\alpha C_s {s}x(k-1). \end{aligned}
(4.18)
This completes the Proof.

From Eq. (4.18), it is inferred that the network-induced fractional delay from sensor to controller can be compensated in the sliding surface s(k) at each sampling instant h using the current and immediate past sample information and parameter $$\alpha$$.

Now we are ready to design a discrete-time sliding mode control law using the proposed sliding surface (4.18).

## 4.4 Discrete-Time Sliding Mode Control

In this section, non-switching type control law along with its stability is proposed based on reaching law in [6] using compensated sliding surface (4.18). The reaching law proposed by Bartoszewicz causes less chattering compared to Gao’s law [7] and offers faster convergence with limited magnitude of the control signal.

### Theorem 4.1

The non-switching discrete-time sliding mode controller for system (4.3, 4.4) in the presence of deterministic type sensor to controller fractional delay satisfying condition (4.5) and matched uncertainty d(k) is given as,

\begin{aligned} u(k)=-(C_{s}G)^{-1}[Hx(k)-Ix(k)-J(s(k))+d_{s}(k)-d_{1}]-d(k). \end{aligned}
(4.19)
where

$$H=(C_{s}F)$$, $$I=\alpha C_{s}$$, $$J=\{1-q[s(k)]\}$$.

### Proof

Let us consider the reaching law in [6] in the presence of sensor to controller fractional delay given as:
\begin{aligned} s[(k+1)h]=\{1-q[s(k)]\}-d_{s}(k)+d_{1}, \end{aligned}
(4.20)
where $$d_{s}(k)$$ is disturbance at the controller end, $$q[s(k)]=\frac{\psi }{\psi +|s(k)|}$$ with $$\psi$$ as user defined constant satisfying $$\psi \ge d_{2}$$, $$d_{1}$$ and $$d_{2}$$ are mean and deviation of $$d(k)$$.

### Remark 8

The disturbance d(k) appearing in the reaching law is applied through the network. So, the compensated disturbance using Thiran’s approximation is given as:
\begin{aligned} d_{s}(k)=d(k)-\alpha d(k-1). \end{aligned}
(4.21)
The reaching law in Eq. (4.20) indicates that the system states always move towards the specified sliding band given as:
\begin{aligned} |s(k)|\le \frac{\psi d_{2}}{\psi -d_{2}}. \end{aligned}
(4.22)
Substituting Eq. (4.18) into Eq. (4.20), we get
\begin{aligned} C_{s}x(k+1)-\alpha C_{s}x(k)=\{1-q[s(k)]\}-d_{s}(k)+d_{1},\nonumber \end{aligned}

### Remark 9

It is noticed from Eq. (4.18) that the sensor to controller fractional delay is compensated at the sliding surface, while controller to actuator fractional delay is compensated at the actuator side. So, the effect of delay will not be observed at the controller side for computing the control signal as well at actuator side. Thus, without loss of generality, the control signal in Eq. (4.3) is given as
\begin{aligned} u(k-\tau ')=u(k) \end{aligned}
(4.23)
Further, substituting $$x(k+1)$$, we get
\begin{aligned} C_{s}[Fx(k)+Gu(k)+d(k)]-\alpha C_{s}x(k) =\{1-q[s(k)]\}-d_{s}(k)+d_{1}.\nonumber \end{aligned}
Further simplification gives,
\begin{aligned} C_{s}Fx(k)+C_{s}Gu(k)+C_{s}d(k)-\alpha C_{s}x(k)=\{1-q[s(k)]\}-d_{s}(k)+d_{1}. \end{aligned}
(4.24)
Solving the above Eq. (4.24), control law is expressed as
\begin{aligned} u(k)=-(C_{s}G)^{-1}[Hx(k)-Ix(k)-J(s(k))+d_{s}(k)-d_{1}]-d(k). \end{aligned}
(4.25)
where

$$H=(C_{s}F)$$, $$I=\alpha C_{s}$$ and $$J=\{1-q[s(k)]\}$$

This completes the proof.

Next, the stability condition is derived using compensated sliding surface (4.18) and control law proposed in Eq. (4.25) such that the system states remain within specified band (4.22) over a finite interval of time.

## 4.5 Stability Analysis

### Theorem 4.2

For given positive scalars $$\tau '_{sc}$$ and $$\tau '_{ca}$$ with total networked delay ($$\tau '$$), the trajectories of the closed-loop system (4.3, 4.4) with controller (4.25) and d(k) satisfying (4.7) drive towards the sliding surface (4.18) provided following condition (4.26) is feasible:
\begin{aligned} \eta s^{T}(k)s(k)\succ 0 . \end{aligned}
(4.26)

### Proof

The compensated sliding surface is given by,
\begin{aligned} s(k)=C_{s}x(k)-\alpha C_{s}x(k-1). \end{aligned}
(4.27)
Selecting the Lyapunov function as,
\begin{aligned} V_{s}(k)=s^{T}(k)s(k). \end{aligned}
(4.28)
Writing forward difference of the above equation,
\begin{aligned} \varDelta V_{s}(k)=s^{T}(k+1)s(k+1)-s^{T}(k)s(k). \end{aligned}
(4.29)
Substituting the value of $$s(k+1)$$ using Eq. (4.27), we get
\begin{aligned} \varDelta V_{s}(k)=[C_{s}x(k+1)-\alpha C_{s}x(k)]^{T}[2C_{s}x(k+1)\nonumber \\ -\alpha C_{s}x(k)]-s^{T}(k)s(k). \end{aligned}
(4.30)
Substituting the value of $$x(k+1)$$,
\begin{aligned} \varDelta V_{s}(k)=[C_{s}[Fx(k)+G(u(k)+d(k))]-\alpha C_{s}x(k)]^{T}\\ \nonumber [C_{s}Fx(k)+G(u(k)+d(k))]-\alpha C_{s}x(k)]-s^{T}(k)s(k).\nonumber \end{aligned}
(4.31)
Substituting the value of u(k) from Eq. (4.25) and further solving it, we have
\begin{aligned} \varDelta V_{s}(k)=[(1-q[s(k)])s(k)-d_{s}(k)+d_{1}]^{T}*[(1-q[s(k)])\\ \nonumber s(k)-d_{s}(k)+d_{1}]-s^{T}(k)s(k).\nonumber \end{aligned}
(4.32)
Denoting,
$$\kappa =[(1-q[s(k)])s(k)-d_{s}(k)+d_{1}]^{T}*[(1-q[s(k)]) s(k)-d_{s}(k)+d_{1}]$$
Then, we have
\begin{aligned} \varDelta V_{s}(k)=\kappa -s^{T}(k)s(k). \end{aligned}
(4.33)
The term $$\kappa$$ can be tuned close to zero by appropriately selecting the parameter $$\psi$$. If $$\kappa$$ is closed to zero, then $$s^{T}(k)s(k)$$ will be larger than $$\kappa$$. Thus, for any small parameter $$\eta$$, we have $$\kappa -s^{T}(k)s(k)\prec \eta s^{T}(k)s(k)$$.

So, by tuning the parameter $$\psi$$, we have $$\varDelta V_{s}(k)\prec \eta s^{T}(k)s(k)$$ which guarantees the convergence of $$\varDelta V_{s}(k)$$ and implies that any trajectory of the system (4.3, 4.4) will be driven onto the sliding surface and maintain on it.

This completes the proof.

## 4.6 Results and Discussions

This section briefly discusses about the simulation results as well as experimental results of the proposed control algorithm in the presence of deterministic network delays and matched uncertainty. The efficiency and robustness of the proposed control algorithms are tested under three different situations: (i) illustrative example (ii) real-time plant as DC servo motor and (iii) real-time networks.

### 4.6.1 Illustrative Example

In this section, an illustrative example given in [8] is simulated in MATLAB environment.

Consider the continuous-time LTI system as,
\begin{aligned} \dot{x}(t)= & {} Ax(t)+Bu(t-\tau )+Dd(t),\end{aligned}
(4.34)
\begin{aligned} y(t)= & {} Cx(t), \end{aligned}
(4.35)
where

$$A =$$ $$\begin{bmatrix} -0.7&2\\ 0&-1.5 \\ \end{bmatrix}$$, $$B =$$ $$\begin{bmatrix} -0.03\\ -1 \\ \end{bmatrix}$$,

$$C =$$ $$\begin{bmatrix} 1&0 \\ \end{bmatrix}$$, $$D =$$ $$\begin{bmatrix} 1 \\ 1\\ \end{bmatrix}$$, $$d(t)=0.2\hbox {sin}(0.086t)$$.

Discretizing the above system parameters at sampling interval of $$h=30\,\hbox {ms}$$,
\begin{aligned} x(k+1)= & {} Fx(k)+Gu(k-\tau ')+d(k),\end{aligned}
(4.36)
\begin{aligned} y(k)= & {} Cx(k), \end{aligned}
(4.37)
where

$$F =$$ $$\begin{bmatrix} 0.9792&0.05805\\ 0&0.956 \\ \end{bmatrix}$$, $$G =$$ $$\begin{bmatrix} -0.001771\\ -0.02934 \\ \end{bmatrix}$$,

$$C =$$ $$\begin{bmatrix} 1&0 \\ \end{bmatrix}$$.

Figures 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 4.10, 4.11, 4.12, 4.13 and 4.14 shows the nature of the system under networked environment. In order to check the robustness of the derived control law, a slowly time-varying disturbance is applied at the input of the system as shown in Fig. 4.2. The deterministic type network-induced fractional delay with range of $$3\,\hbox {ms}\le {\tau }\le 20\,\hbox {ms}$$ is shown in Fig. 4.3. In this work, network delay is considered as the time required for the data packets to travel from sensor to controller and controller to actuator. The time required for data packets to travel from sensor to controller is $$1.5\,\hbox {ms}\le {\tau _{sc}}\le 10\,\hbox {ms}$$ and for controller to actuator is $$1.5\,\hbox {ms}\le {\tau _{ca}}\le 10\,\hbox {ms}$$, respectively. The sliding gain $$C_{s}$$ is calculated using discrete LQR method with $$Q=diag(1000, 1000)$$ and $$R=1$$. The computed values of sliding gain are $$\begin{matrix} C_{s}=[-1.77&-2.766]\end{matrix}$$. The quasi-sliding mode band computed to be $$|s(k)|\le$$ $$+0.2$$ to $$-0.2$$ with proper selection of user-defined constant $$\psi =100$$.

Figures 4.4 and 4.5 show the plant state variables with initial condition $$\begin{matrix} x(k)=[1&1]\end{matrix}$$. Both the states converge to zero from given initial condition in the presence of network fractional delay. Figure 4.6 shows the magnified response of the plant state variables. It can be noticed that the effect of fractional delay is compensated from first sampling instant. Figure 4.7 shows the compensated sliding surface calculated using Thiran’s approximation. It can be observed that the compensated sliding variable is also computed from first sampling instant in the presence of sensor to controller fractional delay. The magnified response of the same is shown in Fig. 4.8. Figure 4.9 shows the control signal $$u(k)$$ which is computed using proposed compensated sliding surface $$s(k)$$. This control signal is further applied to the plant through the network. The same approach of time delay compensation is used to compute the compensated control signal $$u_{a}(k)$$ as shown in Fig. 4.10. From the magnified result in Fig. 4.11, it can be justified that the effect of controller to actuator fractional delay is also compensated from first sampling interval.

The algorithm is also examined for different signal-to-noise ratio (SNR) as shown in Fig. 4.12. It can be observed from Fig. 4.13 that the system states converge to zero for different SNR. Figure 4.14 shows the results of stability. It is observed from Fig. 4.14 that for given $$\psi =100$$ and $$d_{2}=0.2$$ guarantees the covergence of $$\varDelta V_{s}(k)$$ and implies that the trajectories of system (, ) will be driven on the compensated sliding surface and maintain on it under the specified network fractional delay and matched uncertainty.

### 4.6.2 Simulation and Experimental Results of Brushless DC Motor

The state space model of the system () is given as,
\begin{aligned} \dot{x}(t)= & {} Ax(t)+Bu(t-\tau )+Dd(t),\end{aligned}
(4.38)
\begin{aligned} y(t)= & {} Cx(t), \end{aligned}
(4.39)
where

$$A = \begin{bmatrix} -201&0\\ 1&0 \\ \end{bmatrix}$$, $$B = \begin{bmatrix} 1\\ 0 \\ \end{bmatrix}$$,

$$C = \begin{bmatrix} 0&1 \\ \end{bmatrix}$$, $$D =$$ $$\begin{bmatrix} 1 \\ 1\\ \end{bmatrix}$$, $$d(t)=0.2\hbox {sin}(0.086t)$$.

Discretizing the system at sampling interval $$h=30\,\hbox {ms}$$, we get
\begin{aligned} x(k+1)= & {} Fx(k)+Gu(k-\tau ')+d(k),\end{aligned}
(4.40)
\begin{aligned} y(k)= & {} Cx(k), \end{aligned}
(4.41)
where

$$F=\begin{bmatrix} 0.001836&0\\ 0.004753&1 \\ \end{bmatrix}$$, $$G=\begin{bmatrix} 0.004753\\ -0.0001242 \\ \end{bmatrix}$$,

$$C=\begin{bmatrix} 0&1 \\ \end{bmatrix}$$.
This section briefs about the simulation and experimental results of position control brushless DC motor in the presence of various deterministic delays using non-switching control law. The effect of time delay compensation is deeply analysed through tracking response, compensated sliding variable and control signal for different network delays as shown in Figs. 4.14, 4.15, 4.16, 4.17 and 4.18. The robustness of the proposed algorithm is determined by applying time-varying disturbance signal at the input side of the channel. The total networked-induced delay with a range of 10–28  ms was generated for which the effect of time delay is compensated satisfying condition (). The sliding gain is computed through discrete LQR method which comes out to be $$\begin{matrix}C_{s}=[24.5156&31.6288]\end{matrix}$$ with $$Q=diag(1000,1000)$$ and $$R=1$$. The quasi-sliding mode band computed to be $$|s(k)|\le$$ $$+0.2$$ to $$-0.2$$ with proper selection of user-defined constant $$\psi =1500$$. Figures 4.14a to 4.15d show the simulated and experimental results of position control brushless DC motor for total networked-induced delay of $$\tau =10\,\hbox {ms}$$ with $$\tau _{sc}=5\,\hbox {ms}$$ and $$\tau _{ca}=5\,\hbox {ms}$$. The fractional part of total networked delay for sampling interval of $$h=30\,\hbox {ms}$$ is computed to be $$\tau '=0.33$$, $$\tau '_{sc}=0.166$$ and $$\tau '_{ca}=0.166$$, respectively. Figure 4.14a, b shows the simulated as well as experimental trajectory results of the plant. It can be observed that the position of DC motor is controlled according to variations in the reference inputs without chattering even in the presence of specified network delay. The tracking results are magnified as shown in Fig. 4.14c, d in order to examine the effect of time delay compensation. It can be noticed that in both the cases, the fractional part of the delay from sensor to controller is compensated as the position of the motor commences the reference input signal at $$5\,\hbox {ms}$$. The same consequence of time delay compensation is observed in sliding variable, Fig. 4.14e, f, as well as control signal, Fig. 4.15a, b, respectively. Observing the magnified results, Figs. 4.14g, h and 4.15c, d, it can be noticed that the compensated sliding variable and control signal both are computed from first sampling instants. Thus, the effect of fractional delay from sensor to controller is compensated at the sliding surface and control signal. The proposed algorithm was further examined for $$\tau =18\,\hbox {ms}$$ and $$28\,\hbox {ms}$$, respectively. Figures 4.15e–h shows the results of position control of brushless DC motor. The results are carried out under the total networked delay of $$\tau =18\,\hbox {ms}$$ with $$\tau _{sc}=9\,\hbox {ms}$$ and $$\tau _{ca}=9\,\hbox {ms}$$. The fractional part of delay for $$h=30\,\hbox {ms}$$ is computed as $$\tau '=0.6$$, $$\tau '_{sc}=0.3$$ and $$\tau '_{ca}=0.3$$, respectively. The simulated and experimental tracking results of the plant for the specified networked delay are shown in Fig. 4.15e, f. It can be noticed that in both the cases, the position of DC motor is controlled for all given reference inputs. In order to examine the effect of fractional time delay compensation, the same results are magnified in Fig. 4.15g, h. It can be noticed that the effect of fractional delay from sensor to controller is nullified as the output follows the reference signal at $$t=9\,\hbox {ms}$$. The same effect of time delay compensation is observed in sliding variable, Fig. 4.16a, b, as well as control signal, Fig. 4.16e, f. Observing the magnified results, Fig. 4.16c, d, g, h, it can be noticed that in both the cases, the sliding variable and control signal are computed from first sampling instants. Thus, the effect of fractional part of delay from sensor to controller is compensated at sliding variable and control signal. Figures 4.17a and 4.18d shows the results of position control of brushless DC motor for total networked delay of $$\tau =28\,\hbox {ms}$$ with $$\tau _{sc}=14\,\hbox {ms}$$ and $$\tau _{ca}=14\,\hbox {ms}$$. Considering the sampling interval of $$h=30\,\hbox {ms}$$, the fractional part of delay is computed as $$\tau '=0.933$$, $$\tau '_{sc}=0.466$$ and $$\tau '_{ca}=0.46$$ respectively. Figure 4.17a, b show the simulated and experimental tracking results of the system for the specified networked delay. It can be observed that in both the cases, output tracks the reference trajectory without chattering. In order to examine the actual effect of time delay compensation, the results are magnified as shown in Fig. 4.17c, d. Observing the magnified results, it can be concluded that the effect of fractional part of delay from sensor to controller is compensated as output tracks the reference signal at $$t=14\,\hbox {ms}$$. Figures 4.17e, f and 4.18a, b show the simulated and experimental results of compensated sliding variable and control signal for specified networked delay. It can be noticed from the results that the time delay compensation algorithm works efficiently for large value of $$\tau$$. The magnified results of the same are shown in Figs. 4.17g, h and 4.18c, d which clearly justifies that in both the cases, the effect of fractional part of delay from sensor to controller is compensated in the sliding variable as well as control signal.
Thus, from above results, it can be concluded that the non-switching controller designed using proposed algorithm works efficiently with the network delay range of 10–28 ms in simulated as well as experimental environment. The proposed controller compensates the effect of fractional time delay without chattering for $$\psi =1500$$ satisfying (4.22) and shows the stable response satisfying (4.26) in the presence of matched uncertainty.

#### 4.6.2.1 Comparison of Proposed Algorithm with Conventional Sliding Mode Control

In this section, the experimental results of proposed algorithm are compared with switching sliding mode control using time delay approximation and conventional sliding mode control. The results are compared in terms of tracking response, sliding variable and control signal for total networked delay of $$\tau =10\,\hbox {ms}$$. From the comparative results (Figs. 4.19a and 4.20), it can be observed that the conventional sliding mode control becomes unstable for a small delay of $$\tau _{sc}=5\,\hbox {ms}$$ while the sliding mode controller designed using switching algorithm generates the chattering behaviour at the output signal compared to proposed algorithm. Thus, Thiran approximation proved to be more efficient technique for non-switching-based discrete-time sliding mode control. The comparison of proposed algorithm with switching sliding mode control using time delay approximation and conventional sliding mode control is summarized in Table 4.1 (Fig. 4.21).
Table 4.1

Comparison of proposed algorithm, switching-based SMC and conventional SMC

Algorithm

Comparative results

$$\tau$$ (ms)

$$T_{s}$$

Chattering

Response

Conventional SMC

12.8

Undefined

High

Unstable

Switching SMC

12.8

1 s

Within QSMB

Stable

Proposed method

12.8

0.3 s

Nil

Stable

## 4.7 Simulation with Real-Time Networks

In previous section, the efficacy of the proposed control law is examined in the presence of brushless DC motor connected through networked medium. It can be observed from simulation results that the control law proposed using non-switching reaching law provides faster convergence without increasing the amplitude of control signal. The chattering is also negligible compared to switching type control law. Thus, in this section, the efficacy of the proposed non-switching control law is further tested in the presence of real-time networks and matched uncertainty. The real-time networks are simulated using true time software which provides wide range of simulated networks such as CAN, Switched Ethernet, Profibus, Profinet, CSMA/CD, Round Robbin [9]. In this work, the simulations are carried out under CAN and Switched Ethernet communication medium as network delays are assumed to be deterministic in nature. Further, the performance of the system is also studied in the presence of packet loss situation.

The following network specifications and parameters are considered for simulations:

$$Networked$$ $$medium$$: CAN and Switched Ethernet

$$Data$$ $$rate$$ $$(bits/s)$$ = 80,000

$$Minimum$$ $$frame$$ $$size$$ $$(bits)$$ = 512 (CAN) and 1024 (Switched Ethernet)

$$Loss$$ $$probability$$ = 0 to 0.5

$$sampling$$ $$interval$$ $$h$$ = 0.030 s.

$$\begin{matrix}C_{s}=[24.5156&31.6288]\end{matrix}$$

$$|s(k)|\le$$ $$+0.2$$ to $$-0.2$$ with user-defined constant $$\psi =1500$$.

Consider the continuous-time LTI system as,
\begin{aligned} \dot{x}(t)= & {} Ax(t)+Bu(t-\tau )+Dd(t),\end{aligned}
(4.42)
\begin{aligned} y(t)= & {} Cx(t), \end{aligned}
(4.43)
where

$$A =$$ $$\begin{bmatrix} -0.7&2\\ 0&-1.5 \\ \end{bmatrix}$$, $$B =$$ $$\begin{bmatrix} -0.03\\ -1 \\ \end{bmatrix}$$,

$$C =$$ $$\begin{bmatrix} 1&0 \\ \end{bmatrix}$$, $$D =$$ $$\begin{bmatrix} 1 \\ 1\\ \end{bmatrix}$$, $$d(t) = 0.2\, \hbox {sin}(0.086t)$$.

Discretizing the above system parameters at sampling interval of $$h=30\,\hbox {ms}$$, we get
\begin{aligned} x(k+1)= & {} Fx(k)+Gu(k-\tau ')+d(k),\end{aligned}
(4.44)
\begin{aligned} y(k)= & {} Cx(k), \end{aligned}
(4.45)
where

$$F=$$ $$\begin{bmatrix} 0.9792&0.05805\\ 0&0.956 \\ \end{bmatrix}$$, $$G=$$ $$\begin{bmatrix} -0.001771\\ -0.02934 \\ \end{bmatrix}$$,

$$C=$$ $$\begin{bmatrix} 1&1 \\ \end{bmatrix}$$.

### 4.7.1 CAN as a Network Medium

In this section, the nature of the system with CAN as a networked medium is studied in Figs. 4.22, 4.23, 4.24, 4.25, 4.26, 4.27, 4.28, 4.29, 4.30, 4.31, 4.32, 4.33, 4.34, 4.35, 4.36 and 4.37. The robustness of the proposed controller is checked by applying slowly time-varying disturbance at the input side of the system as shown in Fig. 4.2. In CAN, it is assumed that the minimum frame size is 512 bits and data transfer rate is 80,000 bits/s. So, the delay generated in the CAN network to transfer the data packets from sensor to controller is $$\tau _{sc}=6.4\,\hbox {ms}$$ and from controller to actuator is $$\tau _{ca}=6.4\,\hbox {ms}$$. The processing and the computational delays at sensor, controller and actuator are considered as 0.9, 0.5 and $$0.5\,\hbox {ms}$$, respectively. Thus, the total networked delay generated within the closed-loop system is $$\tau =14.7\,\hbox {ms}$$. The fractional part of total network delay is obtained as $$\tau '=0.49, \tau '_{sc}=0.213$$ and $$\tau '_{ca}=0.213$$ for sampling interval of $$h=30\,\hbox {ms}$$. The scheduling policies of sensor to controller and controller to actuator with network under ideal condition and bandwidth sharing condition are shown in Figs. 4.22 and 4.23, respectively. It can be observed that blue samples are indicated as the traffic while yellow and red samples indicate the scheduling policy for sensor to controller and controller to actuator. The trajectory response of the system for the network under ideal condition and traffic condition is shown in Figs. 4.24 and 4.25. It can be noticed that under both situations, the output tracks the reference trajectory for the specified networked delay. In order to show the precise effect of time delay compensation in CAN network at the output results are magnified as shown in Figs. 4.26 and 4.27. It can be noticed that the effect of fractional delay from sensor to controller is compensated as the output tracks the reference input at $$t=8.3\,\hbox {ms}$$. The similar effect of time delay compensation for the network under traffic condition can be observed in sliding variable, Figs. 4.28 and 4.29, as well as control signal, Figs. 4.30 and 4.31. Observing the magnified results in Figs. 4.29 and 4.31, it can be noticed that the sliding variable and control signal are computed exactly after an interval of $$t=1.4\,\hbox {ms}$$ even in the presence of sensor to controller delay. Apart from time delay compensation, the proposed algorithm was examined under packet loss condition. Figures 4.32, 4.33 and 4.34 show the results of tracking response under packet loss condition, while Figs. 4.35, 4.36 and 4.37 show the instances of packet drop. It can be observed from results that when the packet loss is $$50\%$$, the system goes to unstable condition. Thus, it can be concluded that the system shows the satisfactory response under $$30\%$$ of packet loss for specified network delay with CAN as a communication medium.

### 4.7.2 Switched Ethernet as a Network Medium

In this section, the nature of the system is studied for Switched Ethernet type of communication medium considering the delays are deterministic in nature. In Switched Ethernet, the minimum frame size is 1024 bits and data transfer rate is 80000 bits/sec. So, the delay generated within the network to transfer the data packets from sensor to controller is $$\tau _{sc}=12.8\,\hbox {ms}$$ and from controller to actuator is $$\tau _{ca}=12.8\,\hbox {ms}$$. The processing and the computational delays at sensor, controller and actuator are considered as 0.9, 0.5 and 0.5 ms, respectively. Thus, the total networked delay within the closed-loop system is computed as $$\tau =27.5\,\hbox {ms}$$. The fractional part of total network delay is obtained as $$\tau '=0.91$$, $$\tau '_{sc}=0.426$$ and $$\tau '_{ca}=0.426$$ for sampling interval of $$h=30\,\hbox {ms}$$. The scheduling policies of sensor to controller and controller to actuator with network under ideal condition and bandwidth sharing condition are shown in Figs. 4.38 and 4.39, respectively. The trajectory response of the system for the network under ideal condition and traffic condition is shown in Figs. 4.40 and 4.41. It can be noticed that under both the situations, the output tracks the reference trajectory for the specified networked delay. In order to show the exact effect of time delay compensation in Switched Ethernet network at the output, results are magnified as shown in Figs. 4.42 and 4.43. It can be noticed that the effect of fractional delay from sensor to controller is compensated as the output tracks the reference input at $$t=14.7\,\hbox {ms}$$. The similar effect of time delay compensation for the network under traffic condition can be observed in sliding variable, Figs. 4.44 and 4.45, as well as control signal, Figs. 4.46 and 4.47. Observing the magnified results in Figs. 4.45 and 4.47, it can be noticed that the sliding variable and control signal are computed exactly after an interval of $$t=1.4\,\hbox {ms}$$ even in the presence of sensor to controller delay. Apart from time delay compensation, the proposed algorithm was examined under packet loss condition. Figures 4.48, 4.49 and 4.50 show the results of tracking response under packet loss condition, while Figs. 4.51, 4.52 and 4.53 show the instances of packet drop. It can be observed from results that when the packet loss is $$50\%$$, the system goes to unstable condition. Thus, it can be concluded that the system shows the satisfactory response under $$30\%$$ of packet loss for specified network delay with Switched Ethernet as a communication medium.

### 4.7.3 Comparison of Proposed Algorithm with Conventional Sliding Mode Control Under CAN and Switched Ethernet as a Network Medium

In this section, the results of proposed algorithm were compared with conventional SMC for CAN and Switch Ethernet communication medium. Figures 4.54, 4.55, 4.56 and 4.57 show the comparative results of proposed algorithm and conventional SMC for discrete-time sliding mode control. It can be observed from comparison that conventional SMC shows unstable response for the specified networked delay. Thus, Thiran approximation proved to be efficient technique in discrete-time sliding mode control under packet loss condition and matched uncertainty. The comparison of proposed algorithm and conventional SMC for CAN and Switched Ethernet communication medium is summarized in Table 4.2.
Table 4.2

Comparison of proposed algorithm with conventional SMC in true time

Algorithm

Comparison results

$$\tau _{CAN}$$ (ms)

$$\tau _{Ether}$$ (ms)

$$T_{s}$$

Response

Conventional SMC

14.7

25.7

Undefined

Unstable

Proposed method

14.7

25.7

1 s

Stable

## 4.8 Conclusion

In this chapter, we explored Thiran’s approximation technique for fractional delay compensation in discrete-time domain for designing non-switching type discrete-time sliding mode controller which computes the control actions in the presence of network delay and matched uncertainty. The stability of the closed-loop NCS is assured by using Lyapunov approach such that system states remain within the specified band. The effectiveness of the derived algorithms is tested using illustrative example and brushless DC motor set-up with deterministic networked delay and matched uncertainty. The experimental results are compared with switching SMC as well as conventional algorithm without delay compensation. The comparative results show that the non-switching type algorithm is most efficient technique than switching type algorithm. The simulation results and experimental results carried out for DC servo motor plant proved that the control algorithm designed using non-switching reaching law is robust and efficient algorithm as it provides the faster convergence with less chattering in discrete-time domain. Further, the efficiency of non-switching controller was examined under simulated CAN and Switched Ethernet networked medium using true time. The results show that the proposed control algorithm compensates the networked delay and performs well in the presence of network-induced delay.

## References

1. 1.
D. Shah, A. Mehta, Discrete-time sliding mode controller subject to real-time fractional delays and packet losses for networked control system. Int. J. Control, Autom. Sys. (IJCAS) 15(6), 2690–2703 (Dec. 2017)Google Scholar
2. 2.
D. Shah, A. Mehta, Fractional delay compensated discrete-time SMC for networked control system. Digital Commun. Networks (DCN), Elsevier, 2(3), 385–390 (Dec. 2016)Google Scholar
3. 3.
A. Mehta, B. Bandyopadhyay, Multirate output feedback based stochastic sliding mode control. J. Dyn. Sys. Meas. Control 138(12), 124503(1–6) (2016)
4. 4.
J. Thiran, Recursive digital filters with maximally flat group delay. IEEE Trans. Circ. Theory 18(6), 659–664 (1971)
5. 5.
S. Eduardo, Mathematical control theory: deterministic finite dimensional systems, 2nd ed. (Springer, 1998) ISBN 0-387-98489-5Google Scholar
6. 6.
A. Bartoszewicz, P. Lesniewski, Reaching law approach to the sliding mode control of periodic review inventory systems. IEEE Trans. Autom. Sci. Eng. 11(3), 810–817 (2014)
7. 7.
W. Gao, Y. Wang, A. Homaifa, Discrete-time variable structure control systems. IEEE Trans. Ind. Electron. 42(2), 117–122 (1995)
8. 8.
J. Wu, T. Chen, Design of networked control systems with packet dropouts. IEEE Trans. Autom. Control 52(7), 1314–1319 (2007)
9. 9.
D. Shah, A. Mehta, Design of robust controller for networked control system, in Proceedings of IEEE International Conference on Computer, Communication and Control Technology (2014) pp. 385–390Google Scholar
10. 10.
K. Astrom, J. Apkarian, P. Karam, M. Levis, J. Falcon, Student Workbook: QNET DC Motor Control Trainer for NI ELVIS, Quanser, 2015Google Scholar