Journal of Fuzzy Systems and Control. Vol. No 2, 2025 ISSN: 2986-6537. DOI: 10. 59247/jfsc. Nonlinear Control Law Design for Inverted Pendulum Systems via RBF Neural Networks Huynh Van Khuong 1. Nguyen Xuan Chiem 2,*. Alexander Obukhov 3 Department of Automation and Computing Techniques. Le Quy Don Technical University. Hanoi. Vietnam Don State Technical University, 1. Gagarin Square. Rostov-on-Don 344000. Russia Email: 1 huynhvankhuong93@gmail. com, 2 chiemnx@mta. vn, 3 pobuhov@spark-mail. *Corresponding Author AbstractAiThis paper presents the design of a nonlinear control law based on the Backstepping method combined with Radial Basis Function (RBF) neural networks to ensure the stability of an inverted pendulum system with unknown model The control design is developed using a general form of the systemAos mathematical model, in which the unknown nonlinear functions are approximated by RBF neural networks. Experimental results conducted on the STM32F4 embedded platform demonstrate that the proposed approach not only guarantees system stability but also verifies the effectiveness and practical applicability of the control law. KeywordsAiBackstepping. RBF Neural Networks. Adaptive Control. Inverted Pendulum System INTRODUCTION The inverted pendulum represents one of the most fundamental and challenging problems in nonlinear control due to its inherent instability, strong nonlinearity, and highorder dynamics. This system has a wide range of industrial applications, including two-wheeled self-balancing vehicles . Segway. , rockets, spacecraft, intelligent robots, and various systems that model crane mechanisms. The primary control objective is to stabilize the pendulum in its inherently unstable upright position while simultaneously controlling the position of the cart. Achieving this objective requires control strategies that are not only precise but also robust and adaptive to model uncertainties. Numerous studies have investigated the stable control of the inverted pendulum system using a variety of control laws . Traditional control algorithms, such as the Proportional-Integral-Derivative (PID) controller . , are generally inadequate for handling the system's complex and nonlinear dynamics, as they are unable to effectively address and external Furthermore, the system's robust stability degrades in the presence of parameter and structural uncertainties, making gain tuning in PID controllers a particularly challenging task . These limitations underscore the need for more advanced control strategies, such as the Linear Quadratic Regulator (LQR) . However, the performance of LQR significantly deteriorates when the system operates far from the equilibrium point or under model uncertainties. To address these limitations, nonlinear control techniques have been proposed . Feedback linearization has been applied in various studies . , . , while sliding mode control laws have also been developed . , . The Backstepping method has been employed to design stable controllers based on accurate system models . , and other works have introduced control strategies grounded in synergetic theory control . These approaches aim to ensure system stability and robustness against model uncertainties. general, nonlinear control methods enhance system stability and improve disturbance rejection. Additionally, adaptive control strategies are commonly used to handle parameter uncertainties, while intelligent control approachesAi including fuzzy logic, neural networks, and reinforcement learning-show significant promise in managing complex dynamic systems without requiring precise mathematical models . In this study, a control approach is proposed based on a general mathematical representation of the system, under the assumption that the exact parameters of the system model are unknown. The Backstepping method is initially employed to design a control law for the inverted pendulum using the general form of the system's dynamics. To approximate the unknown components of the model, four Radial Basis Function (RBF) neural networks are utilized, each corresponding to a specific nonlinear function within the This framework enables the design of a control law that does not rely on precise knowledge of the system dynamics, while still guaranteeing the asymptotic stability of the overall system. The structure of this paper is organized as follows: Section 2 presents a general mathematical model of a two degrees-of-freedom underactuated mechanical system. Section 3 describes the design of the Backstepping control law based on Radial Basis Function (RBF) neural networks. Section 4 introduces the experimental model of the inverted pendulum and discusses the experimental results obtained by implementing the proposed control law on the actual system. Finally, conclusions and directions for future research are provided in Section 5. II. MATHEMATICAL MODEL OF THE 2-DOF UNDERACTUATED MECHANICAL SYSTEM AND THE INVERTED PENDULUM MODEL To derive the equations of motion for mechanical systems, the Lagrangian method is employed. The Lagrangian function (L) of a mechanical system . is defined as the difference between its total kinetic energy (T) and potential energy (P). The systemAos equations of motion are then obtained from the Lagrangian function using the Euler-Lagrange equations, as follows: ycc yuiya yuiya ( )Oe =yua yccyc yuiyc yuiyc This work is licensed under a Creative Commons Attribution 4. 0 License. For more information, see https://creativecommons. org/licenses/by/4. Journal of Fuzzy Systems and Control. Vol. No 2, 2025 Where: yc represents the generalized coordinates, and yua is the generalized torque vector. In the case of a mechanical system composed of rigid bodies connected by joints, the kinetic energy is calculated as the sum of the kinetic energies of each rigid body. The kinetic energy of each rigid body is decomposed into two terms: the first term results from the translational motion of the body's center of mass, and the second term arises from the rotational motion of the body about its inertia center. The potential energy is typically simplified to a term originating from gravitational forces. This term depends only on the position of the body's center of mass. Applying the Euler-Lagrange equations . yields equations that describe the evolution of the generalized coordinates over time. For a mechanical system consisting of rigid bodies, these equations take the following general form . , . ycO ya. c, ycN )ycN ya. = yua = ycI. yc ycuyycu The symmetric positive-definite matrix ycA. OO ycI called the inertia matrix of the mechanical system. In the general case, it depends on the configuration yc of the mechanical system. The matrix ya. c, ycN ) OO ycIycuyycu corresponds to the centrifugal and Coriolis forces and depends on both the configuration yc and the generalized coordinate velocities ycN . The vector ya. OO ycIycu corresponds to gravity and depends only on the configuration yc. yua is the torque vector of the The matrix ycI. OO ycIycuyyco represents the distribution of forces over the generalized coordinates. And yc OO ycIyco is the input vector of the actuators. A mechanical system is called underactuated if rank. } < ycu, meaning the system has fewer independent control inputs than degrees of freedom. Suppose the following holds: . Ae y. ]ycNyc, where yc = 1 or 0 and yc is the control signal. For the inverted pendulum system, which is a 2-DOF underactuated mechanical system illustrated in Fig. 1, let ycu1 = yc1 denote the position of the cart, and ycu2 = yc2 denote the angle of the pendulum . ith ycu2 = 0 when the pendulum is upright, and ycu2 = yuU when the pendulum is downwar. , ycu3 be the velocity of the cart, and ycu4 be the angular velocity of the pendulum. The state of the inverted pendulum system is represented by the vector ycu = . cu1 , ycu2 , ycu3 , ycu4 ]ycN. From equation . , after transformation, the state-space equations describing the inverted pendulum system take the following . Where ycyc is the voltage supplied to the motor that generates force acting on the cart, and yce3 . , yci3 . , yce4 . , and yci4 . are functions containing unknown dynamic components. SYNTHESIS OF ADAPTIVE BACKSTEPPING CONTROL LAW BASED ON RBF NEURAL NETWORKS Steps to Synthesize a Stable Backstepping Control Law for the Balancing Pendulum Based on Mathematical Model . Step 1: Define yce1 = ycu2 Oe yco1 ycu1 Where yco1 is a constant, taking the derivative of . , we have: yceN1 = ycuN 2 Oe yco1 ycuN 1 = ycu4 Oe yco1 ycu3 To achieve the objective yce1 Ie 0, the Lyapunov function is chosen as follows: ycO1 = . Taking the derivative of the Lyapunov function . , we have: ycO1N = yce1 yceN1 = yce1 . cu4 Oe yco1 ycu3 ) . To ensure system stability, that is ycO1N O 0, we choose: ycu4 = Oeyca1 yce1 yco1 ycu3 From condition . and expression . , we have: ycO1N = Oeyca1 yce12 O 0 Step 2: To satisfy expression . , we select the virtual control signal in the form of: ycu4ycc = Oeyca1 yce1 yco1 ycu3 With the objective of ensuring ycu4 Ie ycu4ycc , the error between the actual and virtual signals is given by: yce2 = ycu4 Oe ycu4ycc = ycu4 yca1 yce1 Oe yco1 ycu3 Derivative of expression . ycuN 1 = ycu3 ycuN = ycu4 { 2 ycuN 3 = yce3 . ycyc ycuN 4 = yce4 . ycyc yceN2 = ycuN 4 yca1 yceN1 Oe yco1 ycuN 3 = ycyc . ci4 Oe yco1 yci3 ) yce4 Oe yco1 yce3 yca1 . cu4 Oe yco1 ycu3 ) Fig. Inverted pendulum system model Choose the Lyapunov function as follows: ycO2 = . Taking the derivative of the Lyapunov function . , we Huynh Van Khuong. Nonlinear Control Law Design for Inverted Pendulum Systems via RBF Neural Networks Journal of Fuzzy Systems and Control. Vol. No 2, 2025 ycO2N = yce1 yceN1 yce2 yceN2 = yce1 . ce2 Oe yca1 yce1 ) yce2 yceN2 = Oeyca1 yce12 yce2 . ce1 yceN2 ) . To ensure ycO2N O 0, we choose: yce1 yceN2 = Oeyca2 yce2 . ca2 > . From equation . , the control law is derived as follows: ycyc = . co yce Oe yce4 Oe yca1 . cu4 Oe yco1 ycu3 ) Oe yce1 yci4 Oe yco1 yci3 1 3 Oe yca2 yce2 ] . co yceC Oe yceC4 Oe yca1 . cu4 Oe yco1 ycu3 ) Oe yce1 yciC4 Oe yco1 yciC3 1 3 Oe yca2 yce2 ] . Where yceC3 , yciC3 , yceC4 , and yciC4 are the estimates of yce3 , yci3 , yce4 , and yci4 , respectively. If yceC3 = yce3 , yciC3 = yci3 , yceC4 = yce4 , and yciC4 = yci4 then ycO2N O 0. The unknown functions yceC3 , yciC3 , yceC4 , and yciC4 can be approximated by neural networks. Fig. 2 shows the closedloop adaptive control scheme based on RBF neural networks. Four RBF networks are used to approximate the functions yce3 , yci3 , yce4 , and yci4 as follows: yce3 = ycO1ycN Ea1 yuA1 . ce4 = ycO3ycN Ea3 yuA3 . ycn = 1,2,3,4 yci3 = ycO2ycN Ea2 yuA2 yci4 = ycO4ycN Ea4 yuA4 Where ycOycn is the ideal network weight vector. Eaycn is the Gaussian function, and yuAycn is the approximation error. C1ycN Ea1 = ycO C1ycN yceycuycy (Oe yceC3 = ycO Anycu Oe ycayc An C2ycN Ea2 = ycO C2ycN yceycuycy (Oe yciC3 = ycO C3ycN Ea3 = ycO C3ycN yceycuycy (Oe yceC4 = ycO 2ycayc2 Anycu Oe ycayc An Anycu Oe ycayc An C4ycN Ea4 = ycO C4ycN yceycuycy (Oe yciC4 = ycO Anycu Oe ycayc An 2ycayc2 fI4 , gI 4 RBF Network Inverted Pendulum Fig. Stabilizing control scheme based on RBF neural networks The implementable adaptive law is presented in study . ycsCN = yuEayuO ycN Oe ycuyuAnyuOAnycsC C1 0 0 0 C2 0 0 Where: ycsC = is the estimated weight matrix. C3 0 0 0 W C . 0 0 W yu1 0 0 0 0 e2 0 0 ] is a positive definite matrix of yu=[ 0 0 e3 0 0 0 0 e4 appropriate dimension. yuO = . ce1 e2 e1 e2 ]ycN . Ea = [Ea1 h2 h3 h4 ]ycN . and ycu is a positive scalar. Synthesis of Swing-Up Control Law The control laws . themselves can only maintain the pendulum balance at the desired unstable equilibrium state ycu = . ,0,0,. ycN if the initial state ycu0 is within the neighborhood of ycu. This is because if the initial state ycu0 is far from ycu, the closed-loop system will enter an unstable region or the control signal ycyc impractical values. Therefore, it is necessary to use the Swing-up control law to bring the pendulum from the initial position with ycu2 = yuU to the vicinity of ycu2 = 0. Afterwards, the control law . is employed to maintain the pendulum balance at the desired unstable equilibrium state. Physically, for the pendulum to approach the vicinity of ycu2 = 0, it must be supplied with energy, and its total energy must increase over time. Suppose at the initial state ycu0 = . , yuU, 0,. ycN , the pendulum has total energy ya = 0. The energy components, including the kinetic energy ycN and potential energy ycO of the pendulum are calculated as follows: a ycoyco 2 )ycN 22 2ycayc2 fI3 , gI 3 ycN= 2ycayc2 Adaptation Mechanism Backstepping Controller According to Lyapunov stability theory, yce1 and yce2 converge to zero. To ensure the system converges to the desired stable state, a design constant yco2 needs to be added to adjust the value of the state variable ycu1, i. , ycu1A = yco2 ycu1 . Here, ycu1A is the input signal applied to the control law . replacing ycu1 to ensure ycu1 Ie 0. To implement the control law . , accurate model information is required. In other words, the specific mathematical expressions of the functions yce3 , yci3 , yce4 , and yci4 must be known. In this study, the authors choose a solution that does not involve explicitly constructing these functions. Instead, these functions are identified through RBF neural networks based on the system states. The control law . is rewritten as follows: ycyc = Where: ycu = . cu1 , ycu2 , ycu3 , ycu4 ]ycN is the input vector, ycayc = . cayc1 , ycayc2 , . , ycaycycu ] is the center coordinate vector of the j-th neural network, ycayc = . ca1 , yca2 , . , ycayco ] is the width vector of CycnycN is the estimated weight value. the Gaussian function, and ycO The block diagram with control law . using neural network . is shown in Fig. ycO = ycoyciyco. Oe ycaycuyc( yuU Oe yc2 )) . ya = . a ycoyco 2 )ycN 22 ycoyciyco. Oe ycaycuyc( yuU Oe yc2 )) . Huynh Van Khuong. Nonlinear Control Law Design for Inverted Pendulum Systems via RBF Neural Networks Journal of Fuzzy Systems and Control. Vol. No 2, 2025 The desired energy to be achieved by the pendulum when ycu2 = 0 is: ya0 = ycoyciyco. Oe ycaycuyc( yuU Oe yc2 )) = 2ycoyciyco communication port. The software, developed by the authors using C# on Visual Studio, allows observation of angle and position values by displaying numerical and graphical outputs on the screen. Using the proportional control technique, the control expression is determined as follows: where ycoyc is the adjustment coefficient. To simplify the implementation of the control law on the physical system, the control action is activated only when ya0 Oe ya > 0. This implies that the control law . is applied only when yuU/2 < yc2 O yuU with ycN 2 Ou 0, andOeyuU O yc2 < OeyuU/2 with ycN 2 O 0, under a fixed motor input voltage of 3 V. Therefore, a simplified version of the control law is presented in Fig. q2 ycN Tynh qyc22vy Determine and ( q2 C . ( OeA C q2 A OeA / . and ( q2 A . Yes ut = 3V Yes ut = 0V BTS7960 yc = ycoyc . a0 Oe y. cN 2 ycaycuyc( yuU Oe yc2 )) (A / 2 A q2 C A ) Board STM32F407 Computer Pendulum Encoder Cart Motor Fig. Experimental model of the inverted pendulum on a cart system The data acquisition software interface is shown in Fig. with a data sampling period of 100 ms, featuring the following main functional groups: AuStatesAy displays the values of the state variables of the inverted pendulum system. AuGraphAy allows plotting or clearing graphs with two buttons labeled AuDRAWAy and AuCLEARAy. AuPosition ControlAy is used to control the cart position after balancing the pendulum at an angle yc2 OO 0. The software interface displays time-based graphs of the system states, including Pendulum angle. Cart position, and Control signal ut. ut = Ae3V Fig. Simple swing-up algorithm IV. EXPERIMENTAL RESULTS In this experimental section, the aim is to verify the control law designed using the adaptive Backstepping method based on RBF neural networks . , with the primary objective of bringing the pendulum angle yc2 = 0 within the limited travel range of the cart. Therefore, the cartAos return to its initial position is not emphasized. Attempting to adjust the cart to return to the initial position would affect the objective of bringing the pendulum angle to zero, meaning the quality of the pendulum angle response would deteriorate. The initial angle for applying control laws . c2 | = yuU/12. Experimental Model and Data Acquisition Software The control law is executed on a real-time embedded system using a model self-built by the authors with the following system parameters: travel length of 0. 4 m, pendulum mass variable, and cart mass of 712 g. The cart is driven by a ball screw transmission system and a DC motor. The components of the inverted pendulum control system are shown in Fig. The STM32F407 microcontroller is used as the central processor, operating at a quartz frequency of 100 MHz. An encoder measuring the inverted pendulum angle . ith a resolution of 600 pulses per revolutio. and an encoder measuring the cart position . ith a resolution of 100 pulses per revolutio. are connected to the microcontroller. The DC motor is controlled via a controller and an H-bridge BTS7960 43 A circuit. The system is powered by a 12 V DC power supply with a current 10A. The system connects to data acquisition software through a UART serial Fig. Data acquisition software interface Experimental Results To demonstrate the effectiveness of the proposed control law . with the adaptive law . based on RBF neural networks, the authors conducted experiments under different scenarios with varying pendulum masses. In case 01, the pendulum is a circular rod with a mass of 84 g. The response of the inverted pendulum system is shown in Fig. Fig. 7, and Fig. Fig. Inverted pendulum angle response Huynh Van Khuong. Nonlinear Control Law Design for Inverted Pendulum Systems via RBF Neural Networks Journal of Fuzzy Systems and Control. Vol. No 2, 2025 Fig. Cart position response Fig. System control signal From the experimental results in this case, we observe that the proposed control law ensures the pendulum remains stable at the equilibrium position, but with some deviation in the cart position. From Fig. 6, it can be seen that the pendulum angle quickly approaches and stabilizes at the upright position within approximately 0. 4 seconds starting from the angle yuE = yuU/12 ycycaycc Fig. 7 shows the cart position stabilizing at 3 cm with minimal oscillation. From Fig. 8, the control signal of the proposed control law remains within allowable limits and exhibits a low oscillation frequency. In case 02, the pendulum is a circular rod with a mass of 126 g. The response of the inverted pendulum system is shown in Fig. Fig. 10, and Fig. Fig. Inverted pendulum angle response Fig. Cart position response Fig. System control signal In this case, although the mass increases, the proposed control law still ensures the inverted pendulum remains stable at the upright position. However. Fig. 10 shows that the cart position oscillates periodically around 3 cm. Fig. 9 illustrates that the pendulum angle quickly approaches and stabilizes at the upright position within approximately 0. 4 seconds. The control signal (Fig. varies at a higher frequency compared to the first case. In case 03, the pendulum is a circular rod with an attached load block, with a total mass of 502 g. The response of the inverted pendulum system is shown in Fig. Fig. and Fig. Fig. Inverted pendulum angle response Fig. Cart position response Fig. System control signal Huynh Van Khuong. Nonlinear Control Law Design for Inverted Pendulum Systems via RBF Neural Networks Journal of Fuzzy Systems and Control. Vol. No 2, 2025 In this case, when the pendulum mass increases significantly, the time required to bring the pendulum close to the equilibrium point using the Swing-up controller increases to 14. 4 seconds. The settling time to the equilibrium position, measured from the angle yuE = yuU/12 ycycaycc, remains nearly unchanged, while small oscillations appear simultaneously (Fig. From Fig. 13, we observe that the larger pendulum mass results in greater amplitude and stronger oscillations in the cartAos movement compared to the previous two cases. The control signal (Fig. also exhibits larger operating amplitude and stronger oscillations. CONCLUSION The authors of this paper proposed a method for designing a nonlinear control law to stabilize the inverted pendulum system using Backstepping control combined with RBF neural networks. The backstepping controller was developed based on the general mathematical model of a 2-DOF underactuated mechanical system. By leveraging the nonlinear function approximation capability of the RBF network to estimate the unknown functions in the model, experimental results under various conditions demonstrated that the system could maintain the pendulum in the upright position with low overshoot and fast response. This study not only confirms the effectiveness of the proposed control law for the inverted pendulum system but also suggests its potential applicability to any system that can be modeled in the form of an inverted pendulum. However, the results also reveal certain limitations, such as the cart position not returning to zero and the presence of oscillations when the model parameters vary significantly. In future work, the authors plan to apply intelligent techniques to optimize controller parameters and RBF network structures to enhance control performance. REFERENCES