Journal of Fuzzy Systems and Control, Vol. 3, No 1, 2025 |
Backstepping Control for Ball and Beam: Simulation and Experiment
Vo-Hoang-Lap Tran 1, Trung-Hieu Le 2, Dai-Phuc Hoang 3, Van-Dong-Hai Nguyen 4, Ngoc-Thinh Ho 5, Tien-Phat Do 6, Tuan-Cuong Le 7, Thi-Xuan-Hy Tran 8, The-Duy Luong 9, Thanh-Son Vo 10, Phuoc-Khanh Nguyen 11, Minh-Tam Nguyen 12,*
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 Ho Chi Minh City University of Technology and Education (HCMUTE), Ho Chi Minh City, Vietnam
Email: 1 20151389@student.hcmute.edu.vn, 2 @20151368student.hcmute.edu.vn, 3 20145301@student.hcmute.edu.vn,
4 hainvd@hcmute.edu.vn, 5 21161015@student.hcmute.edu.vn, 6 21161468@student.hcmute.edu.vn,
7 21161432@student.hcmute.edu.vn, 8 21161323@student.hcmute.edu.vn, 9 19145212@student.hcmute.edu.vn,
10 19145300@student.hcmute.edu.vn, 11 19145075@student.hcmute.edu.vn, 12 tamnm@hcmute.edu.vn
*Corresponding Author
Abstract—This paper presents the modeling and control of the Ball and Beam system, a commonly used Single Input – Multiple Output (SIMO) system in control research experiments. In the study, the Backstepping method is applied to model and control the system. The linear differential equations describing the system's dynamics are derived based on fundamental mechanical principles, using the Euler-Lagrange method to develop an accurate mathematical model. Subsequently, the backstepping method is employed to design a controller that ensures the global stability of the system. Lyapunov theory is applied to prove the system's stability, with an appropriate Lyapunov function selected to guarantee the global stability of the controller. In addition to simulations, the study also conducts experiments to test the system's stability under Backstepping control. The results show that this controller is not only effective in maintaining balance and controlling the position of the ball on the beam but also addresses the limitations of traditional linear control methods. Both simulation and experimental results demonstrate the high performance and stability of the system, confirming the stability according to Lyapunov theory.
Keywords—Backstepping Control, Ball and Beam, Linear Control, SIMO Systems
In the field of control and automation, many real-world systems exhibit a nonlinear nature, presenting significant challenges for analysis and control. This nonlinearity makes such systems unpredictable, requiring advanced analytical techniques and sophisticated control methods to maintain stability and efficiency in operation [1]-[2]. Nonlinear systems are often studied in academic settings as a learning and experimental tool, providing students and researchers with valuable opportunities to develop the skills necessary to address practical control issues.
In educational contexts, the ball-and-beam system is a quintessential example of a nonlinear and unstable system, commonly used to illustrate advanced control concepts [3]. This system consists of a beam that can rotate around an axis, on which a ball moves. The operator must adjust the beam’s angle to keep the ball at a desired position, a challenging task due to the nonlinear relationship between the ball’s position and the beam’s angle. Classical control methods like PID [4] have been applied to this system, alongside optimal control methods such as the Linear Quadratic Regulator (LQR) [5]. However, the nonlinearity and high precision required demand more advanced control approaches.
Numerous studies have proposed and applied advanced control methods to the ball-and-beam system to enhance stability and control efficacy. Specifically, state-space control has been explored in [6] with centrifugal force equations to build adaptive control rules, while adaptive fuzzy control has been used in [7] to manage balancing with dynamic surface optimization strategies. Nonlinear backstepping control [8] and sliding mode control (SMC) were combined in [9] to create a robust strategy, with SMC applied to both static and dynamic configurations. Additionally, in [10], Jacobian-based SMC was employed to linearize the system, and an integral SMC approach has been implemented for this system in [11]. A study has compared various SMC strategies, such as first-order, second-order (super-twisting), fast control, and integral control, to enhance system tracking performance [12].
Other studies have utilized PD controllers for precise compensation, combined with neural network controllers to approximate nonlinear elements [13]. In [14], the extended kalman filter (EKF) was used to improve stability by accurately estimating neural controller weights. Fuzzy control with genetic algorithm optimization for cascade controller design [15], and cascade PD fuzzy control with particle swarm optimization in [16]. Methods like input-output linearization via approximation [17] and two-degree-of-freedom (DOF) model control [18] were also researched to increase efficiency in ball-and-beam control applications.
In this research, we focus on applying the linear backstepping method to stabilize the ball-and-beam system. The backstepping approach is regarded as an effective technique for designing controllers with clear structures and ensuring local stability for the system. However, since this method relies on linearizing the system around an equilibrium point, it is effective only within a limited range around that point. As the ball moves away from the equilibrium position, or when disturbances occur, this method can no longer guarantee stability, which highlights a limitation that current research needs to address.
While the linear backstepping method provides efficacy within a certain range, its limitations reveal a significant gap in the literature regarding the broader application of nonlinear control methods. Modern nonlinear control techniques, such as adaptive control and sliding mode control, are gaining attention for their ability to handle highly nonlinear systems. However, comprehensive studies evaluating the performance of these methods on the ball-and-beam system are still lacking, especially in academic and educational settings where nonlinear control methods can enhance learners’ understanding.
Therefore, this study not only aims to verify the effectiveness of the linear backstepping method but also to explore its limitations in controlling the nonlinear ball-and-beam system. This research contributes to the literature on control methods for unstable systems, further clarifying the operational scope limitations of the backstepping method as discussed in [19]. Additionally, the study will suggest new directions for nonlinear control methods, such as adaptive control or sliding mode control, with the aim of enhancing the comprehensiveness of control systems in nonlinear environments.
The ball and beam system is a SIMO configuration, in which a ball rolls freely along the length of the beam. The system consists of two critical components: a motor that controls the rotational angle of a disk, thereby altering the tilt of the beam, and the ball-beam assembly itself. This system operates with two degrees of freedom, where the ball moves translationally along the horizontal axis of the beam, while the beam oscillates vertically with one end fixed. The beam's angle shifts in response to the torque exerted by the motor can be seen in Fig. 1.
To derive the equations describing the motion of the ball and beam system, based on the reference [21], the Lagrange method based on energy balance is used [22]. At the same time, combined with the method for finding the nonlinear equations of the ball and beam system mentioned in [23] and [24], the authors' group derived the equations describing the system's motion.
First, we need to determine the kinetic energy of the system, which consists of two components: the kinetic energy of the beam and the kinetic energy of the ball.
Translational kinetic energy:
| (1) |
Rotational kinetic energy:
| (2) |
The beam only possesses rotational kinetic energy.
| (3) |
The total kinetic energy of the system:
| (4) |
The potential energy of the system:
The potential energy of the ball:
| (5) |
The potential energy of the beam:
| (6) |
The total potential energy of the system:
| (7) |
According to the Lagrange formula:
| (8) |
From (8)
| (9) |
Upon expanding the Lagrange equation, it will take the following form
| (10) |
From (10), it follows that:
| (11) |
| (12) |
We proceed by differentiating equation (9) as in equation (11) and equation (12).
| (13) |
| (14) |
Finally, after simplification, the mathematical model of the ball and beam system is expressed as follows:
| (15) |
| (16) |
The parameters obtained from the physical model, depicted in Fig. 9, are listed in Table 1.
Parameter | Value | Unit | |
| Ball position | ||
| Beam Angle | ||
| Gear ratio | 5.6 | |
| Torque apply to beam |
| |
| Beam length | 0.54 |
|
| Ball mass | 0.065 |
|
| Beam mass | 0.34 |
|
| Gravitation acceleration | 9.81 |
|
| Lever radius | 0.075 |
|
| Moment of inertia of the ball |
|
|
| Moment of inertia of the beam |
|
|
| Ball radius | 0.0125 |
|
| Motor resistance | 6.83527 |
|
| Torque constant | 0.064943 |
|
| Back EMF constant | 0.064943 |
|
| Coeffcient of viscous friction | 0.00034 |
|
| Moment of inertia of Rotor | 0.000134 |
|
| Moment friction | 0.010764 |
|
u | Voltage Input |
| |
| Constant |
| |
| Constant |
| |
| Constant |
|
The angles
and
are related to each other as described in document [4]. From angle
, we can infer
using the formula below:
| (17) |
To control the torque of the motor, we need to manage its voltage. According to document [25], there is a relationship between torque and voltage. Based on the mathematical equations describing torque and the input voltage of the system from document [25], we proceed to identify the motor parameters to apply the equations to the physical model.
With the relationship between torque and voltage, we substitute into equation (15), (16), and (17) to obtain the following equation:
| (18) |
| (19) |
To linearize the system, it is necessary to construct a state-space model, in which
=
.
Define the state variables as follows:
| (20) |
| |
The system in the state-space equations is represented as follows:
| (21) |
| (22) |
We set the values as follows:
|
|
We can compute the matrices A and B using the model parameters provided in Table 1. Nonlinear system is considered to operate only around an equilibrium point:
| (23) |
| (24) |
The backstepping algorithm referenced from document [26] is applied to system , where we formulate a control law to stabilize the system. According to document [26], the virtual control functions are designed such that the subsystems become stable. Based on Lyapunov’s theory [27], the system's control law is developed through four steps, which are outlined below.
For the ball and beam system, we convert it into a state-space model using state variables.
Step 1: The first step in designing the linear backstepping controller is to define an error variable, which is specified as follows:
| (25) |
Wherein,
represents a constant specific to the system. We compute the derivative of
as follows:
| (26) |
Step 2: To guide the control law
toward zero, we consider
as a virtual control variable. A positive definite Lyapunov function is selected as follows:
| (27) |
According to Lyapunov's criterion, an appropriate function must be chosen to satisfy the condition
. Thus, the derivative of
is given as follows:
| (28) |
From Appendix (A1), we define the function
in such a way as to ensure system stability as follows:
| (29) |
Where
is a positive constant.
Step 3: The next error variable
, is defined as follows:
| (30) |
The derivative of
is calculated as follows:
| (31) |
Substituting equation (24) into equation (31), we obtain:
| (32) |
Substituting equation (26) into equation (32), we obtain:
| (33) |
We set:
| (34) |
Rewrite equation (33) as follows:
| (35) |
Step 4: To ensure that the function
is truly stable, we consider
. The goal of this step is to select a function
such that
, and the function
must include
, defined as follows:
| (36) |
From equation (30) to equation (26), we have:
| (37) |
The derivative of
yields the following equation:
| (38) |
Substituting (37) into (38), the equation becomes:
| (39) |
To
ensure is negative in accordance with Lyapunov stability theory, we define
as follows:
| (40) |
Where
is a positive constant designed for the system. Substituting (40) into (39)
yields the following form:
| (41) |
We substitute equations (25), (30), and (35) into (40). From this equation, we derive the control law as follows
| (42) |
Where
is a design constant of the system
We evaluate the performance and stability of the backstepping controller based on Lyapunov theory, with the Lyapunov function
considered as follows:
| (43) |
When taking the derivative of
, we obtain the following result:
| (44) |
By substituting functions (26), (40), and (37) into (44), we obtain:
| (45) |
Based on the outcomes obtained from (45), it is certain that the system can achieve stability. By satisfying the Lyapunov function conditions from (43) and (45), the system can stabilize as it asymptotically converges to zero as time approaches infinity.
When the error variable tends to zero, indicating that the system has reached a stable state, it can also be observed that both variables
and
have attained the desired positions within the system.
In this study, the backstepping controller is employed to stabilize and control the ball and beam system, a nonlinear system characterized by the intricate interactions between the ball and the beam. Simulations and experiments are conducted to demonstrate the feasibility, accuracy, and performance of the controller, allowing for a comparison with alternative control methods and an assessment of the advantages and disadvantages under practical operating conditions.
In this simulation section, the authors will model the system using the Matlab – Simulink tool, which allows us to simulate the system based on the mathematical equations derived using the Lagrangian method. We will implement the simulation of the system with the Backstepping controller identified in the preceding section. The parameters for the simulation are based on Table 1, which we derived from the physical model to ensure that the simulation results are visually meaningful.
In the simulation, we initialize the starting position for Ball and Beam based on the physical model as follows:
| (46) |
The simulation duration for the system is 100 seconds, and the sampling time is 0.01 seconds.
Functional blocks are constructed in Matlab Simulink, as shown in Fig. 2 and Fig. 3, with the following purposes:
Block 1: This block serves to provide reference signals for the system (e.g., sine waves, square pulses, etc.).
Block 2: This is backstepping controller, which is responsible for collecting input data and generating control signals for actuator, enabling system to achieve desired position.
Block 3: This block represents the actuator of the system, which has been modeled. It describes the motion of the system in response to the control signals.
Block 4: Final block is scope block, which collects data from Matlab Simulink and allows us to visualize the data.
Table 2 are the parameters of the controller:
|
|
|
|
1.001 | 30.3 | 52.1 | 5.3 |
The simulation results, including r (m),
(rad), and voltage (V), are presented from Fig. 4 to Fig. 8 The initial values of the system are as follows:
| (47) |
The authors simulated the Ball and Beam system, with the results displayed from Fig. 4 to Fig. 8, respectively showing the ball position, ball speed, beam angle, beam angular velocity, and finally the control signal, which in this case is the motor voltage. We had the ball follow a square wave trajectory with an amplitude ranging from 0.2m to 0.3m to evaluate the system’s stability.
From this, it can be seen that the system was stable, with no overshoot, and the ball’s settling time was 5.6 seconds. However, although the ball followed the square wave trajectory, there was still a certain error of about 0.03m. This indicates that during the system's linearization process, some changes occurred, leading to slight discrepancies. In summary, with the obtained control signal (Fig. 8), the authors successfully simulated the backstepping controller.
Below is the hardware model of the Ball and Beam system used for experimentation. The components of the actual system are divided into six parts, as shown in Fig. 9, which include:
After conducting the simulation, we proceeded to test the controller on the physical model to verify its stability. The experimental results we have just published, from Fig. 10 to Fig. 14, show the actual ball position, actual ball speed, actual beam angle, actual beam angular velocity, and finally the actual control signal, respectively. Similar to the simulation, we had the ball follow a square wave trajectory to validate the controller.
Regarding the system's performance, as shown in Fig.10, it is clear that the ball closely followed the square wave trajectory, achieving a settling time of 5.8 seconds with an acceptable error margin. However, some noise was present, and we also observed that the signals obtained from the real experiments showed a relatively high degree of similarity.
Therefore, it can be concluded that the process of identifying the system from the physical model to the mathematical equations demonstrates significant reliability. The experimental results indicate that our team successfully implemented the linear backstepping algorithm for the ball and beam system in both simulation and real-world applications.
During the design process of the controller, we identified several noteworthy points. First, in the modeling of the system, we neglected external forces acting on it, specifically frictional forces, in order to simplify the calculations. However, this omission also affects the quality of our controller. Nevertheless, this can potentially be compensated for by employing a robust controller.
Next is the backstepping controller, where the virtual variables in the controller are based on several references mentioned during the designing process. Since these virtual variables are defined to satisfy the Lyapunov theorem, the variable
depends on
, making the system more challenging to stabilize. However, according to the principle that when
approaches zero,
will also approach zero. Therefore, when
stabilizes, the entire system stabilizes as well.
Contributing factor is the unique structure of the ball and beam system, where and
,
or
and
, are interdependent. When the angle
reaches its equilibrium value, the beam remains still, causing the ball to also remain stationary, thereby making the system easier to stabilize. Finally, since the controller we designed is a nonlinear controller, model errors still exist. To address this, a nonlinear controller specifically designed for the ball and beam system could be implemented [28].
This article presents the design of a linear controller using the backstepping method to control the position of the ball in a ball-and-beam dynamic system. The design procedures are described in detail, and both simulation and experimental results show that, although the backstepping controller performs well, there is still a certain degree of error due to its linear nature.
The linear backstepping controller has several advantages, such as ensuring system stability and accuracy through Lyapunov theory, effectively handling nonlinear systems, and being adaptable in dynamic environments. However, it also has some drawbacks, such as the need for an accurate model, difficulty in real-world implementation, and the requirement for in-depth knowledge during the design process. Furthermore, its performance may degrade when faced with strong disturbances or complex systems, particularly when the linear model does not fully capture the nonlinear behavior of the actual system. This was clearly demonstrated during testing.
To address these issues, the controller parameters can be fine-tuned using optimization algorithms such as Particle Swarm Optimization (PSO) or Genetic Algorithm (GA), and noise reduction filters can be added to the system to improve control quality.
Additionally, designing a nonlinear backstepping controller is a promising approach to significantly reduce system errors and enhance control performance. To further improve the system, intelligent controllers such as fuzzy controllers, neural networks, or predictive models could be incorporated to anticipate system behavior, thereby increasing adaptability and optimizing the control process. These methods not only make the system more flexible but also enhance control performance, especially when dealing with unexpected changes or complex operating conditions.
This paper belongs to project of students of Ho Chi Minh City University of Technology and Education (HCMUTE) for year 2025. It is funded by HCMUTE. We, authors, want to give thanks to that support.
The derivative of (27):
| (A1) |
We will choose a function that satisfies (45)
| (A2) |
We select a function that ensures the stability of (45) according to Lyapunov's theory:
| (A3) |
Vo-Hoang-Lap Tran, Backstepping Control for Ball and Beam: Simulation and Experiment