Journal of Fuzzy Systems and Control. Vol. No 2, 2025 ISSN: 2986-6537. DOI: 10. 59247/jfsc. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Thanh-Tri-Dai Le 1. Ngoc-Kien Nguyen 2. Phuc-Truong Le 3. Minh-Nguyen-Bao Bui 4. Trong-Tin Nguyen 5. Chi-Anh Tran 6. Phuong-Tu Doan 7. Duc-Nhan Dao 8. Van-Dong-Hai Nguyen 9. Thanh-Tung Nguyen 10,* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Ho Chi Minh City University of Technology and Education (HCMUTE). Ho Chi Minh City (HCMC). Vietnam Ho Chi Minh City Bach Nghe College. Ho Chi Minh City (HCMC). Vietnam Email: 1 19151051@student. vn , 2 21146477@student. vn, 3 21146528@student. 20151013@student. vn, 5 21151174@student. vn, 6 20151334@student. 21146531@student. vn, 8 21145224@student. vn, 9 hainvd@hcmute. tungnguyen98ac@gmail. *Corresponding Author AbstractAiThis paper presents an enhanced approach to stabilizing the Rotary Double Parallel Inverted Pendulum (RDPIP) through a combination of the LQR method and the BAT algorithm. Traditionally, selecting appropriate Q and R matrices relies on designers' intuitions or trial-and-error processes, often resulting in suboptimal performance. leveraging the BAT algorithmAos swarm intelligence, the proposed method automatically optimizes the cost function to yield improved control performance. Key improvements include shorter stabilization time, reduced overshoot, and minimized oscillations. Simulation results show that the BATenhanced LQR controller significantly outperforms traditional design in terms of convergence speed and system damping. These findings underscore the potential of metaheuristic algorithms in refining classical control strategies for complex, nonlinear systems. linear controller. However, a direction of optimizing LQR control has not been mentioned yet for this model. In this research, we utilize results from previously tested LQR control . but we develop a searching method to optimize the traditional LQR control. KeywordsAiLQR Controller. BAT Algorithm. Rotary Double Parallel Inverted Pendulum. Swarm Intelligence INTRODUCTION Inverted pendulum (IP)Aicharacterized by its underactuated, nonlinear, and strongly coupled natureAiis a classic benchmark in control theory. It effectively exemplifies key attributes such as stability, robustness, and tracking performance, making it an ideal platform for comparing different control strategies and assessing their respective strengths and weaknesses. Consequently, extensive research on this system has significantly advanced the field of control theory . Fig. 1 illustrates fundamental structure of a novel benchmark model: the first-order RPDIP. With its intricate mechanical design, higher degrees of freedom, and pronounced nonlinear dynamics. RPDIP poses a considerably greater challenge in terms of control. Studies on RPDIP are expected to provide valuable insights that will guide the development of control methods for similar systems. LQR and nonlinear controllers have been applied to Rotary IP (RIP) . and other kinds of pendulums . PRDIP is a developed form from RIP in mechanical design by adding parallel link to existing arm . Based on that research, a fuzzy controller is designed to operate this model well from imitating LQR traditional controller . Thence, it is proved that intelligent control can be applied for this model from a Fig. PRDIP model . LQR is a classical control that is applied widely in IP . This method is designed by modeling the system Its accuracy and efficiency have been verified. But, weight matrices ycE and ycI are still chosen through the trialand-error test. In . , methods of choosing those matrices are shown, but difficulties in simultaneously ensuring satisfaction of the objective function and satisfying the criteria still exist. In this paper, we use the BAT algorithm for multivariate problems. This algorithm learns from the movement of bats in finding prey and avoiding obstacles in order to find solutions for the objective function . LQR control is designed from on swarm optimization. The BAT algorithm is used to optimize ycE and ycI. By updating matrix parameter values, we use weighting techniques to incorporate designers' experiences in algorithm's search. Simulation proves the ability of BAT algorithm. Optimized control law is shown to be effective when compared with conventional LQR control rules. Mathematical model of system forms the foundation for designing the LQR controller, which is enhanced through the application of swarm optimization techniques. Specifically, the BAT algorithm is employed to optimize the ycE and ycI 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 matrices, leveraging its robust search capabilities. To further refine optimization process, a weighting technique is integrated into parameter update mechanism, allowing the incorporation of designer's expertise into the algorithm's search process. This approach aims to achieve a globally optimal solution for the matrices, enabling LQR controller to generate an optimal state feedback control matrix. By doing so, it addresses the limitations associated with traditional methods that rely heavily on experience, trial-and-error for selecting ycE and ycI matrices. Effectiveness of the proposed controller is demonstrated through simulation, where its performance is compared against conventional LQR control. Novelty of BAT algorithm in comparison to other-based LQR designs, such as PSO or genetic algorithm (GA), lies in its bio-inspired echolocation mechanism, which enables a dynamic balance between exploration and exploitation through adaptive adjustments of frequency, loudness, and pulse emission rates. Unlike PSO, which relies on position and velocity updates influenced by social learning, or GA, which depends on stochastic crossover and mutation operators, the BAT algorithm offers a more structured and directed search process. It facilitates efficient local exploitation near the best-known solutions while preserving global search capabilities, thereby improving the likelihood of escaping local optimization in high-dimensional and nonlinear optimization problems. The BAT algorithm requires fewer control parameters, simplifies tuning efforts, and generally exhibits faster convergence. These features make it particularly well-suited for optimizing the Q and R weighting matrices, especially for complex and underactuated systems such as RDPIP. II. MATHEMATICAL MODEL OF PRDIP Definition First pendulum's mass First pendulum's length Angle of ith pendulum The inertia of "i-th" pendulum Effective moment of inertia of pendulum Angle of arm Length of arm ArmAos inertia Torque of DC motor Gravitational constant Coefficient of viscosity for i-th pendulum Coefficient of viscosity of arm Table 2. Values of system parameters Pendulum 1 526*10-4 Pendulum 2 0693*10-4 The following is the Lagrange equation. ycc yuiya yuiya yuiycO = yaycn yccyc yuiycN ycn yuiycycn yuiycN ycn Kinetic energy is ya = ya0 yuoN 2 ya1 yuEN1 ya2 yuEN2 yco1 yc1 2 yco2 yc2 2 where yc1 ,yc2 respectively, are the velocities of the first and second pendulums. Kinetic energy is rewritten as. ya = ya0 yuoN 2 ya1 yuEN1 ya2 yuEN2 coEa1 ycycnycu yuE1 yuoN)2 yco1 . ayuoN)2 yco1 . coEa1 yuEN1 ) Oe yco1 ycoEa1 ya ycaycuyc yuE1 yuEN1 yuoN coEa2 ycycnycu yuE2 yuoN)2 yco2 . ayuoN)2 yco2 . coEa2 yuEN2 ) Oe yco2 ycoEa2 ya ycaycuyc yuE2 yuEN2 yuoN The system's potential energy is ycO = yco1 yciycoEa1 ycaycuyc yuE1 yco2 yciycoEa2 ycaycuyc yuE2 ycO= yca yuoN 2 yca1 yuEN1 yca2 yuEN2 The Lagrange equation is. Table 1. System parameters Parameter ycoycn ycoEaycn ya yaycn ya0 yaycn ya0 ya =ycOOeycO Energy dissipation of PRDIP is The fundamentals of PRDIP System parameters are listed in Table 1 . Table 2 presents key parameters relevant to PRDIP . Parameters ycoycn ycoEaycn yuEycn yaycn = yaycn ycycnycu2 yuEycn ya ya0 Arm Unit m/s2 Nms Nms ya = ycO Oe ycO = ya0 yuoN 2 ya1 yuEN1 ya2 yuEN2 coEa1 ycycnycu yuE1 yuoN)2 yco1 . ayuoN)2 yco1 . coEa1 yuE1 ) Oe yco1 ycoEa1 ya ycaycuyc yuE1 yuEN1 yuoN coEa2 ycycnycu yuE2 yuoN)2 yco2 . ayuoN)2 yco2 . coEa2 yuEN2 ) Oe yco2 ycoEa2 ya ycaycuyc yuE2 yuEN2 yuoN Oeyco1 yciycoEa1 ycaycuyc yuE1 Oe yco2 yciycoEa2 ycaycuyc yuE2 DC servo motor is used to control whole model. Relation between torque and voltage is yua= yayc yayc yayca ycOya Oe yuoN ycIyca ycIyca Parameters of DC motor are in Table 3 . Lagrange operator is Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 Table 3. Parameters of motor Parameter yayc ycIyca Unit Vs/rad Vs/rad yu Value ycs12 Matrices A and B are calculated to be Dynamic equations of PRDIP are ycs11 . cs21 ycs31 ycuN = yaycu yaAyc yc = yaycu ya = ycA Oe1 ycI. yaA = ycA Oe1 ya ycs13 yuoO ya1 yayc ycOya ycs23 ] . uEO1 ] . a2 ] = . ycIyco ya3 ycs33 yuEO Where: ycA Where: ycs11 = ya0 yco1 ycoEa1 2 ycycnycu2 yuE1 yco1 ya2 yco2 ycoEa2 2 ycycnycu2 yuE2 yco2 ya2 ycs12 = Oeyco1 yaycoEa1 ycaycuyc yuE1 ycs13 = Oeyco2 yaycoEa2 ycaycuyc yuE2 ya1 = yco1 ycoEa1 2 yuEN1 yuoN ycycnycu( 2yuE1 ) yco1 ycoEa1 yayuEN1 ycycnycu yuE1 yayc yayca yca0 yuoN yco2 ycoEa2 2 yuEN2 yuoN ycycnycu( 2yuE2 ) . ca0 )yuoN ycIyca = 0 0 ya0 yco1 ya2 yco2 ya2 Oeyco1 yaycoEa1 Oeyco2 yaycoEa2 Oeyco1 yaycoEa1 ya1 yco1 ycoEa1 2 ycI= 0 Oe. ca0 0 yco1 yciycoEa1 yco2 yciycoEa2 ya = . Oeyco2 yaycoEa2 ya2 yco2 ycoEa2 2 ] yayc yayca ycIyca ycIyca ycs21 = Oeyco1 yaycoEa1 ycaycuyc yuE1 Oeyca1 Oeyca2 ] . Thence, it yields ycs22 = ya1 yco1 ycoEa1 2 ycs23 = 0 ya2 = Oeyco1 ycoEa1 2 yuoN 2 ycycnycu yuE1 ycaycuyc yuE1 Oe yco1 yciycoEa1 ycycnycu yuE1 yca1 yuEN1 ycs31 = Oeyco2 yaycoEa2 ycaycuyc yuE2 ycs32 = 0 ycs33 = ya2 yco2 ycoEa2 2 ya3 = Oeyco2 ycoEa2 2 yuoN 2 ycycnycu yuE2 ycaycuyc yuE2 Oe yco2 yciycoEa2 ycycnycu yuE2 yca2 yuEN2 yaA = . Linearized state equation Equilibrium point . he upright positio. is chosen as yuo OO 0. yuE1 OO 0. yuE2 OO yuU. yuoN OO 0. yuEN1 OO 0. yuEN2 OO 0 ycu = . uo yuE1 yuE2 yuoN yuEN1 yuEN2 ]ycN ya= 1037 Oe1. 8760 Oe0. 0002 Oe0. 0424 Oe0. ycN . The linear model at the equilibrium can be obtained by . If using pole-placement. MATLAB can be obtained by using the command eig . yuI1 = 0. yuI2 = 4. yuI3 = 4. yuI4 = -4. yuI5 = -5. yuI6 = -1. SYNTHESIS CONTROLLER FOR PRDIP LQR Method Nonlinear system is shown as ycuN = yce. where ycu = . cu1 ycu2 . ycuycu ]ycN is state variable matrix. u is control signal. Equilibrium point is chosen as: ycu1 = ycu2 =. = 0. ycu3 = OeyuU. cu0 = yc. When u=0, system is balanced. We can approximate system in . to linear form as Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 ycuN = yaycu yaAyc ya= yuyce yuyci . cu=ycu . yaA = . cu=ycu yuycu yuycu yc=0 yc=0 Around equilibrium point, we consider system approximately a linear system. Thence. LQR control structure at working point of a linear system in . can be shown in Fig. Fig. LQR controller structure Control signal is . = Oeyaycu. Command to compute K is executed as follows: yayaycEycI = ycoycyc. a, yaA, ycEyaycEycI , ycIyaycEycI ) Where: A and B are calculated in . , ycE and ycI are weight matrices selected as follows. ycEyaycEycI = [ ycE1 ] . ycIyaycEycI = ycI0 Matrices ycE and ycI impose mutual restrictions, where ycE is directly proportional to the system's anti-interference Increasing ycE enhances this capability and shortens the system's adjustment time. However, it also amplifies system oscillations and raises energy consumption. Conversely, increasing ycI reduces power consumption but extends the adjustment time. Therefore, the key to effective design lies in determining the appropriate weight matrices ycE and ycI. Once these matrices are established, the state feedback matrix ya is determined. However, selecting ycE and ycI largely relies on experience and a trial-and-error approach in the LQR controller design process. This subjectivity can lead to an imperfect controller design, ultimately affecting control yayaycEycI = . a0 ya1 ya2 ya3 ya4 ya5 ] . Basics of BAT algorithm BAT algorithm . , is inspired by the echolocation behavior of microbats. A key distinguishing feature of this algorithm is its use of frequency tuning, making it the first of its kind to integrate optimization with computational In this approach, each bat is represented by a velocity ycycnyc and a position ycuycnyc at iteration yc within a yccdimensional search space. The position serves as a solution vector associated with a specific objective function. Among the ycu bats in the population, the best solution ycu O found during the iterative search is retained for reference. The algorithm follows these fundamental assumptions . Bats utilize sound wave echolocation to assess distances and can distinguish between food sources, prey, and Each bat moves randomly with velocity ycycnyc at position ycuycnyc , adjusting frequency ycE . r wavelengt. of emitted pulses as well as the pulse emission rate yc OO . , . based on the targetAos proximity. While echo intensity can vary in different ways, it is generally assumed to decrease from an initial maximum value ya0 to a minimum threshold yaycoycnycu . Many studies, for simplicity, do not incorporate ray tracing into this algorithm. Instead, they leverage variations in frequency yce or wavelength yuI to adapt to different applications, depending on factors such as ease of implementation . Regarding this problem. LQR controller will be utilized in conjunction with BAT algorithm to determine the optimal Q and R parameter set. First, we determine the parameters of algorithm and generate an initial BAT population. The following key parameters are initialized in Table 4: Table 4. BAT algorithm initialization parameters Parameters ycuyaAyaycN ycc ycA ya0 yc0 yayca , ycOyca ycEycoycaycuycoycnycu Definition Number of BATs Number of parameters to find Maximum number of iterations Initial loudness Initial pulse emission rate The search space limits The frequency limits After defining the parameters of the BAT algorithm, first, we initialize the initial random position ycuycn_yaAyaycN , velocity ycycn , and frequency yceycn of the bat. ycuycn_yaAyaycN = yayca . cOyca Oe yayca ) UI rand. ycycn = 0 yceycn = ycEycoycnycuycoycaycuycoycnycu Next is to evaluate the quality of each initial solution in the overall scheme. If the solution violates constraints . any value O . , assign an infinite fitness value. cuycn_yaAyaycN ) = O, ycnyce ycuycn_yaAyaycN ycnyc ycnycuycycaycoycnycc The weight matrices Q and R for LQR controller are constructed as follows to match the search process of BAT Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 ycu0yaAyaycN ycEyaycEycIyaAyaycN = [ 0 ycu1yaAyaycN Increase pulse emission rate: ycu5yaAyaycN ] ycIyaycEycI_yaAyaycN = ycu6_yaAyaycN The optimal controller K is determined by solving the Riccati equation using the matrices ya, yaA, ycE and ycI. yayaycEycI_yaAyaycN = ycoycyc. a, yaA, ycEyaycEycI_yaAyaycN , ycIyaycEycI_yaAyaycN ) . Performance of controller is evaluated using the fitness ycN = ycycn Oe yce Oeyuyc ] Where yu and yu are optional constants that can be adjusted to suit specific cases. The best solution found so far has been If a new solution outperforms the current global best, it is updated accordingly. ycu O = ycuycn_yaAyaycN_ycO , yaycn_yaAyaycN_ycOycoycnycu . The entire BAT algorithm is iteratively repeated until the termination condition of loop ycA is met. Fig. 3 illustrates a block diagram of controller synthesis utilizing LQR method integrated with BAT cuycn_yaAyaycN ) = O Oc yceycn 1 Where yceycn is the error of ycuycn = . uo yuE1 yuE2 yuoN yuEN1 yuEN2 ]ycN Updating of the best-known solution, best-known solution ycu O is updated by selecting solution with minimum fitness value. ycu O = ycaycyciycoycnycuya. cuycn_yaAyaycN ) . ycuycn_yaAyaycN . cOe. cOe. Update bat positionsycuycn_yaAyaycN_ycO , velocities ycycn_yaAyaycN_ycO , and frequencies yceycn_yaAyaycN_ycO iteratively. yceycn_yaAyaycN_ycO = ycEycoycnycuycoycaycuycoycnycu . cOe. cOe. ycycn_yaAyaycN_ycO = ycycn_yaAyaycN_ycO . cuycn_yaAyaycN_ycO Oe ycu O )yceycn_yaAyaycN_ycO . cOe. cOe. ycuycn_yaAyaycN_ycO = ycuycn_yaAyaycN_ycO ycycn_yaAyaycN_ycO . To ensure adherence to the defined search space, boundary constraints are enforced on the position. ycuycn_yaAyaycN_ycO = ycoycaycu. cuycn_yaAyaycN_ycO , ycOyca ), yayca ) . If a bat emits fewer pulses, it performs a local search near the best-known solution. yayceycycaycuycc > ycycn , ycuycn_yaAyaycN_ycO = ycu O yunyayc Where: yun O ycO(Oe1,. Next, repeat the process from formula number . The solution is updated if an improvement is observed. yayce ya. cuycn_yaAyaycN_ycO ) O ya. cuycn ) ycaycuycc ycycaycuycc < yaycn , ycEayceycu ycuycn = ycuycn_yaAyaycN_ycO . The algorithm parameters are adjusted to decrease loudness and increase the pulse emission rate, thereby achieving a balance between exploration and exploitation. Decrease loudness over iterations: = yuyaycn Fig. Block diagram of the controller. IV. RESULTS AND DISCUSSION Parameter set obtained through the trial-and-error method as well as the parameter set derived from the BAT The results from both approaches were then compared to evaluate their effectiveness. To synthesize LQR controller, we first select parameter determination scenario as follows: bring pendulums from initial position ycuycn = . ycN to original equilibrium position ycuycn = . 0 0 0 0 . ycN . Traditional LQR control Parameter values for Q and R are specified as follows. ycEyaycEycI = 0 [ 0 ycIyaycEycI = 10 Control parameters are determined by the usual trial and error method and the resulting ya matrix is yayaycEycI = 105 O . The simulation results of traditional LQR controller are shown in Fig. Fig. Fig. 6, and Fig. Fig. 4 shows position of the crank arm. It shows initial oscillation amplitude of approximately 0. 12 radians. The system exhibits a significant damping effect, with oscillations gradually decreasing over time. however, complete stabilization is achieved after approximately 30 seconds, indicating a Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 relatively slow convergence. In contrast. Fig. 5 shows the position of Pendulum 1, which demonstrates an initial oscillation amplitude of around A0. 01 radians and stabilizes fully within approximately 7 seconds, reflecting a notably faster convergence compared to the crank arm. Similarly. Fig. 6 presents position of Pendulum 2, with initial oscillation amplitude of approximately A0. 01 radians, comparable to Pendulum 1. However. Pendulum 2 requires slightly more time to stabilize, reaching full stability after approximately 8 These results highlight the differences in stabilization dynamics between the crank arm and the pendulums, with the latter exhibiting significantly faster convergence and more efficient damping. Fig. 7 shows control signal U, which initially exhibits approximately A12V. Over time, the signal demonstrates a gradual stabilization, with oscillations diminishing significantly after approximately 10 seconds, ultimately maintaining a stable and reduced level. This behavior indicates the effective convergence of the control system toward a steady-state condition. Fig. Angle of arm Fig. Angle of pendulum 1 Fig. Angle of pendulum 2 Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 Fig. Signal control U LQR Controller optimized by BAT algorithm In this section, we present results obtained from determining ycE and ycI parameters of LQR controller using BAT algorithm can be seen in Table 5. ycEyaycEycI_yaAyaycN ycu0_yaAyaycN [ 0 ycu1_yaAyaycN ycu2_yaAyaycN ycu3_yaAyaycN ycIyaycEycI_yaAyaycN = ycu6_yaAyaycN ycu4_yaAyaycN later than Pendulum 1, yet still demonstrating quick damping and a well-balanced control strategy. These results collectively highlight the efficiency and robustness of the control system in achieving rapid stabilization across all In Fig. 11, it shows control signal U, initially exhibits Amplitude ranges from A12V. Signal gradually decreases and stabilizes within 6 seconds, demonstrating a smooth reduction in control effort. This behavior suggests efficient energy utilization while ensuring system stability. comparison of convergence times across system components further highlights the effectiveness of the control strategy, with the crank arm stabilizing in approximately 10 sec. Pendulum 1 in 3 sec, and Pendulum 2 in 4 sec, collectively underscoring balanced and rapid stabilization achieved by the control approach. ycu5_yaAyaycN ] Fig. Angle of arm Table 5. BAT algorithm parameters table found. Parameters ycu0_yaAyaycN ycu1_yaAyaycN ycu2_yaAyaycN ycu3_yaAyaycN ycu4_yaAyaycN ycu5_yaAyaycN ycu6_yaAyaycN Values Control parameters are determined using BAT algorithm and the resulting K matrix is calculated as yayaycEycIyaAyaycN = 106 O [. 2142 ]-0. Simulation results of LQR controller combined with BAT algorithm are shown in Fig. 8 to Fig. Fig. 8 shows the position of the crank arm, showing initial oscillation amplitude of approximately 0. 04 rad. The system exhibits a gradual reduction in oscillations, stabilizing after approximately 10 sec, with a smooth decrease in amplitude and no excessive overshoot, indicating an effective damping Similarly. Fig. 9 shows the position of Pendulum 1, which demonstrates initial oscillation amplitude of around A0. 005 rad. The system converges rapidly, achieving full stabilization within 3 sec, reflecting highly effective control with minimal residual fluctuations. Fig. 10 presents the position of Pendulum 2, with an initial oscillation amplitude comparable to Pendulum 1 (A0. 005 ra. However. Pendulum 2 stabilizes fully after approximately 4 sec, slightly Fig. Angle of pendulum 1 Fig. Angle of pendulum 2 Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 Fig. Signal control u Fig. Signal control U Compare results The simulation comparison of state variables of the system under traditional LQR and optimized LQR controllers is shown in Fig. 12 to Fig. The details of these figures are listed in Table 6 to Table 8 for discussion. Stabilization Time: In Table 6, the comparison of settling times of variables is shown for both traditional LQR and BAT-optimized LQR In Table 6. LQR BAT Algorithm significantly improves stabilization time across all components. The crank arm now stabilizes three times faster, while the pendulums converge in half the time compared to the traditional LQR. Table 6. Comparison of Stabilization Time. Component Arm Pendulum 1 Pendulum 2 Control Signal U Fig. Angle of arm LQR Traditional 30 sec 7 sec 8 sec 10 sec LQR BAT algorithm 10 sec 3 sec 4 sec 6 sec . Oscillation Amplitude: In Table 7, the vibrations of variables are compared in both traditional LQR and BAT-optimized LQR controllers. In Table 7. BAT algorithm significantly reduces the initial peak oscillations, resulting in a smoother and more controlled system response. Specifically, the crank arm's initial oscillation amplitude is reduced by 67%, demonstrating improved damping performance. Similarly, the pendulums exhibit a 50% reduction in oscillation amplitude, contributing to enhanced stability. While the control signal maintains the same peak amplitude, it stabilizes more rapidly, indicating both efficient energy utilization and faster convergence. These improvements collectively highlight the effectiveness of the BAT algorithm in optimizing system performance. Table 7. Comparison of Initial Oscillation Amplitude. Fig. Angle of pendulum 1 Component Arm Pendulum 1 Pendulum 2 Control Signal U Fig. Angle of pendulum 2 LQR Traditional 0. 12 rad A0. 01 rad A0. 01 rad A12V LQR BAT algorithm 0. 04 rad A0. 005 rad A0. 005 rad A12V Statistical Validation and Discussion of Limitations: To further validate the performance improvement achieved by the BAT-optimized LQR controller, a statistical analysis was conducted based on multiple simulation runs. Specifically, we computed the Mean Absolute Error (MAE) and Root Mean Square Error (RMSE) of the angular positions of the crank arm and both pendulums. Table 8 presents the comparative results between the conventional LQR and the BAT-based LQR controllers. In Table 8, statistical data further corroborate the visual The BAT-based LQR consistently reduces both Thanh-Tri-Dai Le. LQR Controller Based on BAT Algorithm for Rotary Double Parallel Inverted Pendulum Journal of Fuzzy Systems and Control. Vol. No 2, 2025 the MAE and RMSE values across all components, indicating more precise tracking and better damping characteristics. Table 8. Statistical performance comparison over 10 simulation runs Component Controller Type Arm Arm Pendulum 1 Pendulum 1 Pendulum 2 Pendulum 2 LQR LQR BAT LQR LQR BAT LQR LQR BAT MAE (Ra. RMSE (Ra. However, despite the improved performance, the proposed approach also introduces certain limitations that should be acknowledged. One primary concern is the computational cost associated with the BAT algorithm. Since the optimization requires multiple iterations of Riccati equation solving and dynamic simulations per candidate solution, the total computation time may become significant, especially for high-dimensional systems or real-time Furthermore, the current implementation assumes an offline optimization setting, where the optimal gain matrix is computed prior to deployment. Applying this approach to real-time systems would require additional considerations, such as real-time feasibility of matrix updates, computational load on embedded hardware, and stability under model These aspects highlight the need for future work focused on hardware-in-the-loop testing, algorithmic simplification, or hybrid methods that combine fast-converging techniques with the global search capacity of BAT to balance performance and real-time capability. CONCLUSION This study proposed a hybrid control design that combines LQR control with the BAT algorithm to stabilize RDPIP. By leveraging the global search capability of the BAT algorithm, the proposed method effectively optimized Q and R weighting matrices, overcoming limitations of conventional trial-and-error approaches. The simulation results demonstrated significant improvements in stabilization time, oscillation suppression, and control efficiency compared to the traditional LQR controller. In addition to the simulation-based validation, statistical metrics such as Mean Absolute Error (MAE) and Root Mean Square Error (RMSE) confirmed the superior tracking accuracy of the BAT-optimized controller. These findings highlight the practical potential of integrating metaheuristic optimization with classical control strategies for underactuated and nonlinear systems. For future work, several concrete directions are First, real-time implementation of the proposed method on embedded hardware or robotic platforms should be investigated to evaluate its practical feasibility and robustness under physical uncertainties and disturbances. Second, comparative studies with other metaheuristic algorithms such as PSO. GA, or newer variants like Grey Wolf Optimizer (GWO) would further validate the effectiveness of BAT in this context. Additionally, developing a simplified or adaptive version of the BAT algorithm with lower computational cost could enable online or real-time tuning of controller parameters. Finally, the scalability and generalizability of this approach should be explored by applying it to other complex, high-order, or multi-input-multi-output (MIMO) control systems beyond the RDPIP, such as aerial vehicles, robotic manipulators, or balancing robots. Such extensions would demonstrate the broader applicability of the proposed control framework in diverse domains. ACKNOWLEDGMENT This paper belongs to project SV2025-157 and it is funded by Ho Chi Minh City University of Technology and Education (HCMUTE). We, authors, want to give thanks for that support. REFERENCES