1. INTRODUCTION The Inverted Pendulum is one of the most important classical problems of Control Engineering. It is a well known example of a nonlinear and unstable control problem. Inverted pendulum being an inherently unstable system is often used as a benchmark for verifying the performance and effectiveness of a control algorithm [6]. These systems are of two types cart-pendulum and rotary inverted pendulum. It is virtually impossible to balance a pendulum in the inverted position without applying some external force to the system. In cart inverted pendulum this force is applied to cart while in rotary IP to the horizontal link. The rotary inverted pendulum is a simple structure, multi-variable and unstable non minimum phase system subjected to many nonlinear characteristics. It has a pendulum attached to a rotary arm instead of a moving cart. The advantage of this system is that there is no end point, which makes it convenient for experimentation especially during velocity control of the arm speed [8]. The Inverted Pendulum problem resembles the control systems that exist in robotic arms. The dynamics of Inverted SCoE, Mechanical (Mechatronics) 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1. INTRODUCTION
The Inverted Pendulum is one of the most important classical problems of Control
Engineering. It is a well known example of a nonlinear and unstable control problem.
Inverted pendulum being an inherently unstable system is often used as a benchmark for
verifying the performance and effectiveness of a control algorithm [6].
These systems are of two types cart-pendulum and rotary inverted pendulum. It is
virtually impossible to balance a pendulum in the inverted position without applying
some external force to the system. In cart inverted pendulum this force is applied to cart
while in rotary IP to the horizontal link. The rotary inverted pendulum is a simple
structure, multi-variable and unstable non minimum phase system subjected to many
nonlinear characteristics. It has a pendulum attached to a rotary arm instead of a moving
cart. The advantage of this system is that there is no end point, which makes it convenient
for experimentation especially during velocity control of the arm speed [8].
The Inverted Pendulum problem resembles the control systems that exist in robotic arms.
The dynamics of Inverted Pendulum simulates the dynamics of robotic arm in the
condition when the center of pressure lies below the centre of gravity for the arm so that
the system is also unstable. The common thread among these systems is to balance a link
on end using feedback control [10]. Inverted Pendulum is an abstract model for many
existing control systems such as space booster rocket or satellite or missiles guidance
systems, an automatic aircraft landing system, aircraft stabilization in the turbulent air-
flow, stabilization of a cabin in a ship, heavy Cranes lifting containers in shipyards[7], self
balancing Robots, for future transport systems like segways and jetpacks.
SCoE, Mechanical (Mechatronics)1
2. LITERATURE SERVEY
Yi-Wei Tu, Ming-Tzu Ho have designed and implemented robust real-time visual
servoing control with an FPGA-based image processor for a rotary inverted pendulum.
The position of the pendulum is measured with a machine vision system. The pendulum
used in this study is much shorter than those used in published vision-based pendulum
control system studies, which makes the system more difficult to control. The design of
the stabilizing controller is formulated as a problem of the mixed H2/Hinf control, which
is then solved using the linear matrix inequality (LMI) approach. The designed control
law is implemented on a digital signal processor (DSP) [1].
Author Faiza Faizan, Faizan Farid, Muhammad Rehan, Shoaib Mughal, M Tahir Qadri
have implemented a discrete PID controller on cart inverted pendulum. The system is
implemented using PIC microcontroller. The front panel in this system is built in
LABVIEW. The hardware model consists of sensor (incremental encoder) to sense the
position of pendulum, motor to drive the cart and circuit boards of discrete PID. The
system communicates with PC through serial communication. The system starts working
when the sensor detects the set point from the Index signal of incremental encoder. Once
PID starts then it generates commands for driving the Inverted Pendulum System on
behalf of the angle of pendulum. Pendulum is attached with the cart and the movement of
the cart is controlled by full bridge inverter. The stabilization process is completed in 10
milliseconds. The system is limited in 10 degree span i.e. it can only destabilized only if
it is under its limit (5˚). The simulation of PID is done on Matlab and simulink [2].
Zhongmin Wang, YangQuan Chen, Ning Fang implemented a minimum time swing up
control of a rotary inverted pendulum. A PID controller plus an impulse controller is
proposed in this paper for the swing up control.To make the overall control strategy more
robust, a mode switching control method is also proposed. The furuta pendulum used in
this study consists of a rotary servo motor system which drives an independent output
gear. The rotary pendulum arm is mounted to the output gear and the pendulum is
SCoE, Mechanical (Mechatronics)2
attached to the hinge. The overall controller is divided into three parts the swing up
controller, the mode switching controller and the balancing controller/regulator. For
swing up control a positive feedback PID controller is proposed. When the pendulum is
almost upright, a state fed back controller is implemented to maintain it upright and reject
the possible external disturbance using linear quadratic regulator based on the linearized
plant model. In this study the swing up time has been reduced approximately from being
longer than 8 sec. to being less than 3 sec. [3].
Mario E. Maga˜na and Frank Holzapfel has presented an experimental setup of a fuzzy-
logic controller of an inverted pendulum that uses vision feedback. The fuzzy-logic
controller used to control the experimental inverted pendulum uses conventional
triangular membership functions to fuzzify the data measured by the vision system. The
setup consists of a mechanical system composed of an inverted pendulum, a video
camera and a vision computer that are used as a non touching sensor , a fuzzy-logic
controller that is implemented on a 386 personal computer using Borland C++ and an
actuator that consists of an armature-controlled dc servo-motor driven by a pulse width-
modulated amplifier. As the camera sends the data of each frame for 15 ms and pauses
for 1.25 ms during the vertical blank, this window is used to copy the information in to
the main memory. This vertical blank period gives opportunity to manipulate the data and
compute the angle and position of the sled simultaneously before the next image is
acquired. A lead screw is directly coupled to the shaft of a dc motor and is guided by two
steel bars using bearings drives the sled [4].
3. INVERTED PENDULUM TYPES
Inverted Pendulum systems are of two types
Cart Inverted Pendulum (CIP)
Rotary Inverted Pendulum (RIP)
SCoE, Mechanical (Mechatronics)3
3.1 Cart Inverted Pendulum (CIP)
These systems are also called as Carriage Balanced Inverted Pendulum (CBIP). This
system involves a cart, able to move backwards and forwards, and a pendulum, hinged to
the cart at the bottom of its length such that the pendulum can move in the same plane as
the cart. That is, the pendulum mounted on the cart is free to fall along the cart's axis of
motion.
Figure 1. Cart-pendulum [9].
3.2 Rotary Inverted Pendulum (RIP)
Rotary inverted pendulum systems are also known as furuta pendulum. The RIP is a
simple structure, multi-variable and unstable non minimum phase system subjected to
many nonlinear characteristics. It has a pendulum attached to a rotary arm instead of a
moving cart. The advanced of this system is that there is no end point, which makes it
convenient for experimentation especially during velocity control of the arm speed. It
consists of two links, a motor driven horizontal link and an unactuated vertical pendulum
link. A DC power supply together with a pulse-width-modulated (PWM) servo amplifier
supplies power to motor.
SCoE, Mechanical (Mechatronics)4
Figure 2: Furuta or rotary inverted pendulum [9].
4. INVERTED PENDULUM CONTROL SYSTEM
The inverted pendulum control system is shown in fig. 3. The pendulum may be a cart
mounted or arm driven rotary inverted pendulum. Pendulum angle measurement is done
by sensors like camera, encoder or potentiometer. The angle feedback block gives actual
pendulum angle which is compared with reference angle to produce error signal or
deviation. Reference angle is kept zero or near zero as pendulum has to be balanced in
upright position. Error signal is fed to the controller block. Various controller
implementations are PID, LQR,FLC, H2/H∞. The controller output is control signal
which is motor control voltage fed to the motor driver.
Figure 3: General block diagram
SCoE, Mechanical (Mechatronics)5
Controller (PID, LQR,
FLC,H2/HINF)
Inverted Pendulum
system(CIP, RIP)
Angle Feedback(Vision,
Encoder, Potentiomet
er)
Error Control Signal
Actual Angle
Reference Angle +
-
5. CONTROL METHODS
Various methods are implemented in the literature for inverted pendulum control. Some
control methods are PID, LQR, H2/H∞, FLC. The sensors used for measurement of
pendulum angle are image sensor, encoder, potentiometer.
5.1 Using vision feedback
Inverted pendulum control systems with vision feedback use image sensor to measure
pendulum angle. This is non-contact type sensor. Other non-contact type sensor involves
radars, ultrasonic sensors, infra red sensors. Vision sensors are able to identify and track
targets within the scene with ease and provide more information about the relationship
between targets and environment [1]. Measurements made from images are noisy in
nature due to modeling uncertainty of the image sensor and changes in the environment,
background, and illumination, which deteriorates the performance of visual servoing
systems. To mitigate noise, a filter is commonly used to smooth noisy data before it is fed
to the controller.
5.1.1 Just-In-Time Control
Authors Ken-ichiro Fukuda, Shun Ushida and Koichiro Deguchi in [5] have proposed a
control system for stabilization of inverted pendulum which uses a normal frame rate
camera. The motivation behind the study is that, humans can keep a stick on the fingertip
in upright position for a certain time after a brief exercise, although humans have a large
time delay due to signal transfer in the optic nerve and due to information processing in
the brain. Correspondingly in an experiment on the stabilization of the mechanical
inverted pendulum, a normal frame rate camera is used as an angle sensor of the
pendulum, and its large time delay makes the stabilization difficult. JIT is memory-based
scheme which corresponds to the mechanism of human learning and memory.
SCoE, Mechanical (Mechatronics)6
5.1.1.1 Stabilization By PD Controller
A two-link nonlinear Direct Drive Arm and a pendulum placed on the tip of the DD-arm
is considered. To measure the pendulum angle, one camera is placed at the ceiling of
experimental laboratory.(X,Y,Z)and(u,v)indicate 3D world coordinates system and 2D
image coordinates system, respectively. Figure 4 shows the world and image coordinate.
The length of the pendulum ‘h’ is known. By assuming that the pendulum angle is very
little and the height of the pendulum head is always h in 3D world coordinates system.
The relationship between the 3D position (Xt,Yt,h) and 2D position (ut,vt).
w (ut
v t
1 )=P(X t
Y t
h1
) (1)
P is projection matrix. By taking 3D positions at the top (Xt,Yt,h) and bottom (Xb,Yb,h)
of pendulum, the angle of pendulum is calculated as
Φ≈ sin Φ=√(Xb−X t)
2+(Y b−Y t)2
h (2)
SCoE, Mechanical (Mechatronics)7
Figure 4 : World coordinates and camera coordinates [5].
5.1.1.2 Stabilization By JIT Method
In JIT modeling method prior knowledge about the complicated controlled object is not
required. In traditional online identification, the system global model is updated for every
new data. In general it is called Eager Learning. Instead of global model, JIT method
stores much past input-output data of the system. Only when it receives requests to
process of system information, it combines stored data to reply to information requests.
This identification is also called Lazy Learning. In global modeling, prior knowledge
about constructions and parameters of identified objects is considerably important and
necessity. As an another advantage, JIT method has much past input-output data of the
system. This makes one think of human memory and human determination mechanism.
In fact humans memorize their past experiences and make behavioral decisions using past
experiences. JIT method also memorizes past input-output data and predicts system
information combining stored data [5].
5.1.2 Mixed H2/H∞ control
Yi-Wei Tu, Ming-Tzu Ho have presented design and implementation of real time visual
servoing control with an FPGA-based image co-processor for a rotary inverted pendulum.
The pendulum used in the proposed system is much shorter than used in usual systems
i.e. 0.156 m which makes the system more difficult to control. The designed control law
is implemented on a digital signal processor (DSP) [1].
5.1.2.1 Machine vision system
The image processing algorithms of the machine vision system are pipelined and
implemented on a field programmable gate array (FPGA) device to meet real-time
constraints. In this paper, the position of the pendulum is measured with a machine vision
system that uses an image sensor with a frame rate of 250 frames per second. The camera
SCoE, Mechanical (Mechatronics)8
uses a KODAK CMOS image sensor, KAC-9630, which can capture 128 ×101 pixels
quantized to 256 gray-levels at 580 frames per second. The camera is mounted on the
rotating arm of the inverted pendulum system. The SRAM (2 M bits) acts as a frame
buffer, which is used for storing an image during camera calibration. The FPGA board is
based on an Altera Cyclone EP1C12Q240C8 FPGA [1]. A circular-shaped marker is
placed on the top of the pendulum to simplify visual sensing and to increase the accuracy
of visual measurements. Determination of the position of the marker is based on the
perspective pinhole camera model which is given by
λ p=K ICP [ RECP ⃒ t ] POPCS (3)
p represents two dimensional homogeneous coordinates of image point in image
coordinate system, Popcs represents the three-dimensional homogeneous coordinates of
the object point in the world coordinate system, and λ is a scalar factor. The matrix Recp
and three-dimensional vector t are extrinsic camera parameters that describe the rotation
and translation between the world frame and the camera frame, respectively. KICP is the
intrinsic camera parameter matrix.
5.1.2.2 Edge detection
Edges are the pixels at or around which there is a large change in gray-level intensity. In
most images, edges characterize object boundaries and are therefore useful for the
Segmentation and identification of objects in a scene. Most edge detection techniques are
based on the idea of computing image gradients. Let f(x, y) denote the grayscale level of
the pixel at point (x, y) in the image coordinate system. The gradient of an image
grayscale level at pixel (x, y) is defined as
∇ f ( x , y )≣
∂ f∂ x∂ f∂ y
=[ f x (x , y)f y( x , y )] (4)
SCoE, Mechanical (Mechatronics)9
In this study the computation of the image gradient is based on the Sobel operator as
shown in fig 5. The magnitude of image gradient is given by following equation,
|∇ f|≜√ f x2+f y
2 (5)
To lower computational complexity, the magnitude of the gradient is approximated using
the sum of the absolute values of fx and fy, which is given by
|∇ f|≈|f x|+|f y| (6)
Figure 5: Edge detection using sobel masks [1].
5.1.2.3 Thresholding
Once the edge strength is computed using edge detection, the next step is to apply a
threshold to decide whether edges are present at a specific point of the image. The
thresholding with a threshold value 150 is applied which is determined experimentally as
shown in fig 2. The thresholding operation separates the edge of the marker from the
background and the pendulum rod [1].
SCoE, Mechanical (Mechatronics)10
Figure 6: Threshold applied to the image [1].
5.1.2.4 Centroid and displacement determination
As the marker is symmetrical, the centroid of the edge is taken as its location.The
centroid (xc, yc) is given by,
xc=∑
x∑
y
x . f T (x , y)
∑x∑
y
f T (x , y)
(7)
where fT(x, y) represents the binary level of the pixel at point (x, y) in the image
coordinate system.
SCoE, Mechanical (Mechatronics)11
Figure 7: Angular displacement of the pendulum rod [1]
Using triangulation, the angular displacement of the pendulum rod is given by
θ=2sin−1 √( Xc−Xe )2+(Y c−Y e )
2
2 L
(8)
where L is the distance between the pivot joint and the center of the marker.
5.1.2.5 Stabilization using mixed H2/H∞ control synthesis
The design of the stabilizing controller is formulated as a problem of the mixed H2/H∞
control, which is then solved using the linear matrix inequality (LMI) approach. The
rotary inverted pendulum system has two equilibrium points. The downward pendulum is
a stable equilibrium point. The upward pendulum is an unstable equilibrium point. In
order to design the stabilizing controller, the Jacobian linearized model is needed. The
synthesis of the controller is formulated as a problem of the mixed H2/H∞ control. The
H∞ norm constraint is used to enhance robustness against dynamic uncertainty, and the
H2 performance is used to ensure control effort, disturbance attenuation, and sensor noise
attenuation. The simulations are carried out in MATLAB/Simulink. To examine the
robustness of the proposed control system, an impulsive disturbance was manually added
by tapping the pendulum at a time of 3.5 s, the control system recovers from the
impulsive disturbance. The pendulum slightly oscillates in the upright position within a
range of ±1º, and the rotating arm oscillates within a range of ±6º [1].
5.2 Using Encoder feedback
SCoE, Mechanical (Mechatronics)12
The pendulum angle is measured using incremental encoder and angular velocity of
pendulum is obtained by taking its derivative. These values are fed back as system to
calculate error voltage.
5.2.1 LQR and energy based PD control
Viroch Sukontanakarn and Manukid Parnichkun have developed a rotary inverted
pendulum the mechanical model of which is derived by using Euler-Lagrange. An
Energy based on PD controller was applied in self-erecting of the pendulum while LQR
controller was applied to balance the pendulum [8]. The rotary inverted pendulum system
consists of a controller, an arm, a pendulum, an actuator (a dc motor) and two increment
rotary encoders. The controller makes the pendulum stand at upright position on the
rotary arm by moving the arm supported on the base. The motor provides power to rotate
the arm. The encoders detect the pendulum and arm angular position. Derivation of
mathematical equation describing dynamics of the rotary inverted pendulum system is
based on Euler-Lagrange equation of motion:
ddt ( ∂ L
∂ q ' i)− ∂ L
∂ qi
+∂W∂ q i
=Qi (9)
Where q(t) is angular position vector, q˙(t) is angular velocity vector, Qi external force, L
is Lagrangian and W is loss of energy. In the Euler-Lagrange equation, the Lagrangian,
L, is defined as follows
L (q , q ' )=T total−V total (10)
Where, Ttotal is Total kinetic energy of the rotary inverted pendulum system and Vtotal
is the Total potential energy of the rotary inverted pendulum system.
5.2.1.1 Self-erecting pendulum by energy based on PD controller
SCoE, Mechanical (Mechatronics)13
The self-erecting controller is used to swing the inverted pendulum up to the upright
position when the pendulum is far from the upright position; for example, when the
pendulum falls down by gravity. The self-erecting controller brings the pendulum upright
close to the unstable point of equilibrium. Swinging up controller calculates the total
system energy based on the kinetic energy of both links and the potential energy of the
pendulum. The control law function for input of the system is given by,