Simulation and Experimental Study of Ball Position Control at Biaxial Platform using State Space Approach

Ball on plate platform is a great tool for testing of various control techniques. This study provides a detailed design and comparison of three control structures for automatic stabilization of the ball´s location on plate and ball trajectory tracking. Namely PD controller, state space feedback and state space observer with state space feedback. All three methods are designed and practically compared. All structures have a common feature. It is the methodology for calculating the parameters of the controllers. Ball - on - plate mathematical model derived by Newton´s method and DC motor position loop control are also part of this article. 
For the authors of this article, this study is an opportunity to create an educative setup to explain the principles of basic control system for non - technical person and offers motivation to future students.


Introduction
In application practice, the properties of new control theories are often investigated at inverted pendulum. Balancing a ball of on two -axis platform is a variant of this testbed in which you can successfully find the limits and observe behavior of the control structure. Practical impact of these control structures is immense. Generally, in defense military technology such as camera stabilizations on moving vehicle or pointing camera angle control during drone flying are used. The same principle of operation like in this article is used for stabilizing platforms in sea ships and aircrafts. General idea is also used in high -end applications like vertical landing of space rockets. Bench -marking system consists of two DC machines connected with a long stick at moving platform. DC motors are controlled via standard full bridge topology. The processing unit is Kinetis K60 which is a novel digital signal controller designed for the automotive industry. The position of subject placed at plate is obtained from the resistive touch panel in terms of voltage drop. In some articles, the camera [1,2] is used to estimate the position of the globule. Optical detection requires heavy processing for position estimation. This method leads to huge computation power. Another approach is based on laser technology or basic sonar rangefinders. For stabilizing one degree of freedom applications gyro and accelerometers are used to measure system states [3]. Resistive touch surface excel over others due to its positive features. From the perspective of the automatic regulation conductive surface represents zero order transfer function. This means that the response will be recovered immediately without undesirable delay [4].

Ball on plate mathematical model
To be able to analyze the behavior of an ideal ball -and -plate balancing system it is necessary to create mathematical model and equivalent transfer function.
Our testbed is biaxial. It means that it has two degrees of freedom X and Y, and in a center is anchored on a rotating joint. The ball is stabilized and controlled to the demanded position through the movements of the plate, which are performed by two DC motors with permanent magnets. Each of the motors is responsible for the movements of the platform just in one axis. This is the reason why the same scheme is applied to both degrees of freedom Figure 1b).

SIMULATION AND EXPERIMENTAL
Substituting Equation (1) and Equation (5) into the Equation (6) leads to: After mathematical corrections of Equation (7) we can get the relationship between ball acceleration and sin(α). Due to sin function, nonlinear system model was created. In the area of angles up to ± 5° it is possible to neglected the influence of sin function and substitute expression sin(α) = α. By applying Laplace transformation, we can get transfer function of the ball on plate system. Relation between ball position x and inclination angle of the plate α is as follows: Where g is gravitational acceleration. Relation between motor arm angle and inclination angle of the plate: Our main goal during stabilizing platform is to ensure a stable objective position and to achieve position reference tracking. Active force in this task is gravity. The ball is capable of rolling on the beam under the action of gravity. Combination of gravitational force and inclination of plate leads to unstable position change in an open loop system. Root locus plot Figure  2b) explains instability of derivation transfer function Equation (8). Closer look for steady state shows us the behavior of the system under the following condition s = 0. When s approaches 0, the denominator of the transfer function approaches 0, but final value of Equation (8) approaches infinity Figure 2a). A well -known principle as the final value theorem applied at Equation (8), lead us directly to the reason for instability. The same theorem offers a huge space for feedback control by algorithms ensuring stability.

Many authors use Lagrange equations of second kind or
Euler -Lagrange equations for dynamical description of the ball on plate system [5]. It is universal method which is mostly used in mechanical engineering to derive dynamic motion equations. Number of generalized positions q i and velocities q o i depends on degrees of freedom of the system. It is more complex method, but for this application it is sufficient to use another approach based on the Newton's second law [6,7]. This method considers just the relation between the inclination angle of the plate and ball position, see Figure 1b). Friction is neglected.
Forces which affect the ball: F rx -rotational part and F tx -translational part of the force which affect the ball.
Translational part of the force depending on the ball's acceleration: Torque of rotational motion: Where ω x is angular velocity of the ball in X axis and J is its moment of inertia. Equation (2) leads to rotational part of the force which affect the ball: Moment of inertia of the sphere: Substituting Equation (4) into the Equation (3) we get rotational part of the force which affects the ball acceleration: For equilibrium state, the sum of the rotational and translational force component of the ball is equal to the force that moves it on the inclined plane downwards.
The resulting curve is decomposed by offline FFT and then compared with the original position loop bode plot Figure 4b). If the resulting frequencies are part of the position loop bandwidth, then trajectory will be followed without error.

Master control algorithm
The proposed testbed is controlled by the Kinetis K60 digital signal controller. K60 device detects five feedbacks. Voltage drop on resistive touch screen, two currents from hall effect sensors and pulses from two encoders. Each DC machine has its own full bridge topology of power supply converter integrated in BTN8982/86TA.

Stabilization design
The first experimentally verified structure is standard PD controller. By adding the PD controller (the green part of Figure  6a)), a stable structure is created to provide the both objectives. The transfer function Equation (11) of the whole structure was derived from the Masson's rule formula [8]. Parameters of PD controller K D , K P were determined by pole placement method. Equation

Position loop design
Angular position control with PI controllers was implemented in to Kinetis K60. The most important in this step is to ensure the prescribed behavior and set up correct dynamic response. Standard Dodd's formula was applied in prescribed band width finding [8] in combination with pole placement method. The results of this approach describe comparison between simulation and real measurement Figure 4.
Step response and bode plots for speed and position loop are shown below.
From a practical standpoint, knowing how the system responds to Heaviside step function is important because this concept shows us systems transient phenomenon. Fast and stable systems such as in Figure 3 and Figure 4 with settling time 0.05 sec are able to damp fast deviations. Bode plot analysis shows ability of the trajectory following. Any trajectory can be divided Step response of unstabilized system inclination angle = 5°

Figure 3 Axis inclination control via DC machine position loop
Where X is a matrix of state variables (ball position, ball velocity), A is a system matrix, B is a matrix of input variables, The second control algorithm is based on a full state feedback. A state variable is one of the variables used to describe ability to accumulate energy which is speed and position of the ball. The general equation of the linear system with the state feedback is Equation (12). After the following adjustment occurs Equation (13).

Figure 5 a) Block diagram of proposed structure; b) Final form of investigated testbed
To determine the properties of the proposed structure, dynamic error system is important. By subtracting the observer matrix from the whole system matrix for one axis, we obtain a dynamic error system Equation (18). When time groves to infinity the errors and their derivations are equal to 0.
The same approach for designing the parameters was used in all three stabilization techniques.
All techniques were set using pole placement method. Settling time resp., the bandwidth was chosen by Dodd's formula. In the Figure 7 [9] there is a comparison of stabilization structures, which were implemented on real platform Figure 5b). All three structures have the same settling time T sts =1sec. On the left side K R is a feedback gain matrix, K z is a compensatory input gain, and Ball_position_dem is demanded value of the ball's position at resistive surface. To determine dynamic properties of the proposed structure, eigenvalues placement of M CL are important. Due to the At this point, we are again using the final value theorem. There is a steady state error which will be compensated by the K z constant Equation (16).
The last structure uses speed feedback from the state space observer. In the previous structures, the speed was obtained by differentiation of position. For the last structure, the derivation was replaced by a more complex observer. State observer reconstructs state variables by using a mathematical model of a controlled system. Observer equations are created by adding Due to settling dynamics of the state space observer, the last structure shows the best results. The entire control diagram used for the testbed regulation is in the Figure 9b). The black part is position loop of DC machine. The blue belongs to the mathematical model of the ball at beam. The orange part represents the state space control low, and with purple color, the state space observer is highlighted. The two most important graphs are plotted for the analysis.
In step response, the initial intersection in the negative position is seen. This is mostly due to the mechanical backlash of the system. The following increase and settlement is in a very good ( Figure 8) accordance with the simulations of the structure in Figure 9b). Simulated and measured frequency characteristics are just as good as shown in Figure 8. The reference trajectory tracking is shown in Figure 9a). of Figure 7 there is stabilization on zero reference after deflection from the equilibrium position. At right side, there is stabilization from the rest position, to the new equilibrium position. Position loop of DC machine for one axis is shown below. The position of the ball is stable in all graphs at the desired value. The different situation can be seen in the position loop of DC machine for each axis. In the control structure with PD and full state feedback, there is visible noise in axis position loop. This is due to the computation method for the ball speed. The speed is here obtained by derivation of the measured ball position. This means that the noise from the touch screen sensing is also transmitted to the desired position value for the investigated axis. The position of the ball is stable, but the entire platform vibrates due to the noise amplified by derivative amplification. This negative property was removed in the third structure. A smooth change of both positions is ensured by the structure of the state observer. The observer has a smoothing effect, acting as a filter, but adds a delay to the whole control. In our case, the delay is negligible because the settling

Conclusion
We have developed control strategies for stabilizing a ball on a plate. The basic system in an open loop is unstable. With minor modifications after applying linearization strategy, the system provides stable behavior. Linearization of the system is valid in very narrow operating range. The proposed system is capable of satisfying both intended goals. The controller was able to track the ball to the reference trajectory points. The presentation of the