Modelling and Simulation of Inverted Pendulum
using Internal Model Control
Dimple J. Vora Ms. Nabanita Basu
PG student Assistant Professor
Department of Instrumentation & control Department of Instrumentation & control L.D. Collage of Engineering ,Ahmedabad, Gujarat, India L.D. Collage of Engineering ,Ahmedabad, Gujarat, India
Abstract
The internal model control (IMC) philosophy relies on the internal model principle, which states that control can be achieved only if the control system encapsulates, either implicitly or explicitly, some representation of the process to be controlled. In particular, if the control scheme is developed based on an exact model of the process, then perfect control is theoretically possible. Transfer function of Inverted Pendulum is selected as the base of design, which examines IMC controller. Matlab/simulink is used to simulate the procedures and validate the performance. The results shows robustness of the IMC and got graded responses when compared with PID. Furthermore, a comparison between the PID and IMC was shows that IMC gives better response specifications.
Keywords: IMC, Inverted Pendulum, MATLAB/simulink
_______________________________________________________________________________________________________
I.
I
NTRODUCTIONEvery feedback controller is designed by employing some form of a model for the process that is to be controlled and/or the dynamics of the exogenous signal affecting the process. Consequently, the term "model-based" is often used here. 30-years ago, a new model-based controller design algorithm named "Internal Model Control" (IMC) has been presented by Garcia and Morari, which is developed upon the internal model principle to combine the process model and external signal dynamics.[7] In the control theorem, the control systems design is fundamentally determined by the steady state and dynamic behavior of the process to be controlled. It is an important issue to know the way in which the process characteristics influence the controller structure. The internal model control (IMC) viewpoint appeared as alternative to traditional feedback control algorithm, which link the process model with the controller structure. [7]
The theory of IMC states that “control can be achieved only if the control system encapsulates, either implicitly or explicitly, some representation of the process to be controlled”. The main objective is to design an IMC Controller for the proposed pendulum system to reduce the effect of disturbance due to mismatching in modeling.
II.
I
NTERNAL MODEL CONTROLA schematic representation of the IMC structure is presented in Figure 1, in which G(s) represents the process itself. Gd(s) The process transfer functions of the disturbance, G~(s) the mathematical model (transfer function) of the process, and the transfer function of the IMC controller. As may be observed from the block diagram of the IMC structure, there are two parallel paths starting from the manipulated variables u(s): one passes through the real process G(s) and the other passing through the model processG~(s). The role of the parallel containing the model G~(s)is to make possible the generation of the difference between the actual process output y(t) and an estimation predication of the manipulated variable effect on the process output. Assuming that the process model is a perfect representation of the real process that is G~(s) = G(s).
(J4R/ Volume 01 / Issue 12 / 008)
IMC Design Procedure: 1) Factor the model into two parts:
G~(s) G~(s).G~(s) (1)
To improve robustness, the effects of mismatch between the process, and process model should be minimized. Since the differences between process and the process model usually occur at the systems high frequency response end, a low-pass filter f(s) is usually added to attenuate this effect.[7] Thus, IMC is designed using the inverse of the process model in series with a low-pass filter. A common filter choice that conforms to this requirement is
(2)
The filter order n is selected large enough to make G(s) proper 2) In addition to this criterion, the filter time constant λ must satisfy
n
n s s N s D
N s D 1 ) ) 0 ( ) ( 20 ) 0 ( ) ( lim (
(3)3) Augment with a filter f(s) such that the final IMC controller is now, ( )
~ ( ). ( ) 1 s f s G s Gimc (4)
III.
M
ODEL IDENTIFICATION OF INVERTED PENDULUM SYSTEMThe Inverted Pendulum is a single input multi output (SIMO) system with control voltage as input, cart position and pendulum angle as outputs. [7] Even though the system is simple from construction point of view, but there lies a lot of control challenge owing to following characteristics: Highly Unstable, Highly Non-linear, Non-minimum phase system, under actuated.
Fig. 2: Parametric representation of the Inverted Pendulum System
Following is the list of parameters used in the derivation of Inverted Pendulum dynamics M – Mass of cart in kg
m – Mass of Pendulum in kg
J – Moment of Inertia of pendulum in kg-m2 L – Length of Pendulum in m
b – Cart friction coefficient in Ns/m g – Acceleration due to gravity in m/s2
Only the horizontal forces are considered in the analysis as they only give information about the dynamics since the cart has only linear motion. [1]
N F dt dx b dt x d
M 2
2 (5) 2 2 dt d J F r
(6)
Component of force in direction N is Centripetal force
cos
2 2
dt d
MJ (7)
Centripetal force is
2 2 dt d MJ
F (8)
Summing forces of pendulum in horizontal and vertical direction we will get the equation for N:[1] sin cos 2 2 2 2 2 L dt d L dt d m dt x d m N
(9)
Considering the FBD of the pendulum rod, the vertical reaction P is given by the weight of the pendulum on the cart. Let be the displacement of pendulum from the pivot. Then, P is given by [1]
cos sin cos
sin 2 2 2 2 dt x d m dt d mJ mg N
P (10)
To get rid of P ad N terms, Sum the moments across the center of pendulum, we get[1]
2 2 sin cos dt d J PL
NL
(11)
Substitution of (11) in (10) yields
sin cos 2 2 2 2 mg dt d L J mJ dt x dm (12)
After substituting (5) in (1) we get,
F c dt d mL dt dx b dt x d m dt d mL dt x d
M
cos sin
2 2 2 2 2 2 2 (13)
By simplifying we get,
F dt d mL dt d mL dt dx b dt x d m
M
) cos sin
( 2 2 2 2 2 (14)
Equation (12) and (14) are nonlinear and need to be linearized for the operating range Since pendulum is being stabilized at an unstable equilibrium position,[1]
Assume that , where phi is small angle from vertical upward direction. So,
By linearizing we get,
bmgJ m M mgl s mJL J b qs mLs s F s ) ( ) ( ) ( ) ( 2 2 (15) ) 1 ( ) ( ) ( ) ( ) ( 3 2 2 b mgL J mJL bs qs mgL s J mJL s F s X
(16)
Putting real time values in the equation we can get the transfer function of inverted pendulum. [1]
IV.
S
IMULATION AND RESULTHere PID Controllers is used in feedback mechanisms of the pendulum system. Only angle variable is controlled with PID Controllers, as Angle and position cannot be controlled by PID controller simultaneously. In Simulation, PID controllers are optimized for stabilizing the result.
Fig. 3: Simulink model for PID control Fig. 4: Simulink model for IMC
(J4R/ Volume 01 / Issue 12 / 008)
Fig.5. shows position of inverted pendulum for X Axis Subsystem and Y Axis Subsystem together. Steady state time for Inverted Pendulum is 3 seconds. Fig.6. shows angle of the Inverted Pendulum for X Axis Subsystem and Y Axis Subsystem together. Inverted Pendulum makes an oscillation and after that it become stable, using PID Controller.
The following test signals or disturbances are given to monitor the performance of controller:
Impulse Disturbance Input:
A simulation of the system using this controller was firstly conducted with no plant model mismatches, and no delay and as per IMC theory, it was determined to achieve a near ideal response. Then filter of order 2 is selected to obtain a proper transfer function. [7]
Step Disturbance Input:
Fig. 7: Discrete impulse disturbance IMC response Fig. 8: Step disturbance IMC response
Band Limited White Noise Disturbance at the Plant Output:
Very often the plant may suffer from random disturbances, which may not be easily identifiable, which means that a simple transfer function to model the disturbance may not be adequate. [7]
The output of the random disturbance is shown in Figure 9. It comprises a sinusoid with variable amplitude and frequency. They closely follow the noise, there was no instability, and oscillates about the correct set point of zero.
Systems with a Plant/Model Mismatch
The plant/model mismatch can appear in the parameter due to measuring error or in another form as dealing with high order systems as low order ones that increase the gap between them. Besides that, the pendulum system is a nonlinear system and the transfer function of it, is a result of the linearization operation so the mismatch is present in all cases. [7]
Fig.9: Band limited white noise IMC response Fig. 10: Comparison of plant model matching and plant model mismatching
V.
C
ONCLUSIONInverted Pendulum System is modeled and simulated in Simulink. System model works perfectly and stable with exact PID Controller coefficient. Also, System model shows efficient results by the use of IMC. But, limitation of IMC is that it can only work efficiently if plant and model matched exactly.
R
EFERENCES[1] M. Arda, H.Kuscu, “Modeling of the 2 dimentional Inverted Pendulum in MATLAB/simulink “Proceeding of 5th International Mechanical Engineering
Forum 2012.
[2] Li Hong, Xiong Shibo. “Fuzzy internal Model Control for Electro-Hydraulic Servo System” Proceeding of the 27th Chienese control conference.
[3] Juan Chen. Lu Wang and Bin Du. “Modified Internal Model control for Chemical Unstable Processes with Time-delay” Proceeding of the 7th World
congress on intelligent control and Automation June 25-27, 2008, Chongqing, China.
[4] Zheng-Qi WANG, Xue-liang HUANG” Nonlineal Internal Model Control for Bearingless induction motor Based on inverse System Theory”Advance Matrials Research vol 1037 (2014) pp258-263.
[6] Naoto Abe, Kenji Seki, Hindeaki Kanoh “ Two Degree of freedom Internal Model Control for Single Tubular Heat Exchanger System”Department of Precision Engineering , Meili University.
[7] Walid R. Issa “A New Approach of Robust Internal Model Control for Nonlinear Pendulum System” This thesis is submitted in Partial Fulfillment of the Requirements for the Degree of Master of Science in Electrical Engineering Islamic University of Gaza, Palestine