Bicycle Robot Balance Control Based on a Robust Intelligent Controller

,


I. INTRODUCTION
Recently, many studies on the topic of the balance control of two-wheeled vehicles have been proposed. In particular, the balance control of an unmanned bicycle interests many researchers. There are many methods used for balance control of a riderless bicycle. In [1], the running motion of an electrical bicycle was stabilized using a bicycle's center of gravity and steering handle angle control. The authors in [2] used a gyroscopic balancer based on a fuzzy sliding mode controller to control a riderless bicycle. Yang and Murakami [3] proposed a method to control the steering of electric motorcycles. The motorcycle could self-balance by keeping its wheels at sway. A riderless bicycle was developed with a gyroscopic balancer controller by combining a fuzzy sliding mode controller with an adaptive fuzzy sliding mode controller [4].
The associate editor coordinating the review of this manuscript and approving it for publication was Jun Shen .
In [5], the authors proposed a design method for steering control to maintain the balance of a bicycle.
High speed and accurate motion are necessary in modern control systems. Such performance can be realized using a mechanical transmission with rotary motors. These transmission parts obviously reduce the linear speed and system response but also generate chatter and friction. In some applications, simplification in actuation systems is a popular research topic. This can reduce the system cost, energy consumption, mechanical structure design and system uncertainty. A system with actuators that operate within their degrees of freedom is called an underactuated system. Underactuated systems can be found in many control applications such as biped robots, helicopters and inverted pendulums. For some applications, underactuated systems may be designed to sufficiently respond to actuator breakdowns.
Many studies have examined the system control of inverted pendulums. The inverted pendulum is an example of an VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ underactuated and highly unstable system. Recently, many extensions of the one-dimensional inverted pendulum control system have been proposed. The most challenging task is to control such an inverted pendulum system when a cart is no longer on a guide rail. Obviously, the controller design becomes more difficult because of the physical structure. In [6], a novel automatic motion control algorithm was investigated for wheeled inverted pendulum control. The developed scheme achieved dynamic balance and the desired motion tracking. In [7], the authors proposed an approach to compensate for external disturbances and model uncertainties to improve the system performance. The authors presented optimal motion planning for minimizing the energy consumption of a wheeled mobile robot in [8]. In [9], the authors proposed a novel smooth time-invariant controller to achieve desired position control and stabilization of an unstable pendulum-like central body.
On the control view, intelligent control theories (genetic algorithms, fuzzy controls, neural networks, or cerebellar model articulation controllers. . . etc) [10]- [20] provide a method for the design of online controllers of nonlinear systems with unknown or uncertain system dynamics. Many researchers have argued that neural networks (NNs) are powerful building blocks for a wide class of complex nonlinear system control strategies when model information is absent or when a controlled plant is considered a ''black box''. However, learning is slow because all system parameters are updated during each learning cycle. Therefore, the appropriateness of NNs is limited for problems requiring online learning. Recently, a cerebellar model articulation controller (CMAC) was proposed. In general, simple computation, fast learning, good generalization capability, and easier hardware implementation are the major advantages of a CMAC. However, the main drawback of CMACs is that they are static networks.
Recently, the backstepping controller has become a popular topic for nonlinear systems [21]- [22]. The main idea of backstepping controller design is to recursively choose some appropriate functions of state variables, which are used as fictitious control inputs for lower-dimension subsystems of the entire system. Each backstepping stage creates a new virtual control design, which is represented by the virtual control design of the previous design stages. The process terminates the feedback design of the real control input, which achieves the goal of original design by the final Lyapunov function, which is formed by summing the Lyapunov functions associated with each individual design stage. Therefore, the backstepping control method can maintain robustness with respect to uncertainty.
In this study, bicycle robot (BR) balance control based on robust intelligent backstepping tracking control (RIBTC) is proposed. A BR can be considered an inverted pendulum on the bicycle lean axis. This motion is achieved using a flywheel and a mechanical transmission with reduction gears and a lead screw. These transmission components markedly reduce the linear speed and dynamic response but also generate backlash and considerable friction. Clearly, this configuration has transmission loss. Conventional control technologies always require a good understanding of a plant. Undoubtedly, this system has many nonlinear components. Therefore, the dynamic model for such a system will be nonlinear, and the motor parameters are time-varying due to increased temperature and motor drive changes during operation. Obviously, BR control becomes arduous when using traditional control techniques because its exact system model is difficult to understand.
The RIBTC includes an adaptive output recurrent Takagi-Sugeno-Kang cerebellar model articulation controller (AORTCMAC) and a robust controller. The AORTCMAC is used to mimic an ideal backstepping control, and the robust H ∞ controller is designed to attenuate the effect of the residual approximation errors and external desired attenuation level. The output recurrent Takagi-Sugeno-Kang cerebellar model articulation controller is a modified version of the traditional CMAC network such that a small number of receptive fields are used to capture the system dynamics, convert the static CMAC into a dynamic controller and add the Takagi-Sugeno-Kang fuzzy model, which has good capability for nonlinear systems. Combining the advantages of the above, AORTCMAC can aptly mimic an ideal backstepping controller.
In this study, RIBTC is used to control BRs. To obtain the optimal values of the system parameters, all parameter adaptation laws of the AORTCMAC are tuned online based on the Lyapunov stability theorem. The Taylor linearization technique and H ∞ control technology are used; hence, the stability of the proposed controller can be guaranteed. In addition, the learning rate of the adaptation parameters is also determined by the Lyapunov function to ensure the convergence of tracking errors. The major contributions of this work include (1) the successful design and implementation of BR hardware and (2) the successful realization of the proposed RIBTC control scheme to control BRs. Finally, the effectiveness of the proposed control scheme for bicycle robot systems is demonstrated by several experimental results.

II. THE BICYCLE ROBOT PLATFORM HARDWARE STRUCTURE
This section introduces the hardware structure of a BR. Fig. 1 shows the degrees of freedom of the BR. The motions of the BR in this study maintain the balance at a fixed point. Therefore, the BR needs to maintain balance along the Z-axis. In this case, it has one degree of freedom. There are two statespace variables used to fully describe the dynamics of the BR. The dynamics of the BR are derived by assessing the BR as a reaction-wheel inverted pendulum. Obviously, the BR is a complex nonlinear system. For simplification, the flywheel and robot body are assumed to be a single body in this study.
A BR can be considered a reaction-wheel inverted pendulum, which is a nonlinear unstable system. The BR is divided into two subsystems: mechanism and hardware. The mechanism of BR contains a frame, a motor and a flywheel. A child's bicycle is used as the skeleton for loading the whole system to conduct experiments. A 48 V planetary gear motor provides torque through the flywheel to maintain the balance of the BR. The hardware of the BR includes inertial measurement units (IMUs), a micro control unit and motor drive module. The main IMUs in this study are inclinometers and gyroscopes. The inclinometer measures the lean angle, and the gyroscope measures the change rate of the lean angle. A micro control unit (Arduino mega 2560) is used to acquire system states, realize the control algorithm and send out the control signals. To achieve the motor forward-reverse transfer, an H-bridge circuit is designed to drive the motor. To control the speed of the motor, pulse width modulation (PWM) techniques are used to control the motor. A 0-48 V PWM square wave signal at 490 Hz is sent to drive the motor. With these outlined features, the BR can maintain balance. Generally, the Arduino mega 2560 unit is suitable for control algorithm implementation and system control. The 48 V DC motor for the flywheel is placed on the BR system. This motor is sufficient for system control. However, it is uncontrollable if a large extra disturbance is exerted because the extra disturbance will exceed the ability to maintain system stability. In this case, the BR will be uncontrollable. In this study, the proposed BR can afford a maximum lean angle of under 5 degrees.
The Lagrange method is used to derive the dynamic model of the BR. Fig. 2 shows the variable definition of the dynamic model of the BR. Here, two variables require control to achieve a BR balance. One is the lean angle of the BR (θ), and the other is the change rate of the lean angle of the BR (θ).
The parameters used for BR are as follows.  To obtain the dynamic equation from the Lagrange equation, the potential energy V and kinetic energy T are needed. V is the energy of that an object in a force field has due to its position. T is in the energy an object has due to its motion. It includes translational kinetic energy and rotational kinetic energy. The potential energy can be represented as equation (1). The total kinetic energy is obtained as the sum of translational kinetic energy and rotational kinetic energy as equation (2).
Therefore, the Lagrange equation L can be represented as Substituting L into the Lagrange dynamic equation, the dynamic equations of the system are obtained as equation (4).
After linearizing the system model of the BR in approximately θ ≈ 0 • andθ ≈ 0 • / sec, the dynamic equation of the system body can be expressed as where τ F is the torque generated by the flywheel. The relationship between τ G and τ F can be expressed as τ G = k (torque) τ F . It can be learned from the actual test that they move in opposite directions, and the value of τ G is approximately 0.8 times that of τ F . VOLUME 8, 2020

III. CONTROLLER DESIGN
Let us consider BRs where the dynamic equation is described as follows:ẋ T is the state vector of the system that is available through measurement. f (x, t) and g(x, t) represent the nonlinear uncertain functions that are assumed to be bounded, u (t) ∈ R is the control input, and d (t) ∈ R n denotes an unknown but bounded external disturbance. (7) and (8) can be reformulated as follows: where f 0 (x, t) and g 0 denote the nominal parts, f (x, t) and g(x, t) are the unknown uncertainties of f (x, t) and g(x, t), respectively, and l(t) represents lumped uncertainty, which is defined as The control objective is to design a suitable control law for (8) so that X can track a reference trajectory vector , g 0 and l(x, t) are clearly known, an ideal backstepping controller (IBC) can be designed.
The system model of BRs cannot always be obtained precisely. To overcome this problem, a robust intelligent backstepping tracking control (RIBTC) system has been proposed for the systems.

A. ARTICULATION OF THE OUTPUT RECURRENT TAKAGI-SUGENO-KANG CEREBELLAR MODEL ARTICULATION CONTROLLER
A dynamic output recurrent Takagi-Sugeno-Kang cerebellar model articulation controller (ORTSKCMAC) neural network is proposed.
∈ n , the state variable of each input x i , i = 1, 2, · · · , n, must be divided into discrete regions, which are called elements. The number of elements is defined as n E and is termed as a resolution.
2) Associative memory space A: Different elements can form a block. The number of blocks n B is usually equal to or greater than two in a CMAC. A represents an associative memory space in which n A (n A = n × n B ) constituents. In this space, the Gaussian function is accepted as the basis function here, which can be expressed as , for k = 1, 2, · · · n B (11) where ϕ ik is the k-th block for the i-th input x ri with mean m ik and variance v ik . In addition, the input of this block can be represented as where r i is the recurrent weight of the recurrent unit. y (N − 1) denotes the past information of the network. It is clear that the input of this block contains the memory terms, which store the past information of the network. It captures system dynamics and converts the static CMAC into a dynamic controller. It will achieve good performance for nonlinear unknown systems.
3) Receptive-field space R: The areas formed by blocks are called receptive fields. The number of receptive fields is n R . Its multidimensional basis function is as follows: where b k is a receptive field formed by the k th basis function. The multidimensional receptive-field function can be expressed in vector type as follows: This space is the linear combination function in the consequent part of the fuzzy system. Each location of the receptive field R can be converted to a linguistic variable with n R components in the TSK space. The basic configuration of the TSK space includes a fuzzy rule base that is composed of a collection of fuzzy IF-THEN rules in the following.
Rule λ : If x r1 is F λ 1 , · · · , x rn is F λ i , then φ λ = q 0λ + q 1λ x r1 + · · · + q nλ x rn = [1,X T ]q λ = q 0λ z 0 + q 1λ z 1 + · · · + q nλ z n = Z T q λ (14) where Rule λ denotes the λth rule and λ is the number of rules. F λ i are the fuzzy sets, i = 1, 2, · · · , n, and q λ is a vector of the adjustable factors of the consequence part of the fuzzy rules. Furthermore, φ λ is the linguistic variable. It can be expressed The output of ORTSKCMAC is the algebraic sum of the network linkage, parameter update, and active weighting in weight memory space in each layer, and it is expressed as where q = [q T 1 , q T 2 , · · · , q T n R ] T , = [b 1 Z T , b 2 Z T , · · · , b k Z T ] T , and u ORTSKCMAC is the output of ORTSKCMAC.

B. ROBUST INTELLIGENT BACKSTEPPING TRACKING CONTROL
The design of the RIBTC system for a BR uncertain nonlinear system is described as follows.
The system tracking error is defined as Then the derivative of tracking error can be represented aṡ x 2 (t) can be viewed as a virtual control in the above equation. The following stabilizing function is defined: where k 1 is a positive constant. The first Lyapunov function is chosen as Define The derivative of V 1 (t) iṡ Therefore, if e 2 (t) = 0,V 1 (t) = −k 1 e 2 1 (t) ≤ 0 will be achieved.
The derivative of e 2 (t) is expressed aṡ Another Lyapunov function is chosen as Then, the derivative of V 2 (t) iṡ If the dynamic system is well known, the ideal backstepping control law can be obtained as where k 2 is a positive constant. Substituting (25) into (24), the following equation can be obtained: However, the dynamic model cannot be obtained in detail. Therefore, the AORTSKCMAC is utilized to estimate IBC in this study.
where η q , η m , η v and η r are positive constants and The robust H ∞ controller is given as where δ is a positive constant. Then, the desired robust tracking performance can be achieved for a prescribed attenuation level δ. Proof: Since the AORTSKCMAC is utilized to estimate IBC, u AORTSKCMAC can be written as Assume there is an optimal u * AORTSKCMAC to approach the IBC such that where ε is a minimum estimation error and q * , m * , v * , * and r * are the optimal values of q, m, v, , and r. Nevertheless, the optimal u * AORTSKCMAC cannot be obtained, and the online estimation ofû AORTSKCMAC is used to estimate. u * IBC . The control law (28) can be rewritten as follows: u = u AORTSKCMAC (x,q,m,v,r) + u R =q Tˆ + u R (34) whereq,m,v,ˆ andr are the estimates of the optimal parameters q * T , m * , v * , * and r * . Subtracting (34) from (33), an approximation errorũ is defined as whereq = q * −q and˜ = * −ˆ . Furthermore, employing the linearization technique transforms the multidimensional receptive-field basis function into the partially linear form. The expansion of˜ in the Taylor series can be obtained as where ξ =q T C Tm + H Tṽ + R Tr + q * T O t + ε. To develop the robust H ∞ controller, the derivative of e 2 (t) can be expressed aṡ The Lyapunov function is defined as where η 1 , η 2 , η 3 , and η 4 are positive constants. Taking the derivative of the Lyapunov function (40) and using (39) it is concluded thaṫ If the adaptive laws of the AORTSKCMAC are chosen as (27)-(30) and (31), (41) can be rewritten aṡ (43) Since V 3 (T ) ≥ 0, the above inequality implies the following inequality Using (40), the above inequality is equivalent to the following (45) If the system starts with initial condition e 1 (0) = 0, e 2 (0) = 0,w(0) = 0,m(0) = 0,ṽ(0) = 0,r(0) = 0 the H ∞ tracking performance in (41) can be rewritten as where ||e 2 || 2 = T 0 e 2 2 (t)dt and ||ξ || 2 = T 0 ξ 2 (t)dt. The attenuation constant δ can be specified by the designer to achieve the desired attenuation ratio between ||e 2 || and ||ξ ||. If δ = ∞, this is the case of minimum error tracking control without disturbance attenuation [20]. Then, the desired robust tracking performance in (46) can be achieved for a prescribed attenuation level δ.
Q.E.D. Figure 3 shows the structure of the proposed control system.

C. CONVERGENCE ANALYSIS
The learning laws of equations (27) to (30) are arbitrary positive constants. Obviously, the learning laws of (27) to (30) need to call for a proper choice of the constants η q , η m , η v and η r . For a small value, the adaptive speed is slow. On the other hand, the performances of the intelligent backstepping system may not be good if the constants are too large. Definitely, it is difficult to choose suitable learning rates for the four adaptive laws in real-time control by the user. To choose those constants effectively, the variable learning constants, which guarantee the convergence of the output error, are given in the following.
Here, the Lyapunov function is chosen as The change of the Lyapunov function is obtained as The error difference e 1 (N + 1) can be expressed as follows where it is obtained that The error term to be propagated is given by [23] σ p = − ∂V ∂y = − From (54) and (58), V (N ) can be represented as If η s is chosen as 0 < η s < 2 ||Q s (N )|| 2 [σ p e 1 (N )] 2 , V (N ) in (59) is less than 0. Therefore, the Lyapunov stability of V > 0 and V < 0 is guaranteed. Thus, the tracking error e 1 (N ) will converge to zero as t → ∞. From the above derivation, V > 0 and V < 0, when t → ∞, the stability of the Lyapunov function can be guaranteed. Q.E.D.

IV. SEVERAL SYSTEM RESPONSES
The BR is controlled by using the RIBTC in this section. Photographs of the BR experimental system are shown in Fig. 4. Here, the reference signals x d andẋ d are all zero.
The parameters of the BR are given as follows: the total weight of the BR is approximately 19.7 kg (M G is approximately 17.5 kg and M F is approximately 2.2 kg), l FO = 0.42m, and l GO = 0.2m.

1) CASE 1: BALANCE CONTROL WITH NONZERO INITIAL CONDITIONS
In this case, a standing upright balance control is tested, and its target lean angle of the BR is 0 degrees. The control system initial parameters shown above are considered. The system performance is shown in Fig. 5. The initial value of the system lean angle is given as π/10. In Fig. 5(a), the lean angle of the BR converges to 0 degrees at approximately 1 second. Moreover, the angular velocity of the BR also converges at approximately 1 second. The control effort of the BR is shown in Fig. 5(b). Clearly, the vehicle can stand upright stably. The system performance is shown in Fig. 6.
Comparing Fig. 5(a) with Fig. 6(a), the difference is small. In this case, the proposed controller can deal successfully with the effect of the initial parameter setting. Fig. 6(b) shows the control effort of the BR.

3) CASE 3: THE EFFECT OF BALANCE CONTROL WITH PARAMETER UNCERTAINTIES ON THE DYNAMIC RESPONSE
In this case, balance control is performed again. However, at 5 seconds, the angle error of the BR is given as 0.1. Moreover, at 10 seconds, the BR system input is suddenly 300. The system response is shown in Fig. 7. The largest differences are shown at 5 seconds and 10 seconds in Fig. 7(a). However, the angle trajectory finally converges to the intended target position. Obviously, in this case, the proposed controller can deal successfully with the effect of parameter uncertainties. Fig. 7(b) shows the control effort of the BR.

B. EXPERIMENTAL RESULTS
The proposed AORTCMAC in experimental testing is also characterized by ρ = 4, n E = 5, and n B = n R = 2 × 4. The initial conditions of the AORCMAC control system parameters are chosen as k 1 = 0. Generally, the Arduino mega 2560 unit is suitable for control algorithm implementation and system control. A 48 V DC  motor for the flywheel is also sufficient for system control. However, it is uncontrollable if a large extra disturbance is  exerted. In this subsection, the maximum lean angle of the BR is limited to less than 5 degrees.

1) BALANCE CONTROL EXPERIMENT
In this case, the BR starts at approximately 1.5 degrees on indoor flat ground. After 20 seconds, the experimental test stopped. The BR is required to stay at the origin point. Figure  8 shows the experimental results. The lean angle is shown in Fig. 8(a). Figure 8(b) shows the angular velocity of the BR. Obviously, the lean angle approaches zero degrees at approximately 2 seconds. Then, the BR stands stably.
For comparison, the classic PID, the fuzzy logic control (FLC), the Elman neural network (ENN) [23], and the Takagi-Sugeno (TS) fuzzy control schemes [24] are used to control the BR. In the Mamdani-like fuzzy controller, the Gaussian function is used as the membership function of the antecedent part. The consequent part is a singleton. The chosen parameters of the classic PID controller are: k p = 0.2, k i = 0.1 and k d = 0.2. The parameters of the AFSMC method are: γ f = 0.3, γ g = 0.2, γ k = 0.001 c 1 = 10, g max = 1.46, g min = 0.74, and F = 16. Moreover, the normalization factor of the fuzzy control term is K afs = 5.
In this case, the BR starts at approximately 1.5 degrees on indoor flat ground. After 20 seconds, the experimental test stopped. The BR is required to stay at the origin point. Figure 8 shows the experimental results. The lean angle is shown in Fig. 8(a). Figure 8(b) shows the angular velocity of the BR. Obviously, the lean angle approaches zero degrees at approximately 2 seconds. Then, the BR stands stably. For recording the respective control performances, the root-mean-square-error (RMSE) [21] for the angle tracking errors is defined as: where N = 4000 is sampling times for the angle tracking errors. The unit of RMSE is degrees. The experimental performance comparisons of the classic PID, the fuzzy control method, the ENN, and the TS fuzzy control scheme are summarized in Table 1.
According to the RMSE measures in Table 1, the proposed control scheme has the minimum RMSE.
Based on the above experimental results and Table 1, the RIBTC control system can achieve good control performance for the BR compared with the other methods. The proposed controller is suitable for BR real-time control.

2) LATERAL EXTERNAL DISTURBANCE EXPERIMENT
In this test, the BR starts at approximately 0 degrees on indoor flat ground. When the BR tends to stabilize, the external disturbance is given at approximately 11 seconds. The control process lasts for 20 seconds. Figure 13 shows the experimental performance. The lean angle of the BR is shown in Fig. 13(a). Figure 13(b) shows the angular velocity of the BR. It is obvious that the BR leans to 0.5 degrees when an external disturbance is exerted. Then, the BR tends to -0.5 degrees immediately. At approximately 13 seconds, the BR returns to stable status. Obviously, the BR stabilizes quickly.

3) MOVING BALANCE EXPERIMENT
The BR starts at approximately 0.5 degrees and goes to 100 cm before the start point on indoor flat ground. The BR reaches the target position at approximately 6 seconds, and then the BR stays in the target position stably until 20 seconds. Figure 14 shows the system performance of the BR moving forward control experiment. In Fig. 14(a), the lean angle of the BR has a large variation when the BR moves forward. After 6 seconds, the lean angle of the BR is maintained at approximately 0 degrees.
Obviously, good control performance is achieved by the proposed controller shown in the above experimental results. This means that the RIBTC is suitable for real-time BR control. Figure 15 shows a sequence of experimental photographs for the external disturbance test.

V. CONCLUSION
In this study, a BR real-world control system has been successfully implemented. The proposed intelligent controller is designed to maintain the bicycle balance. When the BR is hit by an external disturbance, the controller can still prevent the system from falling down. The main contributions of this work include (1) the successful design and implementation of a BR hardware, and (2) the successful realization of the proposed RIBTC control scheme to control the BR. The experimental results verify that the proposed control schemes are effective for BR real-world control.