# Observer-Based Controllers for Two-Wheeled Inverted Robots with Unknown Input Disturbance and Model Uncertainty

Authors: Khanh G. Tran; Nam H. Nguyen; Phuoc D. Nguyen
Journal: Journal of Control Science and Engineering
 (2020)

---

## Abstract

In this paper, two controllers with a compound disturbance observer are proposed for a two-wheeled inverted robot (TWIR) with model uncertainty and unknown input disturbance. First, an equivalent linear model of the TWIR with uncertainty and input disturbance is proposed using the Taylor series expansion for the nonlinear model of the TWIR at an equilibrium point, in which the nonlinear part of the Taylor series and the model uncertainty are combined with unknown input disturbance as compound input disturbance. Then, the compound input disturbance is estimated by using the Newton method and reference model. As the estimated compound disturbance is used to compensate for the compound disturbance, the equivalent linear system becomes closely definite without compound input disturbance. Finally, two controllers are proposed using the equivalent linear system. Stability analysis of the proposed control methods is also given. To illustrate the proposed methods, some simulations for the TWIR are performed and compared with the existing methods. The main contribution of this work includes the following: (i) simple controllers based on compound input disturbance observer for trajectory tracking and balancing of TWIRs with unknown input disturbance and model uncertainty are proposed; (ii) the stability of proposed closed-loop control systems is proved; (iii) our proposed methods are simulated and compared with the existing methods.


---

## Body

## 1. Introduction

TWIRs were widely studied in the literature and applied as vehicles in practice [1, 2]. Their nature is an unstable, underactuated, and nonlinear system, so it is very difficult to control them. There have been many controllers designed for TWIRs such as backstepping [3, 4], sliding mode control [5–7], nonlinear control [8–11], PID control [12, 13], PD controller with iterative learning [14], fractional PID [15], fuzzy control [16, 17], model predictive control [18], and nonlinear disturbance observer-based control [19].In [3], an adaptive backstepping controller combined with two PD controllers was proposed for an electric scooter with model uncertainty, but the input disturbance was not considered. In [4], both model uncertainty and exogenous disturbance were addressed, but the proposed controller was complicated. In [5], sliding mode controllers were applied to dealt with model uncertainty, and experimental data based friction compensation models were built for a TWIR, so this is an disadvantage in design. In [6], adaptive sliding mode control in combination with direct fuzzy control was applied for balancing and trajectory tracking of the TWIR; however, no disturbance was considered. In [8], a nonlinear state transformation-based controller was proposed without considerations of model uncertainty and disturbance. A state-dependent nonlinear model-based LQR controller was designed in [9], which was robust to external disturbances but not dealing with model uncertainty. In [10], a passivity-based controller using the two-rule Takagi–Sugeno fuzzy model was proposed for the TWIR. In [11], a controller using the state-dependent Riccati equation was designed. A combination of two PD controllers and a time-delayed controller for fast movement of TWMR was proposed in [12], where the first PD controller was designed for the pitch angle, the other PD controller was applied for the orientation, and the time-delayed controller was synthesised for the position. In [13], a proposed control scheme consists of local controller and a global planner for the TWIR-based personal transportation vehicle, in which the local controller contains three PID controllers for the pitch angle, the yaw angle, and the position. In [16], an indirect adaptive fuzzy controller based on the trajectory planner was proposed for the TWIR with model uncertainty. Four interval type 2 fuzzy logic inference system-based controllers [17] were designed using the Takagi–Sugeno model for the TWIR with uncertainty and disturbance, but the controller is dependent on solving linear matrix inequalities. In [20], an optimal H-infinity controller was proposed by using Taylor series approximation at operating point, so it requires a lot of computations. Trajectory tracking control and control for obstacle avoidance of the TWIR with certain model and no disturbance were proposed in [18] and [21]. In [19], a nonlinear disturbance observer based dynamic surface controller was proposed, in which the observer is a complex differential equation to solve and the designed controller was also complicated when using a global change of coordinates and dynamic surface control technique and filters. This controller can only stabilize the pitch and yaw angles of the TWIR. Recently, an adaptive observer-based high gain controller was proposed in [22]. It requires a lot of integral calculations to estimate state variables and TWIR’s parameters. In [23], a hierarchical sliding mode control was proposed for controlling longitudinal and balancing motions of TWIR only. A control moment gyro [24] was used for keeping a small TWIR-balanced independence of moving control; this allows to perform the trajectory tracking problem separately from the balancing problem. Some new application directions of TWIRs were recently developed in [25–27].Most of the mentioned above methods have not dealt with model uncertainty and unknown input disturbances; only few methods had done that, but they were very complicated for design and implementation. This motivates us to propose a simpler controller based on an input disturbance observer to concurrently overcome both model uncertainty and unknown input disturbance. In this work, our main contributions are to (a) convert the nonlinear model of TWIRs into an equivalent linear model, in which the uncertainty of nonlinear model and the unknown input disturbance are lumped as compound input disturbance, (b) prove the stability of the proposed TWIR control system, and (c) compare the proposed method with other existing methods through numerical simulations.The remaining part of the work is organized as follows. The next section revisits a mathematical model of the TWIR and builds an exact linear model of TWIR with model uncertainty and unknown input disturbance by introducing the compound input disturbance. Two controllers with the disturbance observer are proposed for the TWIR and stability analysis is also provided in Section3. In Section 4, some numerical simulations are carried out to illustrate the proposed method and compare it with the existing methods. The final section provides conclusions and future works.


## 2. Mathematical Model of TWIR

In this work, a mathematical model of TWIR in [28] is used for the controller design and simulation. The schematic diagram of a TWIR is shown in Figure 1. The notations and parameters of the TWIR are shown in Table 1, where J=mr2/2, K=mr2/4, I1=I3=Md2/2, and I2=Ml2/2. The motion equations of the TWIR [28] are represented as in equations (1), (2), and (3):(1)M+2m+2Jr2x¨−Mlψ˙2+θ˙2sinθ+Mlcosθθ¨+2Cx˙r−θ˙=1rτL+τR,(2)Mlcosθx¨−Ml2+I2θ¨+I3−I1−Ml2ψ˙2sinθcosθ−Mlgsinθ−2Cx˙r−θ˙=−τL+τR,(3)I3+2K+md22+Jd22r2−I3−I1−Ml2sin2θψ¨+Mlx˙−2I3−I1−Ml2ψ˙sinθ+Cψ˙d22r2=τR−τLd2r.Figure 1
Schematic diagram of a TWIR.Table 1
TWIP’s notations and parameters.
NotationDefinitionxPosition of the TWIRθPitch angle of the pendulum bodyψYaw angle of the TWIRdDistance from the left to right wheelslLength from the center of the pendulum to the wheel axisrRadius of wheelsMMass of the pendulum (without wheels)mMass of left (right) wheelJMass moment of inertia (MOI) of the wheel with respect to (w. r. t.) the wheel axisKMOI of the wheel w. r. t. the vertical axisτL, τRMotor’s left (right) torqueCCoefficient of viscous friction on wheel axisI1, I2, I3MOI of the pendulum w. r. t. the frame at the center of the pendulumLet us define state variables and inputs as follows:(4)x¯=x1x2x3x4x5x6T=xθψx˙θ˙ψ˙T,u¯=u1u2T=τLτRT,respectively. Then,(5)x˙¯=fx¯,u¯,where x˙1=x4, x˙2=x5, x˙3=x6, x˙4=f4x¯,u¯, x˙5=f5x¯,u¯, and x˙6=f6x¯,u¯, where f4x¯,u¯=Ω1+Ω2/Ω,f5x¯,u¯=Ω3+Ω4/Ω,f6x¯,u¯=Ω5/Ω6 with(6)Ω1=r2Ml2+I2u1+u2r+2Cx5−x4/rr+Mlsinx2x52+x62,Ω2=r2Mlcosx2cosx2sinx2I3−Ml2−I1x62+u1+u2+2Cx5−x4/rr−Mglsinx2,Ω3=2J+M+2mr2cosx2sinx2Ml2+I1−I3x62−u1+u2−2Cx5−x4/rr+Mglsinx2,Ω4=−Mlr2cosx2u1+u2r+2Cx5−x4/rr+Mlsinx2x52+x62,Ω5=−2r2du1−u22r+x6sinx2Mlx4+2x5cosx2Ml2+I1−I3+Cd2x62r2,Ω6=2I3+4K+md2+2I1−I3+Ml2sin2x2r2+Jd2,Ω=Mlr21−cos2x2+2I2J+2JMl2+I2M+2I2m+2Mml2r2.System (5) is used to build a linear model with compound disturbance in Section 3.


## 3. Proposed Controllers with Compound Disturbance Observer

### 3.1. Exact Linear Model with Compound Disturbance

Letx¯e be an equilibrium point of system (5), then x¯e is the solution to the equation f¯x¯,0¯=0¯. Thus, x¯e=∗0∗000T, where “∗” are any values of x1 and x3, which are the desired position and heading angle of the TWIR. Without loss of generality, it is assumed that “∗” is zero; this means x¯e=0¯.Sincef1x¯=x4, f2x¯=x5, and f3x¯=x6 are linear functions, the first derivatives of first three variables can be expressed as follows:(7)x˙¯13=A1x¯+B1u¯,x˙¯13=A1x¯,where A1=000100000010000001,B1=000000,x¯=x1x2x3x4x5x6T, and x¯13=x1x2x3T.Because the matricesA1 and B1 are constant, system (7) is certain and x4, x5, and x6 are virtual inputs. In addition, since the matrix B1=0¯3×2, system (7) is not directly affected by both the input and unknown input disturbances.Sincef4x¯, f5x¯, and f6x¯ are nonlinear functions, by using Taylor series expansion, they can be represented exactly as follows:(8)x˙¯46=A2x¯+B2u¯+Δx¯,u¯,where Δx¯,u¯, having a size of 3×1, is the remainder of Taylor series for the functions f4x¯, f5x¯ and f6x¯at x¯e,x¯46=x4x5x6T,A2=0a420a44a4500a520a54a55000000a66, and B2=b4b4b5b5b6−b6, in which a42=−Mrl2g/Λ, a44=−2CMl2+I2+Mlr/Λ, a45=2CrMl2+I2+Mlr/Λ, a52=Mlg2J+Mr2+2mr2/Λ,a54=2CMl+2C2J+Mr2+2mr2/r/Λa55=2C2J+Mr2+2mr2+2CMlr/−Λ, a66=−Cd2/Jd2+2I3+4K+d2mr2, b4=rMl2+I2+Mlr/Λ, b5=−2J+Mr2+2mr2+Mlr/Λ, b6=−dr/Jd2+2I3+4K+d2mr2, and Λ=2I2J+2JMl2+I2Mr2+2I2mr2+2Ml2mr2.SincerankB2=2, the inverse of the matrix B2TB2 exists. So, Δx¯,u¯ can be rewritten as follows:(9)Δx¯,u¯=B2d¯,where d¯=B2TB2−1B2TΔx¯,u¯. In other words, Δx¯,u¯ is in the image space of B2.As parameters of the TWIR are uncertain, system (8) can be represented as(10)x˙¯46=A2+ΔA2x¯+B2+ΔB2u¯+Δx¯,u¯.This is equivalent to(11)x˙¯46=A2x¯+B2u¯+Δux¯,u¯,where Δux¯,u¯=Δx¯,u¯+ΔA2x¯+ΔB2u¯.Similarly, we have(12)Δux¯,u¯=B2d¯u,where d¯u=B2TB2−1B2TΔux¯,u¯. In this case, Δux¯,u¯ also lies in the image space of B2.From equations (7), (11), and (12), we obtain(13)x˙¯=Ax¯+Bu¯+d¯u,where A=A1A2, B=B1B2, and x¯=x¯13x¯46.Thus, the uncertainty of system (13), also combined uncertainty of system (7) and system (11), is Δu=0¯1×3ΔuTT. Then, BTB−1BTΔl=B2TB2−1B2TΔu=d¯u since rankB=2. This means that Δl=Bd¯u. So, Δl is in the image space of B. It implies that the uncertainty of system (5) can be described as uncertain input disturbance d¯u.As unknown input disturbanced¯i is applied to the TWIR, system (13) becomes(14)x˙¯=Ax¯+Bu¯+d¯c,where d¯c=d¯u+d¯i. Thus, the compound disturbance d¯c represents both the unknown input disturbance and the model uncertainty. System (14) is a linear model exactly representing the nonlinear system (5). In Section 3.2, the compound disturbance will be estimated.


### 3.2. Compound Disturbance Observer

In this section, an input disturbance observer (a proposal in [29]) is presented and applied for system (14). By using the Euler method, we have an approximate discrete-time model of system (14) as follows:(15)x¯k≈Adx¯k−1+Bdu¯k+d¯kc,where Ad=I+TsA, Bd=TsB, and Ts is the sampling time. A reference model will be used to estimate the disturbance d¯kc as follows:(16)zk=Adz¯k−1+Bdu¯k−d¯^k−1c,where d¯^k−1c is the estimated disturbance at time instance k−1. Then, system (15) with disturbance compensation d¯^k−1c is presented as(17)x¯k≈Adx¯k−1+Bdu¯k+d¯kc−d¯^k−1c,and system (14) with approximated disturbance compensation becomes(18)x˙¯=Ax¯+Bu¯+d¯c−d¯^c.Subtracting equation (16) from equation (17), we get(19)x¯k−zk≈Adx¯k−1−Adz¯k−1+Bdd¯kc.So, there exists a differenceδ¯k in equation (19), which is also the approximation error of equation (15) due to discretization process as follows:(20)δ¯k=x¯k−zk−Adx¯k−1+Adz¯k−1−Bdd¯kc.Define a cost functionJkd¯kc=δ¯kTδ¯k⟶0. Then, an optimal estimate of d¯kc is(21)d¯^kc=BdTBd−1BdTx¯k−zk−Adx¯k−1+Adz¯k−1.Theorem 1.
(see [29]). If system (18) has rankB=2, the measured state x¯k=x¯tk from system (18) is exactly represented by the following discrete-time model:(22)x¯k=Adx¯k−1+Bdu¯k+d¯kc−d¯^k−1c,with Ts being suitably selected, the estimated disturbance (21) will satisfy that(23)d¯^kc=d¯ctk.Proof.
The proof was given in [29]. So, it is skipped here.
For the reference model (16), it is possible to choose z¯k−1=x¯k−1 for ∀k. So, equation (21) becomes(24)d¯^kc=BdTBd−1BdTx¯k−z¯k.
The correct value of the compound disturbance isd¯kc=BdTBd−1BdTx¯k−z¯k−δ¯k. So, the estimation error is(25)d¯^kc−d¯kc=BdTBd−1BdTδ¯k.
However,δ¯k is proportional to Ts2 because of the local truncation error [30]. Thus, the estimation error can be made as small as possible by decreasing the sampling time Ts.
The estimated compound disturbance is used to complement system (14) as in equation (18), where(26)d¯^ct=d¯^k−1c,∀t,kTs≤t<k+1Ts, and ∀k=0,1,…,. Keep in mind that the estimated compound disturbance d¯^ct looks like a series of step functions.
In summary, the compound disturbance observer is implemented as follows:(1)
Initialization: chooseTs>0 is sufficiently small. Assign d¯^0c=0¯. Measure the state of system (5) at time t0=0. Assign z¯0=x¯0.(2)
Perform the following calculations in forward order fork=0,1,…,:(a)
Measure the statex¯k of system (5) at time tk=kTs.(b)
Computez¯k from equation (16) and calculate d¯^kc from equation (24).(c)
Assignz¯k=x¯k, go back to step a.
System (18) is applied to design state feedback and trajectory tracking controllers using the disturbance observer (24) in Section 3.3.


### 3.3. Stability Analysis

In this section, the stability of system (18) with a state feedback controller is analyzed. Some assumptions are given as follows:Assumption 1.d¯ct is continuous ∀t≥0 and d/dtd¯ct is bounded.Assumption 2. There exists a state feedback controlleru¯=−Kx¯ satisfying that the matrix A−BK is Hurwitz (all real part of eigenvalues is negative).Lemma 1.
With assumption 1, system (18) with a state feedback controller K satisfying the assumption 2 is input to state stable (ISS).Proof.
Letγ¯kt=d¯ct−d¯^k−1c for ∀t,kTs≤t<k+1Ts and γ¯kt=0¯ for t∉kTs,k+1Ts. From equations (25) and (26), one gets γ¯kt=d¯ct−d¯^k−1c−BdTBd−1BdTδ¯k−1. Since δ¯k−1 is proportional to Ts2 due to the local truncation error [30], it is bounded. In addition, the compound disturbance and its first derivative are also bounded by assumption 1, and then, γ¯kt is bounded.
Letγ¯t=∑k=0∞γ¯ktwkt, where wkt is a window function with wkt=1 for ∀t, kTs≤t<k+1Ts, and wkt=0 for t∉kTs,k+1Ts. Then, γ¯t is also bounded.
Substitutingγ¯t and the controller u¯=−Kx¯ into equation (18), we obtain(27)x˙¯=A−BKx¯+Bγ¯t.
DenoteA^=A−BK. Since A^ is Hurwitz by assumption 2, for ∀Q>0 and QT=Q, the Lyapunov equation(28)A^TP+PA^=−Q,always has a unique solution P, which is symmetric positive definite. By using a Lyapunov function as follows,(29)Vx¯=x¯TPx¯,one has(30)dVdt=A^x¯+Bγ¯TPx¯+x¯TPA^x¯+Bγ¯=−x¯TQx¯+2x¯TPBγ¯≤−x¯2λmin+2x¯PBγ¯=x¯−x¯+2PBγ¯,where ∗ denotes L∞ norm and λmin is the smallest eigenvalue of the matrix Q.
As long asx¯ lies outside the domain Γ=∀x¯x¯≤2PBγ¯/λmin, V˙<0, thus x¯⟶Γ containing the origin. Hence, system (27) is input to state stable [31]. This means that system (18) is ISS.
In conclusion, the state feedback controller with disturbance observer is(31)u¯t=−Kx¯−d¯^ct,where the gain matrix K can be designed using existing methods in the literature such as LQR control, pole placement method, or even H∞. The proposed controller is simple not only in design but also implementation. In addition, it can cope with model uncertainty and input disturbance of TWIRs. In Section 3.4, we propose a trajectory tracking controller for TWIRs with model uncertainty and input disturbance.


### 3.4. Tracking Control for TWIR

Letx¯dt be the desired trajectory for the TWIR. Define e¯=x¯−x¯d be tracking error of the TWIR. Taking the first derivative of the tracking error and using equation (18), we obtain(32)e˙¯=Ae¯−x˙¯d+Ax¯d+Bu¯+γ¯,where γ¯ is previously defined in the proof of Lemma 1.Theorem 2.
The tracking error holds thatlimt⟶∞e¯t=0¯ under the following control law:(33)u¯tr=−Ke¯−BTB−1BTAx¯d−x˙¯d,where K satisfies the condition that A−BK is Hurwitz.Proof.
Sincex¯d=x¯1d;x¯2d, x˙¯1d=x¯2d. In addittion, the matrices A and B have special forms as in equation (13), so Ax¯d−x˙¯d=0¯3×1;A2x¯d+x˙¯2d; this lies in the image space of B. Thus, Ax¯d−x˙¯d=Bu¯v, where u¯v=BTB−1BTAx¯d−x˙¯d is unique due to rankB=2. So, system (32) can be represented as follows:(34)e˙¯=Ae¯+Bu¯+γ¯+u¯v.
Substituting equation (33) into equation (34), we get(35)e˙¯=A−BKe¯+Bγ¯.
This system is similar to system (27), but the variable e¯ is in place of x¯. Define a Lyapunov function as(36)Ve¯=e¯TPe¯,where P>0. Then,(37)dVdt=−e¯TQe¯+2e¯TPBγ¯≤−e¯2λmin+2e¯PBγ¯=e¯−e¯+2PBγ¯,where Q=−A^TP+PA^, A^=A−BK, and λmin is the minimum eigenvalue of the matrix Q. This means that V˙<0 whenever e¯∉Γ=∀e¯e¯≤2PBγ¯/λmin. Hence, e¯ is bounded.
Take the second derivative ofV to get(38)V¨=−e˙¯TQe¯−e¯TQe˙¯+2e˙¯TPBγ¯+2e¯TPBγ¯˙=−e¯TQee¯−2e¯TQB−A^TPBγ¯+2e¯TPBγ¯˙,where Qe=A^TQ+QA^. Since e¯ is bounded, γ¯ and γ¯˙ are also bounded according to Lemma 1, V¨ is bounded. Using Barbalat’s Lemma, one gets limt⟶∞e¯t=0¯.
In summary, the tracking controller is(39)u¯t=−Ke¯−BTB−1BTAx¯d−x˙¯d−d¯^ct.
For disturbance estimation, equations (16) and (24) will be applied, where BdTBd−1BdT2×6 is a constant matrix, which is previously computed one time. This is also true for computing the matrix BTB−1BT2×6. Thus, the calculation of control signal involves only matrix/vector multiplication and addition, so it is simple to implement. This is an advantage of the proposed method in comparison with other methods in the literature such as works in [6, 20]. In [6], several integral computations involving adaptive laws have to be calculated to obtain control signals, and no input disturbance is mentioned in design process and simulation. In [20], the model linearization and Riccati equation solving are performed to obtain the control gain matrix at every sampling instance, so the computational load is very huge for implementation.


## 3.1. Exact Linear Model with Compound Disturbance

Letx¯e be an equilibrium point of system (5), then x¯e is the solution to the equation f¯x¯,0¯=0¯. Thus, x¯e=∗0∗000T, where “∗” are any values of x1 and x3, which are the desired position and heading angle of the TWIR. Without loss of generality, it is assumed that “∗” is zero; this means x¯e=0¯.Sincef1x¯=x4, f2x¯=x5, and f3x¯=x6 are linear functions, the first derivatives of first three variables can be expressed as follows:(7)x˙¯13=A1x¯+B1u¯,x˙¯13=A1x¯,where A1=000100000010000001,B1=000000,x¯=x1x2x3x4x5x6T, and x¯13=x1x2x3T.Because the matricesA1 and B1 are constant, system (7) is certain and x4, x5, and x6 are virtual inputs. In addition, since the matrix B1=0¯3×2, system (7) is not directly affected by both the input and unknown input disturbances.Sincef4x¯, f5x¯, and f6x¯ are nonlinear functions, by using Taylor series expansion, they can be represented exactly as follows:(8)x˙¯46=A2x¯+B2u¯+Δx¯,u¯,where Δx¯,u¯, having a size of 3×1, is the remainder of Taylor series for the functions f4x¯, f5x¯ and f6x¯at x¯e,x¯46=x4x5x6T,A2=0a420a44a4500a520a54a55000000a66, and B2=b4b4b5b5b6−b6, in which a42=−Mrl2g/Λ, a44=−2CMl2+I2+Mlr/Λ, a45=2CrMl2+I2+Mlr/Λ, a52=Mlg2J+Mr2+2mr2/Λ,a54=2CMl+2C2J+Mr2+2mr2/r/Λa55=2C2J+Mr2+2mr2+2CMlr/−Λ, a66=−Cd2/Jd2+2I3+4K+d2mr2, b4=rMl2+I2+Mlr/Λ, b5=−2J+Mr2+2mr2+Mlr/Λ, b6=−dr/Jd2+2I3+4K+d2mr2, and Λ=2I2J+2JMl2+I2Mr2+2I2mr2+2Ml2mr2.SincerankB2=2, the inverse of the matrix B2TB2 exists. So, Δx¯,u¯ can be rewritten as follows:(9)Δx¯,u¯=B2d¯,where d¯=B2TB2−1B2TΔx¯,u¯. In other words, Δx¯,u¯ is in the image space of B2.As parameters of the TWIR are uncertain, system (8) can be represented as(10)x˙¯46=A2+ΔA2x¯+B2+ΔB2u¯+Δx¯,u¯.This is equivalent to(11)x˙¯46=A2x¯+B2u¯+Δux¯,u¯,where Δux¯,u¯=Δx¯,u¯+ΔA2x¯+ΔB2u¯.Similarly, we have(12)Δux¯,u¯=B2d¯u,where d¯u=B2TB2−1B2TΔux¯,u¯. In this case, Δux¯,u¯ also lies in the image space of B2.From equations (7), (11), and (12), we obtain(13)x˙¯=Ax¯+Bu¯+d¯u,where A=A1A2, B=B1B2, and x¯=x¯13x¯46.Thus, the uncertainty of system (13), also combined uncertainty of system (7) and system (11), is Δu=0¯1×3ΔuTT. Then, BTB−1BTΔl=B2TB2−1B2TΔu=d¯u since rankB=2. This means that Δl=Bd¯u. So, Δl is in the image space of B. It implies that the uncertainty of system (5) can be described as uncertain input disturbance d¯u.As unknown input disturbanced¯i is applied to the TWIR, system (13) becomes(14)x˙¯=Ax¯+Bu¯+d¯c,where d¯c=d¯u+d¯i. Thus, the compound disturbance d¯c represents both the unknown input disturbance and the model uncertainty. System (14) is a linear model exactly representing the nonlinear system (5). In Section 3.2, the compound disturbance will be estimated.


## 3.2. Compound Disturbance Observer

In this section, an input disturbance observer (a proposal in [29]) is presented and applied for system (14). By using the Euler method, we have an approximate discrete-time model of system (14) as follows:(15)x¯k≈Adx¯k−1+Bdu¯k+d¯kc,where Ad=I+TsA, Bd=TsB, and Ts is the sampling time. A reference model will be used to estimate the disturbance d¯kc as follows:(16)zk=Adz¯k−1+Bdu¯k−d¯^k−1c,where d¯^k−1c is the estimated disturbance at time instance k−1. Then, system (15) with disturbance compensation d¯^k−1c is presented as(17)x¯k≈Adx¯k−1+Bdu¯k+d¯kc−d¯^k−1c,and system (14) with approximated disturbance compensation becomes(18)x˙¯=Ax¯+Bu¯+d¯c−d¯^c.Subtracting equation (16) from equation (17), we get(19)x¯k−zk≈Adx¯k−1−Adz¯k−1+Bdd¯kc.So, there exists a differenceδ¯k in equation (19), which is also the approximation error of equation (15) due to discretization process as follows:(20)δ¯k=x¯k−zk−Adx¯k−1+Adz¯k−1−Bdd¯kc.Define a cost functionJkd¯kc=δ¯kTδ¯k⟶0. Then, an optimal estimate of d¯kc is(21)d¯^kc=BdTBd−1BdTx¯k−zk−Adx¯k−1+Adz¯k−1.Theorem 1.
(see [29]). If system (18) has rankB=2, the measured state x¯k=x¯tk from system (18) is exactly represented by the following discrete-time model:(22)x¯k=Adx¯k−1+Bdu¯k+d¯kc−d¯^k−1c,with Ts being suitably selected, the estimated disturbance (21) will satisfy that(23)d¯^kc=d¯ctk.Proof.
The proof was given in [29]. So, it is skipped here.
For the reference model (16), it is possible to choose z¯k−1=x¯k−1 for ∀k. So, equation (21) becomes(24)d¯^kc=BdTBd−1BdTx¯k−z¯k.
The correct value of the compound disturbance isd¯kc=BdTBd−1BdTx¯k−z¯k−δ¯k. So, the estimation error is(25)d¯^kc−d¯kc=BdTBd−1BdTδ¯k.
However,δ¯k is proportional to Ts2 because of the local truncation error [30]. Thus, the estimation error can be made as small as possible by decreasing the sampling time Ts.
The estimated compound disturbance is used to complement system (14) as in equation (18), where(26)d¯^ct=d¯^k−1c,∀t,kTs≤t<k+1Ts, and ∀k=0,1,…,. Keep in mind that the estimated compound disturbance d¯^ct looks like a series of step functions.
In summary, the compound disturbance observer is implemented as follows:(1)
Initialization: chooseTs>0 is sufficiently small. Assign d¯^0c=0¯. Measure the state of system (5) at time t0=0. Assign z¯0=x¯0.(2)
Perform the following calculations in forward order fork=0,1,…,:(a)
Measure the statex¯k of system (5) at time tk=kTs.(b)
Computez¯k from equation (16) and calculate d¯^kc from equation (24).(c)
Assignz¯k=x¯k, go back to step a.
System (18) is applied to design state feedback and trajectory tracking controllers using the disturbance observer (24) in Section 3.3.


## 3.3. Stability Analysis

In this section, the stability of system (18) with a state feedback controller is analyzed. Some assumptions are given as follows:Assumption 1.d¯ct is continuous ∀t≥0 and d/dtd¯ct is bounded.Assumption 2. There exists a state feedback controlleru¯=−Kx¯ satisfying that the matrix A−BK is Hurwitz (all real part of eigenvalues is negative).Lemma 1.
With assumption 1, system (18) with a state feedback controller K satisfying the assumption 2 is input to state stable (ISS).Proof.
Letγ¯kt=d¯ct−d¯^k−1c for ∀t,kTs≤t<k+1Ts and γ¯kt=0¯ for t∉kTs,k+1Ts. From equations (25) and (26), one gets γ¯kt=d¯ct−d¯^k−1c−BdTBd−1BdTδ¯k−1. Since δ¯k−1 is proportional to Ts2 due to the local truncation error [30], it is bounded. In addition, the compound disturbance and its first derivative are also bounded by assumption 1, and then, γ¯kt is bounded.
Letγ¯t=∑k=0∞γ¯ktwkt, where wkt is a window function with wkt=1 for ∀t, kTs≤t<k+1Ts, and wkt=0 for t∉kTs,k+1Ts. Then, γ¯t is also bounded.
Substitutingγ¯t and the controller u¯=−Kx¯ into equation (18), we obtain(27)x˙¯=A−BKx¯+Bγ¯t.
DenoteA^=A−BK. Since A^ is Hurwitz by assumption 2, for ∀Q>0 and QT=Q, the Lyapunov equation(28)A^TP+PA^=−Q,always has a unique solution P, which is symmetric positive definite. By using a Lyapunov function as follows,(29)Vx¯=x¯TPx¯,one has(30)dVdt=A^x¯+Bγ¯TPx¯+x¯TPA^x¯+Bγ¯=−x¯TQx¯+2x¯TPBγ¯≤−x¯2λmin+2x¯PBγ¯=x¯−x¯+2PBγ¯,where ∗ denotes L∞ norm and λmin is the smallest eigenvalue of the matrix Q.
As long asx¯ lies outside the domain Γ=∀x¯x¯≤2PBγ¯/λmin, V˙<0, thus x¯⟶Γ containing the origin. Hence, system (27) is input to state stable [31]. This means that system (18) is ISS.
In conclusion, the state feedback controller with disturbance observer is(31)u¯t=−Kx¯−d¯^ct,where the gain matrix K can be designed using existing methods in the literature such as LQR control, pole placement method, or even H∞. The proposed controller is simple not only in design but also implementation. In addition, it can cope with model uncertainty and input disturbance of TWIRs. In Section 3.4, we propose a trajectory tracking controller for TWIRs with model uncertainty and input disturbance.


## 3.4. Tracking Control for TWIR

Letx¯dt be the desired trajectory for the TWIR. Define e¯=x¯−x¯d be tracking error of the TWIR. Taking the first derivative of the tracking error and using equation (18), we obtain(32)e˙¯=Ae¯−x˙¯d+Ax¯d+Bu¯+γ¯,where γ¯ is previously defined in the proof of Lemma 1.Theorem 2.
The tracking error holds thatlimt⟶∞e¯t=0¯ under the following control law:(33)u¯tr=−Ke¯−BTB−1BTAx¯d−x˙¯d,where K satisfies the condition that A−BK is Hurwitz.Proof.
Sincex¯d=x¯1d;x¯2d, x˙¯1d=x¯2d. In addittion, the matrices A and B have special forms as in equation (13), so Ax¯d−x˙¯d=0¯3×1;A2x¯d+x˙¯2d; this lies in the image space of B. Thus, Ax¯d−x˙¯d=Bu¯v, where u¯v=BTB−1BTAx¯d−x˙¯d is unique due to rankB=2. So, system (32) can be represented as follows:(34)e˙¯=Ae¯+Bu¯+γ¯+u¯v.
Substituting equation (33) into equation (34), we get(35)e˙¯=A−BKe¯+Bγ¯.
This system is similar to system (27), but the variable e¯ is in place of x¯. Define a Lyapunov function as(36)Ve¯=e¯TPe¯,where P>0. Then,(37)dVdt=−e¯TQe¯+2e¯TPBγ¯≤−e¯2λmin+2e¯PBγ¯=e¯−e¯+2PBγ¯,where Q=−A^TP+PA^, A^=A−BK, and λmin is the minimum eigenvalue of the matrix Q. This means that V˙<0 whenever e¯∉Γ=∀e¯e¯≤2PBγ¯/λmin. Hence, e¯ is bounded.
Take the second derivative ofV to get(38)V¨=−e˙¯TQe¯−e¯TQe˙¯+2e˙¯TPBγ¯+2e¯TPBγ¯˙=−e¯TQee¯−2e¯TQB−A^TPBγ¯+2e¯TPBγ¯˙,where Qe=A^TQ+QA^. Since e¯ is bounded, γ¯ and γ¯˙ are also bounded according to Lemma 1, V¨ is bounded. Using Barbalat’s Lemma, one gets limt⟶∞e¯t=0¯.
In summary, the tracking controller is(39)u¯t=−Ke¯−BTB−1BTAx¯d−x˙¯d−d¯^ct.
For disturbance estimation, equations (16) and (24) will be applied, where BdTBd−1BdT2×6 is a constant matrix, which is previously computed one time. This is also true for computing the matrix BTB−1BT2×6. Thus, the calculation of control signal involves only matrix/vector multiplication and addition, so it is simple to implement. This is an advantage of the proposed method in comparison with other methods in the literature such as works in [6, 20]. In [6], several integral computations involving adaptive laws have to be calculated to obtain control signals, and no input disturbance is mentioned in design process and simulation. In [20], the model linearization and Riccati equation solving are performed to obtain the control gain matrix at every sampling instance, so the computational load is very huge for implementation.


## 4. Numerical Simulation

To illustrate the proposed method, a state feedback controller is designed using LQR method. However, there have been several other methods in the literature for designing the state feedback controller, thus the proposed method is very flexible in design. The linear model (18) is applied to design a LQR controller [32] such that the following cost function is minimum:(40)F=12∫0∞x¯TQcx¯+u¯TRcu¯dt⟶min,where Qc is a symmetric positive definite matrix and Rc is a symmetric nonnegative definite matrix. The controller, which satisfies the cost function (40), is u¯=−Kx¯, where(41)K=Rc−1BTPc,and Pc is the solution to the Riccati equation:(42)PcBRc−1BTPc−PcA−ATPc=Qc.In this paper, the values of the TWIR’s parameters are given as follows:M=0.765kg, m=0.03kg, l=0.1m, d=0.195m, r=0.033m, g=9.81m/s2, and C=0.005 and the sampling time is Ts=0.001. Thus, following matrices are obtained:(43)A2=0−14.500−32.471.0700162.070242.88−8.01000000−5.66,(44)B2=107.159107.159−801.536−801.536−191.648191.648.The matrices of the cost function are chosen asQc=diag4,3,20,3.5,0.001,0.9 and Rc=diag1,1. From equations (41) and (42), the gain matrix of the LQR controller is obtained as follows:(45)K=−0.866−3.676−0.707−1.696−0.597−0.489−0.866−3.6760.707−1.696−0.5970.489.Remark 1.
Since the input to the LQR controller consists of state variable pairsx;x˙, θ;θ˙, and ψ;ψ˙, the LQR output is similar to the sum of the three PD controllers’ output as in works [3, 12, 13], in which each state variable pair is the input to one PD controller.
For performance comparison, four cases are considered as follows:(i)
Case 1: the model is certain, and there is no input disturbance(ii)
Case 2: the model is certain, and there is unknown input disturbance, where(46)d¯i=0.3sint+π/6+0.20.4sin2t+π/4−0.2T.(iii)
Case 3: the model is uncertain, and there is unknown input disturbance, in which the unknown input disturbance is the same as in case 2; the model uncertainty is given as follows:ΔM=1.235, Δm=0.01, Δl=0.1, Δd=0.105, and Δr=0.017.(iv)
Case 4: use the same simulation conditions as Case 3, but the desired trajectory is a circle withψd=0.25t+π/2, θd=0, and xd=1.125t, and the controllers (31) and (39) with the same matrix K are applied.
For the first three cases, setpoints for position, tilt angle, and heading angle are1.5m, 0rad, and 0.4rad, respectively. The initial values for position, tilt angle, and heading angle are 0m, 0.3rad, and 0rad, respectively. The nonlinear model (5) is used to simulate the TWIR and the LQR controller with disturbance observer (31) being applied for these three cases. The disturbances and their estimated disturbances are shown in Figures 2(a), 2(b), 3(a) and 3(b).
It can be seen that for the case 1 the estimated disturbances are nonzero for a short time interval. This is caused by the Taylor approximation errorΔx¯,u¯ in equation (8). For the case 2, it takes a little bit longer time for the estimated disturbances converging to the disturbances in comparison with the case 1. But for the case 3, it takes about 2 seconds for convergence with a small error. The position, tilt angle, and heading angle of robot are shown in Figures 4(a)–4(c). When there is unknown input disturbance, the proposed controller still guarantees the same performance as that in the case 1. This performance is little bit different as both unknown input disturbance and model uncertainty are applied. Thus, the proposed controller maintained well the control performance even though there were model uncertainty and unknown input disturbance. As the LQR controller is used without the compound disturbance observer, the control performance becomes worse than the proposed method, because there are oscillations of position and tilt angle and the divergence of the heading angle from the setpoint (see Case 3 without observer in Figure 4). So, the standard LQR controller fails to control the TWIR in the presence of model uncertainty and input disturbance.
For the fourth case, the nonlinear model (5) is also used to simulate the TWIR, and the tracking controller (39) and the state feedback controller (31) are compared to those in the work in [20]. Simulation results are displayed in Figures 5 and 6. It shows that all the tracking errors by the two proposed methods for position, tilt angle, heading angle, and their derivatives converge to zero quickly, the TWIR follows the desired trajectory closely, and control signals (provided by the tracking controller) are smooth. The tracking controller (39) provides better performance than that of the state feedback controller (30).
In comparison with [20] under the same desired trajectory type (circle, test 3 [20]), the proposed tracking controller (39) is better than the controller in the work [20] in terms of steady-static error and smoothness of control signals, since there was impulse type of control signal and there exists steady-static error of the tilt angle in [20].Figure 2
Left wheel disturbance and its estimation for cases. (a) First short interval. (b) Full simulation time.
(a)(b)Figure 3
Right disturbance and its estimation for cases. (a) First short interval. (b) Full simulation time.
(a)(b)Figure 4
Position, pitch, and yaw angles of TWIR. (a) Position, (b) tilt angle, and (c) heading angle of the robot.
(a)(b)(c)Figure 5
Comparisons onx, x˙, θ, and θ˙. (a) Position error. (b) Error of tilt angle. (c) Error of longitudinal velocity. (d) Velocity error of pendulum.
(a)(b)(c)(d)Figure 6
Comparisons on trajectory, control signals,ψ, and ψ˙. (a) Trajectories. (b) Error of yaw angle. (c) Control signals of the tracking controller. (d) Error of yaw angular velocity.
(a)(b)(c)(d)


## 5. Conclusions and Future Works

In this work, the state feedback controller with compound disturbance observer (31) and the trajectory tracking controller with compound disturbance observer (39) were proposed for TWIRs with model uncertainty and unknown input disturbance, and the stability of the closed-loop control system with the proposed controller was also proved. The proposed controllers have advantages of simplicity in implementation and flexibility in design for the feedback gain matrix.Numerical simulations were taken to illustrate the proposed methods and compare with the existing method in [20] and the classical LQR controller. The results show that the control performance was well maintained under model uncertainty and unknown input disturbance by using the proposed control methods, whereas the control performance becomes worse as the classical LQR controller was applied. The proposed tracking controller (39) provided better performance than the controller in [20] for the circular trajectory type, the state feedback controller (31), and also the LQR controller.Future works focus on controller design methods for the exact linear model of TWIR (14) using different techniques and other existing observers and the further extension to other systems in the Lagrangian form.



---

*Source: 7205737-2020-07-04.xml*