Keywords

1 Introduction

Inverted pendulum system is known as unstable system, highly nonlinear and difficult to control. A lot of investigations have been delivered to control the problem of the inverted pendulum [1, 2]. Sliding Mode Control (SMC) was proposed in the 1960’s is a special nonlinear control strategy with discontinuous property [3]. The special feature of SMC is a switching control law is utilized to drive the state trajectory onto a selected sliding surface in the state space and stay on this sliding surface infinite time. Due to the above property, SMC is attractive to control many highly nonlinear uncertain systems [46]. Recently, due to widespread development of computer, the trend of controller has changed from continuous to discrete time as well as sliding mode control. Unlike the continuous time SMC, in discrete sliding mode control (DSMC) the state trajectory cannot stay on sliding surface and cross it in finite time. It will cross the surface again in the following sampling period and produce a zigzag motion called quasi sliding mode band [7]. The DSMC have many advantages compared to continuous SMC such as high accuracy, low power consumption and the others [8].

The state feedbacks are normally used to design control law in SMC. However in practical situation not all of the state always measurable. In this situation, an observer need to be designed where it will provide an estimation of state variable. [9]. However the used of observer makes the system more complex. The Multirate output feedback (MROF) method that only used the output samples to design the controller can be used in place of an observer. The concept of MROF is the control input and output of a system will be sampled at two different sampling rates. The control input is sampled at a slower rate, meanwhile the output is sampled at a faster rate [10]. Several nonlinear plant system such as Hydraulic Manipulator [11], Magnetic Levitation System [12] was controlled by MROF. In this paper, the main objective is to design the multirate output feedback based on discrete SMC and implemented the developed controller to inverted pendulum system to improve the system performance.

2 System Overview

An inverted pendulum system consists of a freely pivoted rod, mounted on a motor driven cart. The aim of this task is to move the cart to a desired position and at same time balancing the inverted pendulum to maintain at up-right position. The continuous time of inverted pendulum system with additional of external disturbance d(t) can be expressed as follow

$$\begin{aligned} \mathop x\limits^{ \bullet } (t) & = Ax(t) + Bu(t) + Bd(t) \\ y(t) & = Cx(t) \\ \end{aligned}$$
(1)

where

$$\begin{aligned} A & = \left[ {\begin{array}{*{20}c} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & {\frac{{(M_{p} l_{p} )^{2} g}}{P}} & { - \frac{{B_{eq} (I_{p} + M_{p} l_{p}^{2} )}}{P}} & { - \frac{{M_{p} l_{g} B_{p} }}{P}} \\ 0 & {\frac{{(M_{c} + M_{p} )M_{p} gl_{p} }}{P}} & { - \frac{{M_{p} l_{p} B_{eq} }}{P}} & { - \frac{{(M_{c} + M_{p} )B_{p} }}{P}} \\ \end{array} } \right]\quad B = \left[ {\begin{array}{*{20}c} 0 \\ 0 \\ {\frac{{(I_{p} + M_{p} l_{p}^{2} )}}{P}} \\ {\frac{{M_{p} l_{p} }}{P}} \\ \end{array} } \right] \\ P & = (M_{c} + M_{p} )I_{p} + M_{c} M_{p} l_{p}^{2} \quad x(t) = \left[ {\begin{array}{*{20}c} {x_{1} } & {x_{2} } & {x_{3} } & {x_{4} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {x_{c} } & \theta & {\mathop {x_{c} }\limits^{ \bullet } } & {\mathop \theta \limits^{ \bullet } } \\ \end{array} } \right] \\ \end{aligned}$$
(2)

where \(x_{c}\) is the cart position, \(\theta\) is the pendulum angle, \(\mathop {x_{c} }\limits^{ \bullet }\) is the cart velocity, \(\mathop \theta \limits^{ \bullet }\) is the pendulum angular velocity, M p is the pendulum mass, I p is the pendulum moment of inertia, B p is the viscous damping coefficient, \(B_{eq}\) is the equivalent viscous damping coefficient, l p is the pendulum length, M c is the cart mass and g is gravitational constant on earth.

3 Multirate Output Feedback

The Eq. (1) also can be rewrite as

$$\mathop x\limits^{ \bullet } (t) = Ax(t) + Bu(t) + Dd(t)$$
(3)

The reference tracking, z(t) = r(t) − y(t) is added to the system. Then the continuous time of inverted pendulum system can be represented as

$$\left[ {\begin{array}{*{20}c} {\mathop {z(t)}\limits^{.} } \\ {\mathop {x_{1} }\limits^{.} (t)} \\ : \\ {\mathop {x_{n} }\limits^{.} (t)} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} 0 & { - 1} & 0 & 0 \\ 0 & {a_{{11}} } & \ldots & {a_{{1n}} } \\ : & : & {} & : \\ 0 & {a_{{n1}} } & \ldots & {a_{{nn}} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {z(t)} \\ {x_{1} (t)} \\ : \\ {x_{n} (t)} \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} 0 \\ {b_{1} } \\ : \\ {b_{n} } \\ \end{array} } \right]u(t) + \left[ {\begin{array}{*{20}c} 0 \\ {d_{1} } \\ : \\ {d_{n} } \\ \end{array} } \right]d(t) + \left[ {\begin{array}{*{20}c} 1 \\ 0 \\ : \\ 0 \\ \end{array} } \right]r(t)$$
(4)

The system in Eq. (4) can be represented as follow

$$\begin{aligned} \mathop {x_{p} }\limits^{ \bullet } (t) & = A_{p} x_{p} (t) + B_{p} u(t) + D_{p} d(t) + R_{p} r(t) \\ y(t) & = C_{p} (t) \\ \end{aligned}$$
(5)

when the continuous time system in Eq. (5) is sampled at \(\tau = 0.004\;{\text{s}}\). The discrete time of the system is given as

$$\begin{aligned} x(k + 1) & =\Phi \,x(k) +\Gamma u(k) + Ff(k) + Hr(k) \\ y(k) & = C_{p} x(k) \\ \end{aligned}$$
(6)

where \(u(k) \in R,\;\Phi (k) \in R^{n \times n}\) and \(\Gamma (k) \in R^{n \times 1}\) Assume that the \((\Phi ,\,\Gamma )\) is controllable and \((\Phi, \,C)\) is observable. The past N multirate-sampled system outputs can be represented 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]$$
(7)

Then, system in Eq. (7) can be represented in faster sampling time \(\eta = 0.001\,{\text{s}}\) as

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

where \(C_{0} ,\,C_{u} ,\,C_{f}\), 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} } \\ : \\ {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 } )} \\ : \\ {C_{p} \sum\limits_{i = 0}^{N - 2} {\Phi _{\eta }^{i}\Gamma _{\eta } } } \\ \end{array} } \right]\quad C_{f} = \left[ {\begin{array}{*{20}c} 0 \\ {C_{p} F_{\eta } } \\ {C_{p} (\Phi _{\eta } F_{\eta } + F_{\eta } )} \\ : \\ {C_{p} \sum\limits_{i = 0}^{N - 2} {\Phi _{\eta }^{i} F_{\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 } )} \\ : \\ {C_{p} \sum\limits_{i = 0}^{N - 2} {\Phi _{\eta }^{i} H_{\eta } } } \\ \end{array} } \right]$$
(9)

Using Eqs. (8) and (9) the following equation is obtained

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

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

Substitute Eq. (8) into Eq. (10),

$$\left[ {\begin{array}{*{20}c} {x(k + 1)} \\ {f(k)} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\Phi _{\eta } } & {F_{\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)$$
(11)

Then state \(x(k + 1)\) can be represented

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

If \(Q = \left\lfloor {\begin{array}{*{20}c} {\Phi _{\eta } } & {F_{\eta } } \\ \end{array} } \right\rfloor\) 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)$$
(13)

In the case where the linear sliding surface is used, the forward linear surface σ (k + 1) can be expressed as

$$\sigma (k + 1) = G\Phi \,x(k) + G\Gamma u(k) + GFf(k) + GHr(k)$$
(14)

Since the value of \(f(k)\) is unknown, it will be replaced by estimated disturbance of \(\mathop f\limits^{\sim } (k) = f(k - 1)\). It can give the control input as

$$u(k) = - (G\Gamma )^{ - 1} \left[ {G\Phi x(k) + GF\mathop f\limits^{\sim } (k) + GHr(k)} \right] + M\left| {\sigma (k)} \right|\,{\text{sgn}}\,(\sigma (k))$$
(15)

Then the control input can be expressed in MROF as

$$\begin{aligned} u(k) & = - \left( {G\Gamma } \right)^{ - 1} \left[ {G\Phi \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\}} \right] \\ & \quad - \left( {G\Gamma } \right)^{ - 1} \left[ {GF\mathop f\limits^{\sim } (k) + GHr(k)} \right] + M\left| {\sigma (k)} \right|\,{\text{sgn}}\,(\sigma (k)) \\ \end{aligned}$$
(16)

To ensure the system is in the stable condition, the \((\sigma (k + 1) - \sigma (k))\,{\text{sgn}}\,(\sigma (k)) < 0\) and \((\sigma (k + 1) + \sigma (k))\,{\text{sgn}}\,(\sigma (k)) > 0\) must be satisfied. Therefore, the range of M in Eq. (16) must be between 0 < M < 2.

4 Result and Discussion

The inverted pendulum system 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 is shown as below

$$\begin{aligned}\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.462} & { - 0.0513} & {0.9995} \\ \end{array} .} \right] \\\Gamma _{\eta } & = \left[ {\begin{array}{*{20}c} 0 \\ 0 \\ {0.0000} \\ {0.0016} \\ {0.0067} \\ \end{array} } \right],\quad 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] \\ \end{aligned}$$

The MROF has been simulated to demonstrate the ability of cart system to move to desired position and at the same time maintain the inverted pendulum in upright position. The external disturbance is set to \(d(k) = 0.05\,\cos (2\pi kt/3)\). After 1 s the cart is force to move 0.02 m from its initial condition by following the desired input which is the unit step input. The switching surface is designed as \(G = \left[ {\begin{array}{*{20}c} { - 15.6} & { - 89} & {130} & { - 48.4564} & {20} \\ \end{array} } \right]\). Thus as comparison, the performance of the MROF is compared with the discrete linear quadratic regulator (DLQR). Thus, the designed gain for the discrete linear quadratic regulator controller are \(K = \left[ {\begin{array}{*{20}c} { - 43.1696} & {125.9181} & { - 40.3888} & {13.5309} \\ \end{array} } \right]\). Figure 1 shows the simulation result for cart position and angle of inverted pendulum system with MROF and DLQR controllers. Based on Fig. 1a, although all of the controllers are capable to control the cart position, but the output of each controller gave the different characteristic. Table 1 show the comparison data of both controllers. The output of controllers show that the MROF gives the faster settling time and lower overshoot as compared to DLQR controller. Mean while Fig. 2 shows the control input which is the input voltage of the system.

Fig. 1
figure 1

a Tracking performance of cart position, b Angle of inverted pendulum

Table 1 Performance characteristics of cart position with MROF and DLQR
Fig. 2
figure 2

Input voltage

5 Conclusion

In this paper, MROF based DSMC is designed to control inverted system. The MROF is designed using the output feedback and can be used to place an observer. The designed controller is able to deal with existence of external disturbance in the system and guarantee the stability. Only by the usage of output state, the inverted pendulum can maintain at upright, tracked the desired position of cart motor and not depend on the state feedback. This study has shown that developed MROF provide a good pendulum system performance in particular yield solution to nonlinearities problems.