Predictive PID Control Based on GPC Control of Inverted Pendulum

Having regard to the large application of the inverted pendulum in robotic system, this study is interested in controlling this process with two strategies of controls. The first proposed control is the state feedback with an observer based on the Generalized Predictive Control (GPC) algorithm. In the second proposed control we used the characteristic of predictive control GPC to improve the performance of the classical PID controller. The obtained results have been discussed and compared; the simulation results obtained by the predictive PID control are mentioned.


INTRODUCTION
In this study, we have attempted to design a new methodology of synthesis of a PID Controller using Generalized Predictive Control (GPC), this proposed PID control is based on the calculation of an equivalent set of PID parameters based on a control law GPC obtained by using a general process model (Uren and Schoor, 2011;Johnson and Moradi, 2005).However, the implementation of GPC on real time processing need a long execution time that is why the new developed PID approach tends to be easy in real-time implementation to control the industrial system.
The PID control (Proportional-Integral-Derivative control) is a very popular control strategy in the industry hanks to its simple structure and easy adjustment.PID control can usually obtain satisfactory control performance and have been proved to be practical in many industrial processes (Uren and Schoor, 2011;Johnson and Moradi, 2005).GPC belongs to the class of technical Model Predictive Control (MPC).This control strategy is among the most popular and powerful tool to solve many problems.GPC uses a model that includes the prediction of future outputs over a certain horizon and that can provide a variations in the signal measuring and controlling actions based on this prediction (Uren and Schoor, 2011;Johnson and Moradi, 2005;Mrabet and Gu, 2009;Pacheco et al., 2011;Clarke et al., 1987).
The control of the inverted pendulum proposes a classical important problem in the control theory, this model offer a rich research environment to implement a variety of control algorithms (PID controllers, neural networks, fuzzy control, genetic algorithms, etc.) (Parada Renato et al., 2011;Johnson and Moradi, 2005).Today, the linear inverted pendulum model is widely used in robotics application, especially in the task of trajectory generation, it is a major problem in research of biped robot (Kajita et al., 2005(Kajita et al., , 2001;;Morimoto et al., 2006;Sakka et al., 2010).In this study we are interested to the control of an inverted pendulum with two ways.The first methodology is the predictive state feedback with an observer; the second is the predictive PID control.The proposed strategies of controls are both based on GPC control law.
The first part of this study presents the algorithm of the Generalized Predictive Control (GPC).The second part present the state feedback control with an observer based on GPC law.In the third part we are proposed the predictive PID control based on GPC control and in the fourth part we introduce the mathematical model of inverted pendulum and the state space representation.
Finally, we present a comparison between control signal obtained from state feedback with an observer using model predictive control and the proposed predictive PID, both methods are applied to control of an inverted pendulum model.The principal advantage of the proposed method is that the input constraints and future trajectories can easily be incorporated into the control design.The simulation results are presented to demonstrate the performance of the proposed predictive PID control.

GPC ALGORITHM
We begin this study by considering the discretetime state space representation of a single-input and single-output system, described by the following system: ( 1) ( ) ( ) where, x d (k) is the variable state, y d (k) is the output variable and u (k) is the input variable.The predictive controller designed for this model should be put in the form of an augmented model with an integrator.The simply description of the GPC algorithm is giving step by step as follows (Uren and Schoor, 2011;Johnson and Moradi, 2005;Pacheco et al., 2011): Step 1: In the first step we take the difference between x d (k + 1) and x d (k) on both sides of (1), we obtained the following equation: ( ( ( ) ( 1)).
The following equations represent the difference of the state variables and control variables given by: ( 1) ( 1) ( ) With the Eq. ( 4), ( 5) and ( 6), the difference of the state-space equation is: ( 1) ( ) ( ) Step 2: In this step we connect ∆x d (k) to the output y d (k) to obtain the integration effect and we chose the new augmented state vector X (k): The output equation can then be written as: ( 1) ( ) Putting together ( 8) with ( 9): (10) The new state model given by system (10) is: ( This augmented model will be used in the design of predictive control in the rest of the paper.
Step 3: The prediction of the plant output with the future control variable is the important step in the predictive control design.Let the sampling instant k; with k>0.
The future control trajectory given information about X (k) is denoted by: ( ), ( 1), , ( 1) The future vector of control movement is denoted by: where, nc is called the control horizon.
The future state variables X (k) are predicted for np number of samples instant, where np is called the prediction horizon.The future state variables X (k) are denoted by: (14) Based on the state-space of augmented model (A, B, C), the future state variables are calculated sequentially using the set of future control parameters (Uren and Schoor, 2011).Using system (11) we can write the relations recursively for np-step ahead prediction: ( 1 ) The predicted output variables are, by substitution: ( 1 ) The matrices forms are: where, X and Y are, respectively the predicted input and output vectors: The equation above can now be ordered in augmented state space from as:

PREDICTIVE STATE FEEDBACK WITH AN OBSERVER
This section present the application of control law presented in the previous section on a linearized system.We integrate the GPC algorithm with a state feedback control with an observer.The aim is to design a controller that returns the output response of the system follow a given reference signal (Prakash and Senthil, 2007;Xiaohua and Yuanhua, 2008;Roset and Nitmeijer, 2004;Kokate and Waghmare, 2010).Then the control equation using estimated state is: The construction of the observer is based on the model of the plant, described in Eq. (1).After some transient time, the state estimate variable can be calculated and denoted by: Then d (k) is the estimated state.A current estimator d (k) based on the most recent measurements of y d (k).The error between the output state variable and the estimated output variable denoted by: ( ) ( ) ( ) The construction of the observer consists of two terms, the first term is the model plant and the second term is the correction term between the measured outputs used the predictive estimate d (k) and the output prediction.The described equation denoted by: where, L ob is the observer gain matrix.Note that in the implementation of predictive state control using an observer, the control signal ∆ and the matrices (A, B, C) come from the augmented model are used for the predictive control design (Xiaohua and Yuanhua, 2008;Roset and Nitmeijer, 2004).
where, (k) = The augmented output estimator (k) = The augmented state estimator With the information of (k) replacing X (k), the predictive control law is then modified to find ΔU by minimizing of the cost function J ob where: R is the same for all the paper, with r≥0 is a constant used for ameliorate the desired closed-loop performance.The value of r is r = 0.9: ˆ( ) ( ) The necessary condition of the minimum J ob is obtained as: From which we find the optimal solution for the control signal as: Then the optimal solution of ∆u (k) at time k: where, 1 ( ) The observer gain L ob is calculated from the poles of the system P s , the Observer poles P ob must be faster P s .In our case we impose the observer poles ten times faster than the poles of system.Equation ( 24) represents a standard state feedback control with estimated (k).The structure of closedloop state feedback is illustrated in Eq. (25) as: Note that the closed-loop observer error (k + 1) equation is: where, The Eq. ( 25) is rewritten as: ( 1) ( ) ( ) ( ) ( ) Combination of ( 26) with (28) leads to:

PREDICTIVE PID APPROACH
In this part of paper, the generalized predictive control law is used for synthesis of a predictive PID.This methodology of control introduces the predictive output of process and the optimal control parameters for calculate the error, between output signal and the setpoint, at simple instant k.This obtained error can be put in the conventional form of PID controller (Uren and Schoor, 2011).
Conventional PID structure: The discrete form of PID controller given by the following equation: PID controllers could be written as (Johnson and Moradi, 2005): where, 0 and e (k) represents the error at sample k.
The velocity form of PID controller can be obtained with the control input increment at instant k: where, the three gain of the conventional PID controller are k p , k i and k d are the proportional, integral and derivative gains, respectively.The Eq. ( 32) can be written in matrix form as: where, Proposed predictive PID control: Consider the following quadratic cost function presented by Eq. ( 35), where the first principal part minimize the errors between the reference signal and the output signal, the second part minimize the control effort.Propose y r (k) the set-point signal at sample time k: The aim of the proposed predictive PID controller is to maintain the output signal provided as near as possible to the reference signal (Uren and Schoor, 2011).
The optimal parameter vector ΔU can be obtained by substituting of Eq. ( 18) into (35), J y is expressed as: The necessary condition of the minimum J is obtained as: From the first derivative of the cost function J y : 2 ( ( )) 2( ) 0 From which we find the optimal control vector solution as: ) With the obtained results given by ( 40), we can conclude the equality of two gains:

INVERTED PENDULUM MODEL
The inverted pendulum presented in Fig. 1 can be found in a variety of machines that incorporate components with a similar dynamic.The inverted pendulum can be regarded as a simple model of a biped robot (Kajita et al., 2005(Kajita et al., , 2001;;Jong and Kyoung, 1998;Erbatur et al., 2009;Morimoto et al., 2006;Sakka et al., 2010;Zhu et al., 2004).
Let us denote by: g : The acceleration of gravity θ : The angle between vertical and the pendulum where, J = ml 2 We can now combine ( 41) and ( 42) to a single one: ..
( ) sin ( ) ( ) For this equation, we set The Eq. ( 44) will be written: We can put the Eq. ( 45) in the state space form.We choose the state variables x = (θ θ); the continuous state space representation is given by: . . 2 .. 0 We can be deduced the discrete state space system with Ts = 0.1 sec: (47)

COMPARISON OF SIMULATION RESULTS
The proposed methodologies of control based on GPC control are implemented using MATLAB, the simulation results, are presented and discussed in this section: Scenario 1: The first proposed scenario given by the Fig. 2: The pendulum follow a linear path, the  [-365.3934 -365.3934 22.6716] 22.6716The optimal Kpid gain is: -418.3310 149.7301 26.1517)The simulation result obtained by the application of the both proposed controls is shows in Fig. 2.
Scenario 2: The following Fig. 3 shows the comparison of the closed loop responses of the inverted pendulum given by the predictive PID control and the predictive observer state feedback control.
We can see that the closed-loop response of the output system with the proposed PID control given immediately response and follow the reference.As long as the predictive observer state feedback control acts after a noticeable time-delay and the shape of the response curve does not follow the control signal correctly.

CONCLUSION
The design of predictive controllers based on the generalized predictive control is investigated in this study.The GPC control algorithm can give a new methodology of synthesis of a predictive PID control.The proposed predictive controllers are applied to control an inverted pendulum system and the results obtain by the proposed predictive PID is compared with a predictive observer state feedback.The proposed predictive controllers are able to keep the centre of mass of the inverted pendulum track the desired trajectory.The predictive PID control has the potential of offering a good path tracking performance.
So the new developed PID approach tends to be easily implemented in real-time processor to control the industrial system.

Fig. 2 :
Fig. 2: Output system responses given by the predictive PID control and the predictive observer state feedback continuous line represents the desired trajectory of the center of mass.The implementation of the predictive state feedback algorithm with in observer on the inverted pendulum model gives the following result: [ -205.7602 -17.6418]' ob L  the predictive PID controller based on GPC algorithm for a control of an inverted pendulum begins by creating an augmented model and then we choose best values of the control horizon and the prediction horizon.In this simulation the control horizon nc = 3 and the prediction horizon np = 10.F and Φ are matrices and U  present the optimal control parameters: 8951 7.0954 1.0000 -27.1900 7.6169 1.0000

Fig. 3 :
Fig. 3: The closed loop response with proposed PID control reference signal and state observer control