Moasaa 08

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

16th Mediterranean Conference on Control and Automation

Congress Centre, Ajaccio, France


June 25-27, 2008

Mechatronic Design and Position Control of a Novel Ball and Plate


System
Miad Moarref, Mohsen Saadat, and Gholamreza Vossoughi, Member, IEEE

Abstract—The mechatronic design of a novel mechanism for implementation of new control techniques.
ball and plate system is discussed. A webcam provides the In this paper, a novel mechanism for the ball and plate
system with feedback of the ball’s position. A heuristic system is presented. The spatial parallel mechanism enables
technique for image processing is introduced. The kinematics the plate to rotate about two perpendicular axes while
and dynamics of the system are also described. Supervisory
maintaining a fixed point at the center of the plain.
fuzzy control and sliding control techniques are proposed to
perform position control for the system. Experimental results Moreover, both actuators are located on the base and thus
corroborate the validity of the controllers. minimize the device’s inertia. Other advantages of this
mechanism include high stiffness and minor backlash.
I. INTRODUCTION For sensing the ball’s position and receiving (sending)

T HE ball and plate system is a generalization of the signals from sensors (to actuators), a webcam and an
famous ball and beam benchmark. The latter is a two ADVANTECH PCI-1753 data acquisition card are used
Degree of Freedom system consisting of a ball that can roll respectively.
on a rigid beam, while the former is a four DOF system This paper is organized as follows. Section II introduces
consisting of a ball that can roll freely on a rigid plate. the ball and plate mechanism and compares it with other
Despite worldwide recognition of the ball and beam system mechanisms available in literature. The kinematic and
as a control benchmark and existence of numerous dynamic equations of the system are provided in Section III.
publications on the topic [1], the ball and plate system has Next, fuzzy and nonlinear techniques for control of the ball
not attracted that much attention. Although, the difficulty of and plate system are presented. In Section V, experimental
creating a ball and plate mechanism with respect to a ball results are illustrated. Concluding remarks are provided in
and beam mechanism is the main drawback of such systems, Section VI.
the enormous potential of performing manifold control
strategies on ball and plate systems make them desirable. II. MECHATRONICS OF THE BALL AND PLATE SYSTEM
The ball and plate system can be an appropriate device for The main mechatronic features of the ball and plate
studying control techniques at graduate level. system are discussed in this section. They include the
A few ball and plate systems have been produced before. actuation mechanism, ball’s position sensing strategies, and
The mechatronic design of a ball and plate system that takes real-time control.
advantage of a spatial mechanism for rotating the plate is
A. Actuation Mechanism
described in [2]. However, the mechanism suffers from an
undesirable third DOF which is plate’s rotation in its own The actuation mechanism implemented for the ball and
plane. In that work, a PID controller that is based on the plate system is inspired by [8]. It consists of a five link
linearized model of the system is used to control the ball’s spatial parallel mechanism where the links are connected to
position. The ball and plate system in [3] is designed for each other via five one DOF rotational joints (see Fig. 1).
educational purposes and performs tracking control via The benefits of this mechanism include:
geometric control and PID controllers. Reference [4] uses a 1) Actuators are located on the base of the mechanism. It
robot manipulator as the actuation mechanism and applies lessens the inertia of this device, as opposed to the
sliding control method to the linearized model to control the mechanism where one actuator rotates the plate along one
ball. HUMUSOFT [5] is a tendon drive ball and plate direction and the second actuator which is located on the
mechanism that is commercially available. This device was base turns both the plate and the second actuator.
used in [6] and [7] for tracking control using fuzzy control 2) The heuristic arrangement of joints’ rotation axes
methods. provides the mechanism with a fixed point O (see Fig. 2)
The main contributions of this paper are introduction of a which simplifies deriving the ball’s equations of motion and
novel mechanism for the ball and plate system and control signals. The mechanism introduced in [2] lacks this
characteristic.
3) This mechanism has higher stiffness and lower
Manuscript received February 3, 2008.
M. Moarref, M. Saadat, and Gh. Vossoughi are with the Mechanical backlash, contrary to tendon drive mechanisms such as [5].
Engineering Department, Sharif University of Technology, Tehran, 11365- Two five-phase stepper motors are used as actuators. The
9567 IRAN (phone: (+98) 917-315-0617; e-mail: moarref@ mech.sharif.ir).

978-1-4244-2505-1/08/$20.00 ©2008 IEEE 1071


Fig. 2. The ball and plate mechanism. The numbers show the
mechanism’s five links. The frame with index O is fixed to the base
Fig. 1. The ball and plate mechanism. and the frame with index p is fixed to the plate.

innate characteristics of a stepper motor provide the (xk + xk ( tk +1 − tk ) ± l 2, yk + y k ( tk +1 − tk ) ± w 2 ) where l


opportunity to control the plate’s angular position directly.
They also make the dynamic equations of the system and w are the length and width of the dynamic camera
independent of the plate’s dynamics. Considering the window respectively.
angular velocity of the two stepper motors as inputs, the Using this method, the whole process of sensing the ball’s
system looses two of its degrees of freedom and becomes a location can be done in less than 0.05 seconds on a regular
squared system. PC.
Due to stepper motors’ sporadic missing of steps, one can C. Real-Time Control
not rely on them for measuring angle of rotation. Thus, in ADVANTECH PCI-1753 data acquisition card is used for
this system optical encoders are implemented to measure the generating and sending signals to stepper motors and
angles of rotation of the stepper motors. These data are used receiving data from encoders. The control process is done in
to calculate the plate’s angular position. The relations MATLAB using real-time windows target toolbox.
between plate’s angular position and actuators’ angle of
rotation are derived in Section III. III. KINEMATIC AND DYNAMIC EQUATIONS
B. Ball’s Position Sensing Method Kinematic relations between plate angles ϕ1 and ϕ2 and
The position of the ball is extracted from pictures taken actuators angles θ1 and θ 2 are provided in this section as
by a webcam (Fig. 1) using MATLAB’s image acquisition
well as the equations of motion of the ball.
and image processing toolboxes. This sensing method is
clearly cheaper than the touch-screen sensor used in [2]. A. Kinematic Relations
The procedure for finding the ball on a grabbed picture Since the plate is directly connected to the first actuator
consists of the following steps: (see Fig. 2), the kinematic relation between plate’s angle ϕ1
1) The picture is converted to a bi-level image. This
and the first actuator’s angle θ1 is given by the trivial
Image can be regarded as a matrix whose elements are either
one (white) or zero (black). Imagine that the ball appears as equation ϕ1 = θ1 .
a white circle in a black plane in this bi-level image. In order to find a relation between ϕ2 and the two
2) The sum of elements in each row and column of the actuator angles, an inversion of the mechanism is
image are calculated. implemented. In this inversion link 2 is considered as the
3) The row and column with the largest sum of elements base of the mechanism instead of link 1. Next, an arbitrary
correspond to the point located at the center of the ball. point P is selected between point O and the joint between
In order to speedup the process of taking and analyzing links 3 and 4, and the mechanism is virtually broken through
pictures, the dynamic window method is implemented. Using this point. Using the smaller part of the mechanism one can
this method, only a small portion of each frame that is find the position of point P by equation:
located around the ball’s estimated position is searched, as
⎡ q sin ϕ2 ⎤
opposed to searching the full camera frame. Assume that at
P = ⎢⎢ 0 ⎥⎥ (1)
time tk the ball’s center is at ( xk , yk ) and the ball is moving
⎣⎢ q cos ϕ2 ⎦⎥
with velocity ( xk , y k ) , then the corners of the dynamic
where q is the distance between P and the fixed point O .
camera window at time tk +1 will be at
Implementing the notations and conventions introduced in

1072
TABLE I
DENAVIT-HARTENBERG PARAMETERS
i α i −1 ai −1 di θi
1 0 0 0 θ1
2 π 2 0 0 π 2 + θ2
3 −π 2 0 0 π 2 + θ3
4 π 2 0 −a θ4
The parameters are introduced in details in [9]. θ4 is the angle
between links 3 and 4.
system.
Fig. 3. Link frame assignment [9]. a is the distance between point
O and the joint between links 3 and 4. IV. POSITION CONTROL
[9], one can calculate the position of point P using the In this section, two different methods for controlling the
larger part of the mechanism. Fig. 3 illustrates the frames ball’s position are presented. In the first approach, the
assigned to each link. Denavit-Hartenberg parameters are linearized model is used to create a PID controller with a
shown in Table I. Position of point P is derived as follows: supervisory fuzzy controller which controls the PID gains.
⎡ −q ( cos θ1 sin θ 2 cos θ 3 − sin θ1 sin θ 3 ) ⎤ Next, the sliding control of the nonlinear system is
⎢ ⎥ discussed.
P = ⎢ −q ( sin θ1 sin θ 2 cos θ 3 + cos θ1 sin θ 3 ) ⎥ (2)
⎢⎣ q cos θ 2 cos θ 3 ⎥⎦ A. PID Controller with Supervisory Fuzzy Control
Recalling the linearized set of equations, it is clear that x
where θ 3 is the angle between links 4 and 5. Solving
is a function of θ 2 only. Similarly, y is a function of θ1
equations (1) and (2) for ϕ2 one gets:
only. In other words, the system can be treated as two
ϕ 2 = arctan ( )
tan θ 2
cos θ1
(3) different SISO systems operating simultaneously. Hence
similar but independent PID controllers can be used for
B. Dynamic Equations controlling each coordinate of the ball’s motion.
The ball’s equations of motion are derived using First, a preliminary controller is designed using the loop
Lagrange equations: within a loop scheme. Second, a supervisory fuzzy
controller is designed to adjust the PID gains on-line. Fig. 4
d ⎛ ∂L ⎞ ∂L
⎜ ⎟− = Qi (4) shows a diagram of this controller.
dt ⎝ ∂qi ⎠ ∂qi
A simple proportional controller is adequate to obtain the
where qi are the generalized coordinates (here x and y ) desired response from the inner loop, in which the encoder
and L = T − U , in which T and U are the kinetic and feedback is used to achieve servo position control. This
potential energies respectively. inner loop is then placed in an outer loop that controls the
The resulting equations of motion are fully coupled and ball’s position. The outer loop controller is based on the
contain manifold nonlinear terms: transfer function between each of ball’s position coordinates
2 and its corresponding actuator’s angular velocity, that is
y = f1 ( X ) + ∑ b1 j ( X )θj
 y −75 g + Rs
2
j =1
(5) =
2 θ1 s3
x = f 2 ( X ) + ∑ b2 j ( X )θj
 (7)
x 57 g − Rs
2
j =1 =
θ2 s3
where X = [ x, x , y, y , θ1 , θ1 , θ 2 , θ2 ]T .
Root-locus design technique was used to design an
However, linearization of the system about plate’s fixed
appropriate PD controller for the transfer functions.
point, leads to the following simple and decoupled
The last step is to design a supervisory fuzzy system for
equations:
tuning the PD controller gains with respect to ball’s position
y = −75 gθ1 + Rθ1
 error e(t ) and its time derivative e(t ) [10]. Assuming that
(6)
x = 57 gθ 2 − Rθ2
 the outer loop controller is in the form of K p (1 + K d s) , the
In Section IV, these linearized, decoupled equations are fuzzy system adjusts this controller by changing the
used to create two similar but independent PID controllers proportional and derivative gains (i.e. K p and K d ) at each
for the system. The nonlinear equations of motion are also
implemented to obtain a sliding control strategy for the time step to achieve both fast response and small overshoot.

1073
Fig. 4. The scheme of the PID loop within a loop controller and the
supervisory fuzzy controller. Fig. 5. (a) Membership functions for e and e . (b) Membership
The fuzzy rules are derived experimentally based on the functions for Kp and K d .
step response of the system. For example when e(t ) is large
TABLE II
and e(t ) is small, in order to have a fast rise time, a large
SET OF FUZZY RULES FOR Kp
proportional gain and a small derivative gain are needed. On
the other hand, when e(t ) is small and e(t ) is large, to e
avoid a large overshoot, a small proportional gain and a
μ NL NM NS Z PS PM PL
large derivative gain are desired. NL S B B B B B S
For each PD controller, two fuzzy systems with two NM S S B B B S S
inputs (i.e. e(t ) , e(t ) ) and one output (each one of K p and NS S S S B S S S
K d ) are designed. Seven normal, complete, and consistent e Z S S S S S S S
triangular membership functions are defined on each input PS S S S B S S S
variable. Also, forty nine rules are defined on the output to
PM S S B B B S S
make the fuzzy rule base complete. Note that the input and
PL S B B B B B S
output variables of the fuzzy system were assumed to belong
to the following sets: e ∈ (−0.165, 0.165) , e ∈ (−2.5, 2.5) , can linearize the system.
K p ∈ (0.5, 4.5) , and K d ∈ (0.5,3) . To apply sliding control to this two input two output
system, two sliding surfaces are introduced:
The membership functions are illustrated in Fig. 5. Table
II shows the set of rules for K p . Similar sets of rules are s1 = a1 y + y
(10)
s2 = a2 x + x
produced for K d .
which are stable for a1 > 0 and a2 > 0 .
The overall control scheme can be explained as follows:
While the controller in the outer loop computes the angle by The equivalent control laws for moving along the sliding
which the plate should move to balance the ball, the inner surfaces can be computed by the following equation:
loop controller actually moves the plate by that angle. At the ⎡ u1 eq ⎤ −1 ⎡ − f1 ( X ) − a1 y ⎤
same time, the fuzzy system changes the PD controller gains ⎢ ⎥ = B (X ) ⎢ ⎥ (11)
⎣⎢u 2 eq ⎦⎥ ⎣ − f 2 ( X ) − a2 x ⎦
to achieve a reasonable fast response with a small overshoot.
Defining a Lyapunov function for the first surface, one
B. Sliding Control can write derive a control law for reaching the sliding
Recalling (5), the nonlinear system is input to output surface:
linearized and its relative degree is (2, 2). The total relative V1 = 12 s12 ⇒ V1 = s1 s1 = s1[a1 y + f1 ( X ) + b11u1 + b12 u2 ] ≤ −η1 | s1 |
degree of the system is 4, which is equal to the order of the
sgn( s1 )[a1 y + f1 ( X ) + b11u1 + b12 u2 ] ≤ −η1
system. Thus, one can be sure that the system does not have
u1 = u1 eq − b111 sgn( s1 ), k1 ≥ η1
k
an unstable zero dynamics. (12.a)
Assume B( X ) is a matrix with elements bij . One can where η1 is a positive constant and the larger it is, the
write: smaller is the reach time. A similar control law can be
⎡ 
y ⎤ ⎡ f1 ( X ) ⎤ ⎡θ1 ⎤ derived for the second surface:
⎢  =
⎥ ⎢ ⎥ + B ( X ) ⎢  ⎥ (8)
u1 = u1 eq − b111 sgn( s1 ), k1 ≥ η1
k
⎣ x ⎦ ⎣ f2 ( X )⎦ ⎣θ 2 ⎦ (12.b)
The invertible matrix B( X ) is often called the decoupling As a result, the Lyapunov function
matrix, in the sense that the following decoupling control V = V1 + V2 = 2 ( s1 + s2 ) with control signal (12) guarantees
1 2 2

law asymptotic stability of the origin.


⎡θ ⎤ ⎡ w − f (X ) ⎤ From a control point of view, modeling inaccuracies can
u = ⎢ 1 ⎥ = B −1 ( X ) ⎢ 1 1 ⎥ (9)
 ⎣ w2 − f 2 ( X ) ⎦ be classified into two major kinds: structured (or parametric)
⎣θ 2 ⎦
uncertainties and unstructured uncertainties (or un-modeled

1074
dynamics). The first kind corresponds to inaccuracies on the introduced in [10].
terms actually included in the model, while the second kind First, N i normal, complete, and consistent triangular
corresponds to inaccuracies on (i.e., underestimation of) the
membership functions Ai1 ,..., AiNi are created on the each of
system order [11].
In this paper, the following inaccuracies are assumed on the inputs’ domains [α i , β i ] :
system’s parameters: μ A ( xi ) = μ A ( xi ; ei1 , ei1 , ei2 )
1 1

− π 6 < θ1 < π 6 , − π 6 < θ 2 < π 6


i i

μ A ( xi ) = μ A ( xi ; eij −1 , eij , eij +1 ), j ∈ {2,..., N i − 1} (18)


− π 9 < θ < π 9 , − π 9 < θ < π 9
j j

1 2 (13) i i

0.01 < R < 0.02 μ A ( xi ) = μ A ( xi ; e


Ni Ni i
Ni −1
i
Ni
,e ,e ) i
Ni
i i

where R is the ball’s radius and its corresponding where α i = ei1 < ei2 < ... < eiNi = β i and eij is the center of
uncertainty is due to using balls with different radii in
experiments. membership function Ai j .
8
The unstructured uncertainties include friction forces,
actuator ripple, backlash and dither.
Next, ∏N
i =1
i fuzzy IF-THEN rules are created in the
Considering these uncertainties and replacing the following form:
parameters with their nominal values, the equivalent control
Ru i1 ...i8 = IF x1 is A1i1 and ... and x8 is A8i8 , THEN y is B i1 ...i8 (19)
laws (11) are reduced to:
⎡ u1 eq ⎤ ⎡ −50 2 y ⎤ where i j = 1,..., N j and the center of the fuzzy set B i1 ...i8 ,
⎢ ⎥=⎢ ⎥ (14)
⎢⎣u 2 eq ⎥⎦ ⎣⎢ 50 2 x ⎦⎥ denoted by y i1 ...i8 , is chosen as:
Defining the control signals to be in the form of y i1 ...i8 = u1 (e1i1 ,..., e8i8 ) (20)
⎡ u1 ⎤ ⎡ u1 eq ⎤ ⎡ v1 ⎤ Note that in the above equation it was assumed that the
⎢u ⎥ = ⎢u ⎥ + ⎢ v ⎥ (15) approximator is desired to estimate the nonlinear control
⎣ 2 ⎦ ⎢⎣ 2 eq ⎥⎦ ⎣ 2 ⎦
signal u1 .
one can write: 8
V1 = s1 s1 = s1[a1 y + f1 ( X ) + b11u1 + b12 u2 ] Last, a fuzzy system is constructed from the ∏N i rules
i =1
= s1[a1 y + f1 ( X ) + b11 (u1 eq + v1 ) + b12 (u 2 eq + v2 )]
(16) of (19) using product inference engine, singleton fuzzifier,
≤| s1 | [| a1 y | + max( f1 ( X ) + b11u1 eq + b12 u 2 eq )] and center average defuzzifier:
+ s1[min(b11 )v1 + min(b12 )v2 ] ≤ −η1 | s1 | ∑ ...∑ y ( μ ( x )...μ ( x ))
N1 N8 i1 ...i8
1 8
i1 =1 i8 =1 A1i1 i
A88
Writing similar relations for the second surface, one gets: f ( x) = (21)
∑ ...∑ (μ ( x )...μ ( x ))
N1 N8

min(b11 )v1 + min(b12 )v2 = i1 =1 i8 =1 i


A11 1 i
A88 8

−(| a1 y | + max( f1 ( X ) + b11u1 eq + b12 u 2 eq ) + η1 ) sgn( s1 ) The accuracy of this fuzzy system can be computed using
Theorem 10.1. in [10]:
min(b21 )v1 + min(b22 )v2 =
|| u − f ||∞ ≤ 18 [|| ∂∂xu2 ||∞ h12 + ...+ || ∂∂xu2 ||∞ h82 ]
2 2
(22)
−(| a2 x | + max( f 2 ( X ) + b21u1 eq + b22 u 2 eq ) + η 2 ) sgn( s2 ) 1 8

j +1
(17) where hi = max1≤ j ≤ Ni −1 | ei − ei | for i = 1,...,8 .
j

The above equations can be used to compute the values of In this paper, hi were chosen so that the fuzzy
v1 and v2 which are in turn used to compute the control approximator was able to approximate the control signals
signals (15). with an accuracy of 0.01.
s
To avoid chattering, continuous function sat ( ϕii ) is used
V. EXPERIMENTAL RESULTS
instead of the discontinuous function sgn( si ) . The new
Fig. 6 illustrates the way different parts of the ball and
control laws guarantee that all trajectories will reach the
plate system are connected to each other. A PC was used to
boundary layer of thickness ϕi around the sliding surface si
play the role of the controllers discussed in the last section.
in finite time. The inputs to the computer include the position of the ball
In order to increase the speed of computations, that is ( x, y ) and the actuators angles (θ1 , θ 2 ) . The former is
inevitable in real-time control applications, a fuzzy
extracted using image processing from the picture grabbed
approximator system is used. The approximator comprises
via a webcam and the latter is acquired from the encoders.
of two fuzzy systems with eight inputs (i.e.
Each encoder is mounted on a shaft which is connected to
X = [ x, x , y, y , θ1 , θ1 , θ 2 , θ2 ]T ) and one output. Each of these one of the stepper motors via a gearbox. The pulse generated
fuzzy systems approximates one of the control signals (15). by the encoders is read using ADVANTECH PCI-1753 data
The fuzzy approximators are created using the approach acquisition card to calculate the angles. The resulting control

1075
Fig. 6. The ball and plate system. This diagram shows how various parts of the system are connected to each other.

signals are set as the outputs of the data acquisition card. and tracking more complex paths are the subjects of future
The Pulse generator unit uses these outputs to create works.
pulses with proper frequencies, which are sent to the drivers
of the stepper motors. REFERENCES
Fig. 7 illustrates tracking a square of width 0.2 m, which [1] O. Mohareri, and M. Saadat, “A new approach in designing ball and
is positioned symmetrically on the plate. The ball was plate system, a mechatronic benchmark,” In Proc. 4th International
Symposium on Mechatronics and its Applications, Sharjah, UAE,
initially located around the center of the plate. The results 2007.
show that the PID controller equipped with supervisory [2] S. Awtar, K. Craig, “Mechatronic design of a ball on plate balancing
fuzzy controller achieves a fast and monotonic response system,” Mechatronics, 2002, vol. 12, no. 2, pp. 217-228.
with respect to the PID controller with no supervisory [3] http://www.eissq.com/BallandPlate/index.html
[4] J. Park, Y. Lee, “Robust visual servoing for motion control of the ball
control. on a plate,” Mechatronics, 2003, vol. 13, no. 7, pp. 723-738.
The result of position control using sliding control [5] HUMUSOFT CE151 ball and plate apparatus users manual.
technique is shown in Fig. 8. The ball’s initial location was [6] H. Wang, Y. Tian, Z. Sui, X. Zhang, and C. Ding, “Tracking control
of ball and plate system with a double feedback loop structure,” In
(9,-5) cm. The controller was able to stabilize the ball on the Proc. 2007 IEEE International Conference on Modeling and
center of the plate within a reasonable time and with great Automation, Harbin, China , 2007.
accuracy. The proposed sliding controller promises excellent [7] M. Bai, H. Lu, J. Su, and Y. Tian, “Motion control of ball and plate
system using supervisory fuzzy controller,” In Proc. 6th World
performance in tracking control, which is the subject of Congree on Intelligent Control and Automation, Daliian, China, 2006.
future work. [8] E. Samson, D. Laurendeau, M. Parizeau, S. Comtois, J. Allan, and C.
Gosselin, “The agile stereo pair for active vision,” Machine Vision
and Applications Journal, 2006, vol. 17, no. 1, pp. 32-50.
VI. CONCLUSION AND FUTURE WORKS
[9] J. Craig, Introduction to Robotic: Mechanics and control. Pearson
In this paper the mechatronic design and control of a ball Education, 2005, ch. 3.
and plate system was discussed. Two controller schemes [10] L. Wang, A Course in Fuzzy Systems and Control. Prentice-Hall PTR,
1997, ch. 20.
were proposed. The first one was based on a supervisory [11] J. Slotine and W. Li, Applied Nonlinear Control. Prentice-Hall, 1991,
fuzzy system and PID controllers. The second one was ch. 7.
based on sliding control with a fuzzy approximator.
Experimental results corroborate the validity of these control
strategies.
Implementing other control techniques, such as adaptive
control and neural networks, to this ball and plate system

Fig. 7. Tracking a square of width 0.2 m: (a) without supervisory


control and (b) with supervisory control. Each solid dot represents a Fig. 8. Position control using sliding control technique. Each solid dot
data grabbed by the camera. represents a data grabbed by the camera.

1076

You might also like