Professional Documents
Culture Documents
By
Arslan Tahir
Engineering.
Declaration of Originality
I hereby declare that the work contained in this thesis and the intellectual content
of this thesis are the product of my own research. This thesis has not been
previously published in any form nor does it contain any verbatim of the published
resources which could be treated as infringement of the international copyright law.
I also declare that I do understand the terms copyright and plagiarism, and that
in case of any copyright violation or plagiarism found in this work, I will be held
fully responsible of the consequences of any such violation.
Signature:
Name: Arslan Tahir
Date: October 12, 2012
Place: PIEAS
iv
Certificate of Approval
Approved By :
Signature:
Supervisor: Dr. Muhammad Abid
Verified By:
Signature:
Head, Department of Electrical Engineering
Stamp:
v
To my parents.
vi
ACKNOWLEDGEMENTS
Contents
Acknowledgements vi
List of Figures x
Abstract xiii
Nomenclature xiv
1 INTRODUCTION 1
1.1 Applications Of Inverted Pendulum . . . . . . . . . . . . . . . . . . 1
1.2 Rocket Propulsion . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Robot Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Benchmark For Researchers . . . . . . . . . . . . . . . . . . . . . . 2
Appendices 47
References 50
List of Figures
List of Tables
xiii
Abstract
Inverted Pendulum is one of the most famous laboratory equipment used to test and
verify the effectiveness of numerous Control Schemes like Fuzzy control, Non-linear
control, PID control, Robust control and etc. This report will address the complete
indigenous design and implementation phases of hardware and control section of
Inverted Pendulum Project. Hardware section will deal with the electronics and
mechanics of Inverted Pendulum, whereas Control section will deal with the design
and simulation of robust control schemes.
Nomenclature
Symbol Nomenclature
IP Inverted Pendulum
COG Center of gravity
P ID Propotional Integral Diffrential
LQG Linear Quadratic Guassian
SISO Single input Single Output
M IM O Multiple Input Multiple Output
GU I Graphical User Interface
QEI Quadrature Encoder Interface
P CB Printed Circuit Board
1
Chapter 1
INTRODUCTION
An Inverted Pendulum, as name implies, is a pendulum which has mass above its
pivot point. Inverted Pendulum is one of the most famous laboratory equipment used
to test and verify the effectiveness of numerous Control Schemes . The main objective
of these control schemes is to swing up and balance its mass (COG). The simplest
realization of inverted pendulum can be thought of as balancing a broom stick on
ones hand.
Inverted Pendulum is a non-linear, unstable control problem. Its Hardware assembly
is composed of a cart pulley sytem energied by an electric motor. Pivot point of IP lies
on a cart, whereas controlled cart movements can ensure its smooth swingup and
stabilization/upward erection. During swingup and stabilization, position of cart must
always stay within defined parmeters. IP can be used for relative comparison and
effectivenes of dedicated Control schemes. These stabilizing Control schemes can be
compared for rejection of one parameter (e.g. noise, ocilliations,
nonlinearities,unstability) without compromising others .
The IP is among one of the famous and challenging systems to verify effectiveness of
control schemes. So, it has been a task of choice to be assigned to Control
Engineering students to analyze its model and propose a stabilizing controller
according to the different control laws.
Chapter 2
MECHANICS AND
MATHEMATICAL MODELING
2.1 Mechanics of IP
Our inverted pendulum structure is similar to cart pulley system. Choice of this
structure was to avoid the complexities of mathematical modeling.The Figure (2.1)
show the particular arrangement.The motor is attached with the pulley. Belt is
used as a source of connection between cart and pulley . With to and fro rotation
of pulley cart moves to and fro and can be used to balance the pendulum in upward
direction.
Hardware that we design consist of cart which has capability to slide on two rods.
Cart is attached with motor through belt. And pendulum can rotate having pivot
point on cart. Figure(2.2) shows particular hardware assembly.
The Mathematical modeling of Inverted Pendulum can be divided in three
parts i.e.
• The transfer function from force appear on cart to angular position of pen-
dulum
The motor used in our project is a DC servo motor. These motors are widely
used in control system projects because of low cost and simple dynamics. The
differential equation governing the dynamics of servo motor is as follow
00 0
Jθ + Bθ = Ke(t) (2.1)
Here we are interested in calculating the transfer function between angular velocity
0 J
ω and the input voltage e(t) so we substitute ω = θ .where as the ratio τ = B
is
called the time constant of the motor.J is the inertia and B is the frictional force.
By taking the laplace transform and rearranging the equation we get
ω(s) K
= (2.2)
e(s) τs + 1
K is steady state angular speed of the motor and τ is the time required to
attain 60% of angular speed of motor.These both quantities can be calculated
easily with the help of optical encoder attached with the motor.
In this part we are interested to find the transfer function of pulley i.e the transfer
function between angular velocity applied by the motor and as a result force
applied on the cart attached to a belt connected with pulley.
00 0
Js θ = (µ − Bx )r (2.3)
00 0
Js θ = (µ − Brθ )r
So our final expression for the transfer function of pulley is equation (2.4)
µ(s)
= M rs + Br (2.4)
ω(s)
In modeling of system from cart to pendulum two equations are of great impor-
θ(s)
tance i.e the function governing the angular position w.r.t the force µ(s)
and second
X(s)
one is the linear position of the cart w.r.t force µ(s)
. And also the state space
model of this portion will be shown in next chapter.The Figure (2.4) shows the
diagram of inverted pendulum to be modeled.
Define the angle of the rod from the vertical line as θ. Define also the (x, y)
coordinates of the center of gravity of the pendulum rod as (xg ,yg ).Then xg = x +
lsinθ and yg =lcosθ. Rotational motion of pendulum around the center of gravity
is given as
8
00
Jθ = V lsinθ − Hlcosθ (2.5)
The horizontal and vertical motion of center of gravity of rod can be written
as
d2
H=m (x + lsinθ) (2.6)
dt2
d2
V = mg + m (lcosθ) (2.7)
dt2
d2 x 0
M = µ − Bx − H (2.8)
dt
Linearizing the above equations around origin i.e θ=0.We substitute cosθ=1 ,
sinθ ' θ
After Simplification we get following two very important equations.
00 0
(M + m)x + mlθ = µ − Bx (2.9)
00 00
(J + ml2 )θ + mlx = mglθ (2.10)
Our next step is to eliminate x from equation 2.9 .Form equation 2.10 we get
θ(s) −mls
= (2.12)
µ(s) (M + m)As + m2 l2 s3 + BA
θ(s) −mls
=
µ(s) (M J + M ml + mJ)s + B(J + ml2 )s2 − mgl(M + m)s − Bmgl
2 3
(2.13)
As the friction and moment of inertia of rod around its center of gravity can
be neglected. So substituting B=0 and J=0 in equation 2.13. We should make
above assumption compatible with real hardware.For J=0 mass of rod should be
less than mass of bob.And for B=0 we are using linear bearings to reduce friction
as much as possible.
θ(s) −1
= (2.14)
µ(s) M ls2 − (M + m)g
X(s) g (J + ml2 )
= 2− (2.15)
θ(s) s ml
10
X(s)
The transfer function of µ(s)
can be written as
The classical control theory consists of methods like root locus and nyquist plots.
We have been using them, in class to date, for simple transfer function of the
plant to obtain our desired response. These methods do not use any knowledge of
the interior structure of the plant, and are valid for SISO systems. Limited types
of controllers can only be designed with this approach. Modern control theory
solves many of the limitations by using a much richer or good description of the
plant dynamics i.e state-space realization of system. MIMO systems can easily be
handled with this type of approach easily.
Coming toward the inverted pendulum case we have to track the position of cart
and also regulate the angular position of the pendulum. So it will be quite easy
to design a robust controller based on techniques like LQG, H∞ . In this section
we will be presenting the state space realization of our inverted pendulum plant.
By using equation (2.9) and equation (2.10) we get the following two important
equations.
0
θ1 0 1 0 0 θ1
0 mgl(M +m)
θ Bml
2
(M +m)(J+ml2 )−(ml)2
0 0 (M +m)(J+ml2 )−(ml)2
θ2
= + (2.21)
x0 0 0 0 1 x
1 1
0 −(ml)2 −B(J+ml2 )
x2 (M +m)(J+ml2 )−(ml)2
0 0 (M +m)(J+ml2 )−(ml)2
x2
0
−ml
(M +m)(J+ml2 )−(ml)2
µ (2.22)
0
J+ml2
(M +m)(J+ml2 )−(ml)2
Our interested states that we want to see at output are the angular position of
the pendulum and linear displacement of cart.So we choose x1 and θ1 as output
states.
θ
1
y1 1 0 0 0 θ2
= (2.23)
y2 0 0 1 0 x1
x2
M rKe Brτ − M r
µ= +ω (2.24)
τ τ
0 Ke ω
ω = − (2.25)
τ τ
12
θ1 0 0 1 0 0
0 mgl(M +m) Bml
θ2 0 0
(M +m)(J+ml2 )−(ml)2 (M +m)(J+ml2 )−(ml)2
0
x = 0 0 0 1
1
0 −g(ml)2 −B(J+ml2 )
x2 (M +m)(J+ml2 )−(ml)2
0 0 (M +m)(J+ml2 )−(ml)2
0
ω1 0 0 0 0
0 θ1 0
ml(Brτ −M r) M rKml
− τ ((M +m)(J+ml 2 )−(ml)2 )
θ2 −
τ ((M +m)(J+ml2 )−(ml)2 )
0 x + 0 e (2.26)
1
(Brτ −M r)(J+ml2 ) M rK(J+ml2 )
x2 τ ((M +m)(J+ml
τ ((M +m)(J+ml2 )−(ml)2 ) 2 )−(ml)2 )
−1 K
τ
ω1 τ
θ1
θ2
y1 1 0 0 0 0 0
= x1
(2.27)
y2 0 0 1 0 0 0
x2
ω1
00 0
Jθ = V lsin(θ) − Hlcos(θ) − γθ (2.28)
00 00 0
x (m + M ) + ml(sin(θ)) = µ − Bx (2.29)
13
Above two are the basic nonlinear equations of inverted pendulum. here γ is the
friction between the cart and the pendulum i.e the friction present in the rotary
joint.
where
00
V = mg + mlcos(θ)
00 00
H = M x + mlsin(θ)
00 00 0
cos(θ) = −sin(θ)θ − (θ )2 sin(θ)
00 00
sin(θ) = cos(θ)θ − (θ. )2 sin(θ)
00 00 0
Jθ00 = mglsin(θ) − ml2 θ − mlcos(θ)x − γθ
00 0
00 mglsin(θ) mlcos(θ)x γθ
θ = − − (2.30)
J + ml2 J + ml2 J + ml2
00 00 0 0
x (m + M ) + θ (mlcos(θ)) = µ − Bx + mlsin(θ)(θ )2
0 0 00
00 µ Bx mlsin(θ)(θ )2 θ (mlcos(θ))
x = − + − (2.31)
M +m M +m M +m m+M
0
θ1 = θ2
0
θ2 = α1 ((M + m)mglsin(θ1 ) − mlcos(θ1 )µ + Bx4 mlcos(θ1 )2
0
x 3 = x4
0
x4 = α1 (µ(J + ml2 ) − Bx4 (J + ml2 ) + (J + ml2 )sin(θ1 )θ22
The above nonlinear state space equations were implemented in the simulink.
And corresponding fuzzy control strategy is discussed in the upcoming chapters
and zero is present in right half plane, and root locus will always lie in right half
s-plane .But in reality plant friction is present in system so we cannot neglect this
parameter in designing the controller for IP, reason!!, presence of friction moves
zero of plant from the origon to left side of s-plane.
Web Links are provided in apendix where you can get matlab and pi18f4431
codes in soft form and linear and non linear models of IP in simulink.Plant model
is available in appendix too.
The actual parameters of the mechanical system are calculated and explained in
this section First variables are used in MATLAB simulations and second one are
16
Chapter 3
ELECTRONICS OF INVERTED
PENDULUM
Coming toward the electronics of the project We have following problems that
need efficient solution
• Choice Of Sensors
• Choice Of Controller
• Choice Of Actuator
• Big Picture
18
We have two choices to measure the position i.e angular and linear.
• Potentiometer
• Optical Encoder
Potentiometers are actually good choice to design an analog controllers. But for
digital controllers we need ADC to extract some useful information from them.
They have also some very common draw backs that they are sensitive to tempera-
ture, they have limited life .Wear and tear is easy in case of potentiometer.Friction
and nonlinearities are also present in them.
Where as Optical Encoder gives us direct digital output.They give us high reso-
lution .And can be easily interfaced with the digital controller. So we are using
2500 ppr optical encoder of manufacturer named OMRON.
We need a controller which is capable of extracting data form optical encoder and
actuate the system with the desired input. As it was discussed earlier that system
is actuated with the help of voltage signal given to motor drive card. Where
input to motor drive card is PWM signal. We have different methods to extract
info from optical encoder through microcontrollers. Optical encoder give us two
orthogonal pulses as shown in the Figure (3.1)
need PWM signals.So we lock overselves on PIC18f4431 which has built in QEI
and PWM module and available in market easily.
The Quadrature Encoder Interface (QEI) decodes speed and motion sensor in-
formation. It can be used in any application that uses a quadrature encoder for
feedback. The interface implements these features:
• Three QEI inputs: two phase signals (QEA and QEB) and one index signal
(INDX)
21
The QEI sub-module has three main components: the QEI control logic block, the
position counter and velocity post scaler.The QEI control logic detects the leading
edge on theQEA or QEB phase input pins, and generates the count pulse which is
sent to the position counter logic. It alsosamples the index input signal (INDX),
and generates the direction of rotation signal (up/down) and the velocity event
signals.
The position counter acts as an integrator for tracking distance traveled. The
QEA and QEB input edges serve as the stimulus to create the input clock which
advances the Position Counter Register (POSCNT). The register is incremented
on either the QEA input edge, or the QEA and QEB input edges, depending on
the operating mode. It is reset either by a rollover on match to the Period Register,
MAXCNT, or on the external index pulse input signal (INDX). An interrupt is
generated on a reset of POSCNT if the position counter interrupt is enabled.
The velocity postscaler down-samples the velocity pulses used to increment the
velocity counter by a specified ratio. It essentially divides down the number of
velocity pulses to one output per so many input, preserving the pulse width in
the process..Interested readers can furthers refer the original datasheet of this
controller.
22
The Power Control PWM module simplifies the task of generating multiple, syn-
chronized pulse width modulated (PWM) outputs for use in the control of motor
controllers and power conversion applications. In particular, the following power
and motion control applications are supported by the PWM module:
• Up to eight PWM I/O pins with four duty cycle generators. Pins can be
paired to get a complete half-bridge control.
to their inactive state when in Debug mode. The Power Control PWM module
supports three PWM generators and six output channels on PIC18F2X31 devices,
and four generators and eight channels on PIC18F4X31 devices.
Hbridge is needed to actuate the system with the dc motor. H bridge was made
with BUZ11 mosfets with high current ratings and IR2110 is used to open upper
side mosfet gates of Hbridge. Other choice was to use lm298 having embedded
hbridge. But its current rating was upto 4 Amps. An our motor maximum current
is 5Amps, so making Hbridge of our own was preffered.
24
2. Control Card
Motor Drive Card was designed with the capacity of 5Amps rating. Because of
high currents this module was designed separately to avoid EMI[8].
25
Control Card consists of two controllers. Two optical encoders connects on control
card and actuating signals are also generated and sent to motor drive card.
other line is used for data (SDA). The data and clock lines are pulled high with
1k resistors in our PCB design to the VDD rail. The bus can have one Master
module and many Slave module or may have multiple master modules attached.
The master module is used in generating the clock source in both transmission
and reception mode.
The I 2 C protocol supports 7/10 bit addressing mode, permitting about 128 or
1024 controllers to be communicating on the single bus, respectively. But In
practice, the bus reserves some addresses for its own use, so we have slightly
fewer addresses available for our use. For example, the 7-bit addressing mode
allows 128 usable addresses. The 7-bit addressing protocol is used in our project
to trnasmit HIGH and LOW bytes i.e 16 bit word at a time.[3].
All data transfers are initiated by the master module and on every clock edge
eight bits are transfered, Most Significant bit first. There are no limits to the total
size of data that can be sent form one module to other in single go. After each 8-
bit word transfer, a ninth clock pulse is sent on the bus by master module. At this
time instant, the transmitting deve (i.e either master or slave) on the bus releases
the data (SDA) line to get acknowledgment of tranmitted data from the reciever
27
. An ACK condition (SDA held low) is sent if the data reception is successfull, or
NACK condition (SDA is high) is sent if rececption is unsuccessful. NACK can
also be used to terminate data transfer after the reception of last byte.
According to I2C protocol, SDA line should changes its state from 0 or 1, when
SCL pin is at low. Two unique conditions can be detected on the bus because of
above mentioned restriction; (S) a START sequence and a (P) STOP sequence.
START sequence occurs when the master module pulls the SDA line low while
the SCL line is high. The START sequence tells all Slave devices on the bus
that address bytes are about to be sent. The STOP sequence occurs when the
SDA line goes high while the SCL line is high, and it terminates the transmission.
Slave devices on the bus should reset their receive logic after the STOP sequence
has been detected. Because of lack of availability of dedicated master module the
just tuning some of the registers of pic18f4431.Interested readers can further refer
to the data sheet of pic18f4431.
As in the previous semester the controller was designed to sbilize the angular
position of theta but realized later that even with the balanced theta the state
”‘linear position of cart” becomes unbounded. i.e because of infinite euiliblium
point of ”x” exists with θ = 0. So adding a control loop to ”x” solves our problem.
PGM pin of pic18f4431 is usually very sensaative to noise. It was realized after
a very tiring effort that the reason the controller was not working is because of
PGM pin.And it was properly pull down to ground and controller starts working
properly.
and as we are intialiszing our angle with π but in reality angle of pendulum is π −.
So instead of balacing the pendulum and 0 angular position our setup will try to
balance it to i.e. it will read origon as And cart will attain a constant velocity
and will go out of bound.Controller reads the values of Figure(3.9) π − as π and
as 0.
Chapter 4
To bring the pendulum in the upward direction the region of pendulum flight is
divided in to three parts as shown in the Figure(4.1).
the standup routine should consist of the following subroutines, in this order:
2. The the critical point of cart movement where maximum energy can trans-
fered to pendulum should be found.
To apply the above algorithm region I is used to add energy in the system i.e
actuating signal is applied in this region.In region II actuating signal is removed
and pendulum is allowed to deacceleerate which also adds energy and in region
III we wait and repeat same procedure in the opposite direction.[11]
As the pendulum approaches the inverted position a method of switching between
the swing up controller and stabilization controller is required. Different switching
criteria are considered in swing up mode.
The stabilizing controller is designed to work around the 0 (vertical) position in
which it can stabilize the pendulum with the designed stability margins. This is
because the stabilizing controller is based on the linearised system about the 0
point. If the stabilizing controller is switched on when the pendulum is outside
this region of attraction the system will not be able to stabilize the pendulum.
The pendulum must have an angular velocity below a certain value when the sta-
bilization controller switches on. If the angular velocity is too large it will cause
the motor to apply a large force to the cart to try and stabilize the pendulum,
causing the cart to run out of track.
The best switching moment occurs when the pendulum is approaching the 0 ver-
tical position with a small angular velocity. Figure(4.2) shows how both the con-
trollers are connected with each other.
Fuzzy Logic Toolbox provides MATLAB functions, graphical tools, and a Simulink
block for analyzing, designing, and simulating systems based on fuzzy logic. The
product guides you through the steps of designing fuzzy inference systems. Func-
tions are provided for many common methods, including fuzzy clustering and
adaptive neurofuzzy learning. Figure(4.3) shows the fuzzy surfaces which gives us
the insight of actions to be performed for different level of inputs[12].
Figure(4.4) shows the how the angular velocity of inverted pendulum changes
with change in angular position of inverted pendulum.
32
0
Figure 4.4: θ vs θ
34
Chapter 5
REGULATING θ AND
CONTROLLING X
In this chapter SISO and MIMO control strategy will be discussed. As name
implies (single input and single output) inverted pendulum can be converted in
SISO arrangement with only single input and single regulating output i.e θ. But
before going in details of SISO arrangement let try to understand structure of our
plant.
Figure(5.1) shows plant in block diagram. The first thing that can come in
readers mind that why not use only stabilizing controller on angular position of
inverted pendulum and leave x open. But the problem with the arrangement
shown in Figure(5.2) is that the linear position of cart become unbounded. Or it
35
is impossible to control the linear position of cart.From state space model it can be
seen that state x1 is unobservable from θ1 .Intuitively it can be said that if we are
balancing a stick on our hand we can balance a stick but can also attain constant
velocity too, if its assumed that there is negligible air drag. Because of missing air
drag dynamics our simulation results on the proposed Figure (5.2) arrangement
are able to stabilize the angular position of inverted pendulum but linear position
of cart become unbounded.
5.1 SISO
5.1.1 PID
PID controller was designed and tuned for Figure(5.3). Figure(5.4) shows the
response of PID stabilizing control.
whose stability and performance properties are good in spite of bounded differ-
ences between the nominal plant assumed in design and the true plant encoun-
tered in practice. The control system designer mention the desired responses (i.e
step,impulse or frequency) and noise-suppression properties by applying different
weights to the plant transfer function in the frequency domain; then the result-
ing ’loop-shape’ is used and ’robustified’ through different optimization technique.
Robust methods that are applied usually has less effect at high and low frequencies
ranges, but its response near unity-gain crossover is adjusted to obtain and maxi-
mize the desired system’s stability margins. H-infinity loop-shaping can be applied
to multiple-input multiple-output (MIMO) systems. In our SISO configuration we
are using it this technique to get our desired response.[14]
5.2 MIMO
5.2.1 PID
The PID control strategy consists of three separate tunable parameters, or it can
be said as a controller having three degree of freedom: P the proportional param-
eter,I the integral parameter and D is for derivative parameter. These values can
also be evaluated in terms of time,P has effects on the present error, past errors
can be effected by using the parameter I, and derivative term is used for prediction
purpose i.e. D. The sum of these three actions followed by gain K is used stabilize
the plant.
39
In MIMO arrangement two loops are tuned separately to achieve the desired re-
sponse of IP. Figure(5.8) shows the particular loop structure.
5.2.2 LQG
0
x = Ax + Bµ + wd (5.1)
40
y = Cx + wn (5.2)
The cost function for the LQG problem can be given in the following form as
Z T
1
J = E{ lim (xT Qx + uT Ru)} (5.3)
T →∞ T 0
if we choose
1
Q 2 0 x
z=
1
0 R2 u
Z T
1
J = E{ lim (z(t)T z(t)dt)} (5.4)
T →∞ T 0
1
A W 0 B
2
1
Q2 0 0 0
P =
1
0 0 0 R
2
1
C 0 V 2 0
41
if we are interested to control the the plant i.e. we want to track the position of
cart so we have to introduce one more row in the generalized plant.
1
A 0 W 0 B
2
1
Q2 0 0 0 0
P =
0 0 0 0 0
1
C I 0 V 2 0
Chapter 6
GRAPHICAL USER
INTERFACE
Graphical user interface (GUI) is a type of user interface that allows users to
interact with electronic devices with images rather than text commands. Designing
the visual composition and temporal behavior of GUI is an important part of any
computer application. Its goal is to enhance the efficiency and ease of use for the
underlying logical design of a stored program. Methods of user-centered design are
used to ensure that the visual language introduced in the design is well tailored
to the tasks.
Now coming toward the GUI of inverted pendulum setup we have to test different
type of control strategies so programming the micro controllers again and again
is really a cumbersum task.To avoid these complexities user fascilitatedd visual
language is used to ensure the solution of above complexities. Many problems
may arise during hardware testing i.e. communication link may fail, sensors are
not working properly.To check these problems again and again with ocillioscope
and digital multimeter really boils the head of the subject.So by just giving at a
look to gui its very easy to locate the error and can be resolved easily
43
The Figure(6.1) shows the gui of the inverted pendulum setup. This gui con-
sists of display panel, control panel , and setting panel.
Display panel shows in which mode this IP is operating i.e. in swing up mode or
controlling mode etc It also shows connection status and small 2D animation of
IP.It will also be capable of displaying different graphs i.e residues step responses.
Control panel is used for online updation of difference equations in the micro
controller.It really saves our time and reduces complexity of burning code in the
controller again and again.We can either write discrete differential equation up to
eighth order obtained from different robust control techniques like LQG ,H∞ etc.
or use sliders to adjust the PID gain of the system.
In hardware projects the generic work always safe your lot of effort and helps you
to achieve maximum with minimum effort.So setting panels is provided that helps
you to change any parameter in the code i.e. sampling time, cycles per revolutions,
gains etc.
45
Chapter 7
7.1 Conclusion
1. Mechanical Design of IP
2. Electronic of IP
3. Controller design
Appendices
48
Appendix A
Mathematical Model
clc
close all
clear all
numk=1;
denk=1;
%% initializations
s=0
M=1.250; %mass of cart Kg
m=0.250; %mass of pendulum Kg
Mt=M+m; %total mass of system
l=0.24; %length of pendulum m i.e 24cm
r=0.047/2; %radius of pully m
J=0; %inertia of pendulum
Jpul=Mt∗rˆ2; %inertia of complete systrm concentrated on pulley
t=0.1; %time constant of motor s
g=9.8; %gravity
B=0; %friction of cart
K=1;
%% state space model
DDNN=(M+m)∗(J+m∗lˆ2)−(m∗l)ˆ2;
49
References
[1] K. Ogata and Y. Yang, Modern control engineering, vol. 4. Prentice Hall
Upper Saddle River, NJ, USA, 1990.
[5] B. Kuo and M. Golnaraghi, Automatic control systems, vol. 4. John Wiley &
Sons, 2003.
[6] R. Bishop and R. Dorf, Modern Control Systems. Prentice Hall College Di-
vision, 2004.
[7] J. Slotine, W. Li, et al., Applied nonlinear control, vol. 199. Prentice-Hall
Englewood Cliffs, NJ, 1991.