Sie sind auf Seite 1von 11

International Journal of Applied Research and Studies (iJARS)

ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)


www.ijars.in


Manuscript Id: iJARS/894 1


Research Article
Real Time Motion Assessment for Positioning In Time and Space
Critical Systems

Authors:
1
Manoj Acharya,
2
Manish Bhattarai*,
3
Bikash Poudel

Address For correspondence:
1, 2
R&D Engineer, PowerTech Nepal
3
Assistant Lecturer Institute of Engineering, Thapathali Campus
Abstract:
With the advent of computer vision, every system seems to encompass the ideas and control system is not
an exception to it. The notion of image processing articulates the ideas of intuitiveness and elegance in
almost every engineering paradigm and ameliorates the systems which currently lag behinds in achieving
fidelity that every systems is supposed to have. We propose here an image processing based ball and beam
system, where the real time position sensing is carried out with a camera and PID control system has been
attuned to overcome time and space instabilities. Our system has proven to work efficiently exhibiting a
good dynamic response and thus has been a step towards novel inception in the domain of control system
and computer vision based co-design.
Keywords: Ball and beam, PID, Computer vision, time critical systems, space critical systems
I. INTRODUCTION
In our pursue towards finding a dynamic unstable system, we found one particular example that has
garnered ample amount of interest amidst control theory researchers and experts, Ball and Beam as we
have experienced is a time and space critical system where we must consider the various dynamic
parameter like displacement (linear as well as angular), velocity and reaction time and thus the ball and
beam system is one of the most popular and important bench systems for studying control systems. Many
classical and modern control methods have been used to stabilize the ball and beam system [1, 2, 6].The
ball and beam system is characterized as a beam coupled to the motor shaft which can be tilted to a desired
angle. The ball rolls on the beam and the position of the ball is detected by some special sensors, in our
case a camera. The control system is used to automatically regulate the position of the ball on the beam by
changing the beam angle. Due to the nonlinearity and complexity of the governing dynamics, some
researchers used non-model based control strategies such as Neural Network [5], Fuzzy Logic [3] and PID
[4] to control the ball position and beam angle.

ceo.dspspectrum@gmail.com *Corresponding Author E-mail Id
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 2


The non-model based method does not require mathematical procedure to derive dynamic equations and to
apply linearization. However, these methods are mainly experience-based and cannot guarantee the
stability of the system, which may pose challenge to control the unstable ball and beam system. In this
paper we propose the use of normal table tennis ball and a lightweight beam where the position of ball is
the location of centroid of the circular projection of ball seen from the camera, the targeted destination is
given by some hand gesture and the system is actuated using common servo motor.

II. SYSTEM MODEL AND PROBLEM STATEMENT

Figure 1: Modeling of Ball and Beam system

The ball and beam system can be simply modeled as shown in figure 1. The above figure shows the beam
tilted to an angle and the ball positioned on it. The motor rotates either clockwise or anti-clockwise
depending on the position of the ball. When the ball is at the extreme left end then the motor is rotated in
anticlockwise direction to keep the ball over the beam and contrarily in other direction. This process is
repeated until the ball reaches its desired position. For balancing the ball, the angle of the beam is changed
as per the system feedback.
Figure 2 shows schematic representations of the ball on beam balancer system. The Lagrangian approach
was used to model the system. The potential energy of the system relates to the relative movement of the
ball on the beam. Assuming that the location of the pivot corresponds to zero potential energy, we can
write the total potential energy as
(1)
where m is the ball mass, x is the translational position (with positive direction pointing downward)
and is the angle of the beam shaft. The kinetic energy, T, can also be computed from
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 3


(2)
Where, v is the translational velocity of the ball, is the angular velocity of the ball, I
a
is the beam inertia,
and I
b
is the ball inertia.

Figure 2: Schematics of the ball on beam balancer system (courtesy of [7])

Since the sensors in this system measure ball translational position, x, and shaft angular position, , we
rewrite the kinetic-energy equation in terms of these two variables by finding the relationship
between r and , and x. Note that the distance traveled by the ball is given by
(3)
Where, is the rotational angle of the ball with respect to the shaft with respect to the shaft and r is the
rolling, or effective, radius of the ball. The total angle of the ball is the sum of the angle of the ball with
respect to the shaft, , and the angle of the shaft, . The rotational velocity of the ball, therefore, is given by

(4)
The translational velocity of the ball, v, is given by (see Fig. 1B)
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 4


(5)
Replacing the rotational and translational velocities in the kinetic-energy equation yields,

. (6)
The equations of motion can now be obtained using the Euler-Lagrange equation:

(7)
Where L is the Lagrangian given by
L= T - U (8)
Replacing L in the Euler-Lagrange equation, we get

(9)
We ignore the derivatives of the shaft angle assuming the shaft movements remain relatively small. The
simplified equation of motion is then given by

(10)
Applying the Laplace transform to the above equation yields the following transfer function

(11)
In the above equation, the inertia of the ball is given by

(12)

Plugging in I
b
in the transfer function G(s), we get

(13)


International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 5


III. PRACTICAL IMPLEMENTATION AND RESULTS
Our system first captures the real time image of the operating system and then following operations are
done in subsequence:
1. Gaussian Filtering
A 5*5 Gaussian filtering has been implemented for removing any noises present in the image. To perform a
smoothing operation we apply a filter to our image. The most common type of filters are linear, in which
an output pixels value (i.e. g(i,j) ) is determined as a weighted sum of input pixel values
(i.e. ) :

(14)
h(k,l) is called the kernel, which is nothing more than the coefficients of the filter. An example of a
Gaussian kernel K of size=5 that might be used is shown below:

(15)

Figure 3: Original image Figure 4: Image after Gaussian smoothing
2. Canny edge detection
The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide
range of edges in images. Its parameters allow it to be tailored to recognition of edges of differing
characteristics depending on the particular requirements of a given implementation, thus this algorithm has
been used for finding all the edges in the image.

International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 6



Figure 5: Image after Gaussian smoothing
3. Hough Line Transform
After finding the edges the image containing edges is passed through Hough line finding algorithm, which
accurately finds the location of the lines in the images, but using this operation we obtain numerous
spurious lines in the images that could be representing any object. Since the set point of the ball is given
using hand so obviously there is a line representing hand too. Of all these lines we take into account the
longest line which has slope between 85 and 90 degree, here we assume the hand is perpendicular the
horizontal plane while giving any gesture, and also the gesture is above the ball that is obviously above the
beam. Although we have obtained the set point for PID system we need to tract the ball at every instance
and that is actually the key to the success to this kind of applications be it ball and beam or inverted
pendulum or any other system, the more frequently and accurate is the tracking, more stable is the system.

Figure 6: Hough Transform of image with edges
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 7



Figure 7: Final Set point indicated by hand gesture

4. Moments and locating ball
Now, how do we detect ball in the image. Since, in this project we are using colored ball and a smooth
(single colored) background so HSV filtering was enough to find the region corresponding to ball. We find
the HSV range of the ball before hand and direct specifically to threshold HSV color image in that range.
Since we have a threshold region we can obtain the centroid of that region after performing morphological
operation like dilation and erosion, we obtain the center of the circular region after using moments of an
image. Thus the current point and the set point for the system are found and that information are send to a
system processor which converts this information into corresponding feedback to control the servo motor
coupled with the beam.
In image processing, computer vision and related fields, an image moment is a certain particular
weighted average (moment) of the image pixels' intensities, or a function of such moments, usually chosen
to have some attractive property or interpretation. Image moments are useful to describe objects after
segmentation. Simple properties of the image which are found via image moments include area total
intensity, its centroid, and orientation. For a 2D scalar (grayscale) image with pixel intensities I(x,y), raw
image moments M
ij
are calculated by



(16)
Simple image properties derived via raw moments include:
1. Area (for binary images) or sum of grey level (for grey-tone images): M00
2. Centroid: (x, y) = (M
10
/ M
00
, M
01
/ M
00
)
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 8
















Figure 8: HSV tuning for the ball segmentation Figure 9: HSV image


Figure 10: Segmented ball with its centroid marked
5. PID
One of the simplest types of non-linear controllers used in our system is the PID, which stands for
proportionalintegralderivative. Each of the three elements is multiplied by its own constant, and then the
sum is used to determine the new inputs for the actuator. The mathematical formula for the PID control
algorithm:
) (17)
Where, e(t) = error = current value previous value
u(t) = overall error of the system
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 9


With the correct choice of signs for K
p
, K
i
and K
d
, a PID controller as shown in below will generate an
actuator command that attempts to drive the error to zero with the proportional gain, remove the steady-
state error with the integral gain, and
dampen the response with the derivative gain.
Implementing PID controller to unstable
Ball &Beam will make the closed loop
system stable.


Figure 11: Block diagram of PID system
In order to assess the system's response , the system error was calculated as per equation 17 continually
and plotted as a function of time. The graph in figure 12 depicts that with the incorporation of only the K
p

parameter , the system isn't rendered stable , rather it continues in a prolonged oscillation about the set
point. The zero crossings indicate the passage of the ball through set point.

Figure 12: System error only considering proportional coefficient (k
p
)

International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 10


Then, we tried little tweaking with the parameters and incorporating the K
p
, K
i
and K
d
parameters and
subsequently resulted in following response. In contrast to the figure above, figure 13 indicates that the
system has comparatively undergone a much stable response. Hence , we observe that the error is no more
oscillatory but rather tends to zero as the ball approaches the set point.

Figure 13: System error considering all coefficients (K
p
, K
i
and K
d
)

IV. SUMMARY &CONCLUSION:
Thus, an accurate control system that can estimate and guide any object under dynamically unstable and
constrained setups was justified. Taking this example, it can be generalized for any time and space critical
system provided that all of the above mentioned parameters are correctly expressed and is congruous to the
system model in experiment.
In addition this system was found to be pretty effective with promising real time
performances and less reaction time overhead and resulting in more stabilized performance and less error
prone incorporating all the ingenuities that a reliable control system is supposed to have. In a nutshell, this
novel approach can be extended to other engineering paradigms like robotics, aeronautics, mechatronics,
control systems, automobile engineering for reliability, stability, and efficiency in performance.
Our project is based on one dimension implementation, similarly the project can be extended
into 2-D so that the system can be used for other various implementations. Also in the proposed system the
background of the setup is fixed, with few more tweaking the system can be made to perform effectively in
any kind of surrounding .Similarly, the system can be made independent of the color of the object in
pursuit considering other reliable features so that it can be used to track any kind of objects. The video
resource related to this paper can be accessed at
https://www.youtube.com/watch?v=cayVlMbv05g&feature=youtu.be
International Journal of Applied Research and Studies (iJARS)
ISSN: 2278-9480 Volume 3, Issue 7 (July - 2014)
www.ijars.in


Manuscript Id: iJARS/894 11



REFERENCES:
[1] W.Yu, Nonlinear PD Regulation for Ball and Beam System, International Journal of Electrical
Engineering Education, Vol. 46, pp. 3759, 2009.
[2] Li X. and Yu W., Synchronization of Ball and Beam Systems with Neural Compensation,
International Journal of Control, Automation and Systems, Vol. 8, No. 3, pp.491-496, 201
[3] S.K Oh, H.J. Jang and W. Pedrycz, The Design of a Fuzzy Cascade Controller for Ball and Beam
System: A Study in Optimization with the Use of Parallel Genetic Algorithms, Engineering
Applications of Artificial Intelligence, Vol. 22, pp. 261271, 2009.
[4] M.F. Rahmat, H. Wahid and N.A. Wahab, Application of Intelligent Controller in a Ball and Beam
Control System, International Journal on Smart Sensing and Intelligent Systems, Vol. 3, pp. 4560,
2000.
[5] H. Verrelst, K. Van Acker, J. Suykens, B. Motmans, B. De Moor and J. Vandewalle, NLq Neural
Control Theory: Case Study for a Ball and Beam System,Proc. of the European Control Conference
(ECC'97), Brussels, Belgium, July14, 1997.
[6] M. Busl, Modeling and simulation of a general ball and beam process with interaction, Projects in
Automatic control FRT090, Department of Automatic Control, Lund University, Lund 2010.
[7] Robert Hirsch, Ball on Beam System, 1999

Das könnte Ihnen auch gefallen