Feedback Optimal Control for Inverted Pendulum Problem by Using the Generating Function Technique

—In this paper, a model is described for a system consisting of an inverted pendulum attached to a cart. We design for this model a feedback optimal control based on Linear Quadratic regulator, LQR by using the generating Function technique. This design with hard and soft constraints will help the pendulum to stabilize in the upright position. A solution of the continuous low-thrust optimal control problem based on LQR method is implemented. An example applied to this control design for a hard constraint boundary condition.


I. INTRODUCTION
The traditional problem for the field of control systems is the inverted pendulum system see e.g.[1] , [3] , [5] , [6] and [9].The system is consist of an inverted pendulum exposed to a torque and attached to a cart which equipped with a motor that drives it along a friction horizontal track.Both the torque and the force produced from the motor of the cart are the feedback-control forces.there are two equilibrium points for the inverted pendulum system, one of them is that when the pendulum is pointing downwards which is stable, the other one is at the upwards position which is unstable.The stable equilibrium requires no control input to be achieved and, thus, is uninteresting from a control perspective.The unstable equilibrium corresponds to a state in which the pendulum points strictly upwards and, thus, requires a control force to maintain this position.
In literature, the feedback control of inverted pendulum control system is made by linearizing the dynamics about the nominal trajectory and by applying the classic control theory to such linear dynamical system.The approach of optimal feedback control using the generating function [8] is very efficient when used to solve the control problem of this system.In order to use the feedback optimal control approach the lateral dynamics is expressed in a state vector form with adding the control forces to the equations of motion.

II. MODELLING
In this system, a pendulum with a torque T(t), is attached to the side of cart by means of a pivot which allows the pendulum to swing in the xy-plane.A cart equipped with a motor exerts force F(t), provides horizontal motion of the cart on a friction track, see Fig 1 .The purpose of the torque T(t) and the force F(t) is that keeping the pendulum balanced upright.

A. Formation of the problem :
By assuming that the pendulum is a thin rod with length l.Then, applying Newton's second law to the linear and angular displacement, the equations of motion are [4] 2 where M is the cart mass, m is the pendulum mass, x(t) is displacement of the center of mass of the cart from the center of the inertial frame, tis the angle between the pendulum and the top vertical.After some calculation, we can obtain 2 4 2 cos 2 sin ( ) and g is the acceleration due to gravity and equal 9.8 m/s.
By introducing the following variables for a more convenient form of the equations ( 3) and (4) ( , , , ) ( , , , ) TT y y y y x x   y (6) We obtain the following equivalent first-order system (7) where It is well known that for (7) with no control (F(t) = 0 and T(t)=0), the cart at rest with the pendulum in the upright position is an unstable equilibrium, while the cart at rest with the pendulum in the downward position is a stable equilibrium.Our concern is that when the pendulum at the unstable equilibrium point, so in the following section the system will be linearized about the unstable equilibrium (0,0,0,0) T .

B. Linearization:
Now, by putting (7) in the following form ( ) ( ) CD  y y y y u (9) where ) The system (9) will be linearized about the nominal trajectory (0,0,0,0) This linearized system (13) allow to apply the feedback optimal control to balance the inverted pendulum around the point of linearization, as seeing in the following section.

III. CLOSED LOOP (FEEDBACK) OPTIMAL CONTROL PROBLEM
The feedback optimal control problem is introduced to find optimal solutions minimize a certain performance index starting from a generic initial state 0 y , The outcome is a control law written in terms of the time and the initial state, 0 0 0 ( , , ),   , we are able to compute the new optimal solution by simply evaluating 00 ( ' , , ) v v y t t  , avoiding, in this way, the solution of another two-point boundary value problem.Thus, a trajectory designed in this way has the property to respond to errors that occur during the transfer.Another important aspect of this approach is the robustness of the solution.Once the optimal feedback control problem is solved, the solution 00 ( , , ) v v y t t  is available.Analyzing this function, the control law that is less sensitive to changes in the initial conditions can be chosen as nominal solution.This solution is said to be robust with respect to the initial conditions.

A. Solving the Feedback Optimal Linear Quadratic Terminal Controller Using the Generating Function Technique
Consider the problem of minimizing the following performance index , [7] , [ where the set of Lagrangian multipliers has been introduced.From the optimality condition It is possible to get an explicit expression for the control in terms of the Lagrangian multipliers Substituting the expression of given by equation ( 19), the Hamiltonian (17) turns out to be 1 1 2 while the dynamics of the system and that of the Lagrange multipliers reduces to which can be used to find the unknown boundary conditions using the given ones.From the properties of 2 whose sub-matrix components provide the following set of matrix ODEs for (Riccati Equations [2] Since we have 0 y and f y are given the initial Lagrange multiplier can be evaluated through Using (30) we can get the optimal trajectory by forward integration of (21).Since this relation (30) is valid for any initial time f tt  , we have 0 0 0 ) then we have By equating the second and the third equations we get a relation between 0 y and f y which can be plugged into the first equation to get ( , ) , Using (32) we can get the optimal trajectory by forward integration of (21).Since this relation (32) is valid for any initial time When f Q is large enough the SCP solution converges to the HCP one.

IV. NUMERICAL EXAMPLE
The values of the parameters for our numerical example are given as follow, 0.    In the present study, the feedback optimal control of highly nonlinear inverted pendulum problem is solved by linearizing the original nonlinear dynamics.The linearized problem has been solved using the generating function technique where the method can be used for both hard and soft constraint boundary condition.
A proof exists in the very simple case of linear hard constraint problem (the final state is fully specified) and the figures (Fig2 to Fig 10) for the numerical example showed an excellent result in keeping the inverted pendulum in the unstable state for a short time.For a future work we can apply the same method feedback optimal control by using the generating function technique on the double inverted pendulum.

Fig. 1 .
Fig. 1.Inverted Pendulum system 25)Since the Hamiltonian at the fixed state can be taken zero without any loss of generality, then the Hamiltonian of the moving state and the generating function satisfy the Hamilton-Jacobi PDE (22.c) resulting data in the following figures

Fig. 7 .Fig. 8 .Fig. 9 .
Fig. 7. Plot of ̇ www.ijacsa.thesai.orgThis represents a closed loop solution: given any initial state 0 y at the time 0 t , it is possible to evaluate the optimal solution starting from such state up to the final target.If for any reason the state is perturbed and assumes a new value