The main idea behind the present research is to design a state-feedback controller for an underactuated nonlinear rotary inverted pendulum module by employing the linear quadratic regulator (LQR) technique using local approximation. The LQR is an excellent method for developing a controller for nonlinear systems. It provides optimal feedback to make the closed-loop system robust and stable, rejecting external disturbances. Model-based optimal controller for a nonlinear system such as a rotatory inverted pendulum has not been designed and implemented using Newton-Euler, Lagrange method, and local approximation. Therefore, implementing LQR to an underactuated nonlinear system was vital to design a stable controller. A mathematical model has been developed for the controller design by utilizing the Newton-Euler, Lagrange method. The nonlinear model has been linearized around an equilibrium point. Linear and nonlinear models have been compared to find the range in which linear and nonlinear models’ behaviour is similar. MATLAB LQR function and system dynamics have been used to estimate the controller parameters. For the performance evaluation of the designed controller, Simulink has been used. Linear and nonlinear models have been simulated along with the designed controller. Simulations have been performed for the designed controller over the linear and nonlinear system under different conditions through varying system variables. The results show that the system is stable and robust enough to act against external disturbances. The controller maintains the rotary inverted pendulum in an upright position and rejects disruptions like falling under gravitational force or any external disturbance by adjusting the rotation of the horizontal link in both linear and nonlinear environments in a specific range. The controller has been practically designed and implemented. It is vivid from the results that the controller is robust enough to reject the disturbances in milliseconds and keeps the pendulum arm deflection angle to zero degrees.
The rotary inverted pendulum (RIP) is an unstable system with nonlinear dynamics. RIP is the underactuated mechanical system with lesser control inputs than the degree of freedom. The control of such a system is a more challenging task, and the system becomes a classical benchmark for designing, testing, estimating, and comparing different control techniques [
It is a multivariable nonlinear dynamical system having two links. One link revolves around an axis in the horizontal plane so that the other can balance itself upright [
Model-based control techniques have been used frequently, but fuzzy and non-model-based approaches have been utilized too. Newton’s laws or energy balance approaches have been used to formulate the dynamic model [
The energy-based method achieves swing-up and vertical stabilization [
To our knowledge, no efforts have been reported in the literature so far in which an optimal controller for a nonlinear system such as a rotatory inverted pendulum has been designed and implemented using Newton-Euler, Lagrange method, and local approximation. In the current research work, the following are the key contributions: The system has been modelled. The resulting model has been linearized around an equilibrium point. The comparison of the two models has been made in Matlab and Simulink to find the local approximation. The linearized state-space model has been used to estimate the parameters of the LQR controller. The controller has been implemented for both models, and its performance and stability have been analyzed.
The proposed work has been implemented, and the hardware is developed, as shown in
The paper is organized as follows. In Section 2, mathematical modelling has been developed, and linearization has been done around the equilibrium point. The simulation result of the comparison to find a local approximation has been described in Section 3. The controller design has been discussed in Section 4. Section 5 highlights the performance and stability of the controller. The conclusion of the paper has been given in Section 6.
The Lagrange method has been used to develop the mathematical model of this underactuated nonlinear unstable system Newton-Euler. Newton-Euler equations describe the translation and rotation of a rigid body. These equations show the relation among forces and torques acting on a rigid body in the form of matrices [
A free-body diagram of RIP mounted on a box having the reference frames is presented in
Symbols | Description |
---|---|
Length to pendulum’s center of mass | |
Mass of pendulum arm | |
Rotating arm length | |
Servo load gear angle (in degrees) | |
Pendulum arm deflection (in degrees) | |
Distance of pendulum center of mass from the ground | |
Moment of inertia of motor, gear, and arm |
The potential energy (PE)
Substituting
The Lagrangian
Now by simplification of
Substituting the value
Mathematical modelling uses the Newton-Euler, Lagrange method to design a controller. The resulting model was nonlinear, so linearization was required, which was done around an equilibrium point. Following are the assumptions from
The motor torque is given by:
where:
where,
To find the range of angle (
MATLAB (2018a, MathWorks, MA, USA) has been used to evaluate the parameters of the LQR controller. Matrices A and B have been assessed using the system setup parameters and initial conditions in
Parameters | Parameters description | Values |
---|---|---|
Length of pendulum’s center of mass in meter | 0.1675 | |
Mass of pendulum in kg | 0.125 | |
Length of rotating arm in meter | 0.158 | |
Moment of inertia (motor, gear, arm) | 0.0036 | |
Viscous damping of the motor | 0.004 | |
The efficiency of the gear | 0.9 | |
The efficiency of the motor | 0.69 | |
Resistance of the motor | 2.6 | |
Torque constant of the motor | 0.0077 | |
Gear ratio | 70 | |
Damping constant | 0.0076 | |
Encoder constant | 0.0015 |
Q matrix contains 1 in the main diagonal, which means the angular velocities, i.e., (
The designed controller has been simulated in Matlab Simulink. Simulation has been performed for both models, and the controller’s performance has been presented in this section. The plots show the variation in angles along the vertical axis
Similarly, the vertical arm of RIP has been shaken by setting
In
Similarly, the performance of the controller has been evaluated by changing both variables of the system, i.e., (
The designed controller has been tested over an inverted pendulum, shown in
In the proposed research work, we have designed a state-feedback controller for the inverted rotary pendulum utilizing the LQR techniques. A complete set of analyses has been developed to provide a validation of the designed system. The performance of the designed controller is measured for the linear and the nonlinear system using the local approximation. It is evident from the simulation results that the designed controller is giving optimal performance and is robust enough to keep the pendulum in an upright, stable position. The performance has been evaluated by varying the angles of the horizontal and vertical arms of the RIP. From the simulation results, it can be seen that the controller stabilizes the pendulum arm under various disturbances in a specific range. The simulation results have been validated over a real, inverted pendulum. In future, a fuzzy controller will be implemented to compare the performance of the two controllers.
Authors would like to thank Christopher Hille and Dmitry Konstantinov for a thorough discussion.
The authors received no specific funding for this study.
The authors declare they have no conflicts of interest to report regarding the present study.
Appendix A
To evaluate
where
Taking the differential of
Now taking
Taking the differential of
where:
where
Now differentiating
Now taking
where:
Now simplify
Finally, we get two equations (i.e.,
From
Substituting the value of
Now simplifying
The linear system can be expressed by:
For the nonlinear system, the linearized system looks as follows:
The equilibrium point is given by: