# Design Low-Order Robust Controller for Self-Balancing Two-Wheel Vehicle

Authors: Ngoc Kien Vu; Hong Quang Nguyen
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

When there is no driver, balancing the two-wheel vehicle is a challenging but fascinating problem. There are various solutions for maintaining the balance of a two-wheel vehicle. This article presents a solution for balancing a two-wheel vehicle using a flywheel according to the inverted pendulum principle. Since uncertainties influence the actual operating environment of the vehicle, we have designed a robust controller RH∞ to maintain the vehicle equilibrium. Robust controllers often have a high order that can affect the actual control performance; therefore, order reduction algorithms are proposed. Using Matlab/Simulink, we compared the performance of the control system with different reduced-order controllers to choose a suitable low-order controller. Finally, experimental results using a low-order robust controller show that the vehicle balances steadily in different scenarios: no-load, variable load, stationary, and moving.


---

## Body

## 1. Introduction

Bicycles have appeared in the world for centuries as a popular means of transport. Two-wheel vehicles (including bicycles, motorbikes, and electric bicycles) have the advantage of low fuel consumption, fast acceleration, flexibility, narrow parking space, low cost, and being particularly suitable for limited road conditions in large cities. The most significant limitation of two-wheel vehicles is not being able to balance themselves like a car. Driving two-wheel vehicles is not as comfortable as driving a car. Besides, when colliding with another vehicle, the standard two-wheel vehicle will fall and cause injury to the driver. Therefore, the need to develop a two-wheeled vehicle that can balance itself both when stationary, in motion, and in a collision, creating comfort for the driver like when driving a car, is essential. If well designed, the self-balancing two-wheel vehicle will only drop off in the collision and remain vertical thanks to the self-balancing system mounted on it, ensuring the user’s safety. However, the problematic issue is how to control the system so that the system can balance itself under different working conditions, and the load carried can be changed simultaneously. Because the attractiveness of self-balancing two-wheel vehicles comes from theoretical and practical problems, research on self-balancing two-wheel vehicles has attracted the attention of many scientists and manufacturing companies.In Vietnam today, two-wheel vehicles are still used more widely than cars. Therefore, the development of self-balancing two-wheel vehicles is essential and suitable for the traffic situation of Vietnam. This article builds a model to study and experimentally control the balance of the self-balancing two-wheel vehicle. This study will contribute to determining an appropriate model and algorithm for maintaining the balance of two-wheeled vehicles and then apply them into practice.To be able to control the vehicle’s balance, we must understand its dynamics. The bicycle model is nonintuitive and strongly depends on the speed [1]. When the vehicle is not in motion, it is an unstable model like an inverted pendulum [1]. However, when the vehicle is in constant motion under certain conditions, it can be stable [1]. In [1], the authors mention that two-wheel vehicles can be described by various models with different complexity from the second-order linear model to fourth-order linear and nonlinear models. There are multiple methods to solve a two-wheel vehicle’s balance problem without a driver, divided into two groups: with and without a stabilizer.With the group without a stabilizer [2–6], to maintain the equilibrium state of the vehicle, the control system controls the vehicle’s steering angle using an electric motor. This method is built on the nature of the bicycle when there is a driver. When the bicycle moves in the direction of control, it will generate a centrifugal force to maintain the equilibrium. Therefore, this method is very difficult to maintain the equilibrium when the vehicle is stationary.With the method group with stabilizers, there are many solutions to design stabilizers to maintain vehicle equilibrium. In studies [7–14], the flywheel was energized by allowing it to rotate at high speed, and the control system controls the flywheel’s tilt angle to generate force according to the principle of the gyroscope to maintain vehicle balance. The more the flywheel number, the faster the flywheel rotation speed, the greater the accumulated energy of the flywheel, and the better balance the vehicle. However, the number of flywheels used is usually one flywheel in [7–11] or two flywheels as in [12–14]. The advantage of this approach is that it responds quickly; the force to maintain the balance is significant, but the downside is that the flywheel rotates at high speed, so it dissipates a massive amount of energy.In [15], the author added weight to the vehicle model and changed the position of the weight to change the vehicle’s center of gravity to maintain equilibrium. The advantage of this method is that it is possible to keep the vehicle’s balance when the vehicle is stationary and when the vehicle is in motion. However, to ensure a large balance force, the added weight is also large, leading to an increase in the size and weight of the vehicle, and the response of the system is often slow.To overcome the disadvantage of the study in [15], the studies in [16, 17] suggested using flywheel-type weights to change the CoG. Accordingly, a flywheel will be installed on the vehicle. The flywheel structure can be altered to change its CoG, thereby changing the CoG of the vehicle.The stabilizer using flywheel according to the principle of an inverted pendulum is proposed in [18–23]. In this method, the rotation direction of the flywheel will be changed to create a force that balances the gravity of the vehicle to maintain the equilibrium state. The advantage of this method is that the flywheel usually rotates at a low speed, so it dissipates less energy, and the response of the system is fast. The disadvantage of this method is that the balancing force is not large, so the vehicle can only balance within a small angle range.We see that each group has its advantages and disadvantages. Some studies are looking to combine these methods, as specific as combining steering angle control with changing the CoG [24]. Through analysis of two-wheel vehicle balance control solutions, this article chooses the technique using a flywheel to build a self-balancing two-wheel vehicle.To control the self-balancing two-wheel vehicle according to the inverted pendulum principle, there are various methods such as PD [20], PID [17–19], LQG and MPC [21], SMC [25–27], and robust control [11, 28–38]. However, when a two-wheel vehicle works in reality, it will suffer many uncertain effects such as load, noise, and external force. Therefore, the two-wheel vehicle model can be considered as an uncertain object [10]. To control unstable objects, there are many different algorithms, of which the most used algorithm is sliding-mode control (SMC) [25–27] and robust control algorithm [11, 28–38]. Key features of the SMC are its ability to resist parameter uncertainty, a fast response rate, no sensitivity to bounded external disturbances, and simple design computation. The SMC control algorithm has been proven to control the balance of two-wheel vehicles according to the inverted pendulum model in [25]. SMC was improved and converted to NFTSM (nonsingular fast terminal sliding-mode control) in [26] to better meet the requirements of robust control under the presence of uncertainties and disturbances. Robust finite-time composite nonlinear feedback control can be used to control uncertainties, as shown in [27].The robust optimal control algorithm RH¥ [11, 28–38] is designed to shape the system’s response to achieve the desired behavior and maintain this behavior from model parameter variation or disturbances. However, to ensure the two above functions, the robust optimal controller H¥ is often high. The high-order controller can make the controller’s calculation time longer, hence the response speed of the controller slower, reducing the practical applicability of the controller. Therefore, the design of a low-order robust controller is a very concerning issue in robust control. To design a robust low-order controller, there are usually two basic solutions. In Solution 1, a low-order control structure with unknown parameters is selected; then, based on the robust optimization controller design criteria, these parameters are determined [11]. In Solution 2, a high-order stable controller is designed; then, the model order reduction algorithm is applied to reduce the controller [34, 38]. To implement Solution 1, we need to solve two problems simultaneously, namely, the controller design problem that satisfies the robust optimization criteria and the problem of finding controller parameters. The complexity of Solution 1 is high, and the problem of finding parameters can be inexhaustible if the selected controller structure is not suitable. In contrast, Solution 2 usually finds a low-order controller in all cases.This article designs a low-order robust controller for the self-balancing vehicle control system according to Solution 2. After designing a robust controller, we propose using order reduction algorithms to reduce the order of the controller. The purpose of reducing the order of the controller is to make the control program code simpler and straightforward to practical applications while the system still meets the requirements of robust stability.The rest of the article is structured as follows. The dynamics and mathematical model of the two-wheel vehicle are described in Section2. Section 3 introduces steps to design a robust controller for an uncertain object and then a two-wheel vehicle. Section 4 presents the order reduction of a high-order controller and the simulation and testing of a balanced control system using a low-order controller. Finally, the conclusion is given in Section 5.


## 2. Dynamics and Mathematical Model of Self-Balancing Two-Wheel Vehicle

### 2.1. Dynamic of Self-Balancing Two-Wheel Vehicle

The self-balancing two-wheel vehicle, built at the Thai Nguyen University of Technology, is used as the model to verify control algorithms’ performance. The vehicle is designed on a children’s bicycle, as shown in Figure1. It is designed to move forward or backward, carry loads, and change loads without falling over.Figure 1
The self-balancing two-wheel vehicle.The self-balancing vehicle is made up of the following components: a flywheel with a diameter of 0.26 m and a weight of 3,796 kg is used to generate torque; DC motor, 15 V, 100 w, and 3400 rpm, is used to rotate the flywheel around its shaft; a DC motor is used to control the vehicle forwards or backward; H-bridge circuit is used to control the DC motor; a 5 VDC 100-pulse Sharp Encoder is used to measure flywheel speed; a sensor GY-521 MPU-6050 is used to measure the tilt angle of the vehicle. The dimensions of the vehicle are as follows: 1.19 m long, 0.5 m high, and 0.4 m wide.The two-wheel vehicle’s balance system is built based on the inverted pendulum principle. When the motor spins the flywheel around its axis with a certain acceleration, a torque is generated, acting on the vehicle to keep the vehicle balanced.The balance control system configuration of the vehicle is shown in Figure2. The control program of the self-balancing two-wheel vehicle is loaded into an Adruino Uno to control the balance of the two-wheel vehicle.Figure 2
The control structure of the self-balancing two-wheel vehicle.


### 2.2. Modeling of Self-Balancing Two-Wheel Vehicle

To build the dynamic model, we make the following assumptions: all vehicle components form a rigid bond with a degree of freedom (DOF) orbiting theZ-axis. The flywheel is firmly attached to the vehicle, and the center of gravity (CoG) is fixed to the chassis. The simplified model of the vehicle is shown in Figure 3, where F is the center of the flywheel and B is the center of the vehicle. The tilt angle of the vehicle around the Z-axis is defined as α , the rotation angle of the flywheel is defined as δ.Figure 3
Dynamic model of the self-balancing two-wheel vehicle.The dynamic model of the two-wheel vehicle is shown in Figure3.Since the center of the flywheel is not moving relative to the CoG of the vehicle, the absolute speed at points F and B is given as follows:(1)υB=hbα˙,υF=hfα˙,where hb is the height of the vehicle’s CoG (without the flywheel) and hf is height of the flywheel’s CoG.SetTb as the kinetic energy of the two-wheel vehicle and Tf as the kinetic energy of the flywheel. We have Tb and Tf calculated as follows:(2)Tb=12mbvB2+12Ibα˙2,Tf=12mfvF2+12Ifα˙+δ˙2,where mb is the weight of the vehicle including the motors, mf is the weight of the flywheel, Ib is the moment of inertia of the vehicle, and If is the moment of inertia of the flywheel.The total kinetic energy of the system is given by the following:T=Tb+Tf, where(3)T=12mbvB2+12mfvF2+12Ibα˙2+12Ifα˙2+12Ifδ˙2+Ifα˙δ˙,(4)T=12mbhb2+mfhf2+Ib+Ifα˙2+12Ifδ˙2+Ifα˙δ˙.DefiningV as the total energy of the system, we have the following:(5)V=g.cosα.mbhb+mfhf.To describe the dynamics of the two-wheel model, we use the Lagrange equation [8] as follows:(6)ddt∂T∂q˙i−∂T∂qi+∂V∂qi=Qi,where Qi is the external force and qi is the general coordinate system.Forqi=α, applying (3)–(6), we have the following:(7)mbhb2+mfhf2+Ib+Ifα¨+Ifδ¨−g.sinα.mbhb+mfhf=0.Forqi=δ, applying (3)–(6), we have the following:(8)Ifα¨+Ifδ¨=Cm,where Cm is the torque of the DC motor shaft attached to the flywheel by a shaft coupling with a gear ratio k:1, determined by the following formula:(9)Cm=kTmi=kTmU−Teδ˙R,where R is the resistance of the motor; Tm is the torque constant; Te is the electromotive force constant of the motor.Applying (9) into (8), we have(10)Ifα¨+Ifδ¨=kTmU−Teδ˙R.The set of equations for the vehicle kinematic is (7) and (10). We see that these equations are nonlinear.By linearizing (7) around the equilibrium point (α=δ=0,sinα=α) assuming that the tilt angle of the vehicle when operating is tiny (α≤100), we obtain(11)mbhb2+mfhf2+Ib+Ifα¨+Ifδ¨−g.α.mbhb+mfhf=0.SetE=mbhb2+mfhf2+Ib+If, F=mbhb+mfhf.Definex=α=x1α˙=x2δ˙=x3 to be the state variable, y=α,u=UCombining (10) and (11), we obtain a set of equations describing vehicle states as follows:(12)x˙=Ax+Bu,y=Cx+Du,with the following system parameters:(13)A=010FgE−If0kTmTeRE−If−FgE−If0−kTmTeEIfRE−If,B=0kTmRE−If−kRmEIfRE−If,C=100,D=0.


## 2.1. Dynamic of Self-Balancing Two-Wheel Vehicle

The self-balancing two-wheel vehicle, built at the Thai Nguyen University of Technology, is used as the model to verify control algorithms’ performance. The vehicle is designed on a children’s bicycle, as shown in Figure1. It is designed to move forward or backward, carry loads, and change loads without falling over.Figure 1
The self-balancing two-wheel vehicle.The self-balancing vehicle is made up of the following components: a flywheel with a diameter of 0.26 m and a weight of 3,796 kg is used to generate torque; DC motor, 15 V, 100 w, and 3400 rpm, is used to rotate the flywheel around its shaft; a DC motor is used to control the vehicle forwards or backward; H-bridge circuit is used to control the DC motor; a 5 VDC 100-pulse Sharp Encoder is used to measure flywheel speed; a sensor GY-521 MPU-6050 is used to measure the tilt angle of the vehicle. The dimensions of the vehicle are as follows: 1.19 m long, 0.5 m high, and 0.4 m wide.The two-wheel vehicle’s balance system is built based on the inverted pendulum principle. When the motor spins the flywheel around its axis with a certain acceleration, a torque is generated, acting on the vehicle to keep the vehicle balanced.The balance control system configuration of the vehicle is shown in Figure2. The control program of the self-balancing two-wheel vehicle is loaded into an Adruino Uno to control the balance of the two-wheel vehicle.Figure 2
The control structure of the self-balancing two-wheel vehicle.


## 2.2. Modeling of Self-Balancing Two-Wheel Vehicle

To build the dynamic model, we make the following assumptions: all vehicle components form a rigid bond with a degree of freedom (DOF) orbiting theZ-axis. The flywheel is firmly attached to the vehicle, and the center of gravity (CoG) is fixed to the chassis. The simplified model of the vehicle is shown in Figure 3, where F is the center of the flywheel and B is the center of the vehicle. The tilt angle of the vehicle around the Z-axis is defined as α , the rotation angle of the flywheel is defined as δ.Figure 3
Dynamic model of the self-balancing two-wheel vehicle.The dynamic model of the two-wheel vehicle is shown in Figure3.Since the center of the flywheel is not moving relative to the CoG of the vehicle, the absolute speed at points F and B is given as follows:(1)υB=hbα˙,υF=hfα˙,where hb is the height of the vehicle’s CoG (without the flywheel) and hf is height of the flywheel’s CoG.SetTb as the kinetic energy of the two-wheel vehicle and Tf as the kinetic energy of the flywheel. We have Tb and Tf calculated as follows:(2)Tb=12mbvB2+12Ibα˙2,Tf=12mfvF2+12Ifα˙+δ˙2,where mb is the weight of the vehicle including the motors, mf is the weight of the flywheel, Ib is the moment of inertia of the vehicle, and If is the moment of inertia of the flywheel.The total kinetic energy of the system is given by the following:T=Tb+Tf, where(3)T=12mbvB2+12mfvF2+12Ibα˙2+12Ifα˙2+12Ifδ˙2+Ifα˙δ˙,(4)T=12mbhb2+mfhf2+Ib+Ifα˙2+12Ifδ˙2+Ifα˙δ˙.DefiningV as the total energy of the system, we have the following:(5)V=g.cosα.mbhb+mfhf.To describe the dynamics of the two-wheel model, we use the Lagrange equation [8] as follows:(6)ddt∂T∂q˙i−∂T∂qi+∂V∂qi=Qi,where Qi is the external force and qi is the general coordinate system.Forqi=α, applying (3)–(6), we have the following:(7)mbhb2+mfhf2+Ib+Ifα¨+Ifδ¨−g.sinα.mbhb+mfhf=0.Forqi=δ, applying (3)–(6), we have the following:(8)Ifα¨+Ifδ¨=Cm,where Cm is the torque of the DC motor shaft attached to the flywheel by a shaft coupling with a gear ratio k:1, determined by the following formula:(9)Cm=kTmi=kTmU−Teδ˙R,where R is the resistance of the motor; Tm is the torque constant; Te is the electromotive force constant of the motor.Applying (9) into (8), we have(10)Ifα¨+Ifδ¨=kTmU−Teδ˙R.The set of equations for the vehicle kinematic is (7) and (10). We see that these equations are nonlinear.By linearizing (7) around the equilibrium point (α=δ=0,sinα=α) assuming that the tilt angle of the vehicle when operating is tiny (α≤100), we obtain(11)mbhb2+mfhf2+Ib+Ifα¨+Ifδ¨−g.α.mbhb+mfhf=0.SetE=mbhb2+mfhf2+Ib+If, F=mbhb+mfhf.Definex=α=x1α˙=x2δ˙=x3 to be the state variable, y=α,u=UCombining (10) and (11), we obtain a set of equations describing vehicle states as follows:(12)x˙=Ax+Bu,y=Cx+Du,with the following system parameters:(13)A=010FgE−If0kTmTeRE−If−FgE−If0−kTmTeEIfRE−If,B=0kTmRE−If−kRmEIfRE−If,C=100,D=0.


## 3. Design of Robust Control for the Self-Balancing Two-Wheel Vehicle

### 3.1. Design Optimal RH∞ for Uncertain Object

Consider a SISO control system according to the structure diagram shown in Figure4, where Ss is the model of control object, Rs is cotroller, p is the unwanted signal acting on the system, and z is the unwanted output.Figure 4
Structure diagram of RH∞ robust control system.The design of RH∞ controller consists of two steps:Step 1.
Define the set of all the controllers that make the closed system fromw to y stable. This set is denoted by R˜s.Step 2.
Find specific elementRs in set R˜s such that it has the smallest sensitivity to model error and noise and the smallest Gp⟶zs∞.


#### 3.1.1. Determine SetR˜s of Controllers to Make the SISO System Stable

(a) CaseSs is stable. Consider the system containing SISO stages with the structure shown in Figure 4, assuming object Ss is stable or Ss∈RH∞. The objective is to determine set R˜s, including all controllers, to stabilize the system. Define the following:(14)Qs=R1+RS⇒Rs=Q1−QS,With the above controller, the transfer function of the closed system Gwys, i.e., the transfer function between the input signal wtand the output signal yt, is(15)Gwys=S1+SR=1−SQS.Thus, if functionQs is stable that means Qs∈RH∞ and Gwys is also a stable function; i.e., the closed system is robustly stable with the output noise. Accordingly, if the closed system has a stable object Ss∈RH∞, all controllers Rs determined by (14) would make the closed system stable and robust with noise. In other words, set Rs, including all the controllers that stabilize the system, has the following Q-dependent form:(16)R˜s=Rs=Q1−QS|Q∈RH∞.(b) CaseSs is unstable.When(17)Ss=BsAs=b0+b1s+…+bmsma0+a1s+…+ansnwithm≤n,is unstable, it means that Ss∉RH∞ or As is not a Hurwitz polynomial. We can always convert Ss back to case (a) described above by converting(18)Ss=NsMswithN,M∈RH∞.That is, S will be the real function-rational, with both Ns and Ms being stable functions. Indeed, we divide both Bsand As of (17) by some Hurwitz polynomial Cs:(19)Cs=c0+c1s+…+c1sl,n≤l.We will get two stable functions:(20)Ns=BsCsandMs=AsCs.Assume the controllerRs has the following structure:(21)Rs=UsVswithU,V∈RH∞.The transfer functionGwys of the closed system, describing the relationship between the input signal wt and the output signal yt, is as follows:(22)Gwys=S1+SR=NVNU+MV.Obviously, if there is a Bezout similarity relation,(23)NU+MV=1,then Gwys is a stable function; i.e., the closed system is robustly stable.Thus, the problem of determining the controller (21) to make the system stable is only finding U,V∈RH∞to satisfy (23).However, the Bezout equation (23) has infinite solutions because once there is one solution,(24)NU+MV=1,then all functions(25)U=X+MQ,V=Y−NQ,with all parameters Q∈RH∞ will also be its solution. Therefore, if the object has the following transfer function,(26)Ss=NsMs,with M,N∈RH∞, set R˜s including all controllers that make the closed system stable would have the following structure:(27)R˜s=Rs=X+MQY−NQ|X,Y,Q∈RH∞vàNX+MY=1.To findR˜s, it usually follows the Youla parameterization method [37, 38].


#### 3.1.2. FindRs in R˜s So That the System Has the Smallest Sensitivity

(a)
Determine the sensitivity function with respect to the model error.For a simplicity purpose, we consider the closed system in Figure4. The closed-loop transfer function of the system is given by the following:(28)Gwys=SR1+SR.Because the object contains deviationsΔS, there is also a corresponding deviation ΔG in the closed system transfer function. It represents the performance deviation caused by ΔS. The sensitivity function representing the effect of ΔS on system performance is defined as follows:(29)Ks=limΔS⟶0ΔG/GΔS/S=dGdS.SG=11+SR.The next control objective is to determineR∗s∈Rs that has the potential to minimize the sensitivity, i.e.,(30)Ks∞=11+Ss.Rs∞⟶min.(b)
Convert the optimization problem (30) into a model equilibrium problem.Substituting (18) and (27) into (30), we get the following:(31)Ks=11+Rs.Ss=MY−NQMMY−NQM+NX+NMQ=MY−NQMMY+NX=T−UQ,T=YM,U=NM.Then, the optimization problem (30) becomes the following:(32)Q∗=argminQ∈RH∞T−UQ∞,where T,U∈RH∞ are known.(c)
Find the optimal problem solution (32) for the SISO system.Consider the special caseT,U∈RH∞, where Us has a unique zero s0, on the right side of the imaginary axis (including s0=∞).According to the definition of the infinity norm, we have the following:(33)T−UQ∞=supRes>0T−UQ≥Ts0−Us0Qs0=Ts0.Besides, forQ=Ts−Ts0/Us (∗), we have T−UQ=Ts0,Q in (∗) has poles including all poles of T and the remaining zeros (except s0). That’s why Q is a robust function, or Q∈RH∞.Therefore, ifTs−Ts0/Us is valid, then Q=Ts−Ts0/Us is the solution of the optimization problem (32). Consequently,(34)R∗=XU−MTs−Ts0YU−NTs−Ts0,where:(35)S=NM,X,Y,Q,N,M∈RH∞and NX+MY=1.Expanding the above particular case to the problem withUs having m zeros, s1,s2…,sm, on the right side of the imaginary axis, we will apply the Nevanlinna–Pick interpolation formula to transform the problem into a form with only m−1 zeros, s1,s2…,sm−1, on the right side of the imaginary axis. Then, we apply Nevanlinna–Pick again and again until the problem has only a unique zero s1 , on the right of the imaginary axis. In this last case, we will obtain the solution R∗ calculated by (34).


### 3.2. Design of Robust Control for Self-Balancing Two-Wheel Vehicle

Parameters of the self-balancing two-wheel vehicle are given in Table1. By substitution of these parameters into equation (10), the nominal transfer function of the balancing system of vehicle is described as follows:(36)Ws=αsUs=−0.223ss3+0.1284s2−47.2s−5.589,where U is the voltage applied to the DC motor to rotate the flywheel and α is the tilt angle of the vehicle.Table 1
Parameters of the self-balancing two-wheel vehicle.
ParametersValueUnitIb0,1105Kg.m2hb0,105mIf0,03289Kg.m2hf0,205mmb10,024Kgmf3,976KgTe0,045V.s/RadTm0,045Nm/AR0,52Ωk1 : 1g9,81m/s2The actual operation of self-balancing two-wheel vehicle shows that a change in the vehicle’s load will lead to a change in the vehicle’s CoG. Besides, external force and uncertain noise due to changes in the vehicle’s terrain are uncertain factors affecting the vehicle. These uncertainties alter the self-balancing two-wheel vehicle model, so we can consider the two-wheel vehicle model as an uncertain object. Among the uncertainties affecting the vehicle, we mainly concern about the load variation. Specifically, consider the following cases.Case 1.
When load is 1.8 kg, the height of the CoG of the vehiclehb=0.13m is the transfer function of the vehicle model as follows:(37)W1s=αsUs=−0.1527ss3+0.1253s2−40.72s−4.821.Case 2.
When the load is 2.9 kg, the height of the CoG of the vehiclehb=0.16m is the transfer function of the vehicle model as follows:(38)W2s=αsUs=−0.3735ss3+0.1352s2−61.37s−7.352.Case 3.
When the load is 5 kg, the height of the CoG of the vehiclehb=0.05m is the transfer function of the vehicle model as follows:(39)W3s=αsUs=−0.3573ss3+0.1345s2−63.44s−7.511.Case 4.
When the load is 10 kg, the height of the CoG of the vehiclehb=0.12m is the transfer function of the vehicle model as follows:(40)W4s=αsUs=−0.1774ss3+0.1264s2−64.72s−7.663.
The Bode plots of two-wheel vehicle models with different loads are shown in Figure5.
As shown in Figure5, uncertainties can reduce the accuracy of the mathematical model, leading to a decrease in the control performance and even making the system unstable. Due to uncertainty in the two-wheel vehicle model, robust control [11, 34] is the most suitable control algorithm to control the balance of the two-wheel vehicle model among proposed control algorithms, including PD [20], PID [17–19], LQG and MPC [21], and SMC [25–27].
The robust control of a two-wheel vehicle is designed according to the structure diagram given in Figure6.
Designing the robust controller for the self-balancing two-wheel vehicle according to the procedure presented in Section3 [35, 36], we obtain the following controller:(41)Rs=AsBs,where(42)As=−1.01s15−37.98s14−646s13−6580s12−4.486.104s11−2.169.105s10−7.7.105s9−2.051.106s8−4.147.106s7−6.393.106s6−7.46.106s5−6.453.106s4−3.951.106s3−1.566.106s2−3.338.105s−2.302.104,Bs=2.23.10−5s15+0.00525s14+0.1697s13+2.401s12+18.97s11+92.73s10+292.1s9+589.7s8+707.1s7+346.7s6−241s5−436.9s4−203s3−18.37s2.
Applying Matlab/Simulink to simulate the two-wheeled vehicle balance control system using the 15th-order controller, we obtained the results shown in Figures 7 and 8.
When the two-wheel vehicle loads the different circumstances, we obtained the results shown in Figure9 as follows.
(∗) Comment: Figures 8 and 9 show that the 15th-order robust controller is capable of maintaining a stable balance of the two-wheel vehicle when the model parameters change. However, using a 15th-order controller to control a two-wheel vehicle results in a complex control program code, which can affect the actual control system’s response speed and hence make the system unstable. Therefore, we seek to reduce the order of the 15th-order controller to simplify the control program code and ensure that the real-time control system always maintains a stable balance.Figure 5
Bode plot of the self-balancing two-wheel vehicle mode with different loads.Figure 6
Structure of the robust control sytem for a two-wheel vehicle.Figure 7
Two-wheel vehicle model in Matlab/Simulink.Figure 8
Tilt angle response of the control system with initial angle2π/180rad.Figure 9
Tilt angle response of the control system when the two-wheel vehicle loads the different circumstances with the initially tilt angle2π/180rad.


## 3.1. Design Optimal RH∞ for Uncertain Object

Consider a SISO control system according to the structure diagram shown in Figure4, where Ss is the model of control object, Rs is cotroller, p is the unwanted signal acting on the system, and z is the unwanted output.Figure 4
Structure diagram of RH∞ robust control system.The design of RH∞ controller consists of two steps:Step 1.
Define the set of all the controllers that make the closed system fromw to y stable. This set is denoted by R˜s.Step 2.
Find specific elementRs in set R˜s such that it has the smallest sensitivity to model error and noise and the smallest Gp⟶zs∞.


### 3.1.1. Determine SetR˜s of Controllers to Make the SISO System Stable

(a) CaseSs is stable. Consider the system containing SISO stages with the structure shown in Figure 4, assuming object Ss is stable or Ss∈RH∞. The objective is to determine set R˜s, including all controllers, to stabilize the system. Define the following:(14)Qs=R1+RS⇒Rs=Q1−QS,With the above controller, the transfer function of the closed system Gwys, i.e., the transfer function between the input signal wtand the output signal yt, is(15)Gwys=S1+SR=1−SQS.Thus, if functionQs is stable that means Qs∈RH∞ and Gwys is also a stable function; i.e., the closed system is robustly stable with the output noise. Accordingly, if the closed system has a stable object Ss∈RH∞, all controllers Rs determined by (14) would make the closed system stable and robust with noise. In other words, set Rs, including all the controllers that stabilize the system, has the following Q-dependent form:(16)R˜s=Rs=Q1−QS|Q∈RH∞.(b) CaseSs is unstable.When(17)Ss=BsAs=b0+b1s+…+bmsma0+a1s+…+ansnwithm≤n,is unstable, it means that Ss∉RH∞ or As is not a Hurwitz polynomial. We can always convert Ss back to case (a) described above by converting(18)Ss=NsMswithN,M∈RH∞.That is, S will be the real function-rational, with both Ns and Ms being stable functions. Indeed, we divide both Bsand As of (17) by some Hurwitz polynomial Cs:(19)Cs=c0+c1s+…+c1sl,n≤l.We will get two stable functions:(20)Ns=BsCsandMs=AsCs.Assume the controllerRs has the following structure:(21)Rs=UsVswithU,V∈RH∞.The transfer functionGwys of the closed system, describing the relationship between the input signal wt and the output signal yt, is as follows:(22)Gwys=S1+SR=NVNU+MV.Obviously, if there is a Bezout similarity relation,(23)NU+MV=1,then Gwys is a stable function; i.e., the closed system is robustly stable.Thus, the problem of determining the controller (21) to make the system stable is only finding U,V∈RH∞to satisfy (23).However, the Bezout equation (23) has infinite solutions because once there is one solution,(24)NU+MV=1,then all functions(25)U=X+MQ,V=Y−NQ,with all parameters Q∈RH∞ will also be its solution. Therefore, if the object has the following transfer function,(26)Ss=NsMs,with M,N∈RH∞, set R˜s including all controllers that make the closed system stable would have the following structure:(27)R˜s=Rs=X+MQY−NQ|X,Y,Q∈RH∞vàNX+MY=1.To findR˜s, it usually follows the Youla parameterization method [37, 38].


### 3.1.2. FindRs in R˜s So That the System Has the Smallest Sensitivity

(a)
Determine the sensitivity function with respect to the model error.For a simplicity purpose, we consider the closed system in Figure4. The closed-loop transfer function of the system is given by the following:(28)Gwys=SR1+SR.Because the object contains deviationsΔS, there is also a corresponding deviation ΔG in the closed system transfer function. It represents the performance deviation caused by ΔS. The sensitivity function representing the effect of ΔS on system performance is defined as follows:(29)Ks=limΔS⟶0ΔG/GΔS/S=dGdS.SG=11+SR.The next control objective is to determineR∗s∈Rs that has the potential to minimize the sensitivity, i.e.,(30)Ks∞=11+Ss.Rs∞⟶min.(b)
Convert the optimization problem (30) into a model equilibrium problem.Substituting (18) and (27) into (30), we get the following:(31)Ks=11+Rs.Ss=MY−NQMMY−NQM+NX+NMQ=MY−NQMMY+NX=T−UQ,T=YM,U=NM.Then, the optimization problem (30) becomes the following:(32)Q∗=argminQ∈RH∞T−UQ∞,where T,U∈RH∞ are known.(c)
Find the optimal problem solution (32) for the SISO system.Consider the special caseT,U∈RH∞, where Us has a unique zero s0, on the right side of the imaginary axis (including s0=∞).According to the definition of the infinity norm, we have the following:(33)T−UQ∞=supRes>0T−UQ≥Ts0−Us0Qs0=Ts0.Besides, forQ=Ts−Ts0/Us (∗), we have T−UQ=Ts0,Q in (∗) has poles including all poles of T and the remaining zeros (except s0). That’s why Q is a robust function, or Q∈RH∞.Therefore, ifTs−Ts0/Us is valid, then Q=Ts−Ts0/Us is the solution of the optimization problem (32). Consequently,(34)R∗=XU−MTs−Ts0YU−NTs−Ts0,where:(35)S=NM,X,Y,Q,N,M∈RH∞and NX+MY=1.Expanding the above particular case to the problem withUs having m zeros, s1,s2…,sm, on the right side of the imaginary axis, we will apply the Nevanlinna–Pick interpolation formula to transform the problem into a form with only m−1 zeros, s1,s2…,sm−1, on the right side of the imaginary axis. Then, we apply Nevanlinna–Pick again and again until the problem has only a unique zero s1 , on the right of the imaginary axis. In this last case, we will obtain the solution R∗ calculated by (34).


## 3.1.1. Determine SetR˜s of Controllers to Make the SISO System Stable

(a) CaseSs is stable. Consider the system containing SISO stages with the structure shown in Figure 4, assuming object Ss is stable or Ss∈RH∞. The objective is to determine set R˜s, including all controllers, to stabilize the system. Define the following:(14)Qs=R1+RS⇒Rs=Q1−QS,With the above controller, the transfer function of the closed system Gwys, i.e., the transfer function between the input signal wtand the output signal yt, is(15)Gwys=S1+SR=1−SQS.Thus, if functionQs is stable that means Qs∈RH∞ and Gwys is also a stable function; i.e., the closed system is robustly stable with the output noise. Accordingly, if the closed system has a stable object Ss∈RH∞, all controllers Rs determined by (14) would make the closed system stable and robust with noise. In other words, set Rs, including all the controllers that stabilize the system, has the following Q-dependent form:(16)R˜s=Rs=Q1−QS|Q∈RH∞.(b) CaseSs is unstable.When(17)Ss=BsAs=b0+b1s+…+bmsma0+a1s+…+ansnwithm≤n,is unstable, it means that Ss∉RH∞ or As is not a Hurwitz polynomial. We can always convert Ss back to case (a) described above by converting(18)Ss=NsMswithN,M∈RH∞.That is, S will be the real function-rational, with both Ns and Ms being stable functions. Indeed, we divide both Bsand As of (17) by some Hurwitz polynomial Cs:(19)Cs=c0+c1s+…+c1sl,n≤l.We will get two stable functions:(20)Ns=BsCsandMs=AsCs.Assume the controllerRs has the following structure:(21)Rs=UsVswithU,V∈RH∞.The transfer functionGwys of the closed system, describing the relationship between the input signal wt and the output signal yt, is as follows:(22)Gwys=S1+SR=NVNU+MV.Obviously, if there is a Bezout similarity relation,(23)NU+MV=1,then Gwys is a stable function; i.e., the closed system is robustly stable.Thus, the problem of determining the controller (21) to make the system stable is only finding U,V∈RH∞to satisfy (23).However, the Bezout equation (23) has infinite solutions because once there is one solution,(24)NU+MV=1,then all functions(25)U=X+MQ,V=Y−NQ,with all parameters Q∈RH∞ will also be its solution. Therefore, if the object has the following transfer function,(26)Ss=NsMs,with M,N∈RH∞, set R˜s including all controllers that make the closed system stable would have the following structure:(27)R˜s=Rs=X+MQY−NQ|X,Y,Q∈RH∞vàNX+MY=1.To findR˜s, it usually follows the Youla parameterization method [37, 38].


## 3.1.2. FindRs in R˜s So That the System Has the Smallest Sensitivity

(a)
Determine the sensitivity function with respect to the model error.For a simplicity purpose, we consider the closed system in Figure4. The closed-loop transfer function of the system is given by the following:(28)Gwys=SR1+SR.Because the object contains deviationsΔS, there is also a corresponding deviation ΔG in the closed system transfer function. It represents the performance deviation caused by ΔS. The sensitivity function representing the effect of ΔS on system performance is defined as follows:(29)Ks=limΔS⟶0ΔG/GΔS/S=dGdS.SG=11+SR.The next control objective is to determineR∗s∈Rs that has the potential to minimize the sensitivity, i.e.,(30)Ks∞=11+Ss.Rs∞⟶min.(b)
Convert the optimization problem (30) into a model equilibrium problem.Substituting (18) and (27) into (30), we get the following:(31)Ks=11+Rs.Ss=MY−NQMMY−NQM+NX+NMQ=MY−NQMMY+NX=T−UQ,T=YM,U=NM.Then, the optimization problem (30) becomes the following:(32)Q∗=argminQ∈RH∞T−UQ∞,where T,U∈RH∞ are known.(c)
Find the optimal problem solution (32) for the SISO system.Consider the special caseT,U∈RH∞, where Us has a unique zero s0, on the right side of the imaginary axis (including s0=∞).According to the definition of the infinity norm, we have the following:(33)T−UQ∞=supRes>0T−UQ≥Ts0−Us0Qs0=Ts0.Besides, forQ=Ts−Ts0/Us (∗), we have T−UQ=Ts0,Q in (∗) has poles including all poles of T and the remaining zeros (except s0). That’s why Q is a robust function, or Q∈RH∞.Therefore, ifTs−Ts0/Us is valid, then Q=Ts−Ts0/Us is the solution of the optimization problem (32). Consequently,(34)R∗=XU−MTs−Ts0YU−NTs−Ts0,where:(35)S=NM,X,Y,Q,N,M∈RH∞and NX+MY=1.Expanding the above particular case to the problem withUs having m zeros, s1,s2…,sm, on the right side of the imaginary axis, we will apply the Nevanlinna–Pick interpolation formula to transform the problem into a form with only m−1 zeros, s1,s2…,sm−1, on the right side of the imaginary axis. Then, we apply Nevanlinna–Pick again and again until the problem has only a unique zero s1 , on the right of the imaginary axis. In this last case, we will obtain the solution R∗ calculated by (34).


## 3.2. Design of Robust Control for Self-Balancing Two-Wheel Vehicle

Parameters of the self-balancing two-wheel vehicle are given in Table1. By substitution of these parameters into equation (10), the nominal transfer function of the balancing system of vehicle is described as follows:(36)Ws=αsUs=−0.223ss3+0.1284s2−47.2s−5.589,where U is the voltage applied to the DC motor to rotate the flywheel and α is the tilt angle of the vehicle.Table 1
Parameters of the self-balancing two-wheel vehicle.
ParametersValueUnitIb0,1105Kg.m2hb0,105mIf0,03289Kg.m2hf0,205mmb10,024Kgmf3,976KgTe0,045V.s/RadTm0,045Nm/AR0,52Ωk1 : 1g9,81m/s2The actual operation of self-balancing two-wheel vehicle shows that a change in the vehicle’s load will lead to a change in the vehicle’s CoG. Besides, external force and uncertain noise due to changes in the vehicle’s terrain are uncertain factors affecting the vehicle. These uncertainties alter the self-balancing two-wheel vehicle model, so we can consider the two-wheel vehicle model as an uncertain object. Among the uncertainties affecting the vehicle, we mainly concern about the load variation. Specifically, consider the following cases.Case 1.
When load is 1.8 kg, the height of the CoG of the vehiclehb=0.13m is the transfer function of the vehicle model as follows:(37)W1s=αsUs=−0.1527ss3+0.1253s2−40.72s−4.821.Case 2.
When the load is 2.9 kg, the height of the CoG of the vehiclehb=0.16m is the transfer function of the vehicle model as follows:(38)W2s=αsUs=−0.3735ss3+0.1352s2−61.37s−7.352.Case 3.
When the load is 5 kg, the height of the CoG of the vehiclehb=0.05m is the transfer function of the vehicle model as follows:(39)W3s=αsUs=−0.3573ss3+0.1345s2−63.44s−7.511.Case 4.
When the load is 10 kg, the height of the CoG of the vehiclehb=0.12m is the transfer function of the vehicle model as follows:(40)W4s=αsUs=−0.1774ss3+0.1264s2−64.72s−7.663.
The Bode plots of two-wheel vehicle models with different loads are shown in Figure5.
As shown in Figure5, uncertainties can reduce the accuracy of the mathematical model, leading to a decrease in the control performance and even making the system unstable. Due to uncertainty in the two-wheel vehicle model, robust control [11, 34] is the most suitable control algorithm to control the balance of the two-wheel vehicle model among proposed control algorithms, including PD [20], PID [17–19], LQG and MPC [21], and SMC [25–27].
The robust control of a two-wheel vehicle is designed according to the structure diagram given in Figure6.
Designing the robust controller for the self-balancing two-wheel vehicle according to the procedure presented in Section3 [35, 36], we obtain the following controller:(41)Rs=AsBs,where(42)As=−1.01s15−37.98s14−646s13−6580s12−4.486.104s11−2.169.105s10−7.7.105s9−2.051.106s8−4.147.106s7−6.393.106s6−7.46.106s5−6.453.106s4−3.951.106s3−1.566.106s2−3.338.105s−2.302.104,Bs=2.23.10−5s15+0.00525s14+0.1697s13+2.401s12+18.97s11+92.73s10+292.1s9+589.7s8+707.1s7+346.7s6−241s5−436.9s4−203s3−18.37s2.
Applying Matlab/Simulink to simulate the two-wheeled vehicle balance control system using the 15th-order controller, we obtained the results shown in Figures 7 and 8.
When the two-wheel vehicle loads the different circumstances, we obtained the results shown in Figure9 as follows.
(∗) Comment: Figures 8 and 9 show that the 15th-order robust controller is capable of maintaining a stable balance of the two-wheel vehicle when the model parameters change. However, using a 15th-order controller to control a two-wheel vehicle results in a complex control program code, which can affect the actual control system’s response speed and hence make the system unstable. Therefore, we seek to reduce the order of the 15th-order controller to simplify the control program code and ensure that the real-time control system always maintains a stable balance.Figure 5
Bode plot of the self-balancing two-wheel vehicle mode with different loads.Figure 6
Structure of the robust control sytem for a two-wheel vehicle.Figure 7
Two-wheel vehicle model in Matlab/Simulink.Figure 8
Tilt angle response of the control system with initial angle2π/180rad.Figure 9
Tilt angle response of the control system when the two-wheel vehicle loads the different circumstances with the initially tilt angle2π/180rad.


## 4. Results and Discussion

### 4.1. Reducing Order of Controller

The requirement for the order reduction problem is that a low-order controller has the lowest possible order; the response of a control system using a low-order controller should match that of a control system using the 15th-order controller or the control system using a low-order controller ensures stability control for two-wheel vehicle.To reduce order of the controller, there are two basic solutions as follows:Solution 1: Select a low-order controller with a fixed structure and then apply optimal algorithms to select the parameters of the low-order controller so that the control system using the low-order controller ensures stability control for a two-wheel vehicle.Solution 2: Applying the order reduction algorithms to reduce the order of a high-order controller, we will obtain a set of reduced-order controllers. The lowest reduced-order controller that still meets the requirements for stable balance control of a two-wheel vehicle will be selected to replace the high-order controller.In this article, we choose Solution 2 to reduce the order of the 15th-order controller. Analyzing the 15th-order controller, we find that it is an unstable system. In order to reduce the order of an unstable system, we need to use algorithms that reduce the order of an unstable system.The order reduction algorithms for unstable systems are classified into two groups. One group consists of algorithms for the indirect order reduction of an unstable system. These algorithms divide the unstable system into an unstable subsystem and a stable subsystem. The order of the stable subsystem will be reduced to obtain a low-order stable subsystem. The unstable subsystem will then be added to the low-order stable subsystem to get a low-order unstable system. The other group consists of algorithms for direct order reduction of an unstable system. These algorithms perform order reduction of an unstable system without performing subsystem division. Aiming to select the best low-order controller to replace the 15th-order controller, we use both groups of reduction methods and then compare the obtained results.


#### 4.1.1. Indirect Order Reduction Algorithms

Separating the 15th-order controller into stable subsystems and unstable subsystems according to the algorithm [38], we obtained the following results:The stable subsystem:(43)Rss=KsMs,Ks=−4.531.104s12−1.737.106s11−2.972.107s10−2.974.108s9−1.928.109s8−8.5.109s7−2.61.1010s6−5.603.1010s5−8.297.1010s4−8.149.1010s3−4.887.1010s2−1.481.1010s−1.188.109,Ms=s12+236.3s11+7798s10+1.138.105s9+9.409.105s8+4.903.106s7+1.698.107s6+3.987.107s5+6.324.107s4+6.555.107s3+4.102.107s2+1.284.107s+1.042.106.The unstable subsystem:(44)Russ=−2653s2−2162s−991s3−0.7907s2+1.776.10−16s−6.541.10−18.Since the unstable subsystem does not change during order reduction, the 4th-order controller is the smallest order controller obtained by indirect order reduction algorithms.Applying some indirect order reduction algorithms [39–47] to reduce the order of the 15th-order controller (using balancmr/bstmr functions in Matlab/Simulink), we obtained the results as given in Tables 2 and 3.Table 2
The 4th-order controllers using indirect order reduction algorithms.
Order reduction algorithmTransfer function of reduced orde controller, Rr(s)Balanced truncation model reduction (balancmr) [39–43]−4.531.104s4−8.686.104s3−4.417.105s2−4.32.105s−1.986.105/s4+199.9s3−158.7s2−2.782.10−14s−2.132.10−17Balanced stochastic truncation model reduction (bstmr) [44–47]−4.531.104s4−7.535.104s3−4.479.105s2−4.342.105s−1.985.105/s4+199.5s3−158.4s2−3.556.10−14s−1.31.10−15Table 3
The 5th-order controllers using indirect order reduction algorithms.
Order reduction algorithmTransfer function of reduced order controller, Rr(s)Balanced truncation model reduction (balancmr) [39–43]−4.531.104s5−4.544.105s4−2.552.106s3−3.14.106s2−3.894.106s−1.699.106/s5+207.9s4+1552s3−1357s2−2.38.10−13s−1.824.10−16Balanced stochastic truncation model reduction (bstmr) [44–47]−4.531.104s5−5.889.105s4−2.731.106s3−4.545.106s2−5.253.106s−2.311.106/s5+210.9s4+2165s3−1844s2+4.128.10−13s−1.526.10−14


#### 4.1.2. Direct Order Reduction Algorithms

Applying direct order reduction algorithms [40, 48–50] (using programmed code and the available ncfmr function in Matlab/Simulink), to reduce the order of the 15th-order controller, we obtained the results in Table 4.Table 4
The 2nd-order controllers using direct order reduction algorithms.
Order reduction algorithmTransfer function of reduced orde controller – Rr (s)Zhou’s balanced truncation algorithm [48]−4.531.104s2−3.001.105s−2.484.106/s2+204.5s+898.2Balanced truncation model reduction for normalized coprime factors (ncfmr) [40, 49]−4.531.104s2−4.953.104s−2.135.105/s2+69.66s−159.4Zilochian’s balanced truncation algorithm [50]−4.531.104s2−6.714.104s−1.268.106/s2+199.3s−158.3


### 4.2. Simulation Results

To evaluate the efficiency of low-order controllers, we build a simulation model of the self-balancing two-wheel vehicle control system with low-order controllers using Matlab/Simulink; results are obtained as follows.Using the 4th-order controller as given in Table 2 to control a self-balancing two-wheel vehicle, as shown in Figure 10, we obtain results as depicted in Figure 11.Figure 10
Simulation diagram of the self-balancing two-wheel vehicle control system using 4th-order controllers.Figure 11
Step response of the self-balancing two-wheel vehicle control system using 4th-order controllers.Figure11 shows that a self-balancing two-wheeled vehicle control system using the 4th-order controller can not stabilize the vehicle. Thus, the 4th-order controller does not meet the requirements of reducing the order of the 15th-order controller.Using the 5th-order controllers in Table 3 to control the self-balancing two-wheeled vehicle, as in Figure 12, we obtained results as depicted in Figure 13.Figure 12
Simulation diagram of the self-balancing two-wheel vehicle control system using 5th-order controllers.Figure 13
Step response of the self-balancing two-wheel vehicle control system using 5th-order controllers.Figure13 shows that the self-balancing two-wheel vehicle using the 5th-order controller can stabilize the vehicle with an initially off-angle of 2π/180radian. Comparing the control system performance using the 5th-order controller to the system using the 15th-order controller, we see that the control system using the 5th-order controller, according to the bstmr algorithm, has the largest number of fluctuations and the longest settling time. When the control system using the 5th-order controller according to the balancmr algorithm, the amplitude of the oscillation is small. Meanwhile, the settling time of the control system using the 5th-order controller according to the balancmr algorithm is equivalent to that of the control system using the 15th-order controller.Using the 2nd-order controllers in Table 3 to control the self-balancing two-wheel vehicle, as shown in Figure 14, we obtained the following results.Figure 14
Simulation diagram of the self-balancing two-wheel vehicle control system using 2nd-order controllers.Figure15 shows that the control system using the 2nd-order controller, according to Zilochian’s algorithm, can not stabilize the vehicle. In contrast, Figure 16 depicts that the control system using the 2nd-order controller, either according to the ncfmr algorithm or Zhou’s algorithm, ensures stability balance control for the self-balancing two-wheel vehicle. Out of these two algorithms, the quality of the control system using the 2nd-order controller, according to Zhou’s algorithm, is better (smaller number of the oscillation and smaller amplitude of the oscillation) than the quality of the control system using the 2nd-order controller according to the ncfmr algorithm.Figure 15
Step response of the self-balancing two-wheel vehicle control system using 2nd-order controllers according to Zilochian’s algorithm.Figure 16
Step response of the self-balancing two-wheel vehicle control system using 2nd-order controllers according to Zhou’s algorithm and ncfmr algorithm.By comparing and evaluating the reduced-order controllers by direct and indirect order reduction algorithms, we selected the 2nd-order controller according to Zhou’s algorithm to control the self-balancing two-wheel vehicle.Verifying the control system using the 2nd-order controller according to Zhou’s algorithm in variable load cases, we obtained the results as shown in Figure 17.Figure 17
Step response of the self-balancing two-wheel vehicle control system using 2nd-order controllers according to Zhou’s algorithm when the vehicle’s load changes.As shown in Figure17, the self-balancing two-wheel vehicle control system using the 2nd-order controller, according to Zhou’s algorithm, can stabilize the vehicle when the vehicle’s load changes.


### 4.3. Experimental Results

The structure of the control system is shown in Figure2. First, we perform the controller with the model built on Matlab/Simulink. After verifying the control system’s control capability using the Simulink model, we loaded the control program using the 2nd-order controller into the Arduino Uno board’s chip with a sampling time of 10 ms. The tilt angle of the vehicle will be read by sensor GY-521 MPU-6050. Based on the received tilt angle signal, the control program in the Arduino will calculate the control signal sent to the H-bridge circuit. Accordingly, the H-bridge circuit will generate the appropriate voltage signal to control the DC motor. The DC motor will rotate the flywheel so that the torque induces an impact on the vehicle against the gravity torque due to the vehicle tilting away from its balanced position.For experimental validation, Arduino is connected to the ESP32 wifi module to measure the vehicle’s tilt angle. This measured tilt angle will be sent to the server of the Blynk application by Arduino via the ESP 32 wifi module. Then, the computer will receive the tilt angle information from the server of the Blynk application. Using Matlab/Simulink software installed on the computer, the vehicle’s tilt angle is obtained, as shown in the following figures.Experimental control results of self-balancing two-wheeled vehicle when the vehicle is stationary and at no-load are shown in Figure18 as followsFigure 18
Experimental results when the vehicle is stationary: (a) tilt angle response (0–20 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure18 depicts that the control system can stabilize the vehicle at no-load with the tilt angle fluctuating around 0 degrees, from −0.08 degrees to 0.08 degrees.The results of experimenting with the vehicle balance control system when the vehicle is stationary and carrying a load of 1.8 kg are obtained, as shown in Figure19.Figure 19
Experimental results when the vehicle is stationary and carrying a load of 1.8 kg: (a) tilt angle response (0–30 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure19 shows that the vehicle balance control system can stabilize the vehicle when the vehicle carries a load of 1.8 kg with the tilt angle of the vehicle fluctuating around 0°, from −0.2 degrees to 0.2 degrees. Compared to the no-load case, the amplitude of the tilt angle variation of the loaded case is higher.Experimenting with the vehicle balance control system when the vehicle is stationary and carrying a 2.9 kg load, we obtained the results shown in Figure20.Figure 20
Experimental results when the vehicle is stationary and carrying a load of 2.9 kg: (a) tilt angle response (0–30 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure20 shows that the control system can stabilize the vehicle when the vehicle carries 2.9 kg with the tilt angle oscillating around 0 degrees, from –0.6 degrees to 0.6 degrees. Comparing the results between Figures 19 and 20, we see that the angular oscillation amplitude increases when the load weight increases.Experimenting with the control system when the vehicle is stationary and placing a load of 1.8 kg at the eccentric position of the vehicle, we obtained the results given in Figure21.Figure 21
Experimental results when the vehicle is stationary and carrying a load of 1.8 kg eccentric: (a) tilt angle response (0–20 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure21 shows that when the vehicle is not loaded, the control system can stabilize the vehicle with the vehicle’s tilt angle fluctuating around 0 degrees. When the vehicle carries a load of 1.8 kg at the eccentric position of the vehicle, the control system automatically finds a new equilibrium with the tilt angle fluctuating around 2 degrees.Experimenting with the vehicle balance control system when the vehicle moves while carrying a load of 1.8 kg, we obtained the results given in Figure22.Figure 22
Experimental results when the vehicle is moving and carrying a load of 1.8 kg: (a) tilt angle response (0–35 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure22 shows that when the vehicle is not moving, the vehicle’s tilt angle fluctuates around 0 degrees with amplitude ranging from –0.2 to 0.2 degrees. When the vehicle is moving, from 5 s to 30 s, the tilt angle will fluctuate around 0 degrees with an amplitude of 0.8 to 1 degree. When the vehicle stops, the tilt angle is stabilized around 0 degrees with the same oscillation amplitude as when the vehicle is not moving. Thus, when the vehicle is moving, the angular oscillation amplitude increases, but balance and stability of the vehicle are still maintained.


## 4.1. Reducing Order of Controller

The requirement for the order reduction problem is that a low-order controller has the lowest possible order; the response of a control system using a low-order controller should match that of a control system using the 15th-order controller or the control system using a low-order controller ensures stability control for two-wheel vehicle.To reduce order of the controller, there are two basic solutions as follows:Solution 1: Select a low-order controller with a fixed structure and then apply optimal algorithms to select the parameters of the low-order controller so that the control system using the low-order controller ensures stability control for a two-wheel vehicle.Solution 2: Applying the order reduction algorithms to reduce the order of a high-order controller, we will obtain a set of reduced-order controllers. The lowest reduced-order controller that still meets the requirements for stable balance control of a two-wheel vehicle will be selected to replace the high-order controller.In this article, we choose Solution 2 to reduce the order of the 15th-order controller. Analyzing the 15th-order controller, we find that it is an unstable system. In order to reduce the order of an unstable system, we need to use algorithms that reduce the order of an unstable system.The order reduction algorithms for unstable systems are classified into two groups. One group consists of algorithms for the indirect order reduction of an unstable system. These algorithms divide the unstable system into an unstable subsystem and a stable subsystem. The order of the stable subsystem will be reduced to obtain a low-order stable subsystem. The unstable subsystem will then be added to the low-order stable subsystem to get a low-order unstable system. The other group consists of algorithms for direct order reduction of an unstable system. These algorithms perform order reduction of an unstable system without performing subsystem division. Aiming to select the best low-order controller to replace the 15th-order controller, we use both groups of reduction methods and then compare the obtained results.


### 4.1.1. Indirect Order Reduction Algorithms

Separating the 15th-order controller into stable subsystems and unstable subsystems according to the algorithm [38], we obtained the following results:The stable subsystem:(43)Rss=KsMs,Ks=−4.531.104s12−1.737.106s11−2.972.107s10−2.974.108s9−1.928.109s8−8.5.109s7−2.61.1010s6−5.603.1010s5−8.297.1010s4−8.149.1010s3−4.887.1010s2−1.481.1010s−1.188.109,Ms=s12+236.3s11+7798s10+1.138.105s9+9.409.105s8+4.903.106s7+1.698.107s6+3.987.107s5+6.324.107s4+6.555.107s3+4.102.107s2+1.284.107s+1.042.106.The unstable subsystem:(44)Russ=−2653s2−2162s−991s3−0.7907s2+1.776.10−16s−6.541.10−18.Since the unstable subsystem does not change during order reduction, the 4th-order controller is the smallest order controller obtained by indirect order reduction algorithms.Applying some indirect order reduction algorithms [39–47] to reduce the order of the 15th-order controller (using balancmr/bstmr functions in Matlab/Simulink), we obtained the results as given in Tables 2 and 3.Table 2
The 4th-order controllers using indirect order reduction algorithms.
Order reduction algorithmTransfer function of reduced orde controller, Rr(s)Balanced truncation model reduction (balancmr) [39–43]−4.531.104s4−8.686.104s3−4.417.105s2−4.32.105s−1.986.105/s4+199.9s3−158.7s2−2.782.10−14s−2.132.10−17Balanced stochastic truncation model reduction (bstmr) [44–47]−4.531.104s4−7.535.104s3−4.479.105s2−4.342.105s−1.985.105/s4+199.5s3−158.4s2−3.556.10−14s−1.31.10−15Table 3
The 5th-order controllers using indirect order reduction algorithms.
Order reduction algorithmTransfer function of reduced order controller, Rr(s)Balanced truncation model reduction (balancmr) [39–43]−4.531.104s5−4.544.105s4−2.552.106s3−3.14.106s2−3.894.106s−1.699.106/s5+207.9s4+1552s3−1357s2−2.38.10−13s−1.824.10−16Balanced stochastic truncation model reduction (bstmr) [44–47]−4.531.104s5−5.889.105s4−2.731.106s3−4.545.106s2−5.253.106s−2.311.106/s5+210.9s4+2165s3−1844s2+4.128.10−13s−1.526.10−14


### 4.1.2. Direct Order Reduction Algorithms

Applying direct order reduction algorithms [40, 48–50] (using programmed code and the available ncfmr function in Matlab/Simulink), to reduce the order of the 15th-order controller, we obtained the results in Table 4.Table 4
The 2nd-order controllers using direct order reduction algorithms.
Order reduction algorithmTransfer function of reduced orde controller – Rr (s)Zhou’s balanced truncation algorithm [48]−4.531.104s2−3.001.105s−2.484.106/s2+204.5s+898.2Balanced truncation model reduction for normalized coprime factors (ncfmr) [40, 49]−4.531.104s2−4.953.104s−2.135.105/s2+69.66s−159.4Zilochian’s balanced truncation algorithm [50]−4.531.104s2−6.714.104s−1.268.106/s2+199.3s−158.3


## 4.1.1. Indirect Order Reduction Algorithms

Separating the 15th-order controller into stable subsystems and unstable subsystems according to the algorithm [38], we obtained the following results:The stable subsystem:(43)Rss=KsMs,Ks=−4.531.104s12−1.737.106s11−2.972.107s10−2.974.108s9−1.928.109s8−8.5.109s7−2.61.1010s6−5.603.1010s5−8.297.1010s4−8.149.1010s3−4.887.1010s2−1.481.1010s−1.188.109,Ms=s12+236.3s11+7798s10+1.138.105s9+9.409.105s8+4.903.106s7+1.698.107s6+3.987.107s5+6.324.107s4+6.555.107s3+4.102.107s2+1.284.107s+1.042.106.The unstable subsystem:(44)Russ=−2653s2−2162s−991s3−0.7907s2+1.776.10−16s−6.541.10−18.Since the unstable subsystem does not change during order reduction, the 4th-order controller is the smallest order controller obtained by indirect order reduction algorithms.Applying some indirect order reduction algorithms [39–47] to reduce the order of the 15th-order controller (using balancmr/bstmr functions in Matlab/Simulink), we obtained the results as given in Tables 2 and 3.Table 2
The 4th-order controllers using indirect order reduction algorithms.
Order reduction algorithmTransfer function of reduced orde controller, Rr(s)Balanced truncation model reduction (balancmr) [39–43]−4.531.104s4−8.686.104s3−4.417.105s2−4.32.105s−1.986.105/s4+199.9s3−158.7s2−2.782.10−14s−2.132.10−17Balanced stochastic truncation model reduction (bstmr) [44–47]−4.531.104s4−7.535.104s3−4.479.105s2−4.342.105s−1.985.105/s4+199.5s3−158.4s2−3.556.10−14s−1.31.10−15Table 3
The 5th-order controllers using indirect order reduction algorithms.
Order reduction algorithmTransfer function of reduced order controller, Rr(s)Balanced truncation model reduction (balancmr) [39–43]−4.531.104s5−4.544.105s4−2.552.106s3−3.14.106s2−3.894.106s−1.699.106/s5+207.9s4+1552s3−1357s2−2.38.10−13s−1.824.10−16Balanced stochastic truncation model reduction (bstmr) [44–47]−4.531.104s5−5.889.105s4−2.731.106s3−4.545.106s2−5.253.106s−2.311.106/s5+210.9s4+2165s3−1844s2+4.128.10−13s−1.526.10−14


## 4.1.2. Direct Order Reduction Algorithms

Applying direct order reduction algorithms [40, 48–50] (using programmed code and the available ncfmr function in Matlab/Simulink), to reduce the order of the 15th-order controller, we obtained the results in Table 4.Table 4
The 2nd-order controllers using direct order reduction algorithms.
Order reduction algorithmTransfer function of reduced orde controller – Rr (s)Zhou’s balanced truncation algorithm [48]−4.531.104s2−3.001.105s−2.484.106/s2+204.5s+898.2Balanced truncation model reduction for normalized coprime factors (ncfmr) [40, 49]−4.531.104s2−4.953.104s−2.135.105/s2+69.66s−159.4Zilochian’s balanced truncation algorithm [50]−4.531.104s2−6.714.104s−1.268.106/s2+199.3s−158.3


## 4.2. Simulation Results

To evaluate the efficiency of low-order controllers, we build a simulation model of the self-balancing two-wheel vehicle control system with low-order controllers using Matlab/Simulink; results are obtained as follows.Using the 4th-order controller as given in Table 2 to control a self-balancing two-wheel vehicle, as shown in Figure 10, we obtain results as depicted in Figure 11.Figure 10
Simulation diagram of the self-balancing two-wheel vehicle control system using 4th-order controllers.Figure 11
Step response of the self-balancing two-wheel vehicle control system using 4th-order controllers.Figure11 shows that a self-balancing two-wheeled vehicle control system using the 4th-order controller can not stabilize the vehicle. Thus, the 4th-order controller does not meet the requirements of reducing the order of the 15th-order controller.Using the 5th-order controllers in Table 3 to control the self-balancing two-wheeled vehicle, as in Figure 12, we obtained results as depicted in Figure 13.Figure 12
Simulation diagram of the self-balancing two-wheel vehicle control system using 5th-order controllers.Figure 13
Step response of the self-balancing two-wheel vehicle control system using 5th-order controllers.Figure13 shows that the self-balancing two-wheel vehicle using the 5th-order controller can stabilize the vehicle with an initially off-angle of 2π/180radian. Comparing the control system performance using the 5th-order controller to the system using the 15th-order controller, we see that the control system using the 5th-order controller, according to the bstmr algorithm, has the largest number of fluctuations and the longest settling time. When the control system using the 5th-order controller according to the balancmr algorithm, the amplitude of the oscillation is small. Meanwhile, the settling time of the control system using the 5th-order controller according to the balancmr algorithm is equivalent to that of the control system using the 15th-order controller.Using the 2nd-order controllers in Table 3 to control the self-balancing two-wheel vehicle, as shown in Figure 14, we obtained the following results.Figure 14
Simulation diagram of the self-balancing two-wheel vehicle control system using 2nd-order controllers.Figure15 shows that the control system using the 2nd-order controller, according to Zilochian’s algorithm, can not stabilize the vehicle. In contrast, Figure 16 depicts that the control system using the 2nd-order controller, either according to the ncfmr algorithm or Zhou’s algorithm, ensures stability balance control for the self-balancing two-wheel vehicle. Out of these two algorithms, the quality of the control system using the 2nd-order controller, according to Zhou’s algorithm, is better (smaller number of the oscillation and smaller amplitude of the oscillation) than the quality of the control system using the 2nd-order controller according to the ncfmr algorithm.Figure 15
Step response of the self-balancing two-wheel vehicle control system using 2nd-order controllers according to Zilochian’s algorithm.Figure 16
Step response of the self-balancing two-wheel vehicle control system using 2nd-order controllers according to Zhou’s algorithm and ncfmr algorithm.By comparing and evaluating the reduced-order controllers by direct and indirect order reduction algorithms, we selected the 2nd-order controller according to Zhou’s algorithm to control the self-balancing two-wheel vehicle.Verifying the control system using the 2nd-order controller according to Zhou’s algorithm in variable load cases, we obtained the results as shown in Figure 17.Figure 17
Step response of the self-balancing two-wheel vehicle control system using 2nd-order controllers according to Zhou’s algorithm when the vehicle’s load changes.As shown in Figure17, the self-balancing two-wheel vehicle control system using the 2nd-order controller, according to Zhou’s algorithm, can stabilize the vehicle when the vehicle’s load changes.


## 4.3. Experimental Results

The structure of the control system is shown in Figure2. First, we perform the controller with the model built on Matlab/Simulink. After verifying the control system’s control capability using the Simulink model, we loaded the control program using the 2nd-order controller into the Arduino Uno board’s chip with a sampling time of 10 ms. The tilt angle of the vehicle will be read by sensor GY-521 MPU-6050. Based on the received tilt angle signal, the control program in the Arduino will calculate the control signal sent to the H-bridge circuit. Accordingly, the H-bridge circuit will generate the appropriate voltage signal to control the DC motor. The DC motor will rotate the flywheel so that the torque induces an impact on the vehicle against the gravity torque due to the vehicle tilting away from its balanced position.For experimental validation, Arduino is connected to the ESP32 wifi module to measure the vehicle’s tilt angle. This measured tilt angle will be sent to the server of the Blynk application by Arduino via the ESP 32 wifi module. Then, the computer will receive the tilt angle information from the server of the Blynk application. Using Matlab/Simulink software installed on the computer, the vehicle’s tilt angle is obtained, as shown in the following figures.Experimental control results of self-balancing two-wheeled vehicle when the vehicle is stationary and at no-load are shown in Figure18 as followsFigure 18
Experimental results when the vehicle is stationary: (a) tilt angle response (0–20 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure18 depicts that the control system can stabilize the vehicle at no-load with the tilt angle fluctuating around 0 degrees, from −0.08 degrees to 0.08 degrees.The results of experimenting with the vehicle balance control system when the vehicle is stationary and carrying a load of 1.8 kg are obtained, as shown in Figure19.Figure 19
Experimental results when the vehicle is stationary and carrying a load of 1.8 kg: (a) tilt angle response (0–30 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure19 shows that the vehicle balance control system can stabilize the vehicle when the vehicle carries a load of 1.8 kg with the tilt angle of the vehicle fluctuating around 0°, from −0.2 degrees to 0.2 degrees. Compared to the no-load case, the amplitude of the tilt angle variation of the loaded case is higher.Experimenting with the vehicle balance control system when the vehicle is stationary and carrying a 2.9 kg load, we obtained the results shown in Figure20.Figure 20
Experimental results when the vehicle is stationary and carrying a load of 2.9 kg: (a) tilt angle response (0–30 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure20 shows that the control system can stabilize the vehicle when the vehicle carries 2.9 kg with the tilt angle oscillating around 0 degrees, from –0.6 degrees to 0.6 degrees. Comparing the results between Figures 19 and 20, we see that the angular oscillation amplitude increases when the load weight increases.Experimenting with the control system when the vehicle is stationary and placing a load of 1.8 kg at the eccentric position of the vehicle, we obtained the results given in Figure21.Figure 21
Experimental results when the vehicle is stationary and carrying a load of 1.8 kg eccentric: (a) tilt angle response (0–20 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure21 shows that when the vehicle is not loaded, the control system can stabilize the vehicle with the vehicle’s tilt angle fluctuating around 0 degrees. When the vehicle carries a load of 1.8 kg at the eccentric position of the vehicle, the control system automatically finds a new equilibrium with the tilt angle fluctuating around 2 degrees.Experimenting with the vehicle balance control system when the vehicle moves while carrying a load of 1.8 kg, we obtained the results given in Figure22.Figure 22
Experimental results when the vehicle is moving and carrying a load of 1.8 kg: (a) tilt angle response (0–35 seconds); (b) tilt angle response (0–100 seconds); (c) balanced vehicle.
(a)(b)(c)Figure22 shows that when the vehicle is not moving, the vehicle’s tilt angle fluctuates around 0 degrees with amplitude ranging from –0.2 to 0.2 degrees. When the vehicle is moving, from 5 s to 30 s, the tilt angle will fluctuate around 0 degrees with an amplitude of 0.8 to 1 degree. When the vehicle stops, the tilt angle is stabilized around 0 degrees with the same oscillation amplitude as when the vehicle is not moving. Thus, when the vehicle is moving, the angular oscillation amplitude increases, but balance and stability of the vehicle are still maintained.


## 5. Conclusions

The article introduces a self-balancing two-wheel vehicle model using flywheels according to the inverted pendulum principle. Modeling of the vehicle shows that the two-wheeled vehicle is a nonlinear and uncertain object. A high-order robust controller RH∞ is designed to maintain a stable balance of the two-wheel vehicle. To reduce the order of the controller, the article has used different order reduction algorithms. This study evaluated the two-wheel vehicle balance control system utilizing the reduced-order controllers and chose the most suitable low-order controller (2nd-order controller) through the simulation. When used to control the balance of the two-wheel vehicle, a low-order control helps stabilize the vehicle when being stationary and moving and when the load changes. In the upcoming studies, we will apply optimal algorithms to find the low-order robust controller that meets the requirements of the self-balancing two-wheel control problem.


## 6. Future Recommendation Study

Research on solutions to increase the steady angle for self-balancing two-wheel vehicle; research on how to reduce the flywheel mass while maintaining the moment of inertia of the flywheel; research on how to improve the load-carrying capacity of self-balancing two-wheel vehicle; research on solutions to combine steering angle control with two-wheel vehicle balance control; comparing the efficiency of the robust control algorithm for the self-balancing two-wheel vehicle with other control algorithms are warranted.



---

*Source: 6693807-2021-05-24.xml*