Keywords

1 Introduction

Two-wheel self-balancing mobile robot (TWSBMR) is based on two degrees of freedom (2 DOF) robot workstation. It is highly unstable and nonlinear system which is the keen interest of researchers to make it stable and linearize. Two-wheel inverted pendulum which is basically mounted on 2-DOF means two rotary servo base units with a 4-bar linkage system. Two-wheel self-balancing robot consists of a two-DOF instrumented joint, on which an almost 12 in. rod is bolted, which is free to rotate about two rectangular axes. The main aim of the 2-DOF inverted pendulum is to command and control position of the 2-DOF robot end effectors [1] to balance the 2-DOF inverted pendulum system module [2]. By measuring vertical position deviation, a controller is used to rotate the servo such that the end of the servo effectors balances the pendulum [3]. Designing a controller is necessary so that it can maintain the pendulum upright using the two servomotors. It provides so many concepts to the student for aerospace engineering application, such as rocket stabilization, self-balancing robot, earthquake resistant, and building construction [4,5,6].

Previously, several researches have been done which are actually based on inverted pendulum, and it is old secure and easy topic for the research to start and understand for the researchers, like a person upper body needs adjustment constantly to maintain and balance when we are standing or walking. From past few years, it has been found that the researchers design some controllers for the two-wheel self-balancing mobile robot, and using PID controller and fuzzy logic, it is easy to control any system [7]; in this paper, LQR and PID controller have been proposed. Researchers have made two-wheel self-balancing mobile robot in laboratory at the industrial electronics. There are various studies based on stabilization and optimization of two-wheel self-balancing mobile robot. For this chapter I studied proportional and proportional derivative (PD) and go through it [8], proportional integral derivative (PID), linear quadratic regulator (LQR) [9], and model predictive control (MPC). And some more research work which is relevant and based on two-wheel mobile robot [10, 11] has been presented. Further, the chapter is categorized in following sections like Sect. 2 illustrates dynamic modeling of two-wheel self-balancing mobile robot, in Sect. 3 LQG and MPC controller configuration is modeled and designed, Sect. 4 discusses the simulated results and performance comparison of critical characteristics, followed by conclusion in last section.

2 System Modeling

The physical prototype of two-wheeled mobile robot consists of a rigid pole on a cart which is attached to two driving wheels. The mathematical formulation [12] of two-wheeled mobile robot is obtained assuming zero resistance in the air flow, negligible secondary friction, etc. The horizontal movement of cart is represented by distance x. M and m are used to define the mass of cart and pole, respectively. Lc represents the total pole length. The angle by which the pole is titled is described by φ. The wheel mobile robot is driven with the help of a wheel inverted pendulum [13, 14].

3 Model of the Wheel of Inverted Pendulum

The torque produced by left wheel is represented by \(D_{L}\) and that by right wheel is \(D_{R}\) as shown in Fig. 3. The reactive force exerted on left wheel is defined by \(R_{FL} , R_{FR}\) and that in right wheel by \(R_{FL} , R_{FR}\). The equation of motion of left wheel can be represented by Eq. (7) and that of right wheel by Eq. (8).

Fig. 1
figure 1

Wheel of robot free body

Fig. 2
figure 2

LQG controller with plant

Fig. 3
figure 3

Disturbance rejection capability of LQG controller with plant

Fig. 4
figure 4

Disturbance at t = 10 s and LQG controller with plant once disturbance produced

Fig. 5
figure 5

Laguerre function for different values of p and N

For the left wheel

$$M_{w} \ddot{y} = - \frac{{\tau_{mot} \tau_{e} }}{Rr}\dot{\sigma }_{w} + \frac{{\tau_{mot} }}{Rr} V_{a} - \frac{{I_{{w\dddot \sigma_{w} }} }}{r} - R_{FL}$$
(1)

For the right wheel

$$M_{w} \ddot{y} = - \frac{{\tau_{mot} \tau_{e} }}{Rr}\dot{\sigma }_{w} + \frac{{\tau_{mot} }}{Rr} V_{a} - \frac{{I_{{w\dddot \sigma_{w} }} }}{r} - R_{FR}$$
(2)

After converting angular velocity described by \(\dot{\theta }\) into linear velocity \(\dot{x}\) Eqs. (3) and (10) can easily be derived for left and right wheels, respectively,

For the left wheel

$$M_{w} \ddot{y} = - \frac{{\tau_{mot} \tau_{e} }}{{Rr^{2} }}\dot{y} + \frac{{\tau_{mot} }}{Rr} V_{a} - \frac{{I_{{w\ddot{y}}} }}{{r^{2} }} - R_{FL}$$
(3)

For the right wheel

$$M_{w} \ddot{y} = - \frac{{\tau_{mot} \tau_{e} }}{{Rr^{2} }}\dot{y} + \frac{{\tau_{mot} }}{Rr} V_{a} - \frac{{I_{{w\ddot{y}}} }}{{r^{2} }} - R_{FR}$$
(4)

By adding Eqs. (9) and (10), resultant equation will be

$$2\left( {M_{w} + \frac{{I_{w} }}{{r^{2} }}} \right)\ddot{y} = - 2 - \frac{{\tau_{mot} \tau_{e} }}{{Rr^{2} }}\dot{y} + 2\frac{{\tau_{mot} }}{Rr}V_{a} - \left( {R_{FL} + R_{FR} } \right)$$
(5)

3.1 Cart Model

The mathematical formulation of the cart on pole is derived by many scientists [4,5,6] and is written as follows;

$$(I_{p } + l^{2} M_{b} )\ddot{\sigma }_{p} - 2\frac{{\tau_{mot\tau e} }}{Rr}\dot{y} + 2\frac{{\tau_{mot} }}{Rr}V_{a} + M_{p} gl\sin \sigma_{p} = - M_{p} \ddot{y}l\cos \sigma_{p}$$
(6)
$$2\frac{{\tau_{mot} }}{Rr}V_{a} = \left( {2M_{w} + 2\frac{{I_{w} }}{{r^{2} }} + M_{p} } \right)\ddot{y} + 2\frac{{\tau_{mot\tau e} }}{{Rr^{2} }}\dot{y} + M_{p} l\ddot{y}_{p} \cos \ddot{y}_{p} \cos \sigma_{p} - M_{p} l\dot{\sigma }^{2}_{p} \sin \sigma_{p}$$
(7)

Since state-space representation of any given system requires first-order differential equations, above equations are linearized as follows;

$$\sigma_{p} = \pi + \emptyset$$
(8)

where \(\emptyset\). The right angle which is upside

$$\cos \sigma = - 1, \sin \sigma = - \emptyset , \frac{{{\text{d}}\sigma_{{p^{2} }} }}{{{\text{d}}t}} = 0$$
$$\ddot{y} = 2\frac{{\tau_{mot} \tau_{e} \left( {M_{p} l_{r} - I_{p} M_{p} l^{2} } \right)}}{{Rr^{2} a}}\dot{y} + \frac{{M_{p}^{2} gl^{2} \theta }}{\alpha } + 2\frac{{\tau_{mot} \left( {I_{p} + M_{p} l^{2} - M_{p} l_{r} } \right)}}{Rr\alpha }V_{a}$$
(9)
$$\ddot{y} = 2\frac{{\tau_{mot} \tau_{e} \left( {r\beta - M_{p} l} \right)}}{{Rr^{2} a}}\dot{y} + \frac{{M_{p} gl\rho \theta }}{\alpha } + 2\frac{{\tau_{mot} \left( {M_{p} l - r\rho } \right)}}{Rr\alpha }V_{a}$$
(10)

The actual values of the different parameters of given pole and cart model are as follows;

Parameter description

Value with units

Parameter description

Value with units

Gravitational acceleration (g)

9.80 m/s2

Body inertia (Ip)

0.21 Kgm2

Wheel radius (r)

0.062 M

Dist from body’s center of mass (l)

0.22 m

Wheel mass (Mw)

0.1 kg

Motor torque (Km)

0.0335 N m/A

Body mass (Mp)

5.4 kg

Back EMF (Ke)

0.0435 V/(rad/s)

Wheel inertia (Iw)

0.0013 Kgm2

Terminal resistance (R)

\(\Omega \)

4 Designing of Controller

Any disturbance causes the pole on the cart to deviate from its upright position, and the role of the controller is to bring back the pole to its stable vertical position. The system specifications described above impose some constraints on the settling time of four seconds to regain its stable cart position and to the deviation in the angle of pole is \(\pm 0.6 \,{\text{to}}\, \pm 0.8\) rad.

4.1 Linear Quadratic Regulator

The difference between the linear quadratic regulator and Gaussian controller is operated along with Kalman’s filter, and this gives it an edge over LQR which is used for both time-variant as well as time-invariant systems.

$$\dot{y} = Ay + Bu$$
(11)
$$z = Cy$$
(12)

LQR and Kalman filter together formed linear quadratic controller, which can be used for linear time invariant and time variant. In this chapter, we design LQG controller and found satisfactory results, as the optimal controllers are distinguished from normal controllers in terms of performance measure, J, given by following quadratic relationship.

$$J = \frac{1}{2}\mathop \smallint \limits_{0}^{\infty } \left( {y^{T} Qy + U^{T} RU} \right){\text{d}}t$$
(13)

where Q and R are state variable and control vector weighting matrix

$$U = - Ky$$
(14)

where ‘K’ is the gain matrix given by

$$K = R^{ - 1} B^{T} P$$
(15)

P can be calculated using matrix Riccati equation

$$A^{T} P - PA + Q - PBR^{ - 1} B^{T} P = 0$$
(16)
$$\dot{y}\left( t \right) = Ay\left( t \right) + BU + L\left( {z\left( t \right) - Cy\left( t \right) - DU} \right)$$
(17)
$$U = - Ky\left( t \right)$$
(18)
$$\dot{y}\left( t \right) = \left( {A - BK - LC + LDK} \right)y\left( t \right) + Lz\left( t \right)$$
(19)

5 Result and Discussion

All the simulation work has been done on MATLAB software, and we found that the impulse response using LQG controller is better what we have gone through. Settling time is 2.30 s position and the pendulum angle is 1.78 s and their peak amplitude is 0.166 rad. When the system based on LQG controller starts to stabilize, it will be easily stabilized in three seconds, when we produce disturbance system, it will take ten seconds to stabilize itself again. LQG controller found good when disturbance is produced in it and can stabilize itself quickly.

For describing the CMPC controller, Laguerre function is used. Different values of P and N are shown here in the given below.

6 Conclusion

Mathematical modeling of LQG and MPC controller is designed well. Both the controllers are designed using state space, and comparison has been shown. For the simulation work, we use MATLAB software, and all the simulated results have been produced well. System impulse response using LQG controller and their disturbance rejection capability with the plant have been produced. Design controller is found well, and Laguerre function with second- and fourth-order coefficient has been produced and found satisfactory. Controller designed for the two-wheeled self-balancing mobile robot is found easily used for the system.