Optimized PID Position Control of a Nonlinear System Based on Correlating the Velocity with Position Error

We examined a design approach for a PID controller for a nonlinear ball and beam system. Main objective of our research was to establish a nonmodel based control system, which would also not be dependent on a specific ball and beam hardware setup. The proposed PID controller setup is based on a cascaded configuration of an inner PID ball velocity control loop and an outer proportional ball position control loop. The effectiveness of the proposed controller setup was first presented in simulation environment in comparison to a hardware dependent PD cascaded controller, along with a more comprehensive study on possible design approach for optimal PID controller parameters in relation to main functionality of the controller setup. Experimental real time control results were then obtained on a laboratory setup of the ball and beam system on which PD cascaded controller could not be applied without parallel system model processing.


Introduction
Balance control for the ball and beam type experiment is widely considered a difficult problem for control systems design and application, due to its high level of nonlinearity and instability.Although there are few variations of the ball and beam system hardware setup [1][2][3], the basic system dynamics and control principle is common to all of them: a ball is positioned on a beam, on which it can move in two directions from the beam center, left and right, or positive and negative.The beam is connected to a voltage driven servomotor that determines the rotation of the beam and consequently the movement and positioning of the ball.
Ball and beam control experiment serves as a benchmark type engineering problem for various controller designs [1][2][3][4][5][6][7][8][9][10][11][12], which can be divided into two main groups, in terms of controlled system modeling and identification requirements: model based and nonmodel based control systems.Model based control systems require and incorporate controlled system states, which cannot be measured directly and are therefore gained through parallel system model processing, while nonmodel based control systems rely on the available real time sensors output data.Our previous research dealt with model based control design [3], which included a Kalman state observer.From experience, the main problem of model based control design is in its dependency on the quality of the model that is incorporated into a state observer.Because all the factors that determine the nonlinear dynamics of the physical system cannot be included in the system model, a model based control is losing its effectiveness with time through changes in physical setup of the system or wear and tear.
Another distinction between various controller designs is based on physical specification of the ball and beam system, on which some the nonmodel based control designs rely on.Primary example of such a controller setup is the PD cascaded controller [1,2,[4][5][6][7], which relies on the specific hardware configuration of the system that enables the measurement of the beam angle value through a gear system, mounted on the servomotor.This control setup typically uses two PD controllers in a cascade configuration, with first or outer ball position error loop and second or inner motor angle error loop.Related work on this control setup incorporates different types of PD cascaded controller realization and design, such as fuzzy PD cascade [1], optimum search algorithm aided design [1,9], and analytical controller design [10][11][12].
Because for its implementation the servomotor must be combined with a gear and encoder system, which enables a direct measurement of the motor angle value, this controller setup cannot be applied on a physical setup without motor angle measurement, unless with added parallel model processing.
The main objective of this presented study was therefore to design and implement a nonmodel based controller design that would also be independent of the ball and beam hardware setup, which would allow its implementation on all types of physical setup of the ball and beam system.So instead of a PD cascaded controller setup, which incorporates ball position and motor angle states, we tested a cascaded controller with outer ball position and inner ball velocity control loops.While the inner ball velocity control loop consists of a PID controller, the outer ball position control loop uses only a proportional gain to determine a set value for the inner ball velocity control loop.Presented controller setup was first compared to a PD cascaded controller from other researches in a simulation environment, with focus on establishing an optimal controller design approach, based on its functionality and presented analytical implications of the proposed controller configuration.Simulation control results were based on differential evolution optimum search algorithm aided design, with more detailed description of the optimization algorithm presented in Appendix.The linear model of ball and beam system, used for simulation experiments, was in detail presented in [1], which also includes relevant control results for comparison between PD cascaded controller and proposed PID controller setup.
For real time experimental results, we applied the proposed PID controller setup on our laboratory ball and beam system [3], which differs from the system, on which the simulation model was based.The successful implementation of our proposed controller setup showed that our main objective of a controller design, which does not rely on parallel model processing or specific system hardware configuration, was met.

Model of the Ball and Beam System
As already established, the model of the ball and beam system, used for simulation experiments, is in detail presented in [1].One of the key characteristics of this model, as mentioned in [1], is that the ball velocity and acceleration are difficult to control directly, which makes it suitable for testing of our proposed controller setup.Figure 1 shows the physical setup of the ball and beam system.
Nonlinear dynamics of the ball and beam system was simplified into a linear model with three separate transfer functions.First transfer function represents the relation between ball position  and beam angle  and was obtained as Second transfer function describes the relation between motor voltage   and motor angle  and was expressed as The relation between the motor angle  and beam angle  was set as Finally the open loop transfer function of the ball and beam system in terms of relation between ball position  and motor input voltage   incorporates all three separate transfer functions of the system elements into the form The parameters of the ball and beam model with their respective values are shown and described in Table 1.

Controller Setup
The main reference for our proposed controller setup was the PD cascaded controller, which incorporates two of the system states, ball position and motor angle.It consists of two control loops, with first or outer ball position loop and second or inner motor angle loop (Figure 2).For the PD cascaded controller to function as a nonmodel based controller, it requires a direct measurement of the motor angle state, which relies on the specific motor gear physical setup.Because our research focused on designing a nonmodel based controller, which would allow its implementation on other hardware type setups of the ball and beam system, this solution could not be considered final and adequate.The PD cascaded controller setup however shows that it is possible to design a nonmodel based control system based on two of the system states.From that, the two considered system states for our proposed PID type controller in this study were ball position and ball velocity.
The main objective of any controller setup for ball and beam problem is ball position control.In terms of movement of the ball, this regulation task is achieved when both the ball position error and ball velocity state values equal zero, which means that the ball is positioned on the desired location on the beam, with no movement of the ball in either direction of the beam.A stable system response is achieved, when  Motor input voltage the ball velocity is kept within certain limits [3] and when its value is minimized as the ball is in the near proximity of the position set point.From that the proposed controller design was based on dynamic relation between the ball position error and ball velocity values.Because one of the goals of this controller design was the control of the ball velocity in relation to the ball position error value, we used a negative ball velocity feedback.The additional negative feedback of the first derivative of the main controlled system state is normally used in terms of improvement of controlled system dynamics by increasing damping ratio for removal of vibrations, oscillations and overshoot reduction, with main benefits in improved motion stabilization and control [13][14][15][16][17][18][19][20][21].
The basic principle behind the proposed PID controller configuration is to achieve ball position control through correlating the ball velocity to the ball position error value, which is multiplied with a constant value, meaning that in each moment the desired ball velocity is determined by the current ball position error value.The PID controller is thus using the velocity set point value, which is proportional to the position error value, for ball motion control.This is achieved through acceleration of the ball towards the position set point, based on the positive or negative ball position error value.The movement of the ball is then gradually stopped as it is approaching the position set point, lowering the ball position error value and consequently the set point value for the ball velocity.
Proposed PID controller setup incorporates two controlled system values, which are to be regulated to the required value of zero.First is the ball position error   , set as the difference between ball position set point  ref and ball position : The second is ball velocity error  V , which combines the ball position error   , multiplied with a proportional gain  V , and ball velocity ẋ , derived from ball position value measurement.Ball velocity error, which represents the input error value for the PID controller, is thus The proposed PID controller, shown in Figure 3, is therefore a velocity controller with proportional position error for the velocity set point, which in return achieves position control of the ball.Output value of the PID controller is voltage , which drives the servomotor.
Control system from Figure 3 can adequately be presented as shown in Figure 4, with () standing for PID controller transfer function and () standing for ball and beam open loop transfer function.Main components of the proposed control system are inner velocity control loop () and outer position control loop ().
The inner velocity control loop () can be determined as Respectively, the outer position loop (), which incorporates the inner velocity loop, is thus determined as In ideal control system setup, which would obtain a perfect ball velocity control, so the velocity loop () would equal the value of 1, the position loop () would take the form of a first order system, with time constant set as 1/ V : Consequently the proportional gain  V can be presented as an adjustment factor with a physical unit of second −1 , which determines the ideal ball position response.The product of ball position error and adjustment factor   ⋅  V determines a desired ball velocity value, which is used for PID controller set point value.As dictated by ( 8) and ( 9), the value of the adjustment factor  V can determine the response dynamics of closed loop system from Figures 3 and 4, with condition that the inner ball velocity controller parameters are set to optimal values.

Simulation Experiments Setup
Because an analytical design method for optimal PID controller in presented configuration is not yet established, we applied the differential evolution global optimum search algorithm [22][23][24][25] for optimal controller design in simulation environment, using optimization criteria based on desired system response characteristics and presented controller functionality.In simulation control experiments, three key elements of the system were combined: model of the ball and beam system, PID controller, and differential evolution search algorithm.The model, used in following experiments, On the controller we also applied an output saturation limit max, which was used for positive and negative, or (−) max, output limits of the control value, voltage .For optimization process, five parameters for the PID controller design were considered, with filter coefficient  of the controller being set at value of 100 for all of the experiments.The parameters of the PID controller with their respective value range, used in optimization process, are shown in Table 2.
The optimization objective function, which was to be minimized with differential evolution search algorithm in each of the experiments, was designed in relation of desired system response and the functionality of the proposed PID controller configuration.Because the purpose of the controller in terms of system response is to achieve optimal ball In terms of the proposed PID controller configuration functionality, its focus could also be only the minimization of the ball velocity error  V .Because the input signal for the inner PID control loop already includes ball position error   , we examined the effectiveness of the IAE based objective function for ball velocity error  V , thus focusing only on the inner velocity loop of the control system.As established in Section 3 and shown later on, the ball position response dynamics is in this case however also determined by the selected value of proportional gain  V .The second series of experiments therefore dealt with optimization of PID controller parameters with fixed values of the adjustment factor  V , with objective function for second series of optimization experiments (OF2) being The control system for simulation experiments with connection to the differential evolution search algorithm is presented in Figure 5, while a more detailed summary of the optimization algorithm is presented in Appendix.

Optimized PID Controller Configuration with Adjustable
Gain  V .First series of simulation experiments dealt with optimizing the proposed PID controller, focusing on the outer position loop, meaning that the ball position error   would be minimized towards the value of zero.So in this case, we used the first IAE based objective function OF1, applied on ball position error.Results for this optimization process were obtained, PID controller parameters, shown in Table 3. Figures 6 and 7 show the obtained ball position response and output value of the PID controller, respectively.experiments have shown that the optimal adjustment factor  V value was determined at 1.106.However, the first series of experiments used the first objective function OF1, which focused on the outer position loop and thus did not take into account the principal functionality of the proposed PID controller configuration, which is to directly correlate the ball velocity with proportional ball position error   ⋅  V .For that reason, the second series of experiments dealt with optimization of presented PID controller setup, using fixed values of the proportional gain or adjustment factor  V and second objective function OF2, which was the IAE based function applied on the ball velocity error  V , thus focusing on the inner velocity control loop.For this series, three optimization experiments were carried out, using three values of the adjustment factor  V .Because this factor determines the ball position response dynamics as established in Section 3, its lower values would determine slower ball position response and higher values faster ball position response.For that reason the three values of parameter  V were set at 1.106, which was the optimal value from the first optimization experiment, with lower value at 0.5 and higher value at 1.5.

Optimized PID Controller Configuration with
Results for three optimal PID controllers for this series of experiments are shown in Table 4. Comparisons of three obtained ball position responses, each for a different value of parameter  V , are shown in Figure 8 with their controller output values shown in Figure 9, respectively.

Analysis and Comparison of Optimization Results
. Comparison of optimization results, obtained in simulation experiments, was carried out on two levels.First we compared the control results of the proposed PID controller configuration with those of the optimized PD cascaded controller setup, presented in [1].Respectively, we compared the control results of presented PID controller configuration, optimized with both objective functions, OF1 and OF2.The purpose of the first comparison was to demonstrate effectiveness of our proposed nonmodel based, hardware  independent control solution for the ball and beam system to a nonmodel based, hardware dependent controller setup in the PD cascaded controller.The purpose of the second comparison was to establish a useful background for future research in analytical design approach for the proposed PID controller setup.So in this case, we compared the results of two optimization experiments, one carried out with first objective function OF1 and other carried out with second objective function OF2, in which we set the adjustment factor  V at the value of 1.106.This value for factor  V was, as previous results show, obtained as one of the optimal PID controller parameters in the first optimization experiment and was therefore used for comparison of effectiveness of different optimization criteria, with first focusing on main control problem, which was ball position control and second focusing on the inner ball velocity control loop in relation to the functionality of the controller configuration, presented in Section 3. Figure 10 shows the optimized PD cascaded control results, along with both control results for the proposed PID controller, in first case as the result with optimization of first objective function OF1, which focused on the outer position loop, and in second case as the result of optimization with second objective function OF2, which focused on the inner velocity loop, with value of the adjustment factor  V set at 1.106.Figure 11 shows the comparison of controller output values for all three cases.
Because the proposed PID controller configuration functions as a ball velocity controller, which achieves position control through correlation of ball velocity with proportional ball position error, the ball velocity response presents a significant characteristic of the system response.For that reason, Figure 12 shows the ball velocity responses, for the optimized PD cascaded controller and for each objective function used for optimization of the proposed PID controller configuration.
Analytical results for each of the optimization experiments, along with numerical comparison with results of the optimized PD cascaded controller, are shown in Table 5.As expected, first experiment result obtained lower value for objective function OF1, and second experiment lower value for objective function OF2, which meant that the PID controller, optimized with first objective function, obtained better results for ball position error based objective function, and PID controller, optimized with second objective function, obtained better results for ball velocity error based objective function.For ball position responses, shown in Figure 10, this difference is reflected in faster response for PID controller, optimized with first objective function, which also includes overshoot.For PID controller, optimized with second objective function, better correlation of ball velocity with position error meant slower ball position response with zero overshoot.In comparison with results of the optimized PD cascaded controller, two system response parameters were considered.First was the maximum overshoot, and second the settling time.In terms of those two response parameters, the first optimized PID controller achieved similar results as the PD cascaded controller, while the second optimized PID controller was characterized with a longer settling time and zero value of overshoot.However, the settling time for this controller can be additionally lowered by using a higher value of adjustment factor  V , as shown in Figure 8.
Robustness of both optimized PID controller results was in simulation environment examined in three separate experiments, which tested the controller's capability to cope with different scenarios, which were not considered in the optimization process.Therefore results on Figure 10 were considered the reference for these experiments results.Because both the optimization results were obtained on a model of the ball and beam system with no measurement noise on the ball position and ball velocity signals, the first experiment dealt with controller's capability of compensating noise on those values.Figure 13 shows the obtained ball position response with two optimized PID controllers obtained with both objective functions, with additionally added 3% noise on the ball position and ball velocity signals.As the figure shows, the PID controller, which focused on the inner velocity loop and was thus optimized with ball velocity error based objective function, achieved better ball position control than the PID controller, which focused on the outer position loop and was therefore optimized with ball position error based objective function.From that we can assume that the ball velocity error based optimization results are less sensitive to additional noise on the required system states signals.
Second experiment examined the controller's capability to cope with changes in the structure of the model of the ball and beam system.For this experiment the lever arm offset on the ball and beam configuration was reduced from 1 inch to 0.8 inch.Figure 14 shows ball position responses, with noticeable change in the ball position response of the PID controller, optimized with the first objective function.Like in the first experiment, the ball velocity error based optimization has shown to be less sensitive to additional changes in the ball and beam model structure.
Third experiment dealt with age or ware-and-tear based changes in the ball and beam system structure.Therefore for the third experiment we lowered both gearbox efficiency and motor efficiency parameters of the model by 20%.Gearbox efficiency was lowered from the value 0.9 to the value of 0.72, while the value of motor efficiency was lowered from 0.36 to 0.288.Figure 15 shows ball position responses in for such scenario.Again the ball velocity error based optimization results proved to be better, as it showed no significant changes in the ball position response.

Real Time Experimental Results
The additional objective in our attempt to design and implement a nonmodel based controller for ball and beam system was that the designed controller setup would also be independent of the specific hardware setup of the ball and beam system.As the PD cascaded controller relies on the encoder on the gear system of the servomotor, which enables the measurement of the beam angle, such a controller could not be applied on our laboratory setup of the ball and beam system [3], due to the absence of such an encoder hardware setup.PD cascaded controller could be only implemented with the aid of a state observer, thus being a model based controller.Real time experiments, presented in this section, therefore serve as a demonstration of effectiveness of proposed PID controller configuration with outer position and inner velocity control loops.The experiment on laboratory physical setup was applied on a ball and beam system configuration, presented in [3] and shown in Figure 16.
For comparison the results from our previous research on the same laboratory physical setup of the ball and beam system were considered.The reference controller setup was a model based fuzzy controller [3], which was based on three While   ,   , and   represented proportional gain, integral time, and derivative time, respectively, the controller parameters   , 1, and 0 were set as For controller output signal, saturation limit max was used, same as in the simulation experiments.Filter and real differentiator [3] were used for filtering ball position and gaining ball velocity values, with time constant for ball position filter set at   = 0.035 and time constant for real differentiator for ball velocity set at  V = 0.03.Table 6 shows PID controller parameters configuration for presented real time experiment, which were obtained through trial and error approach.
Figure 18 shows ball position response on our laboratory setup of ball and beam system, using presented PID controller setup with filter and real differentiator.As shown, the presented PID controller configuration achieved effective ball position control, although the PID controller parameters were not considered optimal, due to trial and error design approach.When compared to the fuzzy control system results in Figure 17, the obtained results with the presented PID controller proved to be better in terms of overshoot and steady state error reduction.

Conclusion
In this study, a nonmodel based and hardware independent control system for ball and beam type engineering problem was presented.Focus of this research was to implement and test a cascaded PID controller configuration with outer proportional ball position and inner PID ball velocity control loops.Effectiveness of such a controller setup was first successfully demonstrated in simulation environment in comparison to hardware dependent PD cascaded controller from other researches, along with a study of possible controller design approach for future research, based on comparing the results of optimization aided controller design with two objective functions, each focusing on one of the desired effects of the proposed controller setup.Secondly the control results on a real time laboratory ball and beam system were presented, with control system implemented on an industrial PLC platform.
As multiple control results have shown, the presented controller setup achieved successful ball position control in both optimization experiments, with specific differences in system response, which should be considered in future research.Because this controller setup achieved ball position control through direct control of its first derivative or ball velocity, an analytical approach to controller design could be simplified.While the value of the adjustment factor  V determines the ideal dynamics of the ball position response, optimization of only the inner velocity control loop is required.The proposed PID controller configuration is thus a nonmodel based hardware independent control system, used for successful control of a highly unstable ball and beam process.Structure of the proposed controller configuration allows a quick and simple implementation on industrial PLC platforms, which was successfully demonstrated in a real time control experiment in the last section.Future research of such a controller design can also be focused on implementation on other types of nonlinear control problems, as the basic principal of the controller promises a wider range of control applications.

Figure 1 :
Figure 1: Detailed description of the ball and beam system, from [1].
Fixed Values of Gain  V .Results in the first series of optimization

Figure 5 :Figure 6 :Figure 7 :
Figure 5: Control system setup with optimum search algorithm aided parameter design.

Figure 8 :Figure 9 :Figure 10 :
Figure 8: Comparison of three ball position responses obtained with objective function OF2 and fixed values of  V .

Figure 13 :Figure 14 :
Figure 13: Comparison of two ball position responses with additionally added 3% noise.

Figure 15 :
Figure 15: Comparison of two ball position responses with age defined changes in the model.

Figure 17 :Figure 18 :
Figure 17: Ball position control on physical setup of ball and beam system with model based fuzzy control system.

Table 1 :
Parameters of the model.

Table 2 :
PID controller parameters used in optimization experiments.
was already presented in Section 2. The PID controller used was a continuous time PID controller in parallel form:

Table 3 :
Optimal PID controller parameters, obtained with objective function OF1.

Table 4 :
Three optimal PID controller parameters obtained with objective function OF2 and fixed values of  V .

Table 5 :
Comparison of optimization results with first objective function OF1 and second objective function OF2 with same value of adjustment factor  V .

Table 6 :
Parameters for PID controller, used in real time experiment.
Figure 16: Ball and beam laboratory setup used in real time experiment.