Image Fuzzy Control on Magnetic Suspension Ball and Plate System

13
International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace doi: 10.14355/ijace.2014.0302.02 35 Image Fuzzy Control on Magnetic Suspension Ball and Plate System Chin E. Lin 1 , Meng-Che Liou 2 , Chun-Mo Lee 3 Department of Aeronautics and Astronautics, National Cheng Kung University No.1, University Road, Tainan 701, Taiwan *1 [email protected]; 2 [email protected]; 3 [email protected] Received 10 Jun, 2013; Accepted 13 Feb, 2014; Published 10 May, 2014 © 2014 Science and Engineering Publishing Company Abstract This paper presents a fuzzy logic control (FLC) implementation on a ball and plate system for dynamic control verification using CCD position sensing. A two degree-of-freedom (DOF) platform is constructed for experiments using four magnetic suspension (MS) actuators. The mathematical model of the ball and plate operation is derived in Euler-Lagrange equation. From CCD position sensing, a microcontroller is implemented to control MS actuators by PWM current drivers. The position tracking performance on the MS ball and plate system is verified on different cases by adopting an enforced fuzzy logic controller. Keywords Ball and Plate Dynamic Control; Magnetic Suspension Actuator; Enforced Fuzzy Logic Control; CCD Position Sensing; PWM Drive Introduction In control system studies, ball and beam system (B&B) and ball and plate system (B&P) are popularly selected for practice in system implementation and performance verifications. In a general feedback control system, appropriate sensors and drivers are two important components in the controller hardware and software. The controllers are mostly designed by microprocessors with effective algorithms. In literatures, B&P studies have focused on three key components in study such as ball position sensors, platform actuators and feedback controls. Actuators such as step motors (Awtar, et al., 2002), optical encoder motors (Moreno-Amendariz, et al, 2010), rotary cylinders (Yuan, et al, 2010) and maglev techniques (Lin, et al, 2008, Lin, et al, 2007, Ker, et al, 2007) were popular in B&B and B&P. For the ball position sensing, touch panel (Awtar, et al, 2002, Yuan, et al, 2010, Lin, et al, 2008) and CCD camera Moreno-Amendariz, et al, 2010) were quite welcome in closed-loop controls. Among different control theories, PID and lead-lag (Kuo, 1991) are most common conventional systems to implement. Back-stepping control (Lin, et al, 2008, Ker, et al, 2007, Kuo, 1991) was successfully adopted in B&B and B&P as well. In many recent works Fuzzy Logic Control (Moreno- Amendariz, et al, 2010, Ker, et al, 2007) has become the most frequently referred control skills due to its system simplicity and easy implementation. A series of studies has been completed in our laboratory to verify B&B and B&P dynamic operations using magnetic suspension (MS) actuators (Lin, et al, 2007) for a multiple degree-of-freedom mechanics. Based on the proposed MS actuator, different sensors and control theories were adopted to implement the control system for performance verifications (Lin, et al, 2007, 2008, Ker, et al, 2007). Since Zadeh proposed the fuzzy logic theory (Zadeh 1965) as a fuzzy superset, fuzzy logic control (FLC) was developed into control applications, and was quickly accepted in many real systems to replace PID controllers. Fuzzy theory is a combination of fuzzy set to calculate mathematic, and an abstraction of the conception of language and the estimation. When a complex nonlinear system cannot easily be settled with appropriate model, the fuzzy logic theory is always the most suitable one to achieve the goal(Gupta, et al, 1991). FLC takes the experience rule and expertise into exercise perfectly to reduce implementation efforts and to improve system performance. When a human operator performs a task, various sensing organs are used to deal with any change or uncertainty involved in the task and the environment

description

http://www.seipub.org/ijace/paperInfo.aspx?ID=8680 This paper presents a fuzzy logic control (FLC) implementation on a ball and plate system for dynamic control verification using CCD position sensing. A two degree-of-freedom (DOF) platform is constructed for experiments using four magnetic suspension (MS) actuators. The mathematical model of the ball and plate operation is derived in Euler-Lagrange equation. From CCD position sensing, a microcontroller is implemented to control MS actuators by PWM current drivers. The position tracking performance on the MS ball and plate system is verified on different cases by adopting an enforced fuzzy logic controller.

Transcript of Image Fuzzy Control on Magnetic Suspension Ball and Plate System

Page 1: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace doi: 10.14355/ijace.2014.0302.02

35

Image Fuzzy Control on Magnetic Suspension Ball and Plate System Chin E. Lin1, Meng-Che Liou2, Chun-Mo Lee3

Department of Aeronautics and Astronautics, National Cheng Kung University No.1, University Road, Tainan 701, Taiwan *[email protected]; [email protected]; [email protected] Received 10 Jun, 2013; Accepted 13 Feb, 2014; Published 10 May, 2014 © 2014 Science and Engineering Publishing Company Abstract

This paper presents a fuzzy logic control (FLC) implementation on a ball and plate system for dynamic control verification using CCD position sensing. A two degree-of-freedom (DOF) platform is constructed for experiments using four magnetic suspension (MS) actuators. The mathematical model of the ball and plate operation is derived in Euler-Lagrange equation. From CCD position sensing, a microcontroller is implemented to control MS actuators by PWM current drivers. The position tracking performance on the MS ball and plate system is verified on different cases by adopting an enforced fuzzy logic controller.

Keywords

Ball and Plate Dynamic Control; Magnetic Suspension Actuator; Enforced Fuzzy Logic Control; CCD Position Sensing; PWM Drive

Introduction

In control system studies, ball and beam system (B&B) and ball and plate system (B&P) are popularly selected for practice in system implementation and performance verifications. In a general feedback control system, appropriate sensors and drivers are two important components in the controller hardware and software. The controllers are mostly designed by microprocessors with effective algorithms. In literatures, B&P studies have focused on three key components in study such as ball position sensors, platform actuators and feedback controls. Actuators such as step motors (Awtar, et al., 2002), optical encoder motors (Moreno-Amendariz, et al, 2010), rotary cylinders (Yuan, et al, 2010) and maglev techniques (Lin, et al, 2008, Lin, et al, 2007, Ker, et al, 2007) were popular in B&B and B&P. For the ball position sensing, touch panel (Awtar, et al, 2002, Yuan,

et al, 2010, Lin, et al, 2008) and CCD camera Moreno-Amendariz, et al, 2010) were quite welcome in closed-loop controls. Among different control theories, PID and lead-lag (Kuo, 1991) are most common conventional systems to implement. Back-stepping control (Lin, et al, 2008, Ker, et al, 2007, Kuo, 1991) was successfully adopted in B&B and B&P as well. In many recent works Fuzzy Logic Control (Moreno- Amendariz, et al, 2010, Ker, et al, 2007) has become the most frequently referred control skills due to its system simplicity and easy implementation.

A series of studies has been completed in our laboratory to verify B&B and B&P dynamic operations using magnetic suspension (MS) actuators (Lin, et al, 2007) for a multiple degree-of-freedom mechanics. Based on the proposed MS actuator, different sensors and control theories were adopted to implement the control system for performance verifications (Lin, et al, 2007, 2008, Ker, et al, 2007).

Since Zadeh proposed the fuzzy logic theory (Zadeh 1965) as a fuzzy superset, fuzzy logic control (FLC) was developed into control applications, and was quickly accepted in many real systems to replace PID controllers. Fuzzy theory is a combination of fuzzy set to calculate mathematic, and an abstraction of the conception of language and the estimation. When a complex nonlinear system cannot easily be settled with appropriate model, the fuzzy logic theory is always the most suitable one to achieve the goal(Gupta, et al, 1991). FLC takes the experience rule and expertise into exercise perfectly to reduce implementation efforts and to improve system performance.

When a human operator performs a task, various sensing organs are used to deal with any change or uncertainty involved in the task and the environment

Page 2: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

www.seipub.org/ijace International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014

36

(Park, et al, 2003). Among many sensing organs, eye vision is the prime information route to gather the data on the environment in many tasks. Image information becomes more important especially when the environment changes dynamically and no other non-contact means to measure the status of the changing environment is feasible. Intelligent image system is used for measurement of a ball position from a CCD camera. Using Otsu threshold method (Humusoft 2011), the image can be converted into its center of gravity to focus on a control task.

A ball on the plate is an unconstrained object which is able to move freely and is no able to recognize the environment. So the unconstrained object cannot control its behavior by itself. This makes motion control of B&P difficult. Output regulation of B&P is challenging. Stabilization control is to keep the ball in a specific position on the plate. Referring to recent works (Lin et al, 2008, Ker, et al, 2007, Miad Moarref, et al., 2008), a complete B&P is implemented on vision feedback to accomplish a competitive result.

This paper constructed a B&P platform using four MS actuators with CCD for position feedbacks. The Euler-Lagrange equation for B&P is formulated. The proposed B&P is implemented on MSP-430 microprocessor in experiments for performance verifications with various conditions. The result is compared with our earlier accomplishment.

Dynamics of B&P

The operation of B&P makes certain assumptions on slide friction, ball rotation and plate equilibrium to simplify the problem in modeling and implementation (Awtar, et al, 2002, Yuan, et al, 2010) referring to Figure1. The plate has mass-symmetry about −I K and −J K planes that ensures no non-diagonal terms in the inertia matrix for the plate.

The mathematical model of the ball and plate system is shown in Figure 2 for −I K plane, where − −I J K is the space fixed coordinate and − −i j k is the body fixed coordinates; likewise to rotate 90 degrees for

−J K plane. The plate has two degrees of freedom (2 DOF) and its orientation is defined by two angles, α and β . In order to derive the dynamic model definitely, plate rotates α around J axis to ( ', ', ' )i j k at first as shown in Figure 2, and subsequently rotates β around 'i axis to ( , , )i j k . All angles are defined to be positive in the counterclockwise (CCW) sense.

FIG. 1 THE PROPOSED B&P MS PLATFORM

The proposed system state variables are defined by the acceleration of gravity as g , the plate length as 2d , the ball position as ( , )b bx y , the radius of ball as bR , the mass of plate as M , moment of inertia of plate in the X-axis and Y-axis are both pI because of its symmetry, the mass and moment of inertia of the ball as m and bI , respectively.

XMF is the magnetic force

of I-axis, and YMF is the magnetic force of J-axis.

By applying the Euler-Lagrange equation, the mathematical model for the proposed B&P is given by:

, 1, 2,3, 4ii i i

d T T V Q idt q q q

∂ ∂ ∂− + = =

∂ ∂ ∂ (1)

1 2 3 4, , ,q x q y q qα β= = = = (2)

where T is the kinetic energy, V is the potential energy and Q is the external energy.

Assume that ( , , )I J K is the space fixed coordinates and ( , , )i j k is the body (of plate) fixed coordinates. First, plate rotates α around J axis to ( ', ', ' )i j k ,

' cos sin'' sin cos

α α

α α

= + = = − +

i I Kj Jk I K

(3)

Next, plate rotates β around 'i axis to ( , , )i j k ,

'cos ' sin '

sin ' cos 'β β

β β

= = + = − +

i ij j kk j k

(4)

Equations (3) and (4) are transformedto get:

cos ' sin ''sin ' cos '

α α

α α

= − = = +

I i kJ jK i k

(5)

Page 3: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace

37

'' cos sin' sin cos

β ββ β

= = − = +

i ij j kk j k

(6)

Assume the position of an element of mass dm dx dyρ= on the plate at ( , )x y is expressed by:

( , )p px y x y= + =r i j r (7)

( ' ) ( ) ( , , , )p p p px y x yα β α β= × = − + × + =r ω r J i i j r (8)

The kinetic energy of the plate is:

( , , )2

d dp p p pd dT dx dy Tρ β α β− −= ⋅ =∫ ∫ r r

(9)

The potential energy of the plate is:

0d dp pd dU g dx dyρ − −= ⋅ =∫ ∫ r K

(10)

Assume the position of the ball on the plate at ( , )b bx y is expressed by:

( , )b b b b b b bx y R x y= + + =r i j k r (11)

( ) ( )

( ' ) ( ) ( , , , , , , )b b b p b b b

b b b b b b b b

x y x y

x y R x x y yα β α β β

= + + × = + +

− + × + + =

r i j ω r i j

J i i j k r

(12)

The kinetic energy of the ball is:

2 21 12 2

( , , , , , , )

b bb b b b

b b

b b b b b

x yT m I

R R

T x x y y α β β

= ⋅ + +

=

r r

(13)

The potential energy of the ball is:

( , , , )b b b b bU mg U x y α β= ⋅ =r K (14)

Finally, the externally work on the platform is represented as:

( ,0) (0, ) ( ) ( ,0)

( ) (0, ) ( , , , )x y x

y x y

W F A d F B d F C d

F D d W F F α β

= ⋅ + ⋅ + − ⋅ − +

− ⋅ − =

K K K

K (15)

FIG. 2 MATHEMATICAL MODEL OF −I K PLANE OF THE PROPOSED B&P

Assume the ball remains in contact with the plate and rolls without slipping, a constraint is imposed on the rotation acceleration of the plate. The mutual interaction between two coordinates is negligible because of the low velocity and acceleration of the plate rotation. The Euler-Lagrange equation can be written as:

, 1, 2,3, 4ii i i

d T T U Q idt q q q

∂ ∂ ∂− + = =

∂ ∂ ∂ (16)

1 2 3 4, , ,b bq x q y q qα β= = = = (17)

for

b pT T T= + , p bU U U= + , ii

WQq

∂=

∂ (18)

The state space equation for B&P can be formulated to let

1 2 3 4 5 6 7 8, , , , , , ,b b b bx x x x x x x y x y x xα α β β= = = = = = = =

(19)

Page 4: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

www.seipub.org/ijace International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014

38

( )21

22 4 1 3

13 4

4

0sin 0

010

b b

xxx A m x x m g x

ux xx

− ′= +

(20)

( )65

26 8 5 7

27 8

8

0sin 0

010

b b

xxx A m x x m g x

ux xx

− ′= +

(21)

where

2

1 57b

bb

AImr

= =+

,

( )1

1 21p b b

KuI I m x

′ =+ +

,

( )2

2 25p b b

KuI I m x

′ =+ +

,

1 3 1 3 1 2 42 cos cos 2XM b bK F d x m gx x m x x x= − − ,

2 7 5 7 5 6 82 cos cos 2yM b bK F d x m gx x m x x x= − −

The dynamic formulation for B&P is implemented in microprocessor to control the MS actuator motion system.

B&P System Architecture

B&P Structure

The proposed B&P is divided into five parts including micro control unit (MCU), signal amplifier, power supply, image processing system, and plate with MS actuator as shown in Figure 3. The microcontroller MSP-430 CPU is used as a control kernel. The ball and plate structure includes a steel ball, a plate pedestal and four MS actuators (Ker, et al, 2007).

FIG.3 THE PROPOSED B&P HARDWARE ARCHITECTURE

Page 5: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace

39

TABLE 1 OUTPUT MODES OF SIGNAL AMPLIFIER

P4.1 G1 G4 P4.2 G2 G3 Current Action MS actuator L H H H L L Left to right Upward H L L L H H Right to left Downward H L L H L L Stop Stop L H H L H H Danger

Signal Amplifier

MS vibration absorber

Ball and Plate

Image Processing

System

Control Law

Filter

r +

u u y

y

MCU Plant

Control System

Terminal

,y

FIG. 4 THE PROPOSED B&P CONTROL DIAGRAM

The control procedure is reading the signal of the ball position from the image processing system through UART 0. Then, the microcontroller calculates the control signal strength using the control law. The control signal is sent to the signal amplifier by PWM to convey control current into MS actuator from signal amplifier. The procedure is repeating until the ball reaches target position. At the same time, MCU will use HIN232 to transmit ball position to terminal through UART 1. Figure 4 shows the control block diagram. First, the target position, control law and filter are designed in MCU. Then, the control input parameter u with PWM signal output from MCU will be transformed into the actual control input parameter u . Eventually, the control plant includes MS actuator, ball and plate and image processing system will be affected by actual control input u and ball position feedback.

Signal Amplifier

When the MCU receives the ball position, then transmits four PWM signals to control MS actuators. MSP430F169 builds control function among sensors to the main microcomputer. The PWM current signals from the MCU are too weak to drive the actuators using a typical bridge power driver circuit. In the signal amplifiers, the digital signals are transmitted

from microcontroller to analog current through photo-couplers. Subsequently, in the power driver, the direction of the magnetic field of MS actuator is determined by current direction in a conventional bridge configuration. The current direction can gain from the bridge switching from G1-G4 and G2-G3. Table 1 shows the output modes of signal amplifier (Lin, et al, 2007).

From the above statement, each MS actuator needs two PWM signals to control the motion. Therefore, in B&P, it needs eight PWM signals to control four MS actuators. Table 2 is the PWM signals assignment.

MS Actuator

Referring to Appendix A (Lin, et al., 2007), in the magnetic suspension (MS) actuator design, a pair of permanent magnets (PM) is used in a repulsive type PM combination is regarded as a spring in nature but is dynamically unstable to control. The proposed MS actuator is controlled the exerting force on the moving part in attractive or repulsive forces by an electromagnetic (EM) coil (Lin, et al, 2007). The PM and EM is constructed to overcome the repulsive interaction of system instability. It is termed as hybrid mode MS actuator. Figure 6 shows the hybrid mode MS actuator structure, including the pedestal, the holding tube, the motion support, the iron core, the

Page 6: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

www.seipub.org/ijace International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014

40

PM and EM coils. The system specifications and parameters are referred to reference (Lin, et al, 2007, 2008, 012) for details in previous developments.

TABLE 2 PWM SIGNAL ASSIGNMENT

MS actuator 1

P1.6 P1.7 Motion L H Upward H L Downward H H Stop

MS actuator 2

P4.1 P4.2 Motion L H Upward H L Downward H H Stop

MS actuator 3

P4.3 P4.4 Motion L H Upward H L Downward H H Stop

MS actuator 4

P4.5 P4.6 Motion L H Upward H L Downward H H Stop

Considering the MS actuator operation(Lin, et al, 2007), assuming the EM coil has N turns in a unit length to make the total coil of nh turns in the solenoid around the iron core, the magnetic force can be derived as:

2 22

012 ( )

c cmag gap

i iF N A

x P xµ = =

(22)

where 0µ is the permeability of free space, gapA is the cross-section area of the face of air gap, N nh= ,

2

20

( )12 gap

xP xN Aµ

= .

Image Sensing

The TON-556 CCD camera is selected in this study for its light weight and high resolution. This CCD is suitable for detecting the ball position on the plate. An image frame grabber is used to convert the analog signal captured from CCD camera to digital signal. The image grabber can link with the MATLAB/GUI (graphical user interface) software. It can simultaneously handle numbers of images to catch features of target.

In addition to describe the image using the RGB color space model, we can also use the gray scale is used to represent a simple task. The gray scale expresses from the darkest to the brightest, in other words, from “0” to “255”. It is defined by “0” for black, and “255” for white in gray scale. Image segmentation identifies target object. It makes an image partition into

fore-ground as the target and black-ground as the background.

In computer vision and image processing, Otsu threshold method (Humusoft 2011) is adopted to automatically carry histogram shape-based image thresholding, or the reduction of a gray-level image to a binary image. The algorithm assumes that the image to be threshold contains two classes of pixels or bi-modal histogram. It then calculates the optimum threshold separating those two classes, and combines into minimal spread.

Otsu threshold technique is based on a discriminant analysis which partitions the image into two classes

1C and 2C at gray level k such that

1 0,1,2, , C k= and 2 1, 2, , 1C k k L= + + − , where L is the total number of the gray levels of the image. Let the number of pixels at the i th gray level be in , and n be the total number of pixels in a given image. The probability of occurrence of gray level i is defined as:

ii

np

n=

(23)

1C and 2C are normally corresponding to the object of interested and the background, the probabilities of the two classes are 1( )P k and 2 ( )P k :

10

( )k

ii

P k p=

= ∑ (24)

1

2 11

( ) 1 ( )L

ii k

P k p P k−

= += = −∑ (25)

Thus, the mean intensity values of the two classes can be computed as:

101

1( )( )

k

ii

m k ipP k =

= ∑ (26)

1

212

1( )( )

L

ii k

m k ipP k

= += ∑ (27)

Let 2Bσ and 2

Gσ be the between-class variance and global variance respectively, where the between-class variance 2

Bσ and global variance 2Gσ are defined as:

2 2 21 1 2 2( ) ( )B G GP m m P m mσ = − + − (28)

12 2

0( )

L

G G ii

i m pσ−

== −∑ (29)

The average intensity of the entire image is defined as: 1

0

L

G ii

m ip−

== ∑ (30)

Page 7: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace

41

Then, the optimum threshold is the value k∗ , that maximizes 2 ( )B kσ :

2 2

0 1( ) max ( )B Bk Lk kσ σ∗

≤ ≤ −=

(31)

probability

pixel intensity

k

1C 2C

FIG.5 THE GRAY LEVEL IMAGE AND ITS HISTOGRAM

Otsu’s method of threshold gray level images is efficient for separating an image into two classes where two types of fairly distinct classes exist in the image. Figure 5 shows the gray level image and its histogram by observing a white ball.Then, using MATLAB to find out the value k∗ , as the value of k for which 2 ( )B kσ is maximum. The optimum

threshold value is found in this system as 165k∗ = .

Because the image has apparent bimodal distribution, it can get satisfactory result from Figure 5 to distinguish into more black and white contrast sense as the binary image.

(0, 0) (319, 0)

(0, -239) (319, -239)

u

v− ( , )x yG G

FIG.6 IMAGE COORDINATE SYSTEM

The image resolution is 320 x 240 in pixel as shown in Figure 6. The center of gravity (CG) is ( xG , yG ). The origin in image coordinate system is the upper left corner.

The target’s CG is calculated by:

320

1

i ix

i i

m uG

m=

×= ∑ (32)

240

1

j jy

j j

m vG

m=

×= ∑ (33)

where xG and yG are the target’s CG in u and v coordinate directions, im and jm are the mass of the white point, whose mass for any point of target is set equal to 1. iu and jv are target pixels in u and v image coordinate system. Finally, the target CG is converted into a very tiny white dot to be distinguished.

Enforced Fuzzy Logic Control

In B&P, the ball is driven by gravitational force to roll toward the set point. Resulting from the force nature, FLC is selected in this study. Figure 7 shows the concept of position tracking of a ball from different starting positions into the plate origin based on a FLC membership function. bR is the distance between target position and set boundary. No matter where the ball begins to roll, these four MS actuators will drive the ball rolling into the set boundary. Actually, the target position can be any location of the plate.

Page 8: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

www.seipub.org/ijace International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014

42

FIG.7B&P OPERATION CONCEPT OF EFLC

Figure 8 shows the control flowchart of position tracking. First, the UART0_RX of MCU waits for receiving the ball position from the image processing system. When the data are received, MCU calculates the real input position error and its differential of the followings:

( ) ( )( ) x x

xr k y k

e kl−

=

(34)

( ) ( )( ) y y

yr k y k

e kl−

=

(35)

ˆ ( ) ( )xx e xe k K e k= ⋅ (36)

ˆ ( ) ( )yy e ye k K e k= ⋅ (37)

( ) ( ) ( 1)x x xe k e k e k= − − (38) ( ) ( ) ( 1)y y ye k e k e k= − − (39) ˆ ( ) ( )

xx de xe k K e k= ⋅

(40)

ˆ ( ) ( )yy de ye k K e k= ⋅

(41)

where l is the length of the plate, ( )r k is the target trajectory, ( )y k is the ball position during each sampling cycle, ( )e k is the current position error,

( 1)e k − is the former position error, eK is the gain of current position error, deK is the gain of position error differential, ˆ( )e k is the real input position error and ˆ( )e k is the real input position error differential.

The function of eK and deK is used to adjust the slope of variation in ball position error e and position error differential e . Besides, eK and deK have relation with report rate and response time of CCD camera and frame grabber.

After calculation, the controller will process fuzzy logic control with outputs of crisp_x and crisp_y. Because the four MS actuators must be driven at the same time, the MCU needs to determine which MS actuator should be activated according to the crisp_x and crisp_y as shown in Figure 8.

However, any feedback signal cannot be fast enough to

stop the ball to go overshooting. Therefore a brake action is added to decelerate the rolling force near the set point. This idea is oriented from human behavior. By trial and errors, an Enforced FLC is formulated to manipulate B&P control.

When the current state of ball is far from the set point, a suitable tilt angle will be given to result in a rolling force on the ball. In the implementation, the initial tile angle is adjusted to meet the feedback response and avoid ball run-away. However, when the current state of ball is near to the set point, the ball will not oscillate around the set point resulting from a reverse force being applied to cancel the roll inertia. By this way, the ball takes a brake near the set boundary and slowly approach to the set position. This performance can be expected to properly control in zero overshoot.

The partitions and the shapes of the membership function for ball position error, error differential and control input using the conventional triangular FLC rules and the direction mapping of position error and error differential are mapping on to the plane as shown in Figure 7.

The decision rule base is expressed in tabular form as Table 4. Because the controller has seven membership functions for input and output parameters, total 49 fuzzy rules. The rules in Table 4 belong to the Basic FLC. In Basic FLC rules, when the ball is far from the set point, the plane needs more declination to exert larger driving force, and vice versa. A brake mechanism is added onto Table 3 as shown in Table 4. The Enforced FLC is proposed to modify and improve the tracking performance than that of the Basic FLC, especially in overshoot. The braking force is set by trial and error to find a suitable tuning. The EFLC rules predict the next step and let the control force occur in advance to improve the stability control system. When the current state of ball is far from the set point, the system will still give a large control force to push the ball. However, when the current state of ball is near to the set point, the system will not oscillate the ball around the set point but produce a repulsive force to cancel the inertial of rolling. In this way, it can produce a suddenly brake before the state reaches to the equilibrium position, so that the speed of the ball will drop zero and the overshoot will be also decreased. According to the operation concept of EFLC in Figure 7, when the ball rolls into the balance boundary of set position, the control output will produce a reverse force to stop the ball quickly.

Page 9: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace

43

Initial_Clock

Start

Initial_UART

Initial_Timer

While

Low-pass filter

Calculate e and de

MS 1 downMS 3 up

Output PWM

Output position

Open UART 0

Calculate Crisp_X and Crisp_Y

BFLCEFLC

Crisp_X < -0.01

Crisp_X > 0.01

Crisp_Y < -0.01

Crisp_Y > 0.01

MS 1 and MS 3 freeze

MS 2 downMS 4 up

MS 2 upMS 4 down

MS 1 upMS 3 down

MS 2 and MS 4freeze

Yes

Yes

Yes

Yes

No

No

No

No

INT_UART 0 INT_UART 1

Output ball position

Receive ball position

Close UART 0

Main

Main

FIG. 8 CONTROL FLOWCHARTS OF POSITION TRACKING

TABLE 3 BASIC FLC RULES

e NB NM NS ZE PS PM PB

e

PB ZE PS PM PB PB PB PB PM NS ZE PS PM PB PB PB PS NM NS ZE PS PM PB PB ZE NB NM NS ZE PS PM PB NS NB NB NM NS ZE PS PM NM NB NB NB NM NS ZE PS NB NB NB NB NB NM NS ZE

TABLE 4 ENFORCED FLC RULES

e NB NM NS ZE PS PM PB

e

PB ZE PM PB PB PB PB PB PM ZE PS PM PM PM PM PB PS NS ZE ZE PS PM PS PB ZE NM NM NS ZE PS PM PM NS NB NS NM NS ZE ZE PS NM NB NM NM NM NM NS ZE NB NB NB NB NB NB NM ZE

Experiment Implementation

In B&P, the feedback data is ball position from the image processing system. In order to decrease the measurement error, the quantified digital data is

output directly through the MCU’s UART 1, and then the software “MATLB” is used to draw the output. The system performance is verified by position tracking effect. In experiments, both Basic FLC and Enforced FLC are applied in tests to compare their system performances including percentage of overshoot, rise time, and settling time referring to the control flowchart of position trackingin Figure 8.

Position Tracking

Position (0, 0) tracking with Basic FLC

The Basic FLC rules as shown in Table 3 are chosen to test and verify the performance of B&P. The set point is (0, 0) with 1± cm boundary. When the position error ( xe and ye ) and position error differential ( xe and

ye ) are both equal to zero, the MCU will stop to operate. Three different experiment s are carried out from different initial conditions to test system equilibrium and stability. The test results of three cases are as shown in Figure 9 for 2D plot by t-X and t-Y.

Position (0, 0) tracking with Enforced FLC

The Enforced FLC rules as shown in Table 4 are chosen

Page 10: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

www.seipub.org/ijace International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014

44

to test the same conditions and flow chart as previous Basic FLC operation. The set point condition is the same as previous one, to (0, 0) within 1± cm boundary. MCU controller stops at both position error ( xe and ye ) and position error differential ( xe and

ye ) are equal to zero. U will stop control. The same three test results are records in Figure 10 in 2D plots.

From above cases, the performance is summarized for comparison from the Basic FLC with the Enforced FLC by test response indexes in Table 5 and Table 6, respectively. The characteristics of performance are: Rise time ( )rt is reach the final value 10% to 90% of the time; Peak time ( )pt is required to reach the first

peak time; Settling time ( )st is reach the final value within the range of 5% of the time required; Maximum overshoot ( )oM is the system output during the transient of the largest offset; Steady state error ( )sse is the difference between the desired final output and the actual one when the system reaches a steady state.

FIG.9 THE POSITION TRACKING USING BASIC FLC

Page 11: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace

45

FIG.10 THE POSITION TRACKING USING ENFORCED FLC

TABLE 5 RESPONSE INDEXES FOR POSITION (0, 0) TRACKING WITH BASIC FLC

Case rt (s) pt (s) st (s) oM (%) sse

1 0.8 1.7 5.6 68.75 0.4 2 0.7 3.1 6.2 67.5 0.8

3-X 0.9 2.4 6.1 40.39 0.3 3-Y 1.4 2.1 5.9 56.25 0.4

TABLE 6 RESPONSE INDEXES FOR POSITION (0, 0) TRACKING WITH ENFORCED FLC

Case rt (s) pt (s) st (s) oM (%) sse

1 2 3.2 3.8 8.59 0.2 2 2.2 3.2 4 16.33 0.6

3-X 1.8 2.6 3.9 8.56 0.3 3-Y 1.9 2.5 3.8 8.75 0.2

Conclusion

This paper presents the design, integration and verification for tracking ball position on the plate using CCD feedback. System hardware and software implementations including MCU, signal amplifiers, MS actuator, image processing, and fuzzy logic control law are accomplished in B&P mechatronics.

The nonlinear B&P is represented in state space formulation using Euler-Lagrange equation. The B&P system dynamics is carefully derived by considering force, moment and inertia relationship among ball, plate and MS actuators. The result is novel in B&P.

Using FLC, B&P control can easily be implemented to accomplish the desired performance by considering its complex nonlinear characteristics. Since the ball always runs overshooting to the set point, the Enforced FLC is modified to improve the tracking performance by simply applying a brake before the set point. The effect from the Enforced FLC is excellent in comparison to the Basic FLC.

ACKNOWLEDGEMENT

This work is supported by National Science Council under contract NSC100-2218-E006-002.

REFERENCES

Awtar, S., Bernard, C., Boklund, N., Master, A., Ueda, D.,

Craig, K., “Mechatronic Design of a Ball-on-Plate

Balancing System,” Mechatronics, Vol. 12, No. 2, 2002,

pp. 217-228.

Gonzalez, R. C. and Woods, R. E., “Digital Image

Processing”, Prentice-Hall, Upper Saddle River, New

Page 12: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

www.seipub.org/ijace International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014

46

Jersey, 2002.

Gupta, M. M., Yamakawa, T., Fuzzy Computing Theory

Hardware and Applications, Netherlands, 1991.

Ker, C. C., Lin, C. E., Wang, R. T., “Tracking and Balance

Control of Ball and Plate System”, Journal of the Chinese

Institute of Engineering, Vol. 30, No. 3, 2007, pp.

459-470.

Kuo, B. C., Automatic Control Systems, Prentice-Hall

International, Inc., 1991.

Kuo, H. C. and Wu, L. J., “An image tracking system for

welded seams using fuzzy logic”, Journal of Materials

Processing Technology, Vol. 120, 2002, pp. 169-185.

Lin, C. E., Ker, C. C., Wang, R. T., Chen, C. L., Chen, B. C.,

“A New Hybrid Magnetic Suspension Vibration

Absorber with Design, Identification and Control

Implementation“, Journal of Aeronautics, Astronautics

and Aviation, Series A, Vol. 39, No. 3, 2007, pp. 163-174.

Lin, C. E., Ker, C. C., “Control Implementation of a

Magnetic Actuating Ball and Plate System,”

International Journal of Applied Electromagnetics and

Mechanics, Vol. 27, No. 1-2, 2008, pp. 133–151.

Lin, C. E., Huang, W. C., “Dynamic Ball and Plate Control

Verification on Magnetic Suspension Platform using

Forced Fuzzy Logic Control”, International Journal of

Applied Electromagnetics and Mechatronics, Vol. 40, No.

4, 2012.

Moreno-Armendariz, M. A., Perez-Olvera, C. A.,

Rodriguez, F. and Rubio, E., “Indirect Hierarchical

FCMAC Control for the Ball and Plate System,”

Neurocomputing, Vol. 73, No. 13-15, 2010, pp.

2454–2463.

Yuan, D. and Zhang, Z., “Modeling and Control Scheme

of the Ball-Plate Trajectory-Tracking Pneumatic

System with a Touch Screen and a Rotary Cylinder,”

IET Control Theory and Applications, Vol. 4, No. 4, 2010,

pp. 573–589.

Zadeh, L. A., “Fuzzy sets,” Information Control, Vol. 8, 1965

pp. 338-352.

Appendix A: MS Actuator

Structure of MS actuator is Chinese Patent I-228574, 20050301 by Prof. Chin E. Lin.

FIG. A-1 MS ACTUATOR STRUCTURE

TABLE A-1 FABRICATION PARAMETERS OF MS ACTUATOR

Element Material Dimension(mm,

otherwise)

Motion Support

Al. alloy 6061 Inner 26φ = , outer

34φ = , height=51

Holding Tube Al. alloy 6061 Inner 26φ = , outer

34φ = , height=51

Breath Hole NC 2φ = , two in opposite

sides

Iron Core Medium carbon

steel Inner 12φ = , outer

44φ = , height=58

Coil Copper PVF 2φ = , 400 turns,

1.3R = Ω at 25 oC

Bobbin Acrylic Inner 55φ = , outer

155φ = , height=48

PM NdFeB-N46H 25.6φ = , height=10, 5300 Gauss

Pedestal Al. alloy 6061 160φ = , height=14

Chin E. Lin was born in Chang Hua, Taiwan. He received BSEE and MSEE from Department of Electrical Engineering, National ChengKung University, Tainan, Taiwan, in 1975 and 1977, respectively. He received Doctor of Engineering from Department of

Electrical Engineering, LamarUniversity, Beaumont, Texas in 1983. Dr. Lin is currentlyProfessor in Department of Aeronautics and Astronautics, National Cheng Kung University. His research interests are control applications, avionics system, wireless data surveillance system, magnetic suspension system, and e-commerce system.

Meng-Che Liougraduated from Department of Aeronautics and Astronautics, National Cheng Kung University for his MS degree in June 2012.

Page 13: Image Fuzzy Control on Magnetic Suspension Ball and Plate System

International Journal of Automation and Control Engineering (IJACE) Volume 3 Issue 2, May 2014 www.seipub.org/ijace

47

Chun-Mo Leethe B.S. degree in Aeronautical Engineering from National Cheng-Kung University in Taiwan, the Master degree in Aerospace Engineering from the University of Michigan (Ann Arbor) in U.S.A. and the Ph.D. degree in

Electrical Engineering from National Cheng-Kung University in Taiwan. He is now on the faculty of the Department of Aeronautics and Astronautics of National Cheng-Kung University in Taiwan. His current research interests lie in the area of control system design, attitude control of satellite and gray system theory.