Dual PD Control Regulation with Nonlinear Compensation for a Ball and Plate System

1 Centro de Investigación en Computación, Instituto Politécnico Nacional, Avenida Juan de Dios Bátiz S/N, Colonia Zacatenco, 07738 México, DF, Mexico 2 Sección de Estudios de Posgrado e Investigación, ESIMEAzcapotzalco, Instituto Politécnico Nacional, Avenida de las Granjas No. 682, Colonia Santa Catarina, 02250 México, DF, Mexico 3 Escuela Superior de Ingenier̀ıa Mecánica y Eléctrica, Instituto Politécnico Nacional, Avenida Juan de Dios Bátiz S/N, Zacatenco, 07738 México, DF, Mexico 4Departamento de Control Automatico, CINVESTAV, Instituto Politécnico Nacional, 07370 México, DF, Mexico


Introduction
The ball and plate system is one of the most popular and important models in control education, and it is a benchmark nonlinear plant [1], because it is more complex than the traditional ball and beam system [2].The ball and beam system has two degrees of freedom where the ball can roll freely on a rigid plate; see Figure 1.Since the movement of the ball over the plate can reach high speeds, the design of a suitable controller for this system is a major challenge; therefore, these systems are not commonly used in laboratories.
The ball and plate system has low consumer appeal.However, the challenge of balancing is a problem under continuous study for robotics transportation applications, often as extensions of the inverted pendulum project.Therefore, the system can present many challenges and opportunities as an educational tool of the control systems engineering for university students.Thus, this system has enormous potential for advanced control techniques, such as fuzzy control [3,4], classical control [5], robust control [6][7][8][9][10], nonlinear control [11,12], and sliding mode control [13].
There are some reported control algorithms for the ball and plate system in the literature.In [14], a stabilizing switching control scheme is proposed.By the concepts of switchingdriving Lyapunov function and switching-driven stability, a locally asymptotically stabilizing switching controller is obtained.In [15], a linear model and simple PID controller are used for a real-time ball and plate system based on DSpace.On the other hand, intelligent control is suitable when the model of the ball and plate system is not available.In [16], a hierarchical fuzzy control with a genetic algorithm is applied for the adjustment of the membership functions.
From the above controllers, there are two problems for the ball and plate control: (1) some laboratories use simple controllers such as PD control, and the theory analysis is based on linear models [15];

Ball and Plate System
The new ball and plate system is shown in Figure 1.In this system a ball is placed on a plate where it is allowed to roll with two degrees of freedom.As the two motors turn, they produce a shift in the angles   and   , which at the same time cause a variation of position of the ball in (, ) due to the gravity force.In the absence of friction or other disturbances, the dynamics of the ball and plate system can be obtained by the Lagrangian method [19,20].The kinetic energy of the system is where   is the kinetic energy of the ball;  is the mass of the ball;   is the inertia moment of the ball;  is the radio of the ball; √ ẋ 2 + ẏ 2 is the linear velocity of the ball;  and  are the position of the ball on plate;   and   are the angular position of the plate;  is the angular velocity of the ball; and √ θ is the angular velocity of the plate.On the other hand, potential energy of the ball due to the gravity is given by where   is the potential energy of the ball and  is the acceleration due to gravity.From (1) and ( 2), the Lagrange equation is Lagrange's equations of motion are where   and   are the torque applied to the plate.Developing (4) gives the whole ball and plate system as follows: Define the system state as follows: Define the regulation errors as follows: where  * and  * are the desired ball position.For the ball and plate system, in the balance position  *  = 0,  *  = 0, ẋ * = 0, and ẏ * = 0, then It is difficult to analyze the stability of the ball and plate system (5) with normal PD control.Nevertheless, it is well known that PD control can stabilize the manipulator robots [21].Now, a transformation of the ball and plate closed-loop system will be discussed.
Proof.See Appendix A for the proof.

Dual PD Control
The goal of this research is to develop a PD regulation with compensation capable of controlling the position of ball on a plate in both axes (, ).Initially, the plate is at the horizontal, that is,   =   = 0, and tilts in both axes to control the position of the ball.Each tilting axis will be operated by a DC motor.The position of the ball on the plate is measured by a camera [18].A dual PD controller is an adequate basic term to obtain an acceptable response of the system; however, an exact nonlinear compensator is included to find the objective of guaranteeing the closed-loop system stability.Figure 2 shows a diagram of this controller scheme.
The dual PD control law of the -axis is as follows: The dual PD control law of the -axis is as follows: where   ,   and   ,   are positive constants of the controllers of the plate and   ,   and   ,   are constants of controllers of the ball.  and   are compensators, which will be designed in the next section.
For the regulation problem, the control goal is to stabilize the ball in the desired position ( ẋ * , ẏ * ), being denoted by ( ẋ * , ẏ * ) = (0, 0); therefore, the dual PD controllers become or If , and  5 =   ,   and   can be written as follows:

Stability Analysis
In this section, Lyapunov's first method is used to prove the dual PD control with nonlinear compensation ( 14) and ( 15) is asymptotically stable.First, it is analyzed if the matrices  and  may be candidates for Lyapunov function.The matrix  is not symmetric to prove that the function is positive; that is, each main minor determinate is computed.If the constants  > 0,  > 0,   > 0, and  is a square matrix, then Position of the ball is (, ) > 0; therefore, the matrix  that satisfies all determinants of the main minors (16) are positive; then,  is a positive definite matrix that satisfies The matrix  is not symmetric to prove that the function is positive and the calculation of quadratic form is determined.Consider The position of the plate is (  ,   ) > 0, and the constants are  4 > 0,  1 > 0,  4 > 0,  1 > 0. If  is a square matrix (A.5), then the quadratic form satisfies The stability of the closed-loop system is stated in the following theorem.
Theorem 2. Consider the ball and plate system (8), the dual PD control (14), (15), and the following compensators of   and   as follows Therefore, the closed-loop system of the ball and plate system is asymptotically stable Proof.Since () is a positive definite matrix,  in ( 18) is a quadratic form, and recalling that   and   are not negative, the following positive definite quadratic form is used as the Lyapunov function: To assure the potential energy   = ( sin(  )+ sin(  )) is positive, we let   ≥ 0 and   ≥ 0, (, ẋ ) ≥ 0. Differentiating it with respect to time and recalling that  * and  * are constants, it yields It is (see Appendix B) Using the compensators (20) in (24) gives Since  5 > 0 and  5 > 0,  is a semidefinite negative function.Thus, the closed-loop system is stable in the equilibrium point [ ẋ , ẏ ] = [0, 0].To prove asymptotic stability, LaSalle's theorem is used in the following region: From ( 22),  = 0 if and only if θ  = θ  = 0.For a solution  , () to belong to Ω for all  ≥ 0, it is necessary and sufficient that   =   = 0 for all  ≥ 0. Therefore it must also hold that  =  = 0 for all  ≥ 0. It is concluded that the closed-loop system is the only initial condition in Ω for which () ∈ Ω for all  ≥ 0. Finally, the origin of the closed-loop system is asymptotically stable in [,   , ,   ] = [0, 0, 0, 0] [6-10].
Remark 3. In [22][23][24][25][26], the authors use proportional-integralderivative controllers; nevertheless, the proposed controller is different because it has 4 dynamic alternatives being selected by the controller depending on the  and  values of the ball and beam system, and it is called the dual PD control.The proposed controller has the main merit that it can guarantee the convergence of the regulation error; that is, the dual PD controller obtains a desired behavior in the system.The shortcoming of the proposed method is that the changes between the 4 dynamic alternatives in the controller could cause the undesired chattering.

Prototype
Figure 3 shows the prototype used to test the new dual PD controller.Simulink is used to test the model (8); consider  = 0.11 kg,  = 1.27 cm, and  = 9.81 m/s 2 .Once the simulation is successful, the implementation on FPGA is carried out.The prototype has the following parts: the plate size is 50 × 50 cm, the ball is with a radius of 1.27 cm, and a CMOS camera model MT9 M011 [27] is used as a visual position sensor of the ball.The model used as image sensor is the TRDB card DC2 [27] of Terasic company.The designed hardware components of the prototype are image preprocessing, ball position, and dual PD controller with compensator.The image preprocessing component receives a color image from CMOS camera and delivers a binary image.The ball position component receives the binary image and delivers the position (, ) of the ball on the plate; these components are able to process 16 images per second [18]; the position of the ball is sent to the dual PD controller component; this includes the new control law.Finally, the motors receive these control laws and they move the plate on  and  directions, simultaneously.The DC motors are selected as an actuator for its high torque.This motor is a powerful 12 V brushed DC motor with a 50 : 1 metal gearbox and an integrated quadrature encoder [28].To obtain realtime operation, all modules are embedded in hardware using the very high speed hardware description language (VHDL) using Quartus II version 7.2 and are implemented in Altera DE2 [29] (Development Education board) with a Cyclone II FPGA.

Experimental Results
To verify the advantages of the dual PD controller with compensator, several experiments are performed for the regulation [11], [12].A first set of experiments are performed using the proposed method which implements the control laws ( 13) and ( 14); these experiments are repeated using the dual PD controller without compensator, meaning   =   = 0 in ( 13) and (14).Finally, the proposed controller is compared with a fuzzy logic controller [18] using the same experiments.
Consider that the movement of the ball is slow and does not show tendency to slip (smooth bearing), due to the slow speed and acceleration of the plate; the interactions of the movements of the plate are uncoupled; the details of the performance are shown in Figures 4-6, where the position, velocity, and control signals are presented as the dual PD control with compensator, PD control without compensation, and fuzzy logic controller responses.
Figure 4 shows the position of the ball on the -axis; in this experiment the initial position is 0.02587 m and the final position is 0.4375 m, and it shows that the dual PD control  with compensator reaches the desired value faster than the other two methods.Figure 5 shows behavior of the velocity of the ball on the -axis; in this experiment the initial velocity is 0, and it shows that the dual PD control with compensator is stabilized faster than the other methods.Figure 6 shows behavior of the control signals on the -axis, where the dual PD control with compensator shows the best behavior.

Conclusions and Future Work
The dual PD control with nonlinear compensation has been presented to solve the regulation problem for the ball and plate system.To use these controllers, a new dynamic model in the manipulator robot form was obtained.The proposed nonlinear model is very useful to design and validate different control algorithms which can then be extrapolated to problems with the same characteristics; one advantage of working with a nonlinear model is that the full dynamic can be seen, making it possible to analyze the behavior of the system at each equilibrium point.By using the first method of Lyapunov, a new Lyapunov function is presented for the stability analysis; as a result of this analysis, the asymptotic stability of the closed-loop system can be guaranteed.On the order hand, the exact compensator requires to have a precise knowledge of the system nonlinearities; however, the methodology of how to obtain it is presented in detail.Furthermore, the experimental result shows the excellent performance of the proposed controller, obtaining the best behavior in comparison with the other selected controllers; see Figures 4, 5, and 6.As a future work, a PD regulator with an intelligent compensator will be developed [30][31][32][33].

A. Ball and Plate Model
Substituting ( 14) and ( 15) into (5), we have The inertia matrix () is where  1 = +(  / 2 ) and  2 = +(  / 2 ).The Coriolis matrix (, q ) is where ] . (A.5) The gravity matrix  is The compensator matrix  is Therefore the ball and plate system model can be described in the form (8).

Figure 1 :
Figure 1: Ball and plate system.

Figure 2 :
Figure 2: Control scheme of the ball and plate system.

Figure 4 :
Figure 4: Position of the ball on the -axis.

Figure 5 :
Figure 5: Velocity of the ball on the -axis.

Figure 6 :
Figure 6: Control of the ball on the -axis.