Open access peer-reviewed chapter

Performance Comparison of the Ball and Beam System using Linear Quadratic Regulator Controller

Written By

Abubakar Umar, Muhammed B. Mu’azu, Zaharuddeen Haruna, Ore-Ofe Ajayi, Nafisa S. Usman, Onoshoho J. Oghenetega and Abdulfatai D. Adekale

Submitted: 14 January 2023 Reviewed: 13 February 2023 Published: 11 March 2023

DOI: 10.5772/intechopen.110513

From the Edited Volume

PID Control for Linear and Nonlinear Industrial Processes

Edited by Mohammad Shamsuzzoha and G. Lloyds Raja

Chapter metrics overview

116 Chapter Downloads

View Full Metrics

Abstract

This paper proposes the performance comparison of a linear quadratic regulator (LQR) controller for the ball and beam system (BBS). The BBS is a standard benchmark control system, which has two degree-of-freedom (2 DOF). It is an open loop and a highly nonlinear unstable system. This makes its parameter difficult to be estimated accurately, hence designing a controller for it is a challenging task. MatheThe BBS was modelled using Euler–Lagrange modeling technique, while the LQR controller was used for the stabilization of the ball on the beam. Simulation was done in MATLAB/Simulink 2022b environment, and the results simulated showed that for the two weighting matrices (QandR), the state weighting matrix had a higher penalty on the ball displacement, ball velocity, beam angle, and beam angular velocity at lower values of Q. For the state weighting matrix had a better effect of penalty performance on the BBS with lower values. Also, as the diagonal element of the state weighting matrix Q increases from 0.1 to 20, the values of the optimal controller K increase, the reduced Ricatti matrix P increases, and the estimated eigenvalues E reduce. This implies that the ball displacement, ball velocity, beam angle, and beam angular velocity are better at lower values of Q.

Keywords

  • ball and beam system (BBS)
  • linear quadratic regulator (LQR)
  • weighting matrices
  • optimal controller

1. Introduction

Nonlinear systems play an important role in the field of control engineering. This is because suitable control techniques are used to improve the system performance [1]. The ball and beam system (BBS) is a highly nonlinear benchmark control problem in the field of control engineering. This is similar to practical control problems like balance control, position control, and tracking control problems [2]. BBS consists of a rigid beam that rotates freely in a vertical plane around the axis, while the ball rolls along the beam. The system can be categorized into two configurations, the first configuration is the ball and beam balancer, in which the beam is supported in the middle, and it rotates against its central axis. The second configuration is built with the beam supported by two-level arms on both sides. One of the level arms acts as the pivot, while the other is coupled to the motor output gear [3, 4]. The purpose of the BBS is to hold the ball in a desired position on the beam while controlling the ball position by adjusting the angle of the beam [5, 6].

The BBS is used to implement and analyze the results of different modern control algorithms [7]. The control structure of this system is used for many different schemes in practical applications. It is used for demonstrating control applications like aircraft roll-yaw applications [8]. It is widely used due to its nonlinearity, simplicity, and open-loop instability. The control objective is the stabilization of the ball on the beam while tracking the reference trajectory [1, 9].

The BBS comprises of the base, the ball, a beam, support block, gear, and motor. This is shown in Figure 1.

Figure 1.

Ball and beam system [10].

The beam consists of two parts; the first part of the beam consists of a rigid shaft, while the other part rotates up and down on which the ball moves freely on it [10].

However, there are some research done on the system in applying different control algorithms to stabilize and perform trajectory tracking of the ball on the beam. Rahmat et al. [11] investigated the performance of some control techniques that consist of a proportional-integral-derivative (PID) controller, linear quadratic regulator (LQR) controller, and neural network (NN) designed in terms of stabilization and trajectory tracking. It showed that the LQR controller had a better satisfactory result. In Ref. [12], the particle swarm optimization (PSO) algorithm was used to tune the gains of the PID controller for the BBS. The optimized PSO-PID controller was compared with fuzzy logic controller (FLC) and integral of time multiplied by absolute error (ITAE), which the optimized PID outperformed the other two techniques. Kazemi et al. [13] designed cascade PD and fuzzy cascade controllers for stabilization of the BBS. The gains of the PD controller were optimized using the asexual reproduction optimization (ARO) algorithm. The results of PD-optimized ARO were compared with the fuzzy-cascaded controller in which the tuned PD-ARO outperformed the fuzzy-cascaded PD. Also, Ezzabi et al. [14] demonstrated a nonlinear backstepping technique for controlling the ball position of the BBS. The results were compared with LQR controller, it showed that the nonlinear technique required less input magnitude to achieve a better performance than the LQR controller. In Ref. [15], control strategies that were based on optimal control synthesis were presented. LQR and H2 controllers were used to control the ball on the beam. The control systems were implemented on a real BBS with a data acquisition card of DSP F28335. A new control strategy was proposed by Ref. [16] to control the stabilization of the BBS by the use of active disturbance rejection control (ADRC) on the system. The simulated results were compared with the proportional integration differentiation controller in which ADRC had a better performance than the integration differentiation controller. While Howimanporn et al. [17] developed a nonlinear discrete optimal control technique for the regulation of all the state variables in the discrete mode of the BBS. The proposed controller showed passivity, stability, and optimality properties during closed-loop operation. In Ref. [18], the BBS was designed using pole placement and LQR. The ball was able to be stabilized on the beam, and the results showed that LQR performed better than the pole-placement method. While an adaptive control was implemented in Ref. [19] for the BBS. Linear state-feedback model reference adaptive control (MRAC) was used in synchronizing the states of the BBS with the given reference model. Results showed that the error convergence was improved for different sets of the sinusoidal reference signal for the MRAC with modified feedback gains.

The main contribution of this article is the investigation of the performance effect of LQR controller on the BBS. This will be done by varying the Q and R matrix on the system, and observing which of the weighting matrix has a penalty effect on the minimization of the performance index of the LQR controller. However, the simulation was implemented in MATLAB/Simulink 2022b environment by adopting Lagrange’s equation for modeling the system.

The rest of the paper is organized as follows: Section one introduces the BBS, while section two presents the mathematical model of the system. Section three discusses the controller design of the system and section four gives the simulated results. Finally, the conclusion is given in section five.

Advertisement

2. Mathematical model of the ball and beam system

The BBS is a two degree-of-freedom (DOF) system, the lateral movement of the ball is represented by its position on the horizontal axis, while the vertical movement of the beam is represented by the angle with the horizontal axis [16, 18]. The ball position is given by a sensor allocated at one end of the beam. The angle of the beam is adjusted by a toque provided by an actuator placed at the other end, where there is a connected axis [20]. The BBS can be simplified and linearized using the following assumptions [21]:

  1. The ball rolls on the beam without slippage.

  2. The link connected to the beam is solid.

  3. The is no friction on the ball and beam surface, gears, and motor.

  4. The beam angle of rotation has no effect on the behavior of the system.

The equation which describes the dynamics of the system is obtained by using Euler Lagrange equation based on the energy balance of the system as follows [22, 23]:

IbR2+mr¨+mgsinθmrθ̇2=0E1
mr2+I+Ibθ¨+2mrṙθ̇+mgrcosθ=uE2

where m is the mass of the ball, g is the acceleration due to gravity, I is the beam moment of inertia, Ib is the ball moment of inertia, r is the position of the ball, R is the radius of the ball, θ is the angle of the beam, and u is the torque applied to the beam.

The model of the system can be described by the following state variables as x1 represents the ball position along the beam, x2 is the velocity of the ball, x3 is the beam angle, and x4 is the beam angular velocity. The generalized coordinate is given as [24]:

x1x2x3x4=rṙθθ̇E3

The state space representation of the system is given by [25]:

ẋ1=x2E4
ẋ2=αx3E5
ẋ3=x4E6
x4=βx3+γx4E7

where

α=MgJbRb2+ME8
β=MgJ+JbE9
γ=1J+JbE10

The parameters of the BBS used for this article are given in Table 1.

ParametersValue
M0.05kg
Rb0.01m
g9.81m/s2
l40cm
d4cm
J2.0×102kgm2
Jb2.0×106kgm2

Table 1.

Ball and beam system parameters.

Advertisement

3. Linear quadratic regulator (LQR) controller

The LQR controller takes the state equation of the system as feedback and generates a feedback error signal, as shown in Figure 2.

Figure 2.

LQR control structure.

Given the system dynamics, the optimization procedure is to find an optimal control law that minimizes the performance index J, which is given as [26]:

J=0t1xTQx+uTRudtE11

The optimal control law and the optimal controller are given as [26]:

uopt=R1BTPxE12
K=R1BTPE13

Substituting the value of the Eq. (13), into (12), the optimal control law is given as [23]:

uopt=KxE14

From Eq. (11), the P matrix must satisfy the reduced matrix equation, which is given as [26]:

ATP+PAPBR1BTP+Q=0E15

3.1 Selection of Q and Rmatrices

Using Eq. (11), matrices Q and R penalizes the performance of the states, which control the response of the system and the cost of the energy consumed by the system. To improve on the system performance, the Q matrix is been considered, while to improve on the cost, R matrix is been focused on. The Q and R matrices are chosen to be a diagonal matrix while considering the effect of increasing or decreasing their values.

The Q and R matrices used for this research are:

Q0=diag0.10.10.10.1E16
Q1=diag1111E17
Q2=diag10101010E18
Q3=diag20202020E19
R0=diag1E20
Advertisement

4. Results and discussion

The results of the BBS were generated from MATAB 2022b environment. The system has been proven to be controllable and observable, which gives way to further perform analysis of stabilizing the ball on the beam. Various values of the states weighting matrices Q were simulated against the control weighting matrix R, and the various values of the optimal controllers K, reduced Ricatti matrix P, and the estimated eigenvalues E were extracted.

For Q0,R0, the values of the K0,P0,E0 extracted are:

K0=1.07410.64451.89360.4192E21
P0=0.37610.15770.24470.02150.15770.13930.24870.01290.24470.24870.70350.03790.02150.01290.03790.0084E22
E0=1.6935+0.0000i1.7190+2.1616i1.71902.1616i15.8277+0.0000iE23

The effect of the ball displacement, ball velocity, beam angle, and beam angular velocity is shown in Figure 3.

Figure 3.

Q0,R0 weighting matrices.

From Figure 3, it is seen that the ball stabilizes at about 2.8 secs on the beam on the x-axis, while the ball’s velocity was stabilized at about 5.05 secs. Also, the beam angle was stabilized at about 4.7 secs, while the beam angular velocity was stabilized at about 5.1 secs. This shows that the state weighting matrix Q has a penalty on the ball position and also on the beam angle.

Also, for Q1,R0, the values of the K1,P1,E1 extracted are:

K1=1.60431.61235.03141.0960E24
P1=1.79580.79981.22080.03210.79980.98351.73500.03221.22081.73505.28860.10060.03210.03220.10060.0219E25
E1=1.1087+0.0000i1.8503+1.9018i1.85031.9018i49.9866+0.0000iE26

The effect of the ball displacement, ball velocity, beam angle, and beam angular velocity is shown in Figure 4.

Figure 4.

Q1,R0 weighting matrices.

From Figure 4, it is seen that the ball stabilizes at about 5.5 secs on the beam on the x-axis, while the ball’s velocity was stabilized at about 7.5 secs. Also, the beam angle was stabilized at about 5.2 secs, while the beam angular velocity was stabilized at about 5.8 secs. This shows that the state weighting matrix Q has a penalty on the ball position and also on the beam angle.

Also, for Q2,R0, the values of the K2,P2,E2 extracted are:

K2=3.69064.890715.23863.2572E27
P2=15.65066.959310.42350.07386.95939.148315.85620.097810.423515.856248.95020.30480.07380.09870.30480.0652E28
E2=1020.0101+0.0000i0.0187+0.0187i0.01870.0187i1.5809+0.0000iE29

The effect of the ball displacement, ball velocity, beam angle, and beam angular velocity is shown in Figure 5.

Figure 5.

Q2,R0 weighting matrices.

From Figure 5, it is seen that the ball stabilizes at about 7.1 secs on the beam on the x-axis, while the ball’s velocity was stabilized at about 8.2 secs. Also, the beam angle was stabilized at about 6.1 secs, while the beam angular velocity was stabilized at about 6.6 secs. This shows that the state weighting matrix Q has a penalty on the ball position and also on the beam angle.

However, for Q3,R0, the values of the K3,P3,E3 extracted are:

K3=4.98956.894821.44514.5670E30
P3=31.019213.768920.54690.099813.768918.168931.38890.137920.546931.388996.97440.42890.09980.13790.42890.0914E31
E3=1020.0101+0.0000i0.0187+0.0187i0.01870.0187i2.2358+0.0000iE32

The effect of the ball displacement, ball velocity, beam angle, and beam angular velocity is shown in Figure 6.

Figure 6.

Q3,R0 weighting matrices.

From Figure 6, it is seen that the ball stabilizes at about 7.6 secs on the beam on the x-axis, while the ball’s velocity was stabilized at about 8.7 secs. Also, the beam angle was stabilized at about 6.5 secs, while the beam angular velocity was stabilized at about 7.2 secs. This shows that the state weighting matrix Q has a penalty on the ball position and also on the beam angle.

From Figures 36, it can be deduced that as the leading element of the state weighting matrix Q increases from 0.1 to 20, the values of optimal controller K increases, the reduced Ricatti matrix P also increases, and the estimated eigenvalues also reduces. This implies that the ball displacement, ball velocity, beam angle, and beam angular velocity are better at lower values of Q. This shows that the state weighting matrix has an effect on penalty performance on the BBS within lower values of Q.

Advertisement

5. Conclusion

An analysis on the effect of the state and control weighting matrices QandR on a benchmark control problem, the ball and beam system (BBS) has been studied. The system is a 2 DOF, an open loop, and a highly nonlinear unstable system, which makes estimating its parameters difficult, hence designing a controller was a difficult task. The BBS is an underactuated system with multiple input multiple output characteristics. Lagrange modeling technique was used for modeling the system, and LQR controller was used for the stabilization of the ball on the beam. A simulation was done in MATLAB/Simulink 2022b environment, and it showed that the state weighting matrix had a higher penalty on the ball displacement, ball velocity, beam angle, and beam angular velocity at lower values of Q. Also, it showed that as Q increases from 0.1 to 20, the values of the optimal controller K increase, the reduced Ricatti matrix P increases, and the estimated eigenvalues E also reduce. This implies that the ball displacement, ball velocity, beam angle, and beam angular velocity are better at lower values of Q. Future research will consider the effect of varying the control weighting matrix R over some range of values on the BBS system, which can be further applied to the field of autonomous vehicles.

References

  1. 1. Mehedi IM, Al-Saggaf UM, Mansouri R, Bettayeb M. Two degrees of freedom fractional controller design: Application to the ball and beam system. Measurement. 2019;135:13-22
  2. 2. Srivastava V, Srivastava S. Hybrid optimization based PID control of ball and beam system. Journal of Intelligent Fuzzy Systems. 2022;42(2):919-928
  3. 3. Rosa MR, Romdlony MZ, Trilaksono BR. The ball and beam system: Cascaded LQR-FLC design and implementation. International Journal of Control, Automation Systems Science Control Engineering. 2023;21(1):201-207
  4. 4. Umar A, Muazu MB, Aliyu UD, Musa U, Haruna Z, Oyibo PO. Position and trajectory tracking control for the ball and plate system using mixed H∞ sensitivity problem. Covenant Journal of Informatics and Communication Technology, (CJICT). 2018;6(1):1-15
  5. 5. Nguyen C, Phan HN, Hoang L, Tran HN, editors. The design of a quasi-time optimal cascade controller for ball and beam system. In: IOP Conference Series: Materials Science and Engineering. IOP Publishing; 2021
  6. 6. Mehedi IM, Al-Saggaf UM, Mansouri R, Bettayeb M. Two degrees of freedom fractional controller design: Application to the ball and beam system. Measurement. 2019;135:13-22
  7. 7. Howimanporn S, Chookaew S, Silawatchananai C. Monitoring and controlling of a real-time ball beam fuzzy predicting based on PLC network and information technologies. Journal of Advances in Information Technology. 2022;13
  8. 8. Kim Y, Kim S-K, Ahn CK. Variable cut-off frequency observer-based positioning for ball-beam systems without velocity and current feedback considering actuator dynamics. IEEE Transactions on Circuits Systems I: Regular Papers. 2020;68(1):396-405
  9. 9. Umar A, Muazu MB, Aliyu UD, Musa U, Haruna Z, Oyibo PO. Position and trajectory tracking control for the ball and plate system using mixed H∞ sensitivity problem. Covenant Journal of Informatics and Communication Technology, (CJICT). 2018;6(1):1-15
  10. 10. Borgohain N, Buragohain M. Comparative study of optimal controller application on nonlinear systems. In: Modeling, Simulation and Optimization. Springer; 2021. pp. 417-428
  11. 11. Rahmat MF, Wahid H, Wahab NA. Application of intelligent controller in a ball and beam control system. International Journal on Smart Sensing Intelligent Systems. 2010;3(1):45-60
  12. 12. Rana MA, Usman Z, Shareef Z, editors. Automatic control of ball and beam system using particle swarm optimization. In: IEEE 12th International Symposium on Computational Intelligence and Informatics (CINTI), 2011. IEEE; 2011
  13. 13. Kazemi M, Najafi J, Menhaj MB. Fuzzy PD, Cascade controller design for ball and beam system based on an improved ARO technique. Journal of Computer Robotics. 2012;5(1):1-6
  14. 14. Ezzabi AA, Cheok KC, Alazabi FA, editors. A nonlinear backstepping control design for ball and beam system. In: 2013 IEEE 56th International Midwest Symposium on Circuits and Systems (MWSCAS). Columbus, OH, USA: IEEE; 2013
  15. 15. Hung B, You S, Kim H, Lim T. Embedded controller building for ball and beam system using optimal control synthesis. Journal of Engineering Science and Technology. 2017;12(6):1460-1474
  16. 16. Ding M, Liu B, Wang L. Position control for ball and beam system based on active disturbance rejection control. Systems Science Control Engineering. 2019;7(1):97-108
  17. 17. Danilo Montoya O, Gil-González W, Ramírez-Vanegas C. Discrete-inverse optimal control applied to the ball and beam dynamical system: A passivity-based control approach. Symmetry. 2020;12(8):1359
  18. 18. Rai A, Suman SK, Kumar A, Yadav S, editors. Impact of control stability using LQR and pole-placement for ball and beam system. In: 2021 5th International Conference on Intelligent Computing and Control Systems (ICICCS). Madurai, India: IEEE; 2021
  19. 19. Romdlony MZ, Rosa MR, Syamsudin EMP, Trilaksono BR, ASJJoM W. Electrical Power,. Design and application of models reference adaptive control (MRAC) on ball and beam. Journal of Mechatronics, Electrical Power, Vehicular Technology. 2022;13(1):15-23
  20. 20. Edutech QI. Ball and Beam Laboratory Manual. Quanser Inc.; 2012. pp. 1-21
  21. 21. Hajipour S, Pourhashem H, Chegini SN, Bagheri A. Optimized neuro observer-based sliding mode control for a nonlinear system using fuzzy static sliding surface. Applied Soft Computing. 2022;124:108904
  22. 22. Saleem MK, Shahid MLUR, Nouman A, Zaki H, Tariq MAUR. Design and implementation of adaptive neuro-fuzzy inference system for the control of an uncertain ball and beam apparatus. Mehran University Research Journal of Engineering Technology. 2022;41(2):178-184
  23. 23. Do Van D, editor Researching and applying sliding control method for ball and beam system. In: 2022 International Conference on Electrical, Computer, Communications and Mechatronics Engineering (ICECCME). Maldives, Maldives: IEEE; 2022
  24. 24. Khan R, Malik FM, Raza A, Mazhar N, Ullah H, Umair M, editors. Robust nonlinear control design and disturbance estimation for ball and beam system. In: 2020 3rd International Conference on Computing, Mathematics and Engineering Technologies (iCoMET). Sukkur, Pakistan: IEEE; 2020
  25. 25. Soni R, editor. Optimal Control of a Ball and Beam System through LQR and LQG. In: 2018 2nd International Conference on Inventive Systems and Control (ICISC). Coimbatore, India: IEEE; 2018
  26. 26. Umar A, Haruna Z, Mu’azu MB, Shilintang SG, Usman NS, Adekale AD, editors. Performance analysis of a ball-on-sphere system using linear quadratic regulator controller. In: 2022 IEEE Nigeria 4th International Conference on Disruptive Technologies for Sustainable Development (NIGERCON). Lagos, Nigeria: IEEE; 2022

Written By

Abubakar Umar, Muhammed B. Mu’azu, Zaharuddeen Haruna, Ore-Ofe Ajayi, Nafisa S. Usman, Onoshoho J. Oghenetega and Abdulfatai D. Adekale

Submitted: 14 January 2023 Reviewed: 13 February 2023 Published: 11 March 2023