0 Up votes0 Down votes

218 views15 pagesMar 29, 2011

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Attribution Non-Commercial (BY-NC)

218 views

Attribution Non-Commercial (BY-NC)

- Shell Cognitive Test Part 1 - Decision Making
- Shell Competency Based Questionnaire
- LIC Lab Manual
- Feedback Control of Dynamic Systems
- IC Applications Lab Manual Satish Babu
- modelling of double inverted pendulum
- Johnny Lam report 238
- PLL
- 03298 D Woodward Integrated Compressor Control afjfkjfj fjfjfjf
- simulink
- inverted_pendulum
- Lecture Notes Math 307
- Digital Control Sys Syllabus
- Solution for Assignment 2 2012
- Convolution Graphical
- Jordan Canonical Form
- Lect Note 1 Intro
- Control Theory
- PID Tutorial
- 6107-13580-3-PB-LQR

You are on page 1of 15

Lab Experiment #3

Inverted Pendulum

1

Table of Contents

Abstract ......................................................................................................................................................... 3

Introduction .................................................................................................................................................. 3

Models ...................................................................................................................................................... 3

Stabilizing System ..................................................................................................................................... 8

Methods & Results ...................................................................................................................................... 10

PID Controller.......................................................................................................................................... 10

Lead Controller........................................................................................................................................ 11

Discussion.................................................................................................................................................... 15

2

ABSTRACT

Deriving the needed model equations to implement the inverted pendulum control lab experiment was

the first step in this exercise. Reading and understand the theories behind PID and lead controllers and

being aware of their limitations.

Creating the models in MATLAB and observing the overall system feedback values for both types of

controllers when attached to the inverted pendulum cart. Adjusting appropriate parameter values to

fine to and bring system to overall stability.

The lead controller was simple to implement but cannot stabilize the plant for more than a few seconds.

The PID controller using ZN methods was difficult to implement and displayed overshoots that had to be

tuned together with the three different parameters.

INTRODUCTION

The lab requires the balancing of an inverted pendulum apparatus by controlling the cart while it moves.

The controller methods used in the experiment to stabilize the overall system are the lead controller

and PID controller. The assumption is that the lead controller will have better stabilizing properties than

the PID is due to the amount of parameter combinations that would account for the PID system. With

the PID controller relating the angle error to motor velocity and direction, and the lead controller’s

ability to reduce oscillation with zeros pulling the poles from an unstable system, it is thus assumed it is

possible to control a simplified model of the inverted pendulum system.

The non-linear system requires that the necessary equations of motion be linearized to account for any

positional dependencies.

Models

Equation models built in the lab (state equations):

Equation: 1.0

( )

Equation: 2.0

∂L/∂x’) - ∂L/∂x = F

Equation: 3.0

3

∂L/∂a’) - ∂L/∂a = F

Equation: 4.0

Equation: 5.0

Equation: 6.0

( )

x’ = a’ = a = x = 0

Equation: 8.0

x’ = Ax + Bu

Equation: 9.0

Because of the non-linear system, the state-space equation is obtained by first linearizing the equation

around the equilibrium point. These equations for the inverted pendulum’s motion were derived using

Lagrangian mechanics given that K is the kinetic energy and V is the potential energy:

Equation: 10.0

Equation: 11.0

Pendulum:

Equation: 12.0

Equation: 13.0

4

Cart:

Equation: 14.0

Now need to express the system using the state space equations. Replacing k1 = km*kg/r then using the

state variables and linearizing around the equilibrium point, these values along with system parameters

are in Table 1.0 define the model of the system in the experiment.

[ ] [ ]

̇

̇

Equation 15.0

[ ]

( )

[ ] [ ]

5

Parameter Symbol Value Units

Back EMF constant

V/(rad/sec)

The matrix obtained after using the constants and experimental value for (km*kg)/r = 4.27 with kg taken

to be 3.9 is:

A=

0 0 1.0000 0

0 0 0 1.0000

0 -2.4900 -14.8700 0

0 73.2200 83.4800 0

6

>> eig(A)

ans =

0

8.0084

-6.8724

-16.0060

>>

The eigenvalues of Matrix A are plotted in the figure below that resulted from investigating the poles of

the open-loop system. From the resulting pole/zero map figure, it is evident that the system is unstable

due to the existence of a pole (8.0084) in the plane that is beyond the x = 0 axis.

Pole-Zero Map

1

0.8

0.6

0.4

Imaginary Axis

0.2

-0.2

-0.4

-0.6

-0.8

-1

-20 -15 -10 -5 0 5 10

Real Axis

7

Stabilizing System

By setting x’ = 0 in the a” equation, can eliminate the position dependency and thus stabilize the overall

system. This will simplify the model and will now only have the angle of the pendulum in consideration.

Equation 18.0

To have a more functional working equation, the Laplace transform will be performed on the system to

derive the transfer function. Upon taking the Laplace transform, the transfer function obtained is:

Equation 19.0

x’ = Ax + Bu

Equation 20.0

Equation 21.0

Y = Cx’ + Du

Equation 22.0

Equation 23.0

Using the ss2tf function in MATLAB, able to generate the num and denom. From the state space

equation, the transfer function is obtained with the num and denom values and using the bode plot and

rlocus function, able to create the appropriate plots that shows the resultant findings.

>> B = [0; -19.55];

>> C = [1 0];

>> D = [0];

>> [num, denom] = ss2tf(A,B,C,D)

8

num =

0 0 -19.5500

denom =

>> H = tf (num,denom)

Transfer function:

-19.55

--------------------------

s^2 - 1.776e-015 s - 73.22

Figure: 2.0 Transfer Function G(s) root locus & bode plot

The first pole of the simplified system located on the root locus plot causes instability as it is placed on

the right hand plane of the x-axis. The system is able to be stabilized when open-loop transfer function

is able to reach a -180 degree phase angle in the bode plot and by introducing a PID controller or a lead

controller, the ability to potentially create a stable system is therefore possible.

The idea behind introducing a lead controller is to reduce oscillation by having the zero from the lead

pull the pole from the right hand plane to the left. This occurs when parameter K is increased thus

making the system stable. The ideal case for reducing oscillation is to have the zero as far as possible

from the pole on the right hand plane by introducing a large K to draw the pole in.

9

METHODS & RESULTS

PID Controller

The PID controller is used mainly to eliminate the steady-state error that exists within the system. This

is the difference taken between the desired output and experimental output value. The idea of the PID

controller is that by having a higher proportional term creates a faster response at the expense of

system stability.

The integral term would correct any steady-state error that would occur as it will try to ensure a correct

tracking of the reference angle. The tradeoff is that by having a higher integral control term, there exists

the chance to create oscillations that may put the system in an unstable state. The derivative term’s

purpose is used to smooth out changes in error over time. Having the PID controller before the

simplified model in the feedback system allows for the transfer function to be calculated.

Equation 24.0

G’(s) = KG / (1 + KG) = -19.55(s^2*Kd + s*Kp + Ki) / (s^3 – 19.55*Kd*s^2 – (73.22 + 19.55*Kp)*s – 19.55

Now able to set Kd and Ki to be both zero in order to apply the closed loop Ziegler-Nichols test. The Kp

value is adjusted accordingly until the system response becomes oscillatory and the oscillation

amplitude becomes constant.

Equation 26.0

This brings the system to the boarder of stability and instability as the system oscillates when Kp and Ku

equate to -3.6.

The Kp’s purpose is to smooth out the transient response by adjusting the rise time of the system.

Along with the Ki, this parameter provides for an integral gain that was previously discussed to cancel

the steady-state error as much as possible in the system. Lastly with the Kd value contain the

percentage overshoot of the system. This is related to the damping ratio of the system and will

lengthen the transient response large Kd values.

The requirement of having all three parameters but with the right relative combination may potentially

create a more stable system. The procedure and strategy in mind for tuning the system is to have the

Kp value generate a step response from the system that is equal to 1 therefore adjust Kp accordingly.

Need to decrease the percentage overshoot and the settling time and thereby need to tune the right

combination of Kd and Ki respectively. Continuously adjusting and analyzing the system generated K

values produce: Kp = -265; Ki = -46; Kd = -65

10

The initial values of Kp, Ki, and Kd may be then be determined from the step response:

Figure 3.0

The transfer functions bode plot shows that the phase angle never reaches -180 degrees and thus

indicates that the gain/phase margins are not realizable as KG(s) does not equate to 1 when the G(s) is

less than -180. To main objective was to follow and track the responses and the ZN method did not

allow for this and thus is not a good tool for the PID. Also by using the ZN method creates exaggerated

gains and overshoots that are difficult to control which defeats the purpose of including the PID

controller. Fine tuning the three variables in a PID system was difficult to achieve balancing in ZN case.

Lead Controller

The frequency response of an unstable system may be improved by using a lead controller in order to

incorporate the pole-zero pair into the transfer function. In the derivation of the mathematical model,

we see that the following equation governs the angular acceleration of our system.

The velocity parameter is set to zero in order set and motivate the implementation of the lead

controller. With this setting, the assumption is that when the pendulum of the system is balanced, the

cart will also be stationary and thus the term related to the cart may be eliminated. With this

motivation, the cart’s parameter will not be present to affect the controller’s ability to stabilize the

system. The angular acceleration with this assumption is now found to be:

11

Equation 18.0 - Simplified Angular Acceleration Equation

The transfer function is now derived by taking the Laplace transform of the system to get following

equation.

This is slightly different than the model we have due to the sign on the C1 as it has a negative sign placed

in front of it, this however does not hold for our model. The dynamic equations derived were taken

under the consideration of the direction of the cart moving in the positive direction as well as the

positive angle. This is the opposite scenario as the angle is supposed to be taken in the opposite

direction of the carts motion and therefore a sign change placed on C1. The equation indicates that the

direction of angle supposed to be taken in the opposite direction as an indicated by the equation.

The transfer function from equation G(s) can now graphed to show the root locus plots, above. Again

the plot reveals that this is an unstable system due to the pole being on the right hand side of the plane.

A lead controller is used in this case to stabilize the overall system by shifting the pole on the right hand

place over to the left and thus achieving the ideal case.

12

Equation 2 General Lead Controller Equation

Where σa and σb are positive, real numbers. The root locus of the open loop gain D*G to be the

following:

Observed that by introducing a lead controller into the system, the pole on the right hand side is pulled

towards the left by the leading zero as K increases, thus making this system stable. Ideally want the zero

to be as far as possible from the pole on the right hand side plane in order to reduce oscillation. We will

then need a large K to draw that pole in.

Solving for parameter K in the lead controller equation was done using the RLOCFIND function through

MATLAB and selecting pole location points on the root locus plot. The strategy is to choose a point far

from the origin in order to avoid oscillations. This got a gain of K=370.

2. Find the value of the gain, k, for which our unstable right hand plane pole will cross over to the

left hand plane

3. Investigate the optimal value for k balancing the trade-of between a faster response by moving

the unstable pole further into the LHP and therefore farther from the origin. This will have the

remaining system poles drift apart in the complex plane as k increases. Rlocfind() function in

MATLAB allows for defining desired pole position and calculating the gain required to obtain the

outcome.

13

The experimental gain K used is 1250 which deviates from the theoretical K = 370.78 obtained. This

large difference is mainly due to the controller compensating for external factors such as over-coming

mechanical friction, heat loss, drag effects, etc.

Taking a holistic approach to obtaining the experimental K, the 1250 value presented the least amount

of oscillation to the system. To create a stable system, the lead controller’s zero was set at 7.5 while the

pole was positioned on the left hand plane at -13. The large experimental K thus pulls the pole from the

right hand plane over to the left. The observation is that as K increases, less oscillation in the angle plot

is present. The experimental data obtained from this setup is presented:

The required behaviour is obtained by placing the pole and zero around the natural stable pole of the

plant. The natural unstable pole is pulled towards the controller’s zero, with the other stable poles

coming together and drift into the imaginary plane. Like to place the unstable pole as close as possible

to the zero, while maintaining a suitable gain. Want the pole at to move towards the left half plane.

Thus we must place a zero for it to tend to. Also would like the tragectory of the imagineary poles to be

as far away from the imaginary axis as possible. This may be achieved by strategically placing the pole

and zero. Whereas the former condition can be satisfied by using rlocfind() and setting the desired pole

the zero.

14

DISCUSSION

The lead controller was able to stabilize the cart for a few seconds. The first step in designing the

controller in the root locus scheme was to simplify the state model to a single transfer function. This

was done by assuming the position of the cart remained unchanged so to remove the variable in

association. In reality this was not the case as there was instability in the cart position due to signal

pulses. The lead controller displays the potential of having the inverted pendulum balancing on the cart

but more tools need to be incorporated to have a complete stable system.

Since our only objective from the lead controller is to stabilize the system, we can build the system in

the root locus by placing pole and zero at the appropriate locations. The lead controller performs better

in terms of stability properties as the angle exists in a limited bound.

The PID controller was unable to reach the required phase margin for it to be stable. With the bode

function in MATLAB, the gain and phase margins are results that show the stability property of the

system in test. The greater the phase margin the more stable the system is.

There were continuous tradeoffs in design and parameters for both methods and a less holistic

approach next time would save both time and energy. Understanding more on the parameter effects on

system variables would help in defining optimal results.

15

- Shell Cognitive Test Part 1 - Decision MakingUploaded bynaddumj
- Shell Competency Based QuestionnaireUploaded bynaddumj
- LIC Lab ManualUploaded bySakthikumar Balasundaram
- Feedback Control of Dynamic SystemsUploaded byPanayiotis Papadopoulos
- IC Applications Lab Manual Satish BabuUploaded byRAVIHIMAJA
- modelling of double inverted pendulumUploaded byTalhah Abiodun Folorunso
- Johnny Lam report 238Uploaded byanon-641887
- PLLUploaded byshixun
- 03298 D Woodward Integrated Compressor Control afjfkjfj fjfjfjfUploaded byDiego Pareschi
- simulinkUploaded bysjrjanakiraman6870
- inverted_pendulumUploaded byNassim Doukhi
- Lecture Notes Math 307Uploaded byhomopeniscuntfuck
- Digital Control Sys SyllabusUploaded byAndre Silva
- Solution for Assignment 2 2012Uploaded byMarce Soto
- Convolution GraphicalUploaded bybhuian
- Jordan Canonical FormUploaded byjbiteee
- Lect Note 1 IntroUploaded byJie Rong
- Control TheoryUploaded byAnonymous E4Rbo2s
- PID TutorialUploaded byGeorge Maliaris
- 6107-13580-3-PB-LQRUploaded byMuhammad Faris
- dmcs0708.pdfUploaded byarviandy
- Biricha Digital Power LtdUploaded bycolleton
- T10KT MW TKG Lesson 29a Controller-SV-Module9p1 11122014Uploaded byMani Vannan Soundarapandiyan
- TM.G5SW.012Uploaded bych prabu
- Control Loops for BoilerUploaded byGloria Hamilton
- Eee 550 – Advanced Control Systems November 2008Uploaded byKumaraguru Rau
- A First Course in Predictive Control, Second Edition.pdfUploaded bymarmaduke32
- Three Tank System-1Uploaded byj udayasekhar
- 2010_ICMA_ModelingandControlofaRotaryInvertedPendulumUsingVariousMethodsUploaded byFawaz Parto

- 201053112919993Uploaded byTanesan Wyot
- linear_servo_brochure.pdfUploaded byMiguel Chillitupa
- robot modelling and control.pdfUploaded byalper senem
- Optimal Controller Design for Inverted Pendulum System: An Experimental StudyUploaded byzeeshanbabar112
- 495 Report Inverted PendulumUploaded byJohn Davis
- Lqg_ltr Controller Design Quanser Rotary Inverted PendulumUploaded byGeovani Bondo
- Comparison of LQR(1)Uploaded byʚɞ Kwon Boa ʚɞ
- Building a Two Wheeled Balancing RobotUploaded byCp Em Pheerador
- Error Analysis of Inverted PendulumUploaded bysalman
- Design of Control SystemUploaded byJuan Antonio Monaco Nuñes
- MainUploaded bycamilo_peña_37
- Inverted PendulumUploaded byLubeck Abraham Huaman Ponce
- System simulation using Matlab, state plane plotsUploaded bymosictrl
- Controller Design of Inverted Pendulum Using Pole Placement and LqrUploaded byInternational Journal of Research in Engineering and Technology
- Linear Inverted Pendulum - Workbook (Student) (1).pdfUploaded byDeepthi Priya Bejjam
- maple Introduction to Fuzzy Controllers.docUploaded byLeo Kuts
- Dynamic Modeling and Analysis of a Two-Wheeled Inverted Pendulum RobotUploaded byМартин Рейносо
- lab3_v2Uploaded byPranshumaan Singh
- Self-Balancing-Robot.pdfUploaded byPaul R. Bankz
- Loop Shapind Design ProcedureUploaded byRitesh Singh
- State SpaceUploaded byBogdan Manea
- Inverted Pendulum on Cart SolutionUploaded byMario R. Kallab
- Optimal Control of Inverted Pendulum Using Ant Colony System Algorithm2Uploaded byshekhar yadav
- Three Degree of Freedom Control of Inverted Pendulum by using Repulsive Magnetic LevitationUploaded byidescitation
- Frequency Domain Design LimitationsUploaded bywelcome2twinkle_2272
- Lab 3 - Inverted Pendulum - William HoangUploaded byWilliam Sun
- inverted pendulum equations of motionUploaded byapi-439746975
- Lab Inverted Pendulum S05Uploaded byJae Haerys
- Clear Explanation on Dynamic ModelUploaded byJobin Varghese
- Castro Arnoldo 201208 MastUploaded byChau Hoang Lien Son

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.