Keywords

1 Introduction

In practical applications, systems are commonly operated under uncertain conditions for examples modelling error, measurement error and external disturbance. The existence of uncertainties will affect the performances, responses of the system and may lead the system to be unstable. An uncertainty that exists in the system is difficult to track and control. Sliding Mode Control (SMC) was proposed in the 1960’s is a special nonlinear control strategy with discontinuous property [1]. SMC is a robust nonlinear control technique which has been applied widely for many applications that are involved with uncertainties [2,3,4,5,6]. The advantages of SMC among other controllers are external disturbance rejection, guarantee stability and insensitivity to system parameters variation especially after the system is driven to sliding surface as discussed by Edwards and Spurgeon [7]. These characteristics have made the SMC a suitable controller to control an uncertain system.

Nowadays the trend has been changed to discrete, as well as the SMC. That is due to the rapid development of digital computer and digital equipment. In general, digital control systems have many advantages over analog control system. Some of the advantages include low power consumption, high accuracy and high reliability and ease of making software and design changes [8]. For that reason, the discrete-time system representation is more justifiable for controller design compared to continuous-time. The brief idea of Discrete Sliding Mode Control (DSMC) was firstly appeared in the control literature during mid-80s by Milosavljevi´c followed by increasing list of publications [9, 10]. The new discrete integral sliding surface that can eliminate the reaching law was designed in [11]. Then a combination of equivalent control and integral control replacing the switching control was implemented by [12]. The matched and unmatched uncertainties were considered when designing the DISMC [13]. Normally, most of the SMC strategies are based on state feedback. But not all of the system states are available in practical, this situations would demand the need for some observers or dynamic compensators. However the used of observer would make the overall system more complex.

Meanwhile, the output feedback is always available all the time, so output feedback can be used to design the controller. In [14, 15] a concept known as Multirate Output Feedback (MROF) was introduced. The algorithm makes use of only the output samples for designing the controller. In MROF two sampling time were used, the system output sampled at faster rate and the control input is sampled at the slower rate. Several researchers have successfully implemented the concept of MROF to control various nonlinear plant [16,17,18].

In this paper, the controller is designed by combining MROF and DISMC in order to deal with the uncertain system. Then, the designed controller is implemented to inverted pendulum system. Inverted pendulum is selected because it is known as a highly nonlinear and unstable system.

2 Controller Designed

The system in continuous time can be represented as follows:

$$ \dot{x}(t) = (A + \Delta A)x(t) + (B + \Delta B)u(t) + Be(t) $$
(1)

where \( x(t) \in R^{n} \) is the state vector, \( u(t) \in R^{n} \) is the control input, \( y(t) \in R^{n} \) is the output vector, A and B are the nominal constant matrices, ΔA is the uncertainties present in the system, ΔB denote the uncertainties that exist in the input matrices and e(t) is the external disturbance. The output of the inverted pendulum system in continuous time can be described as

$$ y(t) = Cx(t) = \left[ {\begin{array}{*{20}c} {C_{1} } \\ {C_{2} } \\ \end{array} } \right]x(t) = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 1 & 0 & 0 & 0 \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & 0 & 0 \\ \end{array} } \\ \end{array} } \right]x(t) $$
(2)

In order to have the reference tracking in the system, a new error state variable, z has to be added, where z(t) = r(t) − C 1 x(t) and r(t) is the desired reference. The C 1 is chosen because the system only consider the first state as a desired reference. By using Eqs. (1) and (2) with the reference tracking, the continuous time system can be

$$ \begin{aligned} & \dot{x}_{p} (t) = (A_{p} + \Delta A_{p} )x_{p} (t) + (B_{p} + \Delta B_{p} )u(t) + B_{p} e(t) + R_{p} r(t) \\ & y_{p} (t) = C_{p} x_{p} (t) \\ \end{aligned} $$
(3)

where

$$ \begin{aligned} & x_{p} = \left[ {\begin{array}{*{20}c} z \\ x \\ \end{array} } \right]\quad A_{p} = \left[ {\begin{array}{*{20}c} 0 & { - C_{1} } \\ {0_{n \times 1} } & A \\ \end{array} } \right]\quad \Delta A_{p} = \left[ {\begin{array}{*{20}c} 0 & 0 \\ {0_{n \times 1} } & {\Delta A} \\ \end{array} } \right] \\ & B_{p} = \left[ {\begin{array}{*{20}c} 0 \\ B \\ \end{array} } \right]\quad \Delta B_{p} = \left[ {\begin{array}{*{20}c} 0 \\ {\Delta B} \\ \end{array} } \right]C_{p} = \left[ {\begin{array}{*{20}c} 1 & {0_{1 \times n} } \\ 0 & C \\ \end{array} } \right]\quad R_{p} = \left[ {\begin{array}{*{20}c} 1 \\ {0_{n \times 1} } \\ \end{array} } \right] \\ \end{aligned} $$
(4)

The \( x(t) \in R^{n} \) is the state vector, \( u(t) \in R^{n} \) is the control input, \( y(t) \in R^{n} \) is the output vector, A p and B p are the nominal constant matrices, ΔA p is the uncertainties present in the system, ΔB p denote the uncertainties that exist in the input matrices and R p is the reference. If the condition in Eq. (3) is satisfied, then the matching condition holds, where:

$$ rank([B_{p} \vdots \Delta A_{p} \vdots \Delta B_{p} \vdots B_{p} ]) = rank(B_{p} ) $$
(5)

The pair (A p , B p ) is controllable and the following match conditions are satisfied [19].

$$ \Delta A_{p} = B_{p} \Delta \overline{A}_{p} (\Delta \overline{A}_{p} \,{\text{is}}\,{\text{a}}\,{\text{vector}})\quad {\text{and}}\,\,\,\Delta B_{p} = B_{p} \Delta \overline{B}_{p} \,\,\,\,\,\,(\Delta \overline{B}_{p} \,{\text{is}}\,{\text{a}}\,{\text{scalar}}) $$
(6)

The system in Eq. (7) is obtained by substituting (6) into (3). It can be rewritten in the following equation:

$$ \begin{aligned} \dot{x}_{p} (t) & = A_{p} x_{p} (t) + B_{p} u(t) + B_{p} (\Delta \overline{A}_{p} + \Delta \overline{B}_{p} + e(t)) + R_{p} r(t) \\ & = A_{p} x_{p} (t) + B_{p} u(t) + B_{p} d(t) + R_{p} r(t) \\ \end{aligned} $$
(7)

where

$$ d(t) = \Delta \overline{A}_{p} + \Delta \overline{B}_{p} + e(t) $$
(8)

Since the controller is in discrete time, the continuous time system in Eq. (7) is sampled using zero order hold (ZOH) at a slow rate as τ = 0.004 s. Then discrete time of the system is given as

$$ \begin{aligned} & x(k + 1) =\Phi x(k) +\Gamma u(k) +\Gamma f(k) + Hr(k) \\ & \quad y(k) = C_{p} x(k) \\ \end{aligned} $$
(9)

where \( \Phi = e^{{A_{p} \tau }} ,\,\Gamma = \int\limits_{0}^{\tau } {e^{{A_{p} \tau }} B_{p} d\tau ,\,f = \int\limits_{0}^{\tau } {e^{{A_{p} \tau }} B_{p} \left( {(k + 1)\tau - \tau } \right)d\tau .} } \)

The discretization of Eq. (8) is obtained by applying ZOH sampling over time interval (,(k + 1) τ) where τ is a sampling period [20]. The fast output sampling time, η can be obtained by dividing τ with N, where N is an integer and the value of N must be larger or the same as the observability index of (Φ, C). Using the fact that u(k) is unchanged in the interval \( \tau \le t \le (k + 1)\tau \). The previous N fast sampled outputs be denoted as the N-element column as

$$ y_{k} = \left[ {\begin{array}{*{20}c} {y(k - 1)\tau } \\ {y(k - 1)\tau + \eta } \\ {y(k - 1)\tau + 2\eta } \\ : \\ {y(k\tau - \eta )} \\ \end{array} } \right] $$
(10)

The system in Eq. (9) can be represented in a faster sampling time of η = 0.001 s as

$$ \begin{aligned} & x(k + 1) =\Phi _{\eta } x(k) +\Gamma _{\eta } u(k) +\Gamma _{\eta } f(k) + H_{\eta } r(k) \\ & y_{k + 1} = C_{0} x(k) + C_{u} u(k) + C_{u} f(k) + C_{r} r(k) \\ \end{aligned} $$
(11)

where the value of C 0 ,C u and C r can be expressed as

$$ C_{0} = \left[ {\begin{array}{*{20}c} {C_{p} } \\ {C_{p}\Phi _{\eta } } \\ {C_{p}\Phi _{\eta }^{2} } \\ \vdots \\ \vdots \\ {C_{p}\Phi _{\eta }^{N - 1} } \\ \end{array} } \right],\quad C_{u} = \left[ {\begin{array}{*{20}c} 0 \\ {C_{p}\Gamma _{\eta } } \\ {C_{p} (\Phi _{\eta }\Gamma _{\eta } +\Gamma _{\eta } )} \\ \vdots \\ \vdots \\ {C_{p} \sum\limits_{i = 0}^{N - 2} {\Phi _{\eta }^{i}\Gamma _{\eta } } } \\ \end{array} } \right],\quad C_{r} = \left[ {\begin{array}{*{20}c} 0 \\ {C_{p} H_{\eta } } \\ {C_{p} (\Phi _{\eta } H_{\eta } + H_{\eta } )} \\ \vdots \\ \vdots \\ {C_{p} \sum\limits_{i = 0}^{N - 2} {\Phi _{\eta }^{i} H_{\eta } } } \\ \end{array} } \right] $$
(12)

By considering Eqs. (11) and (12), the state x(k) can be expressed as

$$ \begin{aligned} \left[ {\begin{array}{*{20}c} {x(k)} \\ {f(k)} \\ \end{array} } \right] & = \left( {\left[ {\begin{array}{*{20}c} {C_{0} } & {C_{u} } \\ \end{array} } \right]^{T} \left[ {\begin{array}{*{20}c} {C_{0} } & {C_{u} } \\ \end{array} } \right]} \right)^{ - 1} \left[ {\begin{array}{*{20}c} {C_{0} } & {C_{u} } \\ \end{array} } \right]^{T} \left( {y_{{k + 1^{{}} }} - C_{u} u(k) - C_{r} r(k)} \right) \\ & \quad =\Psi \left( {y_{{k + 1^{{}} }} - C_{u} u(k) - C_{r} r(k)} \right) \\ \end{aligned} $$
(13)

where

$$ \Psi = \left( {\left[ {\begin{array}{*{20}c} {C_{0} } & {C_{u} } \\ \end{array} } \right]^{T} \left[ {\begin{array}{*{20}c} {C_{0} } & {C_{u} } \\ \end{array} } \right]} \right)^{ - 1} \left[ {\begin{array}{*{20}c} {C_{0} } & {C_{u} } \\ \end{array} } \right]^{T} $$
(14)

Substituting Eqs. (12) and (13) into Eq. (11), will gives

$$ \left[ {\begin{array}{*{20}c} {x(k + 1)} \\ {f(k)} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\Phi _{\eta } } & {\Gamma _{\eta } } \\ 0 & I \\ \end{array} } \right]\left( {\Psi y_{k + 1} -\Psi C_{u} u(k) -\Psi C_{r} r(k)} \right) + \left[ {\begin{array}{*{20}c} {\Gamma _{\eta } } \\ 0 \\ \end{array} } \right]u(k) + \left[ {\begin{array}{*{20}c} {H_{\eta } } \\ 0 \\ \end{array} } \right]r(k) $$
(15)

Then, the state \( x(k + 1) \) can be represented as in Eq. (16)

$$ \begin{aligned} x(k + 1) & = \left[ {\begin{array}{*{20}c} {\Phi _{\eta } } & {\Gamma _{\eta } } \\ \end{array} } \right]\Psi y_{k + 1} + \left( {\Gamma _{\eta } - \left[ {\begin{array}{*{20}c} {\Phi _{\eta } } & {\Gamma _{\eta } } \\ \end{array} } \right]\Psi C_{u} } \right)u(k) \\ & \quad + \left( {H_{\eta } - \left[ {\begin{array}{*{20}c} {\Phi _{\eta } } & {\Gamma _{\eta } } \\ \end{array} } \right]\Psi C_{r} } \right)r(k)) \\ \end{aligned} $$
(16)

If Q = [Φη Γη] then the state x(k) can be expressed using the output y k as

$$ x(k) = Q\Psi y_{k} + \left( {\Gamma _{\eta } - Q\Psi C_{u} } \right)u(k - 1) + \left( {H_{\eta } - Q\Psi C_{r} } \right)r(k - 1) $$
(17)

The discrete integral sliding surface is defined as

$$ \sigma_{imrof} (k) = G_{imrof} x(k) - G_{imrof} x(0) + h(k) $$
(18)

where h(k) is computed as

$$ h(k) = h(k - 1) - (G_{imrof}\Phi - G_{imrof}\Gamma K)x(k - 1) $$
(19)

where \( \sigma_{imrof} \in R^{n} \) is the sliding surface for MROF based DISMC, \( h \in R^{n} \) is the integral vectors, x(0) is the initial condition, \( G_{imrof} \in \,R^{m \times n} \) and \( K \in R^{m \times n} \) are the constant matrices. The matrix K is chosen such that Φ + Γ(G imrof Φ)−1 G imrof  + ΓK is lie within unit circle. The forward expression of the integral sliding surface can be simplified when considering Eqs. (18), (19) and (9) such that:

$$ \sigma_{imrof} (k + 1) = G_{imrof} [\Gamma u(k) +\Gamma f(k) + Hr(k) - x(0) +\Gamma Kx(k)] + \varepsilon (k) $$
(20)

By consider Eqs. (9), (17) and (20), the control input of the system can be represented in the output feedback as follows

$$ \begin{aligned} u_{imrof} (k) & = - \left( {G\Gamma } \right)^{ - 1} (G_{imrof}\Gamma K - G_{imrof} )[Q\Psi y_{k} + \,\left( {\Gamma _{\eta } - \,Q\Psi C_{u} } \right)\,u(k - 1) + \left( {H_{\eta } - Q\Psi C_{r} } \right)\,r(k - 1)] \\ & \quad - \left( {G\Gamma } \right)^{ - 1} [G_{imrof} Ff(k) + G_{imrof} Hr(k) + \rho \left| {\sigma_{imrof} (k)} \right|sign\,(\sigma_{imrof} (k))]\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \\ \end{aligned} $$
(21)

Different from the continuous time system where the disturbance can be taken directly, in discrete time system the Eq. (21) cannot be implemented because the current value of disturbance f(k) is unknown. To overcome this problem, according to [21], if the updated value is not available, the estimation value can be used in which the last value of a disturbance signal can be taken as the estimate of its current value. Then f(k) will be replaced by the estimated disturbance \( \bar{f}(k) = f(k - 1) \). Therefore, the control input in output feedback is given as:

$$ \begin{aligned} u_{imrof} (k) & = - \left( {G_{imrof}\Gamma } \right)^{ - 1} (G_{imrof}\Gamma K - G_{imrof} )\left[ {Q\Psi y_{k} + \left( {\Gamma _{\eta } - Q\Psi C_{u} } \right)u(k - 1) + \left( {H_{\eta } - Q\Psi C_{r} } \right)r(k - 1)} \right] \\ & \quad - \left( {G_{imrof}\Gamma } \right)^{ - 1} [G_{imrof}\Gamma \bar{f}(k) + G_{imrof} Hr(k) + \rho \left| {\sigma_{imrof} (k)} \right|sign(\sigma_{imrof} (k))] \\ \end{aligned} $$
(22)

2.1 Stability Analysis

The stability condition for the designed controller in Eq. (22) is necessary to be proven to make sure that it is reachable and stable. The stability condition can be proven by using the Sarpturk stability condition as in Eqs. (23) and (24). The first part of Sarptuk stability condition can be described as

$$ \begin{aligned} & (\sigma_{imrof} (k + 1) - \sigma_{imrof} (k))\text{sgn} (\sigma_{imrof} (k)) \\ & = - \rho \left| {\sigma_{imrof} (k)} \right| < 0 \\ \end{aligned} $$
(23)

The condition above is only true if the value of ρ > 0. Meanwhile the second part of Sarpturk stability condition can be expressed as:

$$ \begin{aligned} & (\sigma_{imrof} (k + 1) + \sigma_{imrof} (k))\text{sgn} (\sigma_{imrof} (k)) > 0 \\ & = \left( {2 - \rho } \right)\left| {\sigma_{imrof} (k)} \right| > 0 \\ \end{aligned} $$
(24)

Equation (24) is only true if the value of 2 − ρ > 0. From both conditions as stated in Eqs. (23) and (24), which ρ > 0 and 2 − ρ > 0, it can be concluded that the designed controller is stable when the value of ρ is in the range of 0 < ρ < 2.

3 Result and Discussion

The designed controller as Eq. (22) is implemented to inverted pendulum system. An inverted pendulum model is selected due to its characteristics which is under actuated nonlinear system, unstable and owns more than one degree of freedom. Therefore, it is a challenge to stabilize the unstable inverted pendulum system. The inverted pendulum consists of a single rod mounted on a linear cart in which the axis of rotation is right angles to the direction of the cart motion. The cart is constrained to only move in the horizontal direction, while the pendulum can only rotate in the xy plane. The system state for inverted pendulum system as in Eq. (1) is fourth order system. Thus the observability index of the system is 4, hence the value of N is chosen as 4. In this work, the output is sampled at slow rate of τ = 0.004 s. The inverted pendulum system that discretized in fast sampling time with η = 0.001 s as in Eq. (11) is shown as below:

$$ \Phi _{\eta } = \left[ {\begin{array}{*{20}c} 1 & { - 0.001} & 0 & 0 & 0 \\ 0 & 1 & 0 & {0.0010} & 0 \\ 0 & 0 & {1.000} & { - 0.0000} & {0.0010} \\ 0 & 0 & {0.0009} & {0.9881} & 0 \\ 0 & 0 & {0.0462} & { - 0.0513} & {0.9995} \\ \end{array} } \right]\quad\Gamma _{\eta } = \left[ {\begin{array}{*{20}c} 0 \\ 0 \\ {0.0000} \\ {0.0016} \\ {0.0067} \\ \end{array} } \right] $$
$$ F_{\eta } = \left[ {\begin{array}{*{20}c} 0 \\ 0 \\ {0.0000} \\ {0.0016} \\ {0.0067} \\ \end{array} } \right],\quad H_{\eta } = \left[ {\begin{array}{*{20}c} {0.001} \\ 0 \\ 0 \\ 0 \\ 0 \\ \end{array} } \right] $$
$$ \begin{aligned} & C_{f} = 1.0e - 004*\left[ {\begin{array}{*{20}c} 0 & 0 & 0 & 0 & 0 & 0 & 0 & {0.0160} & {0.0670} & 0 & {0.0478} & {0.2002} \\ \end{array} } \right]^{T} \\ & C_{r} = \left[ {\begin{array}{*{20}c} 0 & 0 & 0 & {0.0010} & 0 & 0 & {0.0020} & 0 & 0 & {0.0030} & 0 & 0 \\ \end{array} } \right]^{T} \\ \end{aligned} $$

The MROF based DISMC has been simulated to demonstrate the ability of cart to move to desired position and at the same time maintain the inverted pendulum in upright position. In this condition, the initial cart position is zero meter and the measured pendulum angle is also zero radian. The cart position then is forced to move to reference tracking which is the unit step input. The switching surface is designed as G imrof  = [0.6819 0.1779 0.5724 −0.4204 −0.4950] and the matrix K is defined as K = [− 35.9282 −22.6932 −8.3910 12.8303 35.7651]. The selection of switching surface is via Particle Swarm Optimization (PSO). Based on stability analysis, the value of ρ must be between 0 < ρ < 2, therefore ρ is selected as 1.995. For the comparison purpose, the performance of the MROF were compared with the discrete linear quadratic regulator (DLQR) and discrete Proportional-Integral-Derivative (PID). The value of DLQR control gain, K dlqr is set as K dlqr  = [945.9 1415.5 −560.1 1530.3]. Meanwhile, there are two PID controllers used in the investigation to control the inverted pendulum system. PID controller 1 is used to control the position and PID controller 2 controls the angle of the inverted pendulum system. The parameter values of K p , K i and K d for PID controller 1 and the PID controller 2 are −20, −0.1, −25 and 100, 4, 12 respectively.

The simulation results of the inverted pendulum’s cart position for MROF based DISMC, DLQR and PID is displayed in Fig. 1. Meanwhile, details of the comparison is shown in Table 1. Based on this comparison, the MROF based DISMC gives the lowest settling time and lowest overshoot among the rest. Although the difference in settling time for the DLQR is only 0.7 s from the MROF based DISMC, the maximum voltage for the control input is very high which is near to 4 V compared to DISMC which is less than 2 V. Meanwhile the PID controller provides the highest overshoot and slowest settling time compared to the MROF based DISMC and DLQR controllers. The simulation result for the angle of the inverted pendulum system for all controllers are shown in Fig. 2. The angle of the inverted pendulum for MROF based DISMC is moved to −0.56 rad, then it moves to positive 0.18 rad before maintaining at 0 rad when the steady state is achieved. The result of control input for three difference types of controller is shown in Fig. 3. Meanwhile Fig. 4 shows the sliding surface for the MROF based DISMC. The system state slides onto sliding surface and remains on that surface thereafter at σ imrof (k + 1) = 0.

Fig. 1.
figure 1

Position of the cart.

Table 1. Comparison of the cart position with different types of controller.
Fig. 2.
figure 2

Angle of the inverted pendulum.

Fig. 3.
figure 3

Control input.

Fig. 4.
figure 4

Sliding surface.

4 Conclusion

The performance of the designed controller was demonstrated to prove that the MROF based DISMC is invariant to the uncertainties that are present in the system and guarantee the stability. Only by the usage of output state, the system is able to be controlled, follow the reference tacking and not depending on the state feedback. The comparison between the PID, DLQR and MROF based DISMC shows that the designed controller has achieved the best capability in providing desired functional and better system response in term of its fast settling time and less overshoot when compared to the others.