Optimal Control for Single Inverted Pendulum Based on Linear Quadratic Regulator

This paper mainly analyzes the structure and mathematic model of the single rotation inverted pendulum, and presents a state expression. It analyzes controllability and substantial of the system with Matlab, and designs optional control. Simulation with Matlab shows that the system has good performance. At last it carries on experimental research and analysis for Q and R.


Introduction
Inverted pendulum system is a typical multivariable nonlinear strong coupling unstable system [1] .In the process of control, such as it can effectively reflect the theory of controlling system stability, controllable, robustness, convergence rate, follow-up and tracking.Its control method in military industry, aerospace, robot and in the field of general industrial process has a wide range of uses, such as the balance in the process of the robot control, verticality control of rocket and satellite attitude control in flight, etc [1,2] .Inverted pendulum system which is more ideal experimental apparatus control theory is often used to test the effect of the control strategy.
In recent years,LQR(Linear Quadratic Regulator) is the dynamic controller based on state space method.It is the development of the earliest and most mature a state space design method in the modern control theory.LQR performance index is easy to analysis, processing and calculation,the optimal solution with uniform analytic expression is convenience to form a simple linear state feedback control law, is advantageous for the project implementation [3] .So the LQR control strategy is widely used in robot control, electro-hydraulic servo system, aviation engine, electric power steering system, missile control, such as structural vibration control engineering field.
This article aims at single stage linear inverted pendulum control problem, the design has realized the single inverted pendulum with LQR optimal control based on linear quadratic form, and starting from the actual control effect [2] , discussed the selection of the weighted matrix Q and R will effect the features of the system.

The mathematical model of single stage inverted pendulum
The balance of the single-stage inverted pendulum control problem can be described as follows, an external force to the car base which makes the car stop at a predetermined position, and make the swinging rod is not down [4] so that no more than a predefined vertical deviation Angle range.
Ignore air resistance and the outside world after friction single-stage inverted pendulum system can be turned into the car and uniform quality of rod system, as shown in figure 1. M for the quality of car, l is the length of the beam centroid to the axis of rotation, displacement of x for cars, T as the Angle of swinging rod and vertical direction, F for the role of external forces on the car, m for the beam quality [6] .The initial conditions of the system is 0 , 0 x T .
Using Newtonian dynamics method we can find.In the formula, T , x is the car's acceleration respectively and the Angle of the pendulum rod acceleration respectively [9] .T , x is the speed of the car and swinging rod of angular velocity respectively.g is the acceleration of gravity.
For organising the type can be inverted pendulum motion equation.T as the higher order infinitesimal to make approximate treatment available.We can get these formulas.

°¿ °¾
Equation of state of inverted pendulum are as follows: This article selects four state variables are respectively the displacement of the car the car x , the speed the car x ,the Angle of the swinging rod and vertical direction T , swinging rod Angle of angular T , and state variables to establish a system state space equation [5] as follows:

Analysis of the stability of the inverted pendulum
Optimal control is the core of the modern control theory.The design idea is to establish the mathematical model of controlled object, choose an admissible control rule which makes the controlled object according to the predetermined requirement operation, and makes a certain performance index peaked at the last [3] .Due to the optimal solution of the linear quadratic control problem can be written as a unified analytical expression and to realize the standardization of the solving process, and can form a simple linear state feedback control law is easy to form closed-loop optimal feedback control [7] , easy to project implementation, has become a hot research topic of modern control theory and practice.
This article chooses the inverted pendulum Numbers are as follows: is controllable and observable.So we can add a optimal controller to the system, therefore, makes the closed-loop stability, and satisfy the transient performance indicators.

optimizing control theory of linear quadratic type
The following is the LQR control principle.
For a given state equations of linear time-invariant systems are as follows: Performance of the quadratic function: We need to achieve the minimum J to reach the optimal [6] .
The type of the first integral system in the process of control [8] , the dynamic tracking error weighted average and the integral requirements of system movement is in the process of dynamic tracking error of the measurement; The second integral item said control in the process of control of the system after the weighted total energy consumption measurement.
The Q is positive semi-definite matrix, R is positive definite matrix in the formula.
The optimal control: Which is suitable for the optimal feedback gain K for the solution of Riccati matrix.
We can work out the P from the Riccati matrix equation.(11) When Q and R take different values, the resulting control parameters are also different.

Simulation Results & Analysis
According to the front and the mathematical model of inverted pendulum using simulink to build a single stage inverted pendulum system model, and encapsulation.Q and R response the relative important degree between error and energy loss respectively, usually Q and R take all diagonal matrix, single-stage inverted pendulum system is only one input, so we should take R as a scalar.Q and R show the weighted values of state variables and input variables respectively .
Using Matlab to solve        In the first environment corresponding results and inverted pendulum controller output below.By the control result shows, LQR theory is adopted to control mode, the car position can accurately track the input signal, swinging rod overshoot volume is small enough, steady-state error, rise time and adjust time is basically conform to the requirements of the design index.
The simulation graph can be seen by the above increase the value of R can reduce overshoot amount of swinging rod, adjust time increased, at the same time also make car displacement changes in increasing; Increase the value of Q can make reduce the amount of regulating time and overshoot the swinging rod, the displacement of the car changes in decreasing.

Conclusion
LQR controller, robustness and transient characteristics of the poor, but the LQR controller has a better steady state characteristics, accurately track the input signal, the swinging rod and the overshoot of the car is small enough.
Based on the mathematical model of single stage inverted pendulum, established the state space description, and design of the single inverted pendulum with LQR controller, using MATLAB simulation and experiment results show that the system has good stability and rapidity, finally discussed the LQR matrix Q and R in the effect of the system.
DOI: 10.1051/ C Owned by the authors, published by EDP Sciences, 201

Figure 2 .
Figure 2. Schematic diagram of LQR method used in inverted pendulum feedback value of the coefficient matrix K .
The simulation graphics as shown:
The simulation graphics as shown:
The simulation graphics as shown: