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

Authors: Nenad Muškinja; Matej Rižnar
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

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.


---

## Body

## 1. 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–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–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–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–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.


## 2. 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.Figure 1
Detailed description of the ball and beam system, from [1].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 positionX and beam angle α and was obtained as(1)Xsαs=5g7s2.Second transfer function describes the relation between motor voltage Vm and motor angle θ and was expressed as(2)θsVms=ngnmKtKgJeqRms2+BeqRm+ngnmKmKtKg2s.The relation between the motor angle θ and beam angle α was set as(3)αsθs=rL.Finally the open loop transfer function of the ball and beam system in terms of relation between ball position X and motor input voltage Vm incorporates all three separate transfer functions of the system elements into the form(4)XsVms=θsVmsαsθsXsαs.The parameters of the ball and beam model with their respective values are shown and described in Table 1.Table 1
Parameters of the model.
Symbol
Description
Value
K
t
Motor torque constant
0.00767
K
m
Back-emf constant
0.00767
K
g
Servo system gear ratio
70
R
m
Armature resistance
2.6
J
eq
Equivalent moment of inertia at the load
2.0
e
-
3
B
eq
Equivalent viscous damping coefficient
4.0
e
-
3
r
Lever arm offset (in.)
1
L
Beam length (in.)
16.75
g
Earth’s gravitational constant (m/s2)
9.8
n
g
Gearbox efficiency
0.9
n
m
Motor efficiency
0.36
X
Ball position
α
Beam pitch
θ
Servo load gear angle
V
m
Motor input voltage


## 3. 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 (Figure2).Figure 2
The PD cascaded controller.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 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–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 errorep, set as the difference between ball position set point xref and ball position x:(5)ep=xref-x.The second is ball velocity errorev, which combines the ball position error ep, multiplied with a proportional gain Kv, and ball velocity x˙, derived from ball position value measurement. Ball velocity error, which represents the input error value for the PID controller, is thus (6)ev=ep·Kv-x˙.The proposed PID controller, shown in Figure3, 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 u, which drives the servomotor.Figure 3
Proposed PID controller configuration.Control system from Figure3 can adequately be presented as shown in Figure 4, with Cs standing for PID controller transfer function and F(s) standing for ball and beam open loop transfer function. Main components of the proposed control system are inner velocity control loop V(s) and outer position control loop P(s).Figure 4
Proposed PID controller configuration, alternative scheme.The inner velocity control loopV(s) can be determined as(7)Vs=Cs·Fs·s1+Cs·Fs·s.Respectively, the outer position loop P(s), which incorporates the inner velocity loop, is thus determined as(8)Ps=Kv·Vs·1/s1+Kv·Vs·1/s=Vs1/Kvs+VsPs=11/Kv·Vss+1.In ideal control system setup, which would obtain a perfect ball velocity control, so the velocity loop V(s) would equal the value of 1, the position loop P(s) would take the form of a first order system, with time constant set as 1/Kv:(9)Ps=11/Kvs+1.Consequently the proportional gain Kv 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 ep·Kv 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 Kv 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.


## 4. 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–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, was already presented in Section 2. The PID controller used was a continuous time PID controller in parallel form:(10)PID=Kp+Kis+Kd·N1+N/s.On the controller we also applied an output saturation limitmax⁡, which was used for positive and negative, or -max⁡, output limits of the control value, voltage u. For optimization process, five parameters for the PID controller design were considered, with filter coefficient N 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.Table 2
PID controller parameters used in optimization experiments.
Symbol
Description
Value range
K
p
Proportional gain
0–20
K
i
Integral gain
0–20
K
d
Derivative gain
0–20
max
Output limit
0.01–10
K
v
Adjustment factor
0.01–10The 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 position control, meaning that the ball position error value is minimized towards the value of zero, the basic and commonly used IAE (integral of the absolute value of error) function was applied on the ball position errorep. Objective function for the first series of optimization experiments (OF1), which focused on the outer position loop of the control system, was therefore(11)OF1=∫eptdt=∫xreft-xtdt.In terms of the proposed PID controller configuration functionality, its focus could also be only the minimization of the ball velocity errorev. Because the input signal for the inner PID control loop already includes ball position error ep, we examined the effectiveness of the IAE based objective function for ball velocity error ev, 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 Kv. The second series of experiments therefore dealt with optimization of PID controller parameters with fixed values of the adjustment factor Kv, with objective function for second series of optimization experiments (OF2) being(12)OF2=∫evtdt=∫ept·Kv-x˙tdt.The control system for simulation experiments with connection to the differential evolution search algorithm is presented in Figure5, while a more detailed summary of the optimization algorithm is presented in Appendix.Figure 5
Control system setup with optimum search algorithm aided parameter design.


## 5. Simulation Experiments Results

### 5.1. Optimized PID Controller Configuration with Adjustable GainKv

First series of simulation experiments dealt with optimizing the proposed PID controller, focusing on the outer position loop, meaning that the ball position errorep 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.Table 3
Optimal PID controller parameters, obtained with objective function OF1.
PID controller parameters
K
p
9.645
K
i
0.000
K
d
8.622
max
10.0
K
v
1.106Figure 6
Ball position response with PID controller, obtained with objective function OF1.Figure 7
Output of the PID controller, obtained with objective function OF1.


### 5.2. Optimized PID Controller Configuration with Fixed Values of GainKv

Results in the first series of optimization experiments have shown that the optimal adjustment factorKv 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 ep·Kv. 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 Kv and second objective function OF2, which was the IAE based function applied on the ball velocity error ev, thus focusing on the inner velocity control loop. For this series, three optimization experiments were carried out, using three values of the adjustment factor Kv. 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 Kv 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. 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 Kv, are shown in Figure 8 with their controller output values shown in Figure 9, respectively.Table 4
Three optimal PID controller parameters obtained with objective function OF2 and fixed values ofKv.
PID controller parameters
K
p
1
20.0
K
i
1
0.052
K
d
1
12.279
max1
10.0
K
v
1
0.50
K
p
2
19.230
K
i
2
0.018
K
d
2
20.0
max2
10.0
K
v
2
1.106
K
p
3
15.863
K
i
3
0.025
K
d
3
20.0
max3
10.0
K
v
3
1.50Figure 8
Comparison of three ball position responses obtained with objective function OF2 and fixed values ofKv.Figure 9
Three PID controller output values obtained with objective function OF2 and fixed values ofKv.


### 5.3. 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 functionOF1 and other carried out with second objective function OF2, in which we set the adjustment factor Kv at the value of 1.106. This value for factor Kv 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 Kv set at 1.106. Figure 11 shows the comparison of controller output values for all three cases.Figure 10
Comparison of the ball position control.Figure 11
Comparison of the controller outputs.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, Figure12 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.Figure 12
Comparison of the ball velocity values.Analytical results for each of the optimization experiments, along with numerical comparison with results of the optimized PD cascaded controller, are shown in Table5. 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 Kv, as shown in Figure 8.Table 5
Comparison of optimization results with first objective function OF1 and second objective function OF2 with same value of adjustment factorKv.
OF1 result
OF2 result
Maximum overshoot
Settling time
Optimized PID controller with OF1
65.0428
51.4929
4.5%
4.6 s
Optimized PID controller with OF2 andKv = 1.106
72.7379
46.6159
0%
7.0 s
Optimized PD cascaded controller
/
/
6.04%
4.8 sRobustness 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 Figure10 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.Figure 13
Comparison of two ball position responses with additionally added 3% noise.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. Figure14 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.Figure 14
Comparison of two ball position responses with constructional changes in the model.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. Figure15 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.Figure 15
Comparison of two ball position responses with age defined changes in the model.


## 5.1. Optimized PID Controller Configuration with Adjustable GainKv

First series of simulation experiments dealt with optimizing the proposed PID controller, focusing on the outer position loop, meaning that the ball position errorep 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.Table 3
Optimal PID controller parameters, obtained with objective function OF1.
PID controller parameters
K
p
9.645
K
i
0.000
K
d
8.622
max
10.0
K
v
1.106Figure 6
Ball position response with PID controller, obtained with objective function OF1.Figure 7
Output of the PID controller, obtained with objective function OF1.


## 5.2. Optimized PID Controller Configuration with Fixed Values of GainKv

Results in the first series of optimization experiments have shown that the optimal adjustment factorKv 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 ep·Kv. 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 Kv and second objective function OF2, which was the IAE based function applied on the ball velocity error ev, thus focusing on the inner velocity control loop. For this series, three optimization experiments were carried out, using three values of the adjustment factor Kv. 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 Kv 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. 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 Kv, are shown in Figure 8 with their controller output values shown in Figure 9, respectively.Table 4
Three optimal PID controller parameters obtained with objective function OF2 and fixed values ofKv.
PID controller parameters
K
p
1
20.0
K
i
1
0.052
K
d
1
12.279
max1
10.0
K
v
1
0.50
K
p
2
19.230
K
i
2
0.018
K
d
2
20.0
max2
10.0
K
v
2
1.106
K
p
3
15.863
K
i
3
0.025
K
d
3
20.0
max3
10.0
K
v
3
1.50Figure 8
Comparison of three ball position responses obtained with objective function OF2 and fixed values ofKv.Figure 9
Three PID controller output values obtained with objective function OF2 and fixed values ofKv.


## 5.3. 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 functionOF1 and other carried out with second objective function OF2, in which we set the adjustment factor Kv at the value of 1.106. This value for factor Kv 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 Kv set at 1.106. Figure 11 shows the comparison of controller output values for all three cases.Figure 10
Comparison of the ball position control.Figure 11
Comparison of the controller outputs.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, Figure12 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.Figure 12
Comparison of the ball velocity values.Analytical results for each of the optimization experiments, along with numerical comparison with results of the optimized PD cascaded controller, are shown in Table5. 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 Kv, as shown in Figure 8.Table 5
Comparison of optimization results with first objective function OF1 and second objective function OF2 with same value of adjustment factorKv.
OF1 result
OF2 result
Maximum overshoot
Settling time
Optimized PID controller with OF1
65.0428
51.4929
4.5%
4.6 s
Optimized PID controller with OF2 andKv = 1.106
72.7379
46.6159
0%
7.0 s
Optimized PD cascaded controller
/
/
6.04%
4.8 sRobustness 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 Figure10 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.Figure 13
Comparison of two ball position responses with additionally added 3% noise.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. Figure14 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.Figure 14
Comparison of two ball position responses with constructional changes in the model.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. Figure15 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.Figure 15
Comparison of two ball position responses with age defined changes in the model.


## 6. 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.Figure 16
Ball and beam laboratory setup used in real time experiment.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 system states: ball position x, ball velocity x˙, and beam angle α. The fuzzy controller included a Kalman state observer for obtaining the values for ball velocity and beam angle states and was implemented in a MATLAB/Simulink environment and connected to the ball and beam system through a xPC Target interface. Figure 17 shows typical control results with such a control system.Figure 17
Ball position control on physical setup of ball and beam system with model based fuzzy control system.For the PID control system implementation we used an industrial Siemens S7315 PLC platform. The PID controller was realized in a discrete form with sample time ofTs=20ms, due to the limitations of AD/DA card. The output value CV(k) of the PID controller was based on ball velocity error ev(k) input value and determined as(13)CVk=Krevk-b1·evk-1+b0·evk-2CVk+CVk-1.While Kp, Ti, and Td represented proportional gain, integral time, and derivative time, respectively, the controller parameters Kr, b1, and b0 were set as(14)Kr=KpTsTi+TdTi+Ts2TsTi,b1=TsTi+2TdTiTsTi+TdTi+Ts2,b0=TdTiTsTi+TdTi+Ts2.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 Tp=0.035 and time constant for real differentiator for ball velocity set at Tv=0.03. Table 6 shows PID controller parameters configuration for presented real time experiment, which were obtained through trial and error approach.Table 6
Parameters for PID controller, used in real time experiment.
PID controller parameters
K
p
12
T
i
1.5
T
d
0.45
max
10
K
v
1.0Figure18 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.Figure 18
Ball position control on physical setup of ball and beam system with proposed PID controller configuration.


## 7. 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 factorKv 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.



---

*Source: 796057-2015-03-04.xml*