Академический Документы
Профессиональный Документы
Культура Документы
By Stephen Salvatore
Ernest Esposito
Joseph Miller
Instructors:
Dr. Raul Ordonez
Dr. Ravi P. Ramachandran
Dr. Stephanie Farrell
Table of Contents
Section
I.
II.
III.
IV.
V.
VI.
Title
Page
3
4
5
6-9
10
11
Introduction
Problem Description
Requirements
Ball & Beam Control Theory
System Design
Team Organization
Page 2
Section I Introduction
The ultimate goal of this experiment is to develop a control system and create the supporting
software for the CE106 ball and beam apparatus. In this experiment, a ball is free to roll along
the track of a beam that is pivoted at the center. Transducers on the ball and beam continuously
detect the ball position and the beam angle of the track. The control problem involves moving
the ball from one position on the track to another by controlling the track angle.
The control system is to be implemented using a computer interfaced to the ball and beam
system via a data acquisition card. Computer inputs are obtained from the voltage signals
proportional to the ball position and beam angle of the ball and beam. The computers output
voltage controls the motor that changes the beam angle. The block diagram below illustrates the
flow of data for the ball and beam experiment.
Inputs
Motor Signal
D to A
Computer &
Control
Software
Outputs
Beam Angle
Ball Position
A to D
Page 3
The major control objective is to position the ball anywhere along the beam. This is a
difficult problem because the only actuator available is the beam itself and its rotation.
Moreover, this is a nonlinear, and unstable system.
Page 4
Beam
Page 5
Page 6
rp
yp
Page 7
where:
rp is the reference or desired value for the ball position on the beam.
yp is the actual ball position on the beam at a given instant in time.
ex is the calculated ball position error signal (ex = rp - yp).
is the actual angle of the beam at a given instant in time.
ref is the reference angle generated by the ball position controller.
e is the calculated beam angle error signal (e = ref - ).
And u is the voltage signal that controls the unstable ball and beam system.
Motor Model: The drive motor tilts the beam through the action of a profiled cam attached to the
motor shaft. A retaining spring is attached to the beam to ensure that the cam follower is kept in
contact with the cam. We can model this motor with the following equation:
1 2 Au
Where A, 1, and 2 are all constants that can be determined by conducting experiments with the
ball and beam apparatus. These experiments include collecting input versus output data for the
ball and beam motor. This data is used to construct a bode plot and derive the appropriate
constants for the ball and beam motor model. Also, u represents the control variable or function
for the control system.
Ball Model: The main co-ordinates for the ball and beam system are the ball position on the
beam and the beam angle . We can now write the Lagrangian (L) for the system:
L=U*-T
where U* is the kinetic energy and T is the potential energy in the system.
The potential energy is zero, since there are no springs in this system. Hence, the Lagrangian is
given by the kenetic energy which consists of the translational and rotational kinetic energy of
the ball as it moves on the beam. Now we can write the following formula:
L U*
1 2 1 2
mv I
2
2
where m is the mass of the ball and I is the ball's moment of inertia.
Page 8
Now the translational velocity of the ball (v) and the angular velocity of the ball as it rolls ()
must be re-written in terms of x and . First, consider the angular velocity. The angular distance
rolled by the ball with respect to the vertical is given by the following formula:
Hence,
d x
dt
r
v 2 x 2 x
Now, by substituting the previous two equations in the Lagrangian equation yields:
m 2
I x
L
x ( x ) 2
2
2 r
At this point we can write the expression for the moment of inertia of the ball:
I
2
mR 2
5
dt x
x
and substituting L in this equation gives us the ball model for the ball and beam apparatus:
2R2
2 R 2
x ( ) 2 g sin
2
2
5r
5r
Page 9
differential equations. In this particular case, we will be solving the nonlinear system of
differential equations using the Runge-Kutta method for simulation control design purposes.
To begin the state-space model we assign new variable names to the beam angle, beam
velocity, ball position, and ball velocity:
x1
x
2
x3 x
x4 x
Now we can begin to fill in the right side of each equation with the appropriate value in the ball
and beam system:
x 1 x 2
x 2 1 x1 2 x 2 Au
x 3 x 4
x 4
g sin( x1 ) x3 ( x 2 ) 2 B ( 1 x1 2 x 2 u )
C
where and
where
2R2
B
2r 2
C 1 B.
R and r refer to different dimension of the ball.
u C1 (C 2 (e x ) x1 ),
where C2 is the outer loop (master) or ball position controller and C1 is the inner loop (slave) or
motor angle controller.
Page 10
CPU
A to D
The computer will retrieve actual readings from the control experiment via the analog to digital
converter on the data acquisition card. The C++ software will process these readings and a
control voltage will be generated and sent to the digital to analog converter. This generated
voltage will in turn be sent to the ball and beam apparatus.
Software: All of the software developed for this project will be coded in C++.
Initialize D/A and A/D
converters
Set Reference Ball
Position rp(k)
Measure Ball Position
yp(k)
Calculate Position
Error
ex(k) = rp(k) - yp(k)
Generate Reference
Angle
ref(k) = C2(ex(k))
Measure Beam Angle
(k)
Calculate Angle Error
e(k) = ref(k) - (k)
Generate Control
Signal
u(k) = C1(e(k))
Page 11
Write control
voltage u(k) to the
motor
Algorithms: In the initial C++ software design a PID controller algorithm will be used. The
following flow chart outlines the algorithm of how the closed loop control would be
implemented on a computer.
Data Acquisition: In order to retrieve information from the various experiments, a Keithley
KPCL-3102 card will be utilized. Also, in order to plug into the various channels on the
computer interface a STP-68 screw terminal panel will be used connected by a CAB-305 cable.
Page 12
Page 13