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

Authors: Sergio Galvan-Colmenares; Marco A. Moreno-Armendáriz; José de Jesús Rubio; Floriberto Ortíz-Rodriguez; Wen Yu; Carlos F. Aguilar-Ibáñez
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

The normal proportional derivative (PD) control is modified to a new dual form for the regulation of a ball and plate system. First, to analyze this controller, a novel complete nonlinear model of the ball and plate system is obtained. Second, an asymptotic stable dual PD control with a nonlinear compensation is developed. Finally, the experimental results of ball and plate system are provided to verify the effectiveness of the proposed methodology.


---

## Body

## 1. 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.Ball and plate system.
(a)
(b)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–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 switching-driving 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];(2)
nonlinear controllers for ball and plate system have good theory results; nevertheless, they are complex and rarely used in real applications [15].In this paper, a novel dual PD control for the ball and plate system is presented. Continuing with the previous results of this research group, on the ball and beam system with two degrees of freedom of [17], a new ball and plate is assembled in [18] to reach the objective of this research. This prototype fulfills the requirements of a real-time control via an embedded system designed by minimal resources. To analyze the closed-loop system (see Figure 2), a new dynamic model of the ball and plate is obtained; therefore, a stability analysis using this novel nonlinear model is developed. To the best of our knowledge, this kind of analysis has not yet been established in the literature. Finally, experimental results are performed to evaluate the theory results.Figure 2
Control scheme of the ball and plate system.This paper is organized as follows. In Section2, the ball and plate dynamic model is introduced. Section 3 introduces dual PD control. In Section 4, the stability analysis of the proposed controller is considered. Ball and beam prototype is shown in Section 5. In Section 6, experimental results of three controllers applied to the ball and beam system are shown. Section 7 presents conclusions and suggests future research directions.


## 2. Ball and Plate System

The new ball and plate system is shown in Figure1. 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 θx and θy, which at the same time cause a variation of position of the ball in (x,y) 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(1)Ec=12mvcdm2+12Icdmw2=12m(x˙2+y˙2)+12m(xθ˙x+yθ˙y)2+12Icdm(x˙2+y˙2R)+12Icdm(θ˙x2+θ˙y2),
where Ec is the kinetic energy of the ball; m is the mass of the ball; Icdm is the inertia moment of the ball; R is the radio of the ball; x˙2+y˙2 is the linear velocity of the ball; x and y are the position of the ball on plate; θx and θy are the angular position of the plate; w is the angular velocity of the ball; and θ˙x2+θ˙y2 is the angular velocity of the plate.On the other hand, potential energy of the ball due to the gravity is given by(2)Ep=mG(xsin(θx)+ysin(θy)),
where Ep is the potential energy of the ball and G is the acceleration due to gravity.From (1) and (2), the Lagrange equation is
(3)L=12m(x˙2+y˙2)+12m(xθ˙x+yθ˙y)2+12Icdm(x˙2+y˙2R)+12Icdm(θ˙x2+θ˙y2)-mG(xsin(θx)+ysin(θy)).Lagrange’s equations of motion are(4)∂∂t[∂L∂x˙]-∂L∂x=0,∂∂t[∂L∂θ˙x]-∂L∂θx=τx,∂∂t[∂L∂y˙]-∂L∂y=0,∂∂t[∂L∂θ˙y]-∂L∂θy=τy,
where τx and τy are the torque applied to the plate. Developing (4) gives the whole ball and plate system as follows:
(5)(m+IcdmR2)x¨-mxθ˙x2-myθ˙xθ˙y+mGsinθx=0(Icdm+mx2)θ¨x+2mxx˙θ˙x+mxyθ¨y+(mxy˙+mx˙y)θ˙y+mGxcos⁡θx=τx(m+IcdmR2)y¨-myθ˙y2-mxθ˙xθ˙y+mGsinθy=0(Icdm+my2)θ¨y+2myy˙θ˙y+mxyθ¨x+(mxy˙+mx˙y)θ˙x+mGycos⁡θy=τy.
Define the system state as follows:
(6)q=[xθxyθy]T.
Define the regulation errors as follows:
(7)x-=x*-x,y-=y*-y,
where x* and y* are the desired ball position. For the ball and plate system, in the balance position θx*=0, θy*=0, x˙*=0, and y˙*=0, then q*=[x*0y*0]T.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.Lemma 1.
The ball and plate closed-loop system (5) can be transformed into the following form:
(8)M(q)q¨+C(q,q˙)q˙+G(q)=Bq¯+Dπ,
where q¯=q*-q, q is defined in (6), and q* is defined in (7).Proof.
See AppendixA for the proof.


## 3. 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(x,y). Initially, the plate is at the horizontal, that is, θx=θy=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. Figure2 shows a diagram of this controller scheme.The dual PD control law of thex-axis is as follows:
(9)Ux=kpmx(θx*-θx)+kdmx(θ˙x*-θ˙x)+πx,θx*=kpex(x*-x)+kdex(x˙*-x˙).The dual PD control law of they-axis is as follows:
(10)Uy=kpmy(θy*-θy)+kdmy(θ˙y*-θ˙y)+πy,θy*=kpey(y*-y)+kdey(y˙*-y˙),
where kpmx, kdmx and kpmy, kdmy are positive constants of the controllers of the plate and kpex, kdex and kpey, kdey are constants of controllers of the ball. πx and πy 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(x˙*,y˙*), being denoted by (x˙*,y˙*)=(0,0); therefore, the dual PD controllers become
(11)Ux=kpmx[(kpex(x*-x)+kdex(x˙*-x˙))-θx]+kdmx(θ˙x*-θ˙x)+πx,Uy=kpmy[(kpey(y*-y)+kdey(y˙*-y˙))-θy]+kdmy(θ˙y*-θ˙y)+πy
or
(12)Ux=kpmxkpexx¯-(kpmx+kdmx)kdexx˙-kdmxkdexx¨-kpmxθx-kdmxθ˙x+πx,(13)Uy=kpmykpeyy¯-(kpmy+kdmy)kdeyy˙-kdmykdeyy¨-kpmyθy-kdmyθ˙y+πy.Ifa1=kpmxkpex, a2=(kpmx+kkdmx)kdex, a3=kdmxkdex, a4=kpmx, a5=kdmx, b1=kpmykpey, b2=(kpmy+kkdmy)kdey, b3=kdmykdey, b4=kpmy, and b5=kdmy, Ux and Uy can be written as follows:
(14)Ux=-a1x¯-a2x˙-a3x¨-a4θx-a5θ˙x+πx,(15)Uy=-b1y¯-b2y˙-b3y¨-b4θy-b5θ˙y+πy.


## 4. 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 matricesM and B may be candidates for Lyapunov function. The matrix M is not symmetric to prove that the function is positive; that is, each main minor determinate is computed. If the constants m>0, R>0, Icdm>0, and M is a square matrix, then
(16)Det(1,1)=m+1R2Icdm>0,Det(2,2)=1R2(R2m2x2+R2mIcdm+mx2Icdm+Icdm2)>0,Det(3,3)=1R4(R4m3x2+R4m2Icdm+2R2m2x2Icdmaa+2R2mIcdm2+mx2Icdm2+Icdm3)>0,Det(4,4)=1R4(R4m3x2Icdm+R4m3y2Icdm+R4m2Icdm2+2R2m2x2Icdm2+2R2m2y2Icdm2+2R2mIcdm3+mx2Icdm3+my2Icdm3+Icdm4)>0.Position of the ball is(x,y)>0; therefore, the matrix M that satisfies all determinants of the main minors (16) are positive; then, M is a positive definite matrix that satisfies
(17)V(0)=q˙TM(q)q˙=0,V(q)=q˙TM(q)q˙>0.The matrixB is not symmetric to prove that the function is positive and the calculation of quadratic form is determined. Consider
(18)q¯TBq¯=a4θx2+xa1θx+b4θy2+yb1θy.The position of the plate is(θx,θy)>0, and the constants are a4>0, a1>0, b4>0, b1>0. If B is a square matrix (A.5), then the quadratic form satisfies
(19)V(0)=q¯TBq¯=0,V(q)=q¯TBq¯>0.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 πx and πy as follows(20)πx={a2x˙-mxθ˙x+mxx˙θ˙x-mxθ˙y+myx˙θ˙yifx˙≠0-mxθ˙x-mxθ˙yifx˙=0πy={b2y˙-myθ˙y+myy˙θ˙y-myθ˙x+mxy˙θ˙xify˙≠0-myθ˙y-myθ˙xify˙=0.
Therefore, the closed-loop system of the ball and plate system is asymptotically stable
(21)lim⁡t→∞x-(t)=0,lim⁡t→∞y-(t)=0.Proof.
SinceM(x) is a positive definite matrix, B in (18) is a quadratic form, and recalling that θx and θy are not negative, the following positive definite quadratic form is used as the Lyapunov function:
(22)V(q,q˙)=12q˙TM(q)q˙+12q¯TBq¯+mGxsinθx+mGysinθy.
To assure the potential energy Ep=mG(xsin(θx)+ysin(θy)) is positive, we let θx≥0 and θy≥0, V(x,x˙)≥0. Differentiating it with respect to time and recalling that x* and y* are constants, it yields
(23)dV=q˙TM(q)q¨+12q˙TM˙(q)q˙-q˙TBq¯+mGx˙sinθx+mGxcos⁡θxθ˙x+mGy˙sinθy+mGycos⁡θyθ˙y.
It is (see Appendix B)
(24)dV=-a5θ˙x2+θ˙x[πx-a2x˙+mxθ˙x-mxx˙θ˙x]+θ˙x[+mxθ˙y-myx˙θ˙y-mGxcos⁡θx+mGxcos⁡θx]-mx˙Gsinθx+mGx˙sinθx-b5θ˙y2+θ˙y[πy-b2y˙+myθ˙y-myy˙θ˙y+myθ˙x-mxy˙]+θ˙y[-mGycos⁡θy+mGycos⁡θy]-my˙Gsinθy+mGy˙sin(θy).
Using the compensators (20) in (24) gives
(25)dV≤-a5θ˙x2-b5θ˙y2.
Since a5>0 and b5>0, dV is a semidefinite negative function. Thus, the closed-loop system is stable in the equilibrium point [x˙,y˙]=[0,0]. To prove asymptotic stability, LaSalle’s theorem is used in the following region:
(26)Ω={[x,θx,y,θy]∣dV=0}.
From (22), dV=0 if and only if θ˙x=θ˙y=0. For a solution θx,y(t) to belong to Ω for all t≥0, it is necessary and sufficient that θx=θy=0 for all t≥0. Therefore it must also hold that x=y=0 for all t≥0. It is concluded that the closed-loop system is the only initial condition in Ω for which x(t)∈Ω for all t≥0. Finally, the origin of the closed-loop system is asymptotically stable in [x,θx,y,θy]=[0,0,0,0] [6–10].Remark 3.
In [22–26], the authors use proportional-integral-derivative controllers; nevertheless, the proposed controller is different because it has 4 dynamic alternatives being selected by the controller depending on the x and y 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.


## 5. Prototype

Figure3 shows the prototype used to test the new dual PD controller. Simulink is used to test the model (8); consider M=0.11 kg, R=1.27 cm, and G=9.81 m/s2. 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 (x,y) 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 x and y 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 real-time 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.Figure 3
Ball and plate prototype.


## 6. 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 πx=πy=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 Figures4–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
Position of the ball on thex-axis.Figure 5
Velocity of the ball on thex-axis.Figure 6
Control of the ball on thex-axis.Figure4 shows the position of the ball on the x-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 x-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 x-axis, where the dual PD control with compensator shows the best behavior.


## 7. 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 Figures4, 5, and 6. As a future work, a PD regulator with an intelligent compensator will be developed [30–33].



---

*Source: 894209-2014-04-16.xml*