Virtual and remote experimentation with the Ball and Hoop system
E. Fabregas, N. Duro, R. Dormido, S. Dormido-Canto, H. Vargas, S. Dormido
Dpto. Informática y Automática (UNED)
C/ Juan del Rosal nº 16, 28040, Madrid, Spain
traditional control laboratories in engineering education
can be replaced with a remote or simulated experimental
session. Thus, the way of studying becomes more
flexible: the assistance to the laboratories is minimized.
Accessing to the application students can make
experiments and obtain results with a real plant from
different localizations far from the university. This paper
presents a complete virtual and remote control
laboratory for experimentation of an oscillatory system:
the Ball and Hoop. Using this application students can
understand in a practical way important topics such as
non-minimum phase behaviors, zeros transmission of the
system, resonance, or to demonstrate control of
oscillatory systems. The client-side of the virtual
laboratory has been developed using the programming
support provided by Easy Java Simulations (Ejs). The
server-side has been developed using Labview and a
data acquisition card.
Intenet-based networking technologies
In Control Engineering Education, concepts taught
through lectures are often complemented by practical
laboratory experimentation. The students can observe
dynamic phenomena that are often difficult to explain by
written material. It is usual that in distance education
laboratory experimentation is inconvenient to integrate,
because the students have to be physical present at the
facilities in the laboratory. Remote control of laboratory
experiments avoids this disadvantage. [1, 2].
Our institution, the Spanish National Distance
Education University (UNED) offers distance education
courses on Automation Control for as many as 300
students every year. In our department, since some years
ago we are developing a battery of remotely accessible
web-based labs . The students will have access via
Internet to various experiments in control engineering,
which are physically situated in the laboratories at the
university. An important advantage of the remote web
based laboratory is that students can use it any time and
at any place and save travel time and cost. Furthermore,
interactive experimentation on real-world plants is
highly motivating for students and also develops an
engineering approach to solve realistic problems . An
experimental approach to explain the most usual control
system benchmarks can indeed enhance student
motivation [5, 6]. In this context the Ball and Hoop
system is a good example to show some important topics
in control such as non-minimum phase behavior or zeros
This paper describes a virtual and remote laboratory
to control the Ball and Hoop system. This system is
described in . The Ball and Hoop system is an
electromechanical device with a steel ball that is free to
roll on the inside of a rotating circular hoop. The hoop is
mounted vertically on the shaft of an electric motor, so
that it can be rotated about its axis. The system was
originally proposed to study the control of the
oscillations of liquid in a container when the container is
moving and undergoing changes in velocity and
direction. In our case, the system is used to implement a
remote laboratory to be used in a basic Automation
Control course to study modelling, dynamic and control
design fundamental principles of process control. The
experiments proposed allow understanding concepts
like: non-minimum phase behaviour, resonance of the
system or position and velocity control.
The laboratory has been developed using Ejs (Easy
Java Simulations)  to implement the model and the
graphical user interface of the laboratory. The lower-
level, server-side communication and hardware control
part of the laboratory is implemented using Labview
(http://www.ni.com/Labview/), a data acquisition card
and a standard TCP/IP (Transmission Control Protocol /
Internet Protocol) communication routines.
The paper is organized as follows. In Section 2 the
Ball and Hoop system is reviewed showing different
theoretical frameworks of the system. The Section 3
shows how the laboratory operates the plant in virtual
and remote mode. The architecture and the software
implementations required to built the laboratory at the
server and client sides is also presented in this section. In
Section 4 some experiences are shown. Finally, some
concluding remarks are presented in Section 5.
978-1-4244-2728-4/09/$25.00 ©2009 IEEE
2. The Ball and Hoop system
To develop the web-based laboratory, a laboratory
plant was modeled (Figure 1). The plant corresponds to
the Ball and Hoop CE9, manufactured by TecQuipment
Figure 1. Ball and Hoop CE9.
2.1. The Ball and Hoop system model
The scheme of the Ball and Hoop system is shown in
Figure 2. The principal components of the system are: A
steel hoop which can rotate about its axis, a steel ball on
the hoop inner periphery, a servomotor which drives the
hoop motor torque, τ(t), a sensor of the hoop angle, θ, a
sensor of the hoop velocity, a sensor for the ball angle,
ψ; and the interface between the plant and the data
acquisition card which contains some electronically
devices to establish specific conditions of operation .
Moreover y represents the position of the ball on the
hoop periphery with respect to a concrete point A.
Figure 2. The Ball and Hoop scheme.
All the non mentioned variables relevant for the
model are shown in Figure 2. The hoop radius, R; the
rolling radius of the ball, r; the ball mass, m; the gravity,
g; the translational velocity of the ball, v; the angular
rotation of the ball, φ and the vertical displacement of the
ball, measured positively in the downward direction, x.
The Ball and Hoop dynamic is quite complicated to
derive using the normal approach. The hoop is mounted
on the shaft of a motor, and the motor is assumed to be a
pure source of torque τ(t). So, the dynamical behavior of
the system would be completely represented by the
equations of motion of the angular position of the hoop,
θ, and the position y of the ball on the inner periphery of
the hoop. For this reason this paper uses these variables
as the generalized coordinates for Langrange’s
equations. However equations (1) are needed to relate
the generalized coordinates to the other variables in the
φ = y/r, v = (R - r)ψ, ψ = (θ - y/R)
The Lagrangian system is made up entirely from the
kinetic energies, associated with the rotation of the hoop,
the rotation of the ball and the translation of the ball’s
centre of mass . So, the dynamical behavior of the
system would be completely represented by the motion
equation of the hoop angular position (2), and the ball
position on the inner periphery of the hoop (3).
mg R r
m R rm Rr
Where Ia and Ib are the moment of inertia of the hoop
and ball respectively, bm is the rotational friction
coefficient of the motor, and bb is the friction coefficient
of the ball
2.2. Special features of the ball and hoop
The ball and hoop system is very rich and complex in
its dynamic because has an oscillating and always
changing behaviour. For this reason its study is very
interesting for our students. Two special features are the
ability to demonstrate ‘zeros of transmission’ and to
show ‘non-minimum phase behavior’ .
2.2.1. Zeros of transmission
Some simplifications can be made in equations (2)
and (3), in order to show some special behaviors of the
process. The first simplification is the linearization of the
model. For this, it must be considered that the slosh
angle, ψ, is very small and then sin(ψ) can be replace by
ψ. Another important simplification that can be
considered is that the hoop radius R is much bigger that
the rolling radius of the ball, r. And also that the moment
of inertia of the solid ball is equal to (2/5)m(rb)2. It is
very important to note, that the radius considered for the
solid ball is different that the rolling radius of the ball, r,
as it is shown in Figure 3.
Figure 3. Relation between the radius rb - r
With these considerations, the equations of the model
(2) and (3) after the aproximation and linearization can
be rewritten as follow:
Making use of the Laplace transform, (5) can be
represented by the following transfer function:
This transfer function presents purely imaginary zeros
( / )sj g R
. This means that if the hoop angle θ, is
under feedback control and a sine wave of frequency
equal to g/R in radians/sec is applied to θ, then there will
be exact zero response from the ball position output y(s).
In physical terms this corresponds to the case where the
ball oscillates inside the hoop at exactly the same
frequency as the hoop. Thus, to an observer standing on
the hoop, the ball does not move because the ball and
hoop are moving in exact synchronism. Of course, the
ball is in fact really moving when looked from the
outside. It is just that
measurement/observation point it appears to be
When the system is implemented and connected to
the real plant, the reference frequency must be tuned
accurately to be able to find the exact zero frequency. At
this frequency, named frequency of the transmission
zeros, the ball and hoop will be synchronized.
Occasionally, there can be external disturbances that
produce a transitory response. This phenomenon causes
that the ball and hoop go out of synchronization
temporally, but after a time the ball and hoop return to
from a particular
In the particular case that the frequency of the sine
wave applied to the hoop angle θ, is reduced until the
resonant pole frequency; when the steady state has been
reached the ball angle and the hoop angle will have
constant amplitude. Now however the ball and hoop will
no longer be synchronized. It may also necessary to
reduce the amplitude of the sine wave. This prevents the
amplitude of the ball becoming too large.
2.2.2. Non-minimum phase behavior and shifting zeros
The outputs of the ball and hoop system are θ(s) and
ψ(s). It is possible to construct the signal y(s) by
subtracting scaled measurements of θ(s) and ψ(s).
Scaling is required to take account the amplification and
possible sign inversion introduced by the angle sensors.
Generally, it can be considering the synthetic output
signal x(s) given by:
( )x s ( )s ( )s
where ks is a scalar gain factor. When this gain is
equal to 1, x(s) is the variable y(s)/R, and this
corresponds to a scaled version of the ball position on
the periphery of the hoop. The equation (7) is the
combination of the two system output signals, such that
the input has two paths to the output x(s). Rewriting
equation (7) as a transfer function gives:
By varying the gain ks a root locus of the transfer
function zeros can be plotted and part of the root locus is
in the right hand plane. This means that non-minimum
phase behavior occurs in the system. This will give the
characteristic feature of non-minimum phase where the
output goes initially in the ‘wrong’ direction when step
inputs are applied.
2.3. Control strategies on the ball and hoop system
In this paper it has been implemented three different
control experiences in order to prove some control
experiments on the plant. These experiences are the
angle control of the hoop, the control of the slosh angle
deviation and the angle control of the ball.
2.3.1. Angle control of the hoop
The objective of this experiment is to maintain the
position of the hoop under control, with any control on
the ball. However, when the hoop is moving to a specific
position, it is required to generate the minimal
displacement of the ball from its equilibrium point.
The first step to implement the control is to model the
servomotor of the plant, which represents the behavior of
the hoop. The servomotor has been modelled as a first
order transfer function where Km is the gain of the
servomotor, and τm the servomotor time constant. These
parameters are obtained identifying a model of the plant.
This model has been experimentally obtained and
neglects the motor electrical time constant and other
uncertainties in the motor-hoop dynamics.
The second step for the angle control of the hoop is to
implement the control strategy. For that, it can be used a
PID, or a PI with a feedback control loop in the velocity
of the servomotor. In this paper it has been modelled the
second alternative as it is shown in Figure 4.
Kp s + Ki
τm s + 1
Figure 4. Angle control of the hoop.
The first internal loop is the velocity feedback control
loop, which is added to implement the derivative action
of the controller and to achieve a best stability of the
system. This loop needs a velocity scaling gain (Kω),
which is experimentally tuned. The second feedback
loop is the classical control loop. A conventional PI is
located between the error signal and the control signal.
In this loop it is also necessary to introduce a position
scaling gain (Kθ), to convert the position of the hoop to a
All the parameters related to the control are
experimentally tuned in order to obtain good results.
To evaluate this control it is applied a step signal to
the reference voltage input. In this situation the hoop
follows the reference until reaches the steady state,
however the ball is moving without control.
2.3.2. Control of the slosh angle deviation
The objective of this control strategy is to control the
angle of the hoop but maintaining the position of the ball
near to its equilibrium point. So, it is also necessary to
control the slosh angle deviation of the ball.
Kp s + Ki
τm s + 1
Figure 5. Control of the slosh angle deviation
The scheme shown in Figure 4 must be modified. It is
necessary to incorporate into the model the relation
between the angle of the hoop (θ) and the slosh angle
deviation (ψ), as it is shown in Figure 5. This transfer
function is G(s), and it is obtained from the equations
commented in Section 2.2. Another feedback control
loop is incorporated between the slosh angle deviation
and the input to the PI controller, with a control gain K.
With this control strategy, the hoop can be moved
faster and at the same time the ball deviation from zero
is minimized, depending on the value of the gain K.
When the gain K is increased, the hoop will be forced to
move more and more slowly to maintain a small slosh
angle deviation. This can be understood by examining
the root locus of G(s) with K as a controller. For small
values of the gain K, the ball is only lightly damped
while the hoop response is faster. For large values of the
gain K, the hoop position is sluggish. So an intermediate
value of this gain is recommended for obtain good
2.3.3. Angle control of the ball
The last control system proposed is the angle control
of the ball when the hoop is moving. The objective of
this control is that the hoop achieves a constant velocity
in order to maintain the angle of the ball in a concrete
value. At this point, the deviation between the angle of
the ball and its equilibrium points will be constant.
The control strategy is similar to the control strategy
shown in Figure 5, but with two considerations: the
angle of the reference is a concrete angle desired for the
ball and the feedback position loop is suppressed,
because now it is not necessary to control the position on
3. Virtual and remote laboratory
In this section will be detailed the general structure of
the virtual and remote laboratory architecture, which is
shown in Figure 6. This laboratory is a part of a project
that contains a network of virtual and remote laboratories
for teaching and learning of control engineering,
available at http://lab.dia.uned.es/automatlab. The ball
and hoop system will be accessible to the student the
Figure 6. Architecture of the laboratory
3.1. Virtual laboratory using Ejs – Client side
The ball and hoop application has been developed
using Easy Java Simulations (Ejs). Ejs is a freeware,
B & H
open-source tool developed in Java, specifically
designed to create interactive dynamic simulations to
provide a visual representation of a model and its
dynamic behavior .
Figure 7. The ball and hoop interface.
The view of this virtual and remote laboratory at the
client side is shown in Figure 7. This window is
composed by the main window located in the left and a
graphic area in the right side. The upper part of the main
window shows an interactive system that represents in
the left the non linear model and in the right the linear
model. Using this interface the user can change
interactively some properties of the model such as: the
size of the frame, the radius of the hoops or the position
of the models in the frame. It is also possible to
superimpose both models in order to compare theirs
behaviors. Moreover, the reference can be changed
directly by dragging and dropping the hoop position on
the main window.
In the middle area of the main window there is a set
of buttons to play, pause and stop the simulation. The
connect button allows users to work in remote mode
using the real system running at the laboratory. During
the remote connection a video image of the real plant is
displayed. For this purpose a TCP/IP protocol is used to
connect the webcam with the application.
There are also five radio buttons to choose between
the following actions:
? Init, to set initial operation conditions. This button
is chosen by default when the simulation begins.
? Zeros, to prove the behavior of the zeros of
transmission. When this button is pressed, it
appears a slider which allows modifying the
frequency of the sinusoidal signal.
? Hoop, to study the angle control of the hoop and
the control of the slosh angle deviation. When this
option is selected it appears a slider which allows
modifying the reference of the hoop angle.
? Ball, to run the angle control of the ball. When it is
chosen, a slider is displayed in order to modify the
reference of the ball angle.
? Manual, to work without any control.
At the lower part there are three panels:
? Draw_Properties, to modify the physics properties
of the objects such as the radius of the hoops and
balls; the amplitude of the sinusoidal signal and the
possibility to introduce disturbances in the hoop
angle when the system is controlling the angle of
? Hoop_Angle, to modify the parameters of the PI
controllers when the hoop button is selected.
? Ball_Angle, to modify the parameters of the PI
controllers when the ball button is selected.
At the right side of figure 7, there are some graphics
to show the results of the different experiments.
The first graphic, titled Plots, displays the evolution
of the slosh angle deviation and the behavior of the angle
of the hoop for non linear and linear model. Both
responses are represented in the same plot in order to
compare the systems. Depending on the experience
selected the user can choose the variables to be plotted.
The different variables to be selected are: the slosh angle
deviation (ψ), the hoop angle (θ), the control signal (τ)
and the ball position (y).
The second, titled Dynamic, contains an interactive
root locus representation of the system. The user can
drag and drop the zeros and the poles of the graphic.
3.2. Remote laboratory using Labview - Server side
The architecture of the remote lab is based on a single
client/server structure, that is, the same computer
performs both functionalities the server and the
controller (Figure 8) .
Figure 8. Single client-server structure.
The interface of the client-side has been described in
the previous section since it is the view developed by
Ejs. This interactive view is able to play either as a
virtual laboratory using the mathematical model, or as
remote laboratory making a TCP connection with the
controller running at the server-side. That is, a TCP
channel among view and plant replaces the local channel
among view and model when the interface is used as
remote laboratory (see Figure 8). This switch is done
when the user press the Connect button in the view.
From this moment, every user action sends a data array
to the server, obtaining as response a vector with the
current state of the plant. The length of the data packets
is 42 bytes for the user data and 20 bytes for the system
state. The 42 bytes packets contain only the information
of the Ejs view that is necessary to modify in the real
experiment in order to manage the system, such as: play,
pause, stop, select between the different experiment (Init,
Zeros, Hoop, Ball, Manual), the amplitude and
frequency of the sinusoidal wave (for Zeros), the
reference (for Hoop, Ball) and the controllers
The server-side is a computer running the JIL_server
, an application developed in our department using
Labview to allow the communication between Ejs and
Labview application which is running in the server side.
At the same time in the server exists an application also
developed in Labview, which is the control loop to
govern the physic of the ball and hoop plant through the
data acquisition card and its corresponding driver
software. This application is developed as a “Stand-
Alone Application” and can be manage throw JIL_server
when the user is connected to the remote laboratory.
The package of the system state (20 bytes) received
by the Ejs application from the server side contains the
value of the sensors of hoop position, hoop velocity and
ball position. These data are used to plot the results and
replace the simulation plots with the real plots using the
values from the real plant.
4. Experiments with the ball and hoop
In this section are presented some results obtained
with the ball and hoop system, using the virtual and
remote laboratory developed. Due to the interactivity of
the laboratory, students can modify easily the set points
and the values of the variables in the experiment in order
to compare the different performances of the plant.
4.1. Zeros of transmission
The first experience is with the zeros transmission,
whose behaviour have been commented in Section 2.
When the application starts the initial state (Init) is
selected by default. In this experiment it must be selected
the Zeros radio button, and then the Play button to start
The initialization of the experiment is r = 0.0088 m, R
= 0.085 m, Amplitude = 0.5 and Frequency = 1.786 Hz.
With this frequency the ball position inside of the hoop
(y) is constant, so the displacement of the ball inside the
hoop is zero, due to the ball and the hoop oscillate at the
Figure 9 shows the results. The left figure shows the
evolution of the slosh angle deviation for both models
(dotted line for non linear and continued line for linear).
The right figure shows the displacement of the ball
inside the hoop which is the same for both models.
Another phenomenon associated with the zero
transmission and that the user can observe is the
resonance. For achieving the resonance peak, the
frequency must be decreased until the ball position and
the hoop angle oscillate at constant amplitude. In this
moment the resonance peak is taken place. The
frequency of the input signal can be modified using a
slider, and its numerical value it is shown in a panel.
Figure 9. Zeros of transmission
4.2. Angle control of the hoop
For this experience it must be selected the Hoop radio
button. In this case the simulation applies some steps to
the reference input of the system (the hoop angle
reference) and the associated graphics show the results.
The radius of the ball and the hoop are the same for
all experiences. For this experiment the reference in the
hoop angle begins at -30º. At t = 48 s this reference
changes to 60º and then at t = 59 s changes again to -50º.
The parameters of the controller are Kp = 2.18 and Ti =
4.35. Figure 10 shows the control of the hoop without
control on the ball until t = 59 s. From this time it is also
applied a control for the ball. The top graphic shows the
reference of the hoop angle and its evolution for both
models. It can be observed that when there is only
control on the hoop, the hoop angle is perfectly
controlled, but the ball is oscillating around its
equilibrium point. The bottom graphic shows the slosh
angle deviation of the ball for both models.
Figure 10. Control experiences with the system
4.3. Control of the slosh angle deviation
In the same condition as in the previous experiment,
this experience shows the behaviour of the system when
the slosh gain K changes its value. Until t = 59 s, K = 0,
and from this time K = 0.7. Figure 10 shows this
experience from t = 59 s. It can be observed that with
this strategy the ball and the hoop are well controlled.
4.4. Angle control of the ball
For this experience the user must select the Ball radio
button. For this experiment the reference is changing
from -30º to 30º as a pulse signal. Now, the parameters
of the controller are Kp = 6.18 and Ti = 3.35 and the
control gain K = 1. The obtained results are shown in
Figure 11. The top graphic shows the evolution of the
reference and the signal of the angle of the ball for the
two systems. And the bottom graphic represents the
control signal. It can be observed that when the hoop is
moving as a constant velocity the control of the ball is
Figure 11. Angle control of the ball
Today, virtual and remote laboratories are discussed
topics. They allow students to acquire methods, skills
and experience related to the real equipment in an
intuitive and cost-effective way.
This paper presents the development of a virtual and
remote laboratory with the Ball and Hoop system. It has
been proposed as part of an Automation Control course
to study the dynamic and control of the process. The
system to control is interesting because its dynamic is
very particular to study different control phenomena.
Experimentation on the developed laboratory provides a
fundamental educational feature: students can observe
on-the-fly the resulting dynamics and be aware of some
physical phenomena that are tricky to explain from just a
theoretical point of view. The main features of the
laboratory are, in contrast with others, its portability, its
realistic graphical interface and large amount of options
which allow students to learn control concepts from
home easily. Authors have used Easy Java Simulations
to develop the software, a Java-based tool intended to
create interactive simulations [12, 13].
However there is some further technical work to be
done regarding the creation of remote labs. The
capabilities of Ejs have still to be improved to ease the
programming of the connections with the server-side
more intuitively, specially, if Labview is chosen as
software tool to create the server-side.
This virtual and remote laboratory is only a piece of a
battery of virtual labs developed in our Department that
offers a complete range of experiences to the students.
 D. Gillet, G. Fakas, Y. Rekik, K. Zeramdini, F. Geoffroy,
S. Ursulet. “The Cockpit: An Effective Metaphor for
Remote Experimentation in Engineering Education”,
International Journal of Engineering Education, Vol.19
(3), pp. 389-397, 2003.
R. Dormido, H. Vargas, N. Duro, J. Sánchez, S.
Dormido-Canto, G. Farías, F. Esquembre, S. Dormido,
“Development of a web-based control laboratory for
automation technicians: The three-tank system”, IEEE
Trans on Education, Vol.51, pp. 35-44, 2008.
S. Dormido, H. Vargas, J. Sánchez, R. Dormido, N.
Duro, S. Dormido-Canto, F. Morilla, “Developing and
Implementing Virtual and Remote Labs for Control
Education: The UNED pilot experience.” 17th IFAC
World Congress. pp. 8159-8164, Seoul (Korea), 2008.
 S. Dormido, S. Dormido-Canto, R. Dormido, J. Sánchez,
N. Duro, “The Role of Interactivity in Control Learning”,
International Journal of Engineering Education, Vol. 21,
(6), pp. 1122-1133, 2005.
 N. Duro, R. Dormido, H. Vargas, S. Dormido-Canto, J.
Sanchez, G. Farias, F. Esquembre, S. Dormido, “An
Integrated Virtual and Remote Control Lab: The Three-
Tank System as a Case Study”, Computing in Science
and Engineering Magazine, Vol. 10 (4), pp.50-58, 2008.
 Vargas, H., Sánchez, J., Duro, N., Dormido, R., Dormido-
Canto, S., Farias, G., Dormido, S., Esquembre, F.,
Salzmann, Ch., Gillet, D., “A systematic Two-layer
Approach to Develop Web-Based Experimentation
Environments for Control Engineering Education”,
Intelligent Automation & Soft Computing Vol. 14 (4), pp.
P. E. Wellstead, “The Ball and Hoop System”,
Automatica, Vol.19, No 4, pp. 401-406, 1983.
F. Esquembre, “Easy Java Simulations: A software tool
to create scientific simulations in Java”, Comp. Phys.
Comm. 156 (2), pp 199-204, 2004.
TecQuipment Ltd. http//www.tecquipment.com.
 S. Skogestad, I. Postlethwaite Multivariable Feedback
Control: Analysis and Design. Wiley, 2005.
 J. Sánchez, S. Dormido, F. Morilla, R. Pastor. “A
Java/Matlab-Based Environment for Remote Control
System Laboratories: Illustrated With an Inverted
Pendulum”, IEEE Transactions on Education, 47 (3), pp.
 S. Dormido, F. Esquembre. “The Quadruple-Tank
Process: An Interactive Tool for Control Education”,
European Control Conference ECC’03, Cambridge
 R. Pastor, J. Sánchez, S. Dormido. “Web-based virtual
lab and remote experimentation using Easy Java
Simulations”, 16th IFAC World Congress, Prague Czech