Furuta

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Inverted Pendulum Demonstration

Experimental Set Up
Johan kesson
5th January 2001
1. Introduction
This document is intended to give the necessary information to set up and
run a demonstration of manual control on the inverted pendulum. Once the
hardware is connected, a Simulink application may be used for experiments
or demonstration. The purpose of the demonstration is to illustrate various
control strategies that ensures stability of the inverted pendulum, while
enabling manual control of the pendulums pivot point. For details on the
controller structures, see kesson (1999).

2. Experimental Set Up
A Furuta pendulum, (see figure 1) a joystick and a personal computer is
used in the set up. The computer used in the experiments performed in
kesson (1999) run Linux as operating system and Matlab / Simulink for
design and implementation of controllers.
2.1 The Pendulum
The pendulum used for the experiments provides direct measurements of
the states. The arm and pendulum positions ( and ), as well as their
z

PSfrag replacements

Figure 1

A schematic picture of the Furuta pendulum

I/O Connection
AI2

Pendulum Signal
Pendulum Angle (Top)

AI3

Pendulum Velocity (Top)

AI4

Arm Position

AI5

Arm Velocity

AI6

Pendulum Angle (360)

AI7

Pendulum Velocity (360)

AO0

Control signal

Ground
Table 1

Ground

Connection of the Furuta pendulum.

I/O Connection

Joystick Signal

AI0

White (X Axis)

AI1
DC Servo, +9V

DC Servo, Ground
Table 2

Blue (Y Axis)

Red

Black

Connection of the joystick.

respective velocities are available. The pendulum measurements exist in


two versions, one that covers all possible pendulum angles and one that
only covers angles near the upright position. The top angle measurements
are used for stabilization and velocity control, while the other signals are
used for the swing up sequence. The Simulink application is designed to
automatically take care of the necessary switching.
The signals from the pendulum should be connected to the I/O interface
on the computer as in table 1.
2.2 The Joystick
A joystick may be used to generate the reference trajectory for the pivot
point of the pendulum. Notice that only the X-direction of the joystick is
used. For power supply a DC servo is used. Connections should be made as
in 2. For experiments however, the predefined reference trajectories may
be better suited.
2.3 The Simulink Interface
All control structures has been calculated using Matlab and implemented
in Simulink. Simulink in combination with the I/O interface offers the
possibility to easily evaluate controllers by simulation before performing
the experiment on the real pendulum.
A few practical advises are worth mentioning to ease the procedure of
setting up a well functioning demonstration.
Firstly, it is critical to make sure that the measured signals are transformed
from Volts to rad, rad/s etc in a proper way. This is done by examining the
2001-01-05 10:10

signals in the block Process/Hardware/Conversion of Inputs. Especially it


is critical to make sure that the measurements of the angle is zero when
the pendulum is in upright position. Adjustments of the conversion coefficients may have to be made in the file pend_init.m, to set the conversion
coefficients right.
2.4 Experienced Problems
In this section some of the problems experienced during the experiments
will be briefly discussed.
A major problem at the beginning of the project was measurement noise.
Although stabilization of the pendulum was possible, it was hard to distinguish the actual signals because of noise. T problem was most serious
for the angular velocity of the pendulum. The most significant reason for
the noise was that the pendulum and the computer were connected to
power points with common ground far away. This caused a large ground
loop which picked up a lot of noise. The problem was significantly reduced
when pendulum and computer were connected to power points close to each
other. Shielded cables were used for the measurement signal showing the
most severe noise as well as the the control signal. This reduced the noise
further. The remaining noise was found to be acceptable.
A problem that appeared right after the swing up sequence was a high
frequent oscillation of the pendulum. High frequent is here meant to be
compared to the natural frequency of the pendulum. Since the frequency
of this oscillation was higher than the bandwidth of the closed loop system, it could not be damped by the control laws. This phenomena could be
explained by the fact that the pendulum was modeled as rigid, where as
it is really flexible. Our solution to the problem was to simply damp the
oscillation manually before any experiments were performed.
A problem experienced in Simulink is also worth to mention. The original idea was to include both a model of the pendulum and the hardware
interface in the same application. This would enable fast and easy switching between simulation and experiment. However, this turned out to be a
problem since the continuous states of the model required much calculation time when experiments were performed on the real pendulum. It is
then not possible to keep up with the sampling rate, which is of course
unacceptable. The solution was to remove the pendulum model during the
experiments and insert it for the simulations.
A phenomena that grew more and more significant during the project was
the appearance of periodic spikes in the jitter curve. The measured signals exhibited more or less significant discontinuities at those samples.
This problem caused a lot of confusion, but was tracked down to depend
on the numerous Scopes used in the application for debugging purposes.
When the Scope buffers were updated every fifth second, the sampling time
could not be held. The problem was solved by removing the scopes from
the application.

2001-01-05 10:10

Figure 2

The main view of the user interface.

3. User Interface
The main view of the user interface is shown in fig 2. All relevant plots and
controls are located in this view. To start the demonstration, make sure the
pendulum is at rest (either hanging down or standing upright) and press
Ctrl+t. If the pendulum is at rest hanging down, the swing up sequence is
started by moving the joystick in any direction along the x-axis. When the
pendulum has reached its upright position the velocity of the pendulum
can be controlled.
Both control of the real pendulum and simulation using a model is possible. However, the pendulum model is not included in the application when
control of the real pendulum is performed. The reason for this is discussed
above. Instead, the model has to be imported before simulations can be
done. The model is stored in the file pend_model.mdl and should be imported to the block Process. Double click the block Process to enable the
simulation.

2001-01-05 10:10

Button

Function

Options

The application may be set to operate in


two modes, either open loop or closed loop.
Closed loop is normally used, but open loop
may be used for debug purposes. In the later
case no control signal is given to the process, but all measured signals are logged. Further, two ways of generating reference the signal is allowed. Either the joystick or a sequence of reference steps. It is possible to
change the step sequence by modifying the
block Controller/Reference / Controller / Reference generator. Further, any of the implemented strategies may be selected. Suitable
values for the control signal saturation are 0.5
(the controllers providing protection mechanisms has been tuned to deal with this saturation) and 2 (unconstrained control).
Displays a plot showing , , , , u and jitter

Plot Graphics
Reference Evaluation

Ref,

Displays the loss function as well as the reference signal and response. Also calculates rise
times. (Works best when the step sequence is
used.)

A real time plot showing the reference and


phidot.
A real time plot showing and .

Jitter

A real time plot of the jitter.


Table 3

2001-01-05 10:10

Buttons and their usage in the Simulink interface.

4. References
kesson, J. (1999): Safe reference following on the inverted pendelum.
Report ISRN LUTFD2/TFRT--7587--SE. Department of Automatic
Control, Lund Institute of Technology, Lund, Sweden.

2001-01-05 10:10

You might also like