Professional Documents
Culture Documents
PLATE SYSTEM
EENG291_Final Year Project I
Phoenicia University_ PU
Department of Electrical and Communication Engineering
Spring 2018_2019
Acknowledgment
We would like to express our gratitude for everyone who helped in achieving this final year
project.
We are appreciated for Dr. Mirvat Madi, our supervisor, for following with us the work
progress and for the motivation, positive vibes and the extensive support that she was
We are grateful for Dr. Salem Salem, the head of Electrical and Communication
department, for his enthusiastic guidance and his precious support throughout the work
progress also for his advice for choosing this topic for our project.
|Page1
Abstract
Controlling an open-loop unstable system presents many inimitable and remarkable
system specified by two-dimensional extension of the ball and beam problem. One of the
challenges of this system is the indirect control of the ball using the positions on the plate.
This paper covers the physical system behind the controller design (PID), modeling, and
conception.
|Page2
Table of Contents
Chapter 1 : Introduction and Background .................................................................................. 6
A. Literature Review ....................................................................... 7
B. Challenges .............................................................................................. 11
Chapter 2 : Design Technical Requirement ............................................................................... 11
A. Idea of Design .................................................................................... 11
B. Software and Equipment .............................................. 12
a. Resistive touch screen ................................................. 12
b. Servomotors ................................................................................ 13
c. Arduino Uno............................................................................... 14
d. Plates ....................................................................................................... 15
e. Joints ....................................................................................................... 15
f. Software ............................................................................................. 15
C. Alternative Approaches .................................................. 15
a. Ball Position Detection Mechanism ..... 15
b. Actuation Mechanism: ............................................... 16
c. Control Mechanism........................................................ 16
Chapter 3 : Design Analysis......................................................................................................... 17
Types of Systems ....................................................................................................................... 17
a. Linear control system ................................................. 17
b. Nonlinear Control System................................... 17
c. Open Loop Systems ........................................................ 18
d. Closed Loop Control System .......................... 19
Proportional, Integral, and Derivative controller (PID) ....................................................... 19
a. Effect of
proportional, integral, and derivative components 21
b. Tuning of PID Controller .................................... 22
B. Model Development ............................................................... 23
a. Equation of Motion......................................................... 24
C. Control Development .......................................................... 28
a. Determining Transfer
Function of the System: 28
b. Desired Control Parameters: ......................... 29
c. Ball and beam cascade control design
30
d. PID design ...................................................................................... 32
D. Resistive Touch Screen
Subsystem Development 35
|Page3
a. Excitation and measurement method
38
b. Connections with MATLAB ........................... 39
c. Requirements for a touch screen
controller 41
E. Servomotor ........................................................................................... 43
a. Definition ......................................................................................... 43
b. Features .............................................................................................. 44
c. Types of Servomotor ................................................. 45
Chapter 4 : Economical and Safety Issues ................................................................................. 49
A. Estimation of the Cost of the Project ....... 49
B. Safety of the Design................................................................. 49
Chapter 5 : Project Management ................................................................................................ 50
A. Work done in First Semester ................................... 50
B. Work to be done in Second Semester....... 50
Chapter 6 : Conclusion and Future Work ................................................................................. 51
References ..................................................................................................................................... 52
List of Tables
Table 1: Specification of Resistive Touch Screen .......................................................................... 13
Table 2: Effect of Increasing gain coefficients on system parametes ............................................ 22
Table 3: PID Gain Parameters ........................................................................................................ 34
Table 4: 5-wire touch screens scanning.......................................................................................... 37
|Page4
List of Figures
Figure 1: Ball on Balancing Beam’ Built by Berkeley Robotics Laboratory (Arroyo 2005).......... 8
Figure 2: Ball and Beam Balancer’ Built by University of Lakehead .............................................. 9
Figure 3: Ball and Beam Module Presented by ‘Quanser’ (Quanser 2006) ..................................... 9
Figure 4: Ball on Beam System (Hirsch 1999)............................................................................... 10
Figure 5: A Robotic Ball Balancing Beam (Lieberman 2004) ....................................................... 10
Figure 6: Resistive Touch Screen ................................................................................................... 12
Figure 7: Servomotor to be used .................................................................................................... 13
Figure 8: Motor's specifications ..................................................................................................... 14
Figure 9: Arduino Uno ................................................................................................................... 15
Figure 10: Block Diagram of PID Controller ................................................................................. 20
Figure 11: Block Diagram of the open loop system ....................................................................... 23
Figure 12: Block Diagram representing one axis of system ........................................................... 24
Figure 13: Free Body Diagram of Ball on Beam............................................................................ 25
Figure 14: Complete Free Body Diagram ...................................................................................... 26
Figure 15: Cascade Control Design ................................................................................................ 30
Figure 16: Block Diagram of the Inner Loop ................................................................................. 31
Figure 17 Block Diagram Representing the Outer Loop ................................................................ 32
Figure 18: 5-wire pins .................................................................................................................... 37
Figure 19: Electrodes in 5- wire touch screens............................................................................... 38
Figure 20: The layout of the voltage ranges with the corresponding digital values ....................... 39
Figure 21: Design suggestion for 5-wire touch screens ................................................................. 43
Figure 22: Servomotor Wires and their Connections ..................................................................... 44
Figure 23: Types of Servomotors ................................................................................................... 45
Figure 24: Two Phase of two phase squirrel cage AC servomotor ................................................ 45
Figure 25: Torque and speed characteristics .................................................................................. 46
Figure 26: Separately excited DC motor ........................................................................................ 46
Figure 27: Armature MMF and excitation field MMf .................................................................... 47
|Page5
Chapter 1 : Introduction and Background
The aim of this project is to develop a ball-on-plate balancing system. This type of projects
can be found in many universities due to their importance in teaching the basics of control
system. It plays a major role in solving problems such as horizontally stabilizing an airplane
The ball and plate system is one of the popular models developed by control engineers in
order to understand different control strategies and concepts. This system is of particular
interest to the control community because it allows the user to study and validate a wide
class of both linear and nonlinear control schemes before applying them to real-life
applications that reveal similar dynamics. Balancing ships or the Ping-Pong table in water
The horizontal plate will be titled along two horizontal axis (x, y) in order to control the
position of the ball. Each of the two axis will be operated and controlled using:
The position of the ball on the plate will be detected through a Resistive Touch Screen. At
first, a decision about using a camera and image processing was taken because we thought
that resistive touch screen is not available at affordable cost but after some researches, we
found that the price is reasonable so we decided to use resistive touch screen for simplicity
The main objective of this project is to maintain a static ball position on the plate besides
rejecting position disturbances. It’s all about moving to specified positions on the system:
2. A trajectory is plotted.
|Page6
The control signal can be derived by feeding back the position information of the ball. One
of its challenges is that the open loop system in unstable. This can be solved by closing the
The characterizing of the specs in this system is difficult, especially because the motion of
- The controller
The sensor subsystem consists of the circuitry and software that generate coordinates from
The physical system refers to the design and machining of parts needed to construct the
large yoke and axle (x and y plane), as well as the new motor bracket, that bears the weight
Note: the sensor and physical system will be implemented in FYP 2 through fall semester.
The control system consists of modeling, simulation of the system as a whole, and the
design of the controllers: one for the ball position and another for the plate angles.
A. Literature Review
A ball-and-beam system is one of the challenging control systems integrated into many
practices and techniques. This project concept initially was resolved from the ball-and beam
concept and then it was extended into the ball-and-plate balancing system. This control
University.
|Page7
This project has been implemented by many organizations and electrical engineers around
the world.
In this section a brief background of the ball and beam projects will be covered.
In 2005, Arroyo designed a system called “Ball on Balancing Beam in 2005.” It consists of
resistive wire sensor to measure the position of the ball. This sensor acts like a wiper that
is similar to a potentiometer resulting in the position of the ball [1]. Check figure (1).
Figure 1: Ball on Balancing Beam’ Built by Berkeley Robotics Laboratory (Arroyo 2005)
In 2006 Quanser worked on processing the signal from the sensor in a DSP. Besides that,
a DC motor with reduced gear was used. PD controller was used to control the system. This
controller was easy to design, also the overall project was easy to implement. The
disadvantage of this project: the beam was made of acrylic glass that is too hard for a
sudden impact. In addition, the tilting angle of the beam was not measured and was not
takin into consideration in the calculations. Hence the system was not very strong [2].
system named “Ball and Beam Balancer” (Ambalavanar, Moinuddin & Malyshev 2006). It
includes a DC motor with an integrated gearbox, a resistive wire position sensor, and a
digital encoder. It was controlled by Linear Quadratic Regulator "LQR" controller. It also
|Page8
consists of one input (the voltage input of the motor), and two outputs (first the position of
the ball and the second for the tilt angle of the beam). Due to the excellent state space in
the LQR controller that is good at controlling MIMO (multiple input, multiple output), the
system is very robust. Besides that the beam was heavy because it was made of aluminum.
In the same year, Quanser presents a product called “ball and beam module”, it contains of
a position sensor made by a resistive wires and DC servo motor with reducing gearbox. It
was controlled by a PID controller. The configurations were more complicated than “Ball
and Beam Balancer” due to the leverage effect coming from the relative small motor [2].
In 1999, Hirsch constructed his “Ball on Beam System.” It employed an ultrasonic sensor
to measure the position of the ball. However, the angle of the beam was measured using
|Page9
potentiometer. Also, where was a motor with a gearbox w/ a high power op-amp circuits.
It was controlled using PD controller. The system was easy to design because of the
simplicity in the mechanical configuration. However, one of its disadvantages is that the
shaft (that supports the weight beam) was too long for the motor bearing leading to a large
In 2004, Rosales built the ball and beam system very similar to the “Ball and Beam
Balancer.” But it was made of acrylic not aluminum. In the same year Lieberman
constructed a system called “A robotic ball balancing beam.” It was similar to (Hirsch
1999) project but the main difference was that Lieberman system used resistive wire
| P a g e 10
B. Challenges
Several challenges in the design and construction of this system can be predicted. First of
all, a method for keeping the ball on the plate rolling when in motion rather than sliding is
necessary.
Secondly, the challenge of balancing is a problem under continuous study for applications
Therefore, the system can present many challenges and opportunities as an educational tool
Having a high speed motor and making a system with a small delay since it should respond
directly. Basically, having a system with fast response and increasing the accuracy of the
Finally, the basic challenges that will be addressed by our design are the method used to
find the ball position in real time, the mechanisms to tilt the plate accordingly and the design
of the control itself that will be used between sensors and actuators.
A. Idea of Design
The main idea of the design will be illustrated briefly in this section. A reference signal is
given to the system this is the position coordinate that we want the ball to be on. Then the
position of the ball will be measured by a resistive touch screen. The position of the ball is
subtracted from the reference and this is the "error". This error is sent to the PID controller
that is a commonly used controller in industry, and the PID will give the output for the
servo motor this output is the angle of the plate. Then the servo motor will change its angle
| P a g e 11
to return the ball back to its initial position and this process will repeat from step 1. All this
In this section, equipment that will be used in this project with their specifications are listed.
Four wires are connected to the electrodes, these are referred to UL (Upper Left), UR
(Upper Right), LL (Lower Left), and LR (Lower Right). The fifth wire is used for sensing
the electrode voltage and referred to (Sense) wire, it is embedded in the top sheet.
This screen is coated with a thin metallic electrically conductive and resistive layer that
causes a change in the electrical current which is registered as a touch event and sent to the
The specifications of the 19 inches resistive touch screen that will be used are:
| P a g e 12
Table 1: Specification of Resistive Touch Screen
Length 323 mm
Width 396 mm
Thickness 2.3 mm
b. Servomotors
Our project includes two DSS-M15 servomotors which are positional rotation. (Figure 7)
| P a g e 13
Figure 8: Motor's specifications
c. Arduino Uno
Our project includes one Arduino board which is a microcontroller board. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
quartz crystal, a USB connection, power jack, an ICSP header and a reset button. Arduino
controls the system by receiving ball location’s data from the screen and control the
| P a g e 14
Figure 9: Arduino Uno
d. Plates
The system has two plates, the lower and the higher. The lower one holds the servomotors
e. Joints
The system has three joints, one is universal, and it is fixed from lower plate to the higher.
The other two joints are connected between the servomotors and the higher plate.
f. Software
Matlab/ Simulink in combination with Arduino will be used for controlling the system
C. Alternative Approaches
In this section a summary of the alternative approaches that were encountered before other
In order to detect the location of the ball these approaches may be taken:
- An overhead digital Camera with processing software, and then calculating the
position by image processing techniques. But this is expensive and require special
software.
| P a g e 15
- Two Cameras on top of the plate, and then calculate the position by image
processing techniques.
- Grid of infrared sensors, this is not expensive but there is limited resolution and
- Photo-transistor sensors
b. Actuation Mechanism:
- Linear actuators.
c. Control Mechanism
controller.
- Fuzzy Logic
- Robust control
| P a g e 16
Chapter 3 : Design Analysis
In this chapter, a design for controlling the balancing ball system is done. First a
mathematical model of the system will be derived, then the design of the controller will
be set according to specified limitation that are appropriate for the system.
A deep analysis of two important components: servo motors and resistive touch screen
But before starting, a brief discussion about the types of systems and the effect of the PID
Types of Systems
A linear control system is the system that follows the principle of superposition. This
principle states that the system should include two properties: homogeneity and
additivity. The first property mention that if we multiply the input with a certain constant
then the output is also multiplied by this constant. The second property mention that if the
output of the system to input a1 is b1 and that for a2 is b2 , additivity means when you add
the two inputs the output should be the sum of the two outputs. So the response for
several inputs in linear system is treated by dealing with each input separately and then
adding them.
In real life not every system is linear. Nonlinear systems are systems where the principle
of superposition cannot be applied. So the inputs cannot be treated each one separately
and then adding the outputs of each. In practice, most of the systems are nonlinear even
though they are represented by linear equations. In fact, most systems are linear only in
specific operating ranges. For example, dampers in physical systems are linear at low
| P a g e 17
velocities but they may become nonlinear as velocity increase and the damping force
The normal operation of a system is around the equilibrium point because the signal at
this point are considered small. So if the system is operating around equilibrium point
with a small signal, then we can approximate the nonlinear system by a linear one and
this is called linearization of nonlinear system. The new model that involves a linearized
The nonlinear function can be expanded into Taylor series about the operating point and
this in turn will linearize the function. The higher order terms of Taylor series will be
In these systems the output has no effect on the input or on the control action. So the
output is not measured and it is not fed back in order to be compared with the input. For
example the washing machine that operates on time basis and don’t measure the output
which is how clean the clothes are. In general, any system operating on time basis is open
loop system.
The accuracy of the open loop control system depends on calibration since the input is not
compared with the reference input. Because the open loop control system is not able to
perform the desired task in the presence of disturbance so in practical life it is used only if
there is no internal or external disturbances. Also, it used in case the relationship between
| P a g e 18
Open loop control system is easy to build because stability is not a main problem. So for
systems with known inputs and with no disturbance it is advisable to use open loop
system.
Closed loop systems are considered to be feedback control systems and in practice these
two terms are used interchangeably. The difference between input signal and the feedback
signal which is the output signal and its derivatives and integrals is called actuating error.
This actuating error is fed back to the controller in order to reduce the error and to bring
the output of the system to the desired value. Hence the closed loop system, is the system
One advantage of using closed loop control system is that the system is not sensitive to
external or internal disturbance due to the use of feedback. So this allow us to use
But stability in closed loop control system is a major problem because it might allow the
The closed loop system is advisable when the system have unpredictable disturbances or
The number of components used in closed loop is high so it costs more and it consumes
more power and in order to decrease the power of the system it is more applicable to use
Nowadays, half of the industrial controllers used are PID or modified PID controllers.
PID calculates the difference between the measured value and the desired one and this is
| P a g e 19
called "error value" or e(t). PID attempts to minimize this error and to do a correction
Each of the terms P, I, and D has its own purpose and sometimes one can be removed
because it is not needed in the design. So in total we may have: P, PI, PD and PID
controllers.
The block diagram of PID controller is shown in figure (10). As shown in the block
diagram, the PID controller is calculating the error e(t) that is the difference between the
desired value r(t) and the measured one y(t). The controller minimize the error by
adjusting the control variable u(t) which is the summation of the integral, proportional,
𝑑𝑒(𝑡)
𝑢(𝑡) = 𝐾𝑝 ∗ 𝑒(𝑡) + 𝐾𝑖 𝑒(𝑡 )𝑑𝑡 + 𝑘𝑑
𝑑𝑡
Where Kp, Ki, and Kd are the coefficients for the proportional, integral, and derivative
terms respectively.
| P a g e 20
a. Effect of proportional, integral, and derivative components
The term proportional means that the output is proportional to the current error value. The
relationship between the controller output u(t) and the error signal e(t) is :
𝑢(𝑡) = 𝐾𝑝 ∗ 𝑒(𝑡)
the actual mechanism or the operating power of the system. If Kp is too high then the system
may become unstable. Also small Kp is not advantageous because it will result in small
output for a high input and hence a less responsive controller and the control action might
be too small when responding to disturbance. Increasing kp causes the system to react
quickly but the overshoot will increase. It will also reduce the error but it will not eliminate
it.
Whenever an integral action is added to the system then the output, the controller output
u(t) is changed proportionally to the error signal e(t). That is the relation between them is:
The integral action lead to a faster system with eliminating the steady state error that occurs
when having proportional controller. However, the integral action increase the overshoot
of the system.
| P a g e 21
iii. Derivative Control Action
Derivative of error is calculated by determining the slope of the error and multiplying this
𝑑𝑒(𝑡)
𝑢(𝑡) = 𝑘𝑑
𝑑𝑡
The derivate term predicts the behavior of the system in the future, so it improves the
settling time and the stability of the system and the overshoot decrease. But it has no effect
on the error.
Hence each control action has its own advantages and drawbacks. Combining the three
control actions can allow us to have a better control over the system but the decision is
taken according to the specifications and requirements of the system. When designing the
designer should take care when choosing the controller coefficients. Table (2), will
summarize the effect of increasing each of the coefficients kp, ki, and kd independently on
Tuning of controller means adjusting the control parameters (proportional, integral, and
derivative gain) in order to get the most appropriate values that will lead for the best
response of the system. Usually having a stable system is one of the most important and
| P a g e 22
basic requirements that we aim for but it is a matter of fact that different systems have
B. Model Development
In order to construct the PID controller of the system, first the transfer function of the
system will be established. Then a design for proportional velocity PV that is responsible
Also a PID design will be formed, this design is responsible for controlling the position of
ball on plate.
Both the PV and the PID controller are responsible for controlling the whole system.
To begin with, the block diagram that represents the open loop system of the ball balancing
Servo y_axis
Vm,y(s) θ1,y(s) Pbb(s) X(s)
(s)Ps
Where Ps(s) is the dynamic between servo input motor voltage and resulting load angle and
Pbb(s) is the dynamic between angle of servo load gear and position of ball.
| P a g e 23
It is important to mention that x_axis actuator does not affect y_axis, but the dynamic of
The block diagram that represent one axis of the system is shown in figure (12) and it is
noted as 1DBB:
Servo Plant
Vm(s) θ1(s) Pbb(s) X(s)
Ps (s)
Where 1DBB transfer function, Pbb(s) and servo transfer function Ps(s) are:
( )
𝑃 (𝑠 ) = ( )
[2]
( )
𝑃 (𝑠 ) = ( )
[3]
𝑃 (𝑠 ) = ( )
[4]
a. Equation of Motion
Equation that describes motion of ball (x) with respect to angle of beam (α) is represented
as:
| P a g e 24
Figure (13) presents the free body diagram of ball on beam. Applying Newton's law of
motion:
∑𝑓 = 𝑚 𝑥(𝑡) [6]
Where mb is the ball mass. Neglecting friction the equation ends up as:
Where fx,t is the translational force caused by gravity and fx,r is the force generated from
ball's inertia.
For the ball to be in equilibrium, i.e. stationary at certain moment, force from ball
Consider the free body diagram shown in figure (14) with forces on ball presented on it.
| P a g e 25
mb g sin( α )
To convert between linear and angular displacement, sector formula is used and it states:
𝑥 (𝑡 ) = 𝛾 (𝑡) 𝑟 [9]
𝐹, = [10]
𝜏 = 𝐽 𝛾 (𝑡 ) [11]
( )
Using EQ [9], 𝛾 (𝑡) =
| P a g e 26
( )
𝐹, = 𝐽 [12]
( )
𝑚 𝑥(𝑡) = 𝑚 𝑔 sin 𝛼(𝑡) − 𝐽 [13]
( )
𝑥(𝑡) = [14]
It is important to mention that this obtained equation is not linear due to the presence of
trigonometric terms in it and we shall linearize it. This will be done using the below steps:
1. Obtain a relation between servo load gear angle θ1 and beam angle α.
Consider that servo angle change the height of beam by h given the length of plate (L)
sin(𝛼(𝑡)) = [15]
( ( ))
sin 𝛼(𝑡) = [17]
2. Linearize the equation of motion that represent ball's motion with respect to servo
angle θ1 at θ1=0.
( ( ))
𝑥 (𝑡 ) = [18]
( )
| P a g e 27
At angle zero , sin(θ1(t))= θ1(t)
( )
𝑥 (𝑡 ) = [19]
( )
Parameter Kbb is the model gain and it is the coefficient of θ1. Hence Kbb is:
𝐾 = [20]
( )
𝐽= [21]
The numerical value of Kbb can be obtained whenever the mass of ball is known.
Hence the final linear equation of motion of 1D balancing ball system is:
C. Control Development
The transfer function that describes servo voltage to ball position displacement (for single
Assuming initial conditions are zero, then the Laplace Transform of the linear equation of
motion is:
( )
𝑋(𝑠) = [24]
| P a g e 28
The transfer function Pbb(s) of 1D using EQ (2) is:
𝑃 (𝑠 ) = [25]
The complete transfer function that includes both servo and 1D is:
( )
𝑋(𝑠) = [27]
( )
1. Time domain specifications for controlling position of servo load shaft are:
ess = 0 [28]
These are the transient response when tracking the load shaft with a step
reference.
2. Time domain specification for controlling the position of the ball for both x and y
axis are:
So it is desired that the ball should not overshoot more than 7.5 % after 2.5 sec and it must
settle within 4% of its s.s value. And the s.s should be within 1mm of desired location.
| P a g e 29
It is important to note that the formulas for calculating % overshoot, peak time, and settling
𝑡 = [35]
𝑜𝑣𝑒𝑟𝑠ℎ𝑜𝑜𝑡 = 𝑒 [36]
( )
𝑡 = [37]
Where ζ is the damping ratio of the system and ωn is the natural frequency.
The block diagram of the system is shown in figure (15). This block diagram consists of
two loops: inner and outer loop. The inner loop is responsible for controlling the servo
motor. So the servo compensator Cs(s) calculates motor's voltage, Vm(s) required for the
load angle to track the given desired load angle. The outer loop is responsible for controlling
the plate angle according to the desired ball location. So the needed servo load angle, θd is
computed by the ball balancer compensator, Cbb(s) based on the ball position, X(s) in order
| P a g e 30
i. Inner Loop Design (position control of PV)
PV controller gain are computed for servo when it is in high gear configuration and based
The block diagram that describes the inner loop is shown in figure (16).
The steady state gain K and time constant τ should be computed at high gear configuration.
These are to be calculated based on the device parameters. That’s why this part will be
postponed until next semester so that all calculations will be done according to the approved
servo motor that will be used. Kp and Kv are also dependent on the value of K.
Damping ratio and natural frequency of the inner loop should also be computed.
The damping ratio is calculated from the desired % of overshoot that is PO < 5%
( )
Where 𝑎 =
𝜁 = 0.69 [38]
Similarly the natural frequency is calculated from the peak time, and after some
𝜋
𝜔 =
𝑡 1−𝜁
| P a g e 31
ii. Outer loop control design
In this section, it is assumed that the desired load angle is equal to the actual load angle,
i.e.
This assumption is due to the fact that the dynamics of servo dynamics can be considered
negligible after computing the position of servo load shaft from the inner loop.
The block diagram showing the outer loop is shown in figure (17), a PID will be designed
in order to control this loop will control and thereafter the position of the ball along the x-
1D Compensator 1D Plant
Xd(s) E(s) Cbb(s) Θd(s) Θ1(s) X(S)
+ Gs(s) Pbb(s)
-
d. PID design
The equation representing the PID compensator that will be used is:
Where kp,bb, kd,bb, and ki,bb are the proportional gain, derivative gain, and integral gain
respectively.
Now, taking the Laplace of EQ (41) and doing some manipulation the closed loop equation
will be obtained.
| P a g e 32
𝜃 (𝑠 ) = 𝑘 + 𝑋 (𝑠 ) − 𝑋 (𝑠 ) + 𝑘 𝑠 𝑋 (𝑠) − 𝑋(𝑠) [42]
Since as mentioned before, there is no servo dynamics then the actual angle is equal to the
𝜃 (𝑠 ) = 𝑘 + 𝑋 (𝑠 ) − 𝑋 (𝑠 ) + 𝑘 𝑠 𝑋 (𝑠) − 𝑋(𝑠)
The closed loop equation can be found by substituting the equation of θ1 in equation (24),
( )
( )
= [43]
This is a third order equation and it can be simplified into second order system and
1st order system in order to do the transient response analysis. To do so, first
(𝑠 + 2 𝜁 𝜔 𝑠 + 𝜔 )(𝑠 + 𝑃 ) [44]
Where P0 is the pole location. ζ, ωn, and P0 determine the response of the 3rd order system
and they are calculated in order to satisfy the time domain specification stated.
Expanding the 3rd order characteristic equation results in the following equation:
i.e.
𝑠 +𝑘 𝑘 𝑠+𝑘 +𝑘 𝑠 [46]
| P a g e 33
Table 3: PID Gain Parameters
S0 𝑘 𝑘 = 𝜔 𝑃
S1 𝑘 𝑘 = 2𝜁𝜔 𝑃 +𝜔
S2 𝑘 𝑘 = 𝑃 + 2𝜁𝜔
𝑘 = [47]
𝑘 = [48]
𝑘 = [49]
Using time domain specifications to calculate the natural frequency and damping ratio of
𝑎
𝜁=
1+𝑎
( )
Where 𝑎 = and PO is 7.5%
( )
And 𝜔 = with ts = 2.5 and cts = 0.04.
𝜁 = 0.636 [50]
Substituting these values in equations (47), (48), and (49), gives the control gain
parameters. With stating that P0 is specified according to the pole decay time constant, Tp.
Note: because we decided to leave the calculation of Kbb until we get the ball that we will
| P a g e 34
For Tp = 1 sec (P0= 1), PID gain parameters are as below:
.
𝑘 = [52]
.
𝑘 = [53]
.
𝑘 = [54]
To sum up, the linearized equation of motion was determined using newton's law. Since
the position of the ball in x direction is independent of that in y direction then similar but
independent controllers can be used for controlling the coordinates of ball on plate in both
directions. So in this section a design of one controller was discussed and the second is the
same.
The controller is designed with the concept of loop within a loop. The design of the inner
loop is achieved where a feedback is sent to the servo motor to achieve a servo position
control. This loop should have a very high response speed and the design of the controller
should take this into consideration. This inner loop is then placed in an outer loop that
controls the position of the ball on the plate by determining the transfer function that relates
Therefore, the controller receives the ball position from the resistive touch screen, while
the outer loop is computing the angle by which the plate should be tilted to return the ball
to its position the inner loop is giving the order to the servo motor to actually move the
Ball position feedback is accomplished using an analog resistive touch screen element.
Those types of screen are mainly used in public information kiosks (a small open-fronted
| P a g e 35
hut from which newspaper and tickets are sold) and cashier stations. It allows the user to
Based on the feedback of the system, the touch screen will read the application of pressure
by a steel ball and track it as it moves within the active portion of the screen.
1. Two layers of material are coated with Indiumtin oxide (ITO) to give them a known
resistance, something between 100 and 500 /sq. depending on the manufacturer and
the application.
2. The two layers are replaced 90_ offset from each other on top of a glass or
layers.
3. Silver bus bars are placed at the edges to allow the application of voltage across the
layers [7].
To generate a touch position, the force of the ball must exceed the activation force of the
screen, pressing the two layers together. This creates an electrical connection between the
two layers. However, both X and Y axes cannot be read simultaneously, because the
concept works by applying a voltage across one layer, and looking for the voltage that
appears on the other layer. Therefore, the system works by alternately applying a voltage
to one layer and reading of the other. After that the voltages can be read using analog-to-
There are several types of analog resistive touch screens that differ in the number of wires
between the screen and the screen controller. Some of them are 4-wires, 5-wires, and 8-
wires.
To start by the specifications of 4-wires screens: they operate by applying voltage across
the two wires for one layer, and reading the voltage from the ground wire of the other layer.
| P a g e 36
The 5-wire screens use the bottom layer for both axes measurements, applying voltage
across the top layer only. This simplifies measurement and voltage application duties over
The 8-wire screen is an extension of the 4-wire screen, using the additional 2-wires per
layer to provide a stable voltage gradient. The number of wires effect on the stability while
testing.
In this project we are going to use 5-wire analog resistive touch screen based on our
It consists of a conductive glass bottom layer and conductive top film layer. In the 5-wire
construction, all the electrodes are on the bottom layer and the top layer acts as a voltage-
measuring probe. When the screen is touched, it pushes the ITO film to have an electrical
contact with ITO glass (both on the ITO coating side). It then produces a voltage which is
the analog representation of the position touched. With this structure, the touch screen may
still work properly even when the top layer is slightly scratched or damaged. The result is
an accurate, durable and reliable touch screen that offers a higher touch life. [7]
| P a g e 37
A 5-wire touch screen only uses the top sheet for measuring. Referring to figure (18) and
table (4) that shows the connections while measuring the coordinates on 5-wire touch
screens. 5-wires connect to the electrodes these are referred to as UL (Upper Left), UR
(Upper Right), LL (Lower Left), and LR (Lower Right). The fifth wire is used for sensing
the electrode voltage and is referred to as the “sense” wire. The sense wire is embedded in
5-wire touch screens have circular electrodes (see Figure 19). Since all of them reside in
the substrate ITO there is a need for linearization pattern (conductive) to make an applied
To get a complete set of coordinates, the voltage gradient is applied on the substrate layer
once in horizontal direction to determine the Y coordinate and once in vertical direction to
determine the X coordinate. In both cases the top sheet layer is used to do a high-impedance
The method for measuring the pressure point is based upon a preferably homogenous
resistive surface (ITO). When applying a voltage to the electrode pair in the resistive
surface a uniform voltage gradient appears across the surface. A second ITO layer is
| P a g e 38
be seen as an electrical switch requiring a small amount of pressure (0.1 – 1.5 Newton) to
close.
1024x1024 positions on the surface of the touch screen. This, however, is limited to a subset
of the full range, (100-900)x(100-900) positions, due to losses in drive voltage from the
various transmission lines leading to the screen itself. The layout of the voltage ranges with
Figure 20: The layout of the voltage ranges with the corresponding digital values
The SC3 controller takes these X-Y coordinate pairs it produces and converts them into
sets of three 8-bit packets which can be converted into coordinate pairs.
These packets can be sent asynchronously and without prompting: as soon as the touch
screen receives sufficient pressure for the controller to register a touch, the system begins
to send data. A serial interface needs to be created in MATLAB Simulink that can be
| P a g e 39
compiled for the xPC Target system in order to process this data, and get the resultant
coordinate information into the real-time computer. Normally, Simulink is unable to utilize
binary numbers; however, the Communications Toolbox allows conversion to and from
binary [7].
This makes possible the individual bit manipulation necessary to move the 8-bit packets
from the controller into the 10-bit binary words that the controller’s A/D converter creates.
After assembling the Simulink system and using the steel ball to generate coordinate paths,
it becomes obvious that while the touch screen does generate a great many points, it
generates a number of coordinates in the same area due to settling time settings in the
controller.
The easiest alternative was to pass the generated coordinates is through a low-pass filter.
The rapid changes in the output coordinates are equivalent to a step command, so in order
to smooth it; we added first order low pass filter, with a cutoff at 50 radian/second.
Moreover, with the coordinates been smoothed, the remaining work is to scale and map of
coordinates. First of all, the coordinates generated by the touch screen are based on a
reference point of (0,0) in the top left corner, as seen in Figure3. The controller, however,
assumes (0,0) to be the center of touch screen, which is really coordinate point (512,512).
So, to map the coordinates to this new space, each generated coordinate is reduced by 512
to find the new coordinate. The controller is also expecting displacements from the center
(0,0) point in meters. To scale the coordinates to meters, the known resolution and size of
the touch screen is utilized to find the meters per digital level generated by the touch screen
controller as below:
| P a g e 40
= 1.860 (𝑌) [56]
Finally, due to the calculation done by the controller, the error is calculated and the new
position will be sent to the controller of the servomotor to calculate the angle that the touch
i. ADC
An (A/D) converter with a resolution of 10 bits and the absolute inaccuracy far under the
linearity error of the touch screen is required for the conversion of the analog values into
digital values.
The conversion time of the ADC must be applied when the minimum detection time for
applying pressure on the screen is considered and the coordinates are changed. Also, the
CPU must be able to process the ADC readings with sufficient computational accuracy to
The pins driving the touch screen must be able to sink and source in the range of 525mA
(depending on the value of the ITO resistance and the voltage used).
A 5-wire touch screen controller just needs one analog input line – to measure the sense
line.
iii. Timer
A timer is used as a scheduler for different purposes, since the proposed method is interrupt
driven; there is no need for additional delays. And it also can be used to trigger the ADC
and set the I/O pins in the correct order immediately before a measurement starts, create a
| P a g e 41
timeout function; which sets the controller in sleep mode when there are no activities to be
As touch screens are often used in portable applications, the power consumption of the
To reduce the power consumption, the touch screen controller must enter a low power
consumption when there is no activity is detected on the touch screen. This operation called
implemented using a pin change interrupt combined with an internal pull-up. In this case
the touch screen will be allowed to enter low power mode while waiting for any activity on
the screen, and to wake up when the pin is change is been trigged.
Figure 4 shows how to connect the ATmega88 to respectively a 5-wire touch screen. In
order to drive a 5-wire touch screen one have to connect the sense line to an ADC channel
input of the AVR. The remaining lines should be connected to any I/Os. As voltage
reference it is recommended to use AVCC with an external capacitor on the AREF pin. To
minimize noise signals it is common to add capacitors from the touch screen drivers to
ground forming a low-pass filter (typical value 0.01µF), but it might will increase the time
| P a g e 42
Figure 21: Design suggestion for 5-wire touch screens
E. Servomotor
In this section, a discussion about the servo motors and their specifications and importance
will be covered. Servomotors find wide applications in radar, tracking and guidance
a. Definition
Servomotors are rotary actuators or motors that allow for a precise control in terms of
1. Power wire: is typically red, it should be connected to the 5V pin on the Arduino or
Genuino board.
2. Ground wire: is typically black or brown, it should be connected to a ground pin on the
board.
3. Signal wire: is typically yellow, orange or white, it should be connected to a PWM pin
on the board.
| P a g e 43
Figure 22: Servomotor Wires and their Connections
b. Features
Servomotors:
- Are able to return to a given position time after time without any drift.
| P a g e 44
c. Types of Servomotor
1. AC Servo Motor:
These motors are either two-phase squirrel cage induction type or three-phase one.
First type is used for low power applications while the second one is used for high
power applications.
The stator has two distributed windings which are displaced from each other by
90º. The main winding is supplied from a constant voltage source, Vin∠ 0º. The
other winding is supplied with a variable voltage of the same frequency as the
| P a g e 45
DC: These motors are either separately excited DC motors or permanent magnet
The speed of DC servomotors is normally controlled by varying the armature voltage. Their
| P a g e 46
The negative slope serves the purpose of providing the viscous damping for the servo drive
system. As shown in Figure 27 the armature MMF and excitation field MMF are in
quadrature.
This is a most common type of motor and the o/p of the shaft rotates in about 180°.
It comprises physical stops situated in the gear device to stop revolving outside
This motor is quite correlated to the common positional rotation servo motor, but it
can move in any direction indefinitely. As per the speed & direction of rotation, the
control signal rather than set the static position of the servo is assumed. The range
In our project two dc servomotors will be used one for each direction (x and y). These servo
| P a g e 47
Motor 1:
Motor 2:
The decision for choosing the servo motor was upon the need of high speed that’s why the
DSS-M15 servomotor was chosen for having operating speed 0.18 sec/ 60° and for being
| P a g e 48
Chapter 4 : Economical and Safety Issues
Arduino: 5$
Plates: 10$
In any project wherever the domain was, or the technique used we have to take into
consideration the safety. Design decisions must emphasize the goal of a safe product that
- Metal edges must be filed and screw heads countersunk to prevent injury during
- To protect the user if the touch pad become damaged we can use a polycarbonate
plate placed across the rotational axis to protect the glass substrate of the touch
screen.
- A further level of safety is to shut the system down upon retrieval of 0s to the
coordinate generator in case the ball break contact with the plate or the ball left
| P a g e 49
Chapter 5 : Project Management
In this semester, a research about the topic was done. We discovered different
approaches for implementing the design until we took the final decision.
A decision about the components that should be used was taken according to the
A model of the system is set and the design of the PID controller is covered.
A meeting every week was done so that the group members can share the latest updates
In next semester when the ordered equipment are received the implementation will be done.
The codes needed will be written and a further study for improving the system and adding
| P a g e 50
Chapter 6 : Conclusion and Future Work
The objective of the project was to control the position of the ball on the plate for static
positions and smooth paths, as well as have the system capable of correcting for
disturbances in ball position. It was about two servo motor connected to the beneath of the
plate. These servo motor are with high speed. Also, the position of the ball on the plate was
detected through a resistive touch screen. Thus, the overall system consists of two distinct
processing units, one running the PID control and controls the servo motors while the other
one that does the reading from the resistive touch screen to track the ball position. The
project was divided into three parts the sensor system, physical system, and controller
system. They were integrated together into a complete system since the sensor subsystem
consists of the circuitry and software that generate coordinates from the touch screen.
Finally, the goal of this project is to be taught as a basic for control system in universities
and to be used in many fields that require balancing and controlling issues.
| P a g e 51
References
[1] Arroyo, S. (2005). Ball on Balancing Beam. Viewed December 12, 2006.
[2] Quanser (2006). Q4 hardware in the loop board. Viewed September10, 2006.
[4] Bang, H. (2018). Implementation of a Ball and Plate Control System using Sliding
[5] Lieberman, J. (2004). A robotic ball balancing beam. Viewed September 12, 2006.
[7] Andrews, G., Colasuonno, C., Herrmann, A. (2004). Ball on plate balancing system.
[8] Wang, W. (2007). Control of a Ball and Beam System. School of Mechanical
[9] Cazzolato, B. (2006). Lecture notes distributed in the unit, 3028 Dynamics & Control
| P a g e 52