A Novel Integration of Metaheuristic – Based Optimization Methods for Enhancing Fuzzy Logic Control Performance on Inverted Pendulum-Cart Systems

A Novel Integration of Metaheuristic – Based Optimization Methods for Enhancing Fuzzy Logic Control Performance on Inverted Pendulum-Cart Systems

Ngoc-Khoat Nguyen* Thai-Duong Le | Duy-Trung Nguyen | Thi-Mai-Phuong Dao 

Faculty of Control and Automation, Electric Power University, Hanoi 100000, Vietnam

Faculty of Automation, School of Electrical and Electronic Engineering (SEEE), Hanoi University of Industry, Hanoi 100000, Vietnam

Corresponding Author Email: 
khoatnn@epu.edu.vn
Page: 
773-782
|
DOI: 
https://doi.org/10.18280/jesa.580411
Received: 
22 February 2025
|
Revised: 
25 March 2025
|
Accepted: 
5 April 2025
|
Available online: 
30 April 2025
| Citation

© 2025 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).

OPEN ACCESS

Abstract: 

This paper proposes a novel hybrid control strategy for improving the balance and trajectory tracking performance of a typical inverted pendulum system. The system is made up of a freely circling pendulum mounted on a horizontally mobile cart. The control objective is to stabilize the pendulum in an upright position while simultaneously guiding the cart along a desired trajectory. A hybrid optimization approach, combining an enhanced Particle Swarm Optimization (PSO) algorithm with the BA Algorithm (BA), is proposed to optimize the critical parameters of a direct fuzzy logic controller. In the initialization phase, PSO is utilized to generate a high-quality initial population. Subsequently, BA refines the optimization by tuning the scaling factors of the fuzzy controller. The direct fuzzy controller incorporates five preprocessing and postprocessing factors, which significantly impact the overall control performance. Numerical simulations and experimental results demonstrate that the proposed PSO-BA hybrid method achieves faster computation times and efficiently identifies optimal parameters, resulting in rapid and robust control responses even in large search spaces. Comparative analysis reveals that this novel approach outperforms conventional PID controllers and fuzzy controllers optimized with standard PSO-based techniques, exhibiting superior control quality and responsiveness.

Keywords: 

hybrid, PSO, BA, initialization, inverted pendulum on cart system, balancing problem

1. Introduction

The inverted pendulum is considered a quintessential system in control theory, embodying fundamental principles and acting as a crucial platform for testing the practical application of theoretical control designs and engineering, renowned for its instability and nonlinear dynamics [1-3]. The challenge lies in maintaining the pendulum in an upright position while the cart moves along the horizontal axis. This problem has wide-ranging applications in robotics, transportation systems, and aerospace engineering, making it a critical subject for validating advanced control strategies [4]. Despite being the application focus of this research, the inverted pendulum system primarily serves as a testbed for exploring improvements in optimization techniques, which is the core objective of this study.

Within the domain of inverted pendulum control, traditional linear controllers, with the Proportional-Integral-Derivative (PID) algorithm being a prime example, have been frequently implemented due to their structural simplicity and established design procedures. While effective for linear systems, these methods often struggle with the nonlinear and uncertain nature of inverted pendulum dynamics [5, 6]. In recent years, intelligent control methods, particularly fuzzy logic controllers, have gained significant attention. Fuzzy logic controllers are highly suitable for nonlinear systems due to their reliance on expert knowledge rather than precise mathematical models [7-10]. They enable flexible and adaptive control through a set of rule-based operations, making them effective under dynamic and uncertain conditions.

A key factor influencing the performance of fuzzy logic controllers is the proper tuning of their parameters, such as scaling factors, membership functions, and rule sets. The tuning process presents significant challenges as it requires optimization within a high-dimensional search space containing numerous local extrema. Among existing optimization techniques, metaheuristic methods in general, and the Particle Swarm Optimization (PSO) algorithm in particular, have gained widespread popularity due to their simplicity, computational efficiency, and ability to deliver satisfactory solutions across various domains [11-15]. The PSO is a nature-inspired metaheuristic algorithm based on the social behavior of bird flocks or fish schools. It works by having a population of particles, each representing a potential solution, explore the search space. These particles adjust their positions iteratively based on their own best experiences and those of their neighbors, converging toward an optimal or near-optimal solution. Standard PSO offers several advantages, including ease of implementation, few hyperparameters, and suitability for continuous optimization problems. However, it might include the following limitations:

Premature convergence: PSO often converges to suboptimal solutions, especially in complex or multimodal landscapes.

Local optima: The algorithm may become trapped in local optima due to insufficient exploration.

Inertia and balance: Striking the right balance between exploration (searching new areas) and exploitation (refining known good solutions) is a persistent challenge.

To address these limitations, this study proposes a hybrid optimization approach that enhances the standard PSO algorithm by integrating it with the BA Algorithm (BA). The BA, inspired by the echolocation mechanism of BAs, is effective in maintaining a balance between exploration and exploitation [16-18]. By using the BA to initialize the positions and velocities of particles in the PSO process, the PSO-BA hybrid method is designed to accelerate convergence and mitigate the risk of premature stagnation.

This approach addresses some of the limitations of PSO while combining the strengths of both algorithms. The organization of this paper is structured into five Sections. Following the Introduction, Section 2 discusses the mathematical modeling of the cart-inverted pendulum system and the framework of the control strategy utilizing a fuzzy logic controller. Then, Section 3 introduces an enhanced PSO algorithm integrated with the BA algorithm. Section 4 highlights the simulation outcomes carried out on MATLAB/Simulink software as well as the practical experiments on a physical prototype, and the final section concludes the study while suggesting potential future research directions.

2. Inverted Pendulum System: Dynamic and Control Strategy

2.1 Dynamic model

Numerous studies have shown that the design of a fuzzy controller does not necessarily rely on an accurate mathematical model of the system. Instead, the design process is primarily based on expert knowledge and insight into the system’s dynamic behavior, aiming to establish a reasonable relationship between input and output variables. The core objective is to formulate an appropriate control strategy in which the control signal, the quantity exerting influence on the system, is adjusted based on information obtained from measured variables.

However, to evaluate the performance and feasibility of the proposed fuzzy control algorithm, the study still employs the dynamic model of the inverted pendulum system in a simulation environment. This model, illustrated in Figure 1, consists of two main components: a cart that moves translationally along a horizontal plane under the influence of a DC motor, and a pendulum with a concentrated mass at its upper end, rotating freely about a pivot mounted on the cart. The control task is formulated in a two-dimensional space, where the pendulum is inherently unstable and tends to fall unless stabilized by appropriate control forces.

The inverted pendulum constitutes a canonical benchmark system in control engineering, frequently utilized for validating the performance of advanced control strategies. Its defining characteristics—inherent nonlinearity, open-loop instability, and pronounced sensitivity to external perturbations—render it an ideal testbed for assessing the efficacy, robustness, and adaptability of modern control algorithms.

Figure 1. A typical configuration of the inverted pendulum system

In this study, the system's dynamic model is formulated using Lagrangian mechanics, a foundational energy-based approach in analytical dynamics. The specific mathematical representation adopted herein is sourced from reference [19], an established publication within the intelligent control field. This model structure is rigorously derived from first principles of physics and has undergone validation in prior research, confirming its physical fidelity.

Specifically, applying the Lagrange Polynomial and Euler–Lagrange Equation to the cart–pendulum system yields the following dynamic equations:

$(M+m)\ddot{x}-(ml\sin \theta ){{\dot{\theta }}^{2}}+(ml\cos \theta )\ddot{\theta }=F$     (1)

$m\ddot{x}\cos \theta +ml\ddot{\theta }=mg\sin \theta $     (2) 

The force, denoted as F, represents the control action exerted on the cart by its onboard electric motor. This force serves as the manipulative input variable, denoted interchangeably as F or u, aimed at achieving stabilization of the pendulum at its unstable upright equilibrium. Utilizing the system’s equations of motion, presented as Eqs. (1) and (2), the following dynamic relationships can be derived:

$\ddot{x}=\frac{F+(ml\sin \theta ){{{\dot{\theta }}}^{2}}-mg\cos \theta \sin \theta }{M+m{{\sin }^{2}}\theta }$     (3)

$\ddot{\theta }=\frac{F\cos \theta -(M+m)g\sin \theta +ml(\sin \theta \cos \theta )\dot{\theta }}{ml{{\cos }^{2}}\theta -(M+m)l}$      (4)

These final equations form the basis for reasonably describing the system dynamics of the cart–pendulum and serve to support the design and evaluation of the proposed control strategies in this study.

2.2 A hybrid control scheme for stabilizing the inverted pendulum

The proposed hybrid architecture integrates an optimization technique with a control strategy. Several earlier studies have employed conventional optimization algorithms to tune controller parameters [20-22]. Nevertheless, in cases involving complex controller structures or nonlinear systems that demand extensive computational time for optimization, more recent research has adopted hybrid frameworks incorporating enhanced or modified algorithms to improve control performance [23-25]. Based on the control requirements for the inverted pendulum system, one of two control structures can be employed: either a single-controller design with four inputs and one output or a dual-controller configuration, where each controller has two inputs and one output. For this study, the single-controller structure has been prioritized as the preferred approach. Specifically, in this study, the PSO algorithm is used for the initial optimization phase to optimize the five scaling factors of the fuzzy controller. This control method is illustrated in Figure 2.

Figure 2. Proposed control strategy applying novel PSO-BA algorithm and the direct fuzzy logic controller for the inverted pendulum system

The control objective is to restore the system to a stable state within acceptable limits. Both the cart position and the pendulum angle deviation must be regulated to maintain the balance of the cart-pendulum system. The PSO optimization objective function employs the ITAE criterion, as defined below:

$J=\int{\left( \left| {{e}_{x}}(t) \right|+\rho \cdot \left| {{e}_{\theta }}(t) \right| \right)}\cdot tdt$     (5)

where $e_x$ and $e_\theta$ represent the control errors of the cart-pendulum system, corresponding to the cart position and pendulum angle deviation, respectively. The optimal-positive weighting factor $\rho$ is added to Eq. (5) to represent the priority in the optimization mechanism.

The ITAE criterion is widely employed due to its ability to prioritize the elimination of sustained errors over time. By multiplying the error by time t, ITAE imposes heavier penalties on errors that persist at later stages, thereby promoting faster system stabilization and reducing long-lasting oscillations. Compared to other criteria such as IAE (Integral of Absolute Error) and ISE (Integral of Squared Error), ITAE typically yields smoother responses, less aggressive overshoots, and shorter settling times.

The weighting factor p plays a critical role in balancing the influence of two types of errors during the optimization process. In the cart–pendulum system, the relationship between the cart position and the pendulum angle is nonlinear. For example, even a small angular deviation of the pendulum may require a significant cart movement to maintain balance. Therefore, treating both error terms as equally weighted in the objective function would not accurately reflect the control demands of the system.

By tuning p, the designer can increase or decrease the relative importance of pendulum stabilization versus cart position control:

If p > 1, greater emphasis is placed on minimizing the pendulum angle error, resulting in faster balancing of the pendulum, though at the cost of potentially longer settling time or larger cart displacement.

If p < 1, cart position is prioritized, which may constrain cart movement more effectively, but could lead to slower pendulum stabilization.

Adjusting p is thus a key tool for tailoring control performance to specific application requirements.

Ensuring that p > 0 is essential to maintain a positive-definite objective function and to preserve the physical meaning of the optimization process. A negative p could lead to inconsistencies in the function's formulation and potentially destabilize the optimization algorithm.

For the fuzzy logic controller, four input variables are defined: the pendulum angle relative to the equilibrium position, the pendulum's angular velocity, the cart position, and the cart velocity. The output variable of the system is the force applied to the cart. Three fuzzy sets are defined for each input variable, and the number of fuzzy sets for the output variable is chosen as 7. Thus, the direct fuzzy logic controller has 81 fuzzy rule sets [19]. The applicability of this fuzzy logic controller will be tested in Section 4.

3. Overview of Metaheuristic Optimization and Hybrid Algorithm Strategies

3.1 Classical PSO

Particle PSO, derived from a well-established metaheuristic paradigm, has emerged as a robust and versatile method for solving complex optimization tasks. Its application is particularly prominent in the domain of control systems, where it is employed to determine optimal parameter configurations that enhance system performance. This optimization paradigm emulates the collective behavior observed in a flock of birds in flight, navigating a multidimensional space. By dynamically adjusting their movements and inter-particle distances, the particles collectively search for optimal positions, facilitating efficient exploration of the solution space. The implementation structure of a commonly employed PSO algorithm is graphically depicted in Figure 3. While recognized as one of the most effective techniques for addressing optimization challenges, the PSO algorithm exhibits a susceptibility to becoming entrapped in local minima and premature convergence. The PSO algorithm can be improved by enhancing parameters such as inertia weight and learning coefficients domains [23], or by introducing new variables into the standard formula [24].

Figure 3. The flowchart of a typical PSO algorithm

3.2 Typical BA algorithm

The BA algorithm (BA) is an advanced metaheuristic optimization algorithm designed for global optimization processes. The BA is inspired by the hunting mechanism of BAs and was developed by Xin-She Yang in 2010. The fundamental phenomenon of BA is based on the echolocation behavior of micro-BAs, which occurs through the use of varying pulse frequencies and sound intensities.

The BA mechanism, as illustrated in Figure 4, is inspired by the echolocation mechanism of BAs, simulating their ability to detect and locate prey in space. In the algorithm, each BA in the population is represented by a position and velocity, corresponding to a potential solution in a dimensional search space. During each iteration, BAs emit sound pulses with varying frequency, wavelength, and loudness to adjust their positions and update their velocities. The frequency and pulse emission rate enable the BAs to expand or narrow the search space, while the loudness gradually decreases, indicating their approach to the optimal solution.

This algorithm flexibly combines exploration—broadly searching the entire space to avoid being trapped in local optima and exploitation refining potential solutions around the optimal region. The balance between these two phases is controlled through parameters such as frequency, pulse emission rate, and loudness. The search process continues until one of the stopping criteria is satisfied, such as reaching the maximum number of iterations, achieving population convergence, or observing no significant improvement in the objective function value.

Figure 4. The flowchart of the BA algorithm

3.3 Proposed hybrid PSO-BA algorithm

As mentioned in Section 3.1, the performance of the PSO algorithm can be improved by optimizing its parameters or by introducing new ones. In addition, PSO can be combined with other optimization algorithms to form a hybrid structure that leverages each other’s computational steps [25]. In this paper, an improved PSO mechanism is proposed to reduce execution time and address some limitations of the standard PSO algorithm. The proposed hybrid structure incorporates an additional phase that utilizes a suitable preliminary optimization technique to generate initial parameters for the PSO algorithm.

The PSO algorithm offers effective optimization capabilities; however, it has certain drawbacks, such as premature convergence and a tendency to get stuck in local optima, which reduces optimization effectiveness and increases computational time. On the other hand, the BA Algorithm (BA), while not guaranteeing fast convergence like PSO due to its reliance on random movements, excels in controlling the exploration and exploitation of the search space efficiently and requires less computational time [17]. PSO can quickly identify and exploit promising regions in the search space, whereas BA can effectively pinpoint the best solution within a given region. The overall procedure of the proposed hybrid algorithm is illustrated in Figure 5.

Figure 5. The flowchart of the proposed PSO-BA algorithm

The pseudo-code is a systematic representation of a code segment or algorithm developed in a specific programming language. It clarifies the logic and structure of the algorithm without being constrained by the syntax of any particular language, thereby facilitating the reader’s understanding of the proposed method. Moreover, pseudo-code enhances the portability of the algorithm by allowing straightforward translation into actual source code across various platforms. In this study, the pseudo-code of the developed algorithm provides an intuitive and accessible illustration of the leading implementation steps.

Pseudo-code of the proposed hybrid PSO-BA algorithm

Initialize BA and PSO parameters (population size, search spaces, algorithm iterations…)

% BA Algorithm Phase

Initialize BA population (positions, velocities)

Evaluate initial fitness using simulation

BA Algorithm loop:

For each BA iteration:

    For each BA:

        Generate frequency

        Update velocity and position

            Apply boundary constraints

            If rand > pulse rate:

                    Do local random walk near best solution

                  Evaluate new fitness

            If improved OR random chance:

                       Accept new solution

                    Update loudness and pulse rate

            Update best and second-best solutions

        End

End

% PSO Algorithm Phase

Initialize PSO positions, velocities

Add best two BA individuals to PSO population

For each particle:

         Evaluate fitness using simulation

         Update personal best

Main loop of Proposed PSO-BA Algorithm:

For each PSO iteration:

    For each particle:

        Update velocity and position (PSO rules)

        Evaluate fitness using simulation

        Update personal best

    End

    Update global best

    If global best <= Stop Condition:

        Break

    Save global best of iteration

End

Display final best solution;

Plot fitness history;

4. Numerical Simulation and Experiment Results

4.1 Numerical simulation in MATLAB/ Simulink

In this section, MATLAB/Simulink-based simulations are conducted to validate the theoretical foundation and evaluate the practical applicability of the proposed optimization approach. The performance is also compared with that of conventional PID controllers [11], fuzzy controllers optimized using standard PSO, fuzzy controllers tuned via Genetic Algorithm (GA) [19], and those optimized using the Grey Wolf Optimizer (GWO) [26]. In the standard PSO, GWO, and GA, the initial population is randomly generated within the defined bounds of the solution space. Simulation parameters are detailed in Tables 1 and 2. All fuzzy controllers applied to the inverted pendulum system share the same structural design, including identical membership functions and fuzzy rule bases [19].

Table 1. Nomenclature of parameters

Symbol

Meaning of the Parameter

Value [unit]

l

Pendulum's arm length

0.5 [m]

M

Weight of the cart

2.4 [kg]

m

Weight of the pole

0.3 [kg]

$\theta(t)$

Tilt angle of the pendulum

[rad]

$\dot{\theta}(t)$

Angular speed of the pendulum

[rad/s]

$\ddot{\theta}(t)$

Angular acceleration of the pendulum

[rad/s2]

x(t)

The cart’s position

[m]

$\dot{x}(t)$

The cart’s velocity

[m/s]

$\ddot{x}(t)$

Rate of change of the cart's velocity

[m/s2]

F

Force applied to the cart

[N]

K1, K2, K3, K4, K5

Five pre- and post-processing coefficients of the FLC

N/A

Table 2. The PSO algorithm’s parameters

Symbol

Parameters

Value [unit]

Condition 1

Condition 2

Nmax

Maximum iteration

100

Npar

Swarms size

20

Nvar

Number of variables

5

UB

K1

Upper bound

7

5

K2, K3, K4

2

2

K5

500

200

LB

K1

Lower bound

0

0

K2, K3, K4

0.01

0.01

K5

40

40

$\omega$

Inertia weight factor

0.65

c1, c2

Learning coefficients

1.45

For the GA, a real-coded chromosome representation is adopted, where each individual is encoded as a vector of real numbers. This enhances the algorithm's search capability across wide solution spaces and overcomes the limitations associated with binary or decimal encoding, thus improving optimization efficiency. However, real-coded GA does not support standard crossover and mutation operations designed for binary representations. In this study, the GA employs linear ranking selection, BLX (Blend Crossover), and random mutation techniques to tune the parameters of the fuzzy controller.

In the fuzzy rule-based controller structure used in this study, fuzzy sets are defined to describe the linguistic values of the input and output variables. Each input variable is assigned three triangular membership functions, as illustrated in Figure 6. For the output variable, seven fuzzy sets are used, and their membership functions are defined as singletons to facilitate the defuzzification process, as shown in Figure 7.

The fuzzy rules are constructed in the standard "IF–THEN" format. For example:

IF $\theta$ is PO AND $\dot{\theta}$ is ZE AND x is ZE AND $\dot{x}$ is PO, THEN u is PM.

The rule base is developed using a trial-and-error approach, combined with expert knowledge. Given that each input variable is represented by three fuzzy sets, the total number of rules required to ensure complete control coverage is 81 (3⁴). The number of fuzzy sets per input is limited to three to reduce computational complexity. Increasing the number of fuzzy sets would lead to a significantly larger and more complex rule base.

Figure 6. The input membership functions

Figure 7. The output membership functions

To illustrate the fuzzy inference characteristics of the system, Figure 8 presents the control surface of output $u$ with respect to the two most significant input variables: the pendulum angle $(\theta)$ and its derivative $(\dot{\theta})$, while the other two inputs are held at neutral values. The resulting surface appears nearly linear, forming a planar shape in three-dimensional space. This indicates that the relationship between these main inputs and the control force is approximately linear within the examined operating range. Such behavior reflects the stability and predictability of the controller in the small-angle regime, which is typical in inverted pendulum balancing control.

Furthermore, the analysis of the control surface serves as a sensitivity assessment of the fuzzy rule base. As $\theta$ and $\dot{\theta}$ vary, the output response exhibits a clear linear trend. This implies that these two variables play a dominant role in the control process and directly influence the system's response.

Figure 8. A 3D illustration of the fuzzy logic model with 81 rules

Under Condition 1, in which a wide search space is defined as presented in Table 2, the optimization trajectories illustrated in Figure 9 indicate that the standard PSO exhibits a tendency toward premature convergence, becoming trapped in local optima. This behavior results in prolonged computation time and suboptimal performance in high-dimensional search spaces.

In contrast, the proposed PSO-BA hybrid algorithm demonstrates a superior ability to explore the search space effectively and to identify promising regions during the early iterations. This advantage leads to significantly faster convergence and more accurate optimization results when compared to standard PSO.

The GWO also shows improved performance over standard PSO in this condition, offering a more balanced exploration-exploitation mechanism. However, it still converges more slowly and less precisely than the proposed PSO-BA. Meanwhile, the GA tends to converge slowly and exhibits larger fluctuations near suboptimal solutions, limiting its optimization efficiency.

Figure 9. Simulation results for the first condition

Under Condition 2, where the search space is narrowed (as also specified in Table 2), the PSO-BA algorithm continues to outperform the other methods in terms of convergence speed and final objective value. Notably, GWO achieves a final result comparable to PSO-BA, although its convergence is slightly slower. This indicates that GWO can maintain strong performance under constrained search conditions. The standard PSO and GA, however, remain less efficient, both in terms of convergence speed and solution quality.

Overall, the results shown in Figure 10 highlight the effectiveness and robustness of the proposed PSO-BA approach across varying search space configurations, while also demonstrating the competitiveness of GWO, particularly in more restricted domains.

Figure 10. Simulation results for the second condition

With five control coefficients to be optimized using metaheuristic techniques, the feasibility of the algorithm is assessed through system simulations under three scenarios:

Scenario 1: Balancing control of the pendulum while maintaining the desired cart position at a fixed value $x^*=0.25(\mathrm{m})$.

Scenario 2: Balancing control of the pendulum while the cart position alternates periodically in a squarewave pattern between two positions: $x_0^*=0.2(\mathrm{m}), x_1^*=0.5(\mathrm{m})$.

Scenario 3: Balancing control of the pendulum with the cart position varying across four discrete levels: $x_0^*=0(m), x_1^*=0.2(m), x_3^*=0.6(m), x_4^*=0.4(m)$.

The first control scenario addresses the classic inverted pendulum-on-cart problem. The control task requires designing a controller that simultaneously stabilizes the pendulum in its upright vertical orientation while steering the cart from its starting location to a specified target position. Key variables representing the system's dynamic behavior are the pendulum angle $(\theta)$ and the cart's linear position $(x)$.

Figure 11. Simulation results for the first scenario

As illustrated in Figure 11, the fuzzy controller utilizing the proposed PSO-BA hybrid optimization algorithm exhibits superior control performance. This is evidenced by its rapid stabilization, minimal overshoot, and robust reference tracking capabilities compared to the alternative approaches evaluated. While controllers optimized using standalone PSO, GWO, and GA also deliver satisfactory performance-significantly surpassing the conventional PID controller-the relative simplicity of the control task in this scenario results in only minor performance variations among these optimization-based methods. Overall, all controllers employing metaheuristic optimization demonstrate comparable dynamic behavior and successfully meet the control objectives stipulated for this scenario.

Figure 12. Simulation results for the second scenario

Figure 13. Pole angles and cart positions in the third simulation scenario

In the following scenarios, the control task becomes increasingly challenging due to the requirement for the cart’s position to change intermittently, with Scenario 3 presenting a particularly higher level of difficulty. These conditions are designed to evaluate the proposed controller’s ability to handle dynamic variations in the system’s states. As illustrated in Figures 12 and 13, the PSO-BA optimized controller demonstrates relatively good performance in position control compared to other techniques, while effectively maintaining the pendulum in an upright balanced state.

4.2 Experiments

To experimentally validate the theoretical findings and simulation results presented in Section 4.1, a physical prototype of a system consisting of an inverted pendulum and a cart was constructed. Notably, this practical model incorporates an ESP32 camera as the pendulum mass (m), thereby demonstrating the feasibility of developing an autonomous vehicle equipped with an inverted pendulum for real-time target surveillance applications in both civilian and military contexts. To achieve this, the software component integrates the YOLO v3 algorithm for efficient image data processing from the camera. In the practical implementation, a TPS61088 boost converter elevates the input voltage to 24VDC to drive the motor, while an angular sensor precisely measures the angular displacement (θ) of the pendulum, consistent with the theoretical framework outlined in previous sections. Figure 14 illustrates the actual system diagram of the cart-inverted pendulum setup, including the control box design. From a software perspective, in addition to YOLO v3 for image processing, the system utilizes a WinForms interface to provide real-time monitoring and visualization of critical parameters, such as the pendulum's angular deviation, motor control signals, and live video feed from the ESP32 camera, enabling users to effectively observe the surrounding environment. A significant advancement of this physical model, beyond maintaining the pendulum rod in the upright (zero angular deviation) position, lies in its capability to stabilize the rod at any arbitrary angle. Figure 15 demonstrates this capability, showcasing the pendulum rod positioned at a 133° angle with the corresponding pulse-width modulation (PWM) signal applied to the motor. The experimental results unequivocally demonstrate the system's exceptional control performance, successfully achieving the desired objective of balancing the inverted pendulum rod while simultaneously facilitating target tracking through the integrated camera and robust image processing software.

Figure 14. Practical model of the proposed cart-inverted pendulum system

Figure 15. Practical signals observed on WinForms interface

5. Conclusion and Future Work

This study proposes an advanced optimization technique that synergistically combines the PSO algorithm with the BA one to mitigate certain inherent limitations of the PSO method. This hybrid optimization approach is subsequently employed to develop a novel hybrid control strategy namely PSO-BA algorithm, integrating it with a fuzzy logic controller for stabilizing the inverted pendulum system. Initial simulations conducted within the MATLAB/Simulink environment demonstrate the efficacy of the proposed hybrid control method. The numerical simulation results obtained through this novel strategy exhibit superior control performance compared to traditional PID controllers and fuzzy logic control structures utilizing conventional optimization methods such as standard PSO. Moreover, experimental validation on a practical cart-inverted pendulum system not only corroborates the theoretical findings but also extends the applicability of this approach to both military and civilian domains. This is achieved by replacing the pendulum mass (m) with a camera to enable real-time object tracking in practical environments.

Future research directions should prioritize further optimization of the membership functions and fuzzy rules within the fuzzy logic controller. In this context, the intelligent control strategy predicated on fuzzy logic offers the potential for superior control performance and enhanced system adaptability to address diverse and more complex trajectory control requirements. Furthermore, future research should focus on expanding the practical applications of the current physical prototype to demonstrate its feasibility and applicability in real-world scenarios.

Acknowledgment

This research is funded by Electric Power University under research 2024 (Grant No.: ĐTNH.101/2024). The authors would like to thank Mr. Van-Tien Nguyen, B.A., for his support on validating the experimental results.

  References

[1] Mobeen, S., Hira, F., Haydar, M.F. (2023). A comparative study of nonlinear control techniques: Inverted pendulum on a cart. In 2023 20th International Bhurban Conference on Applied Sciences and Technology (IBCAST), Bhurban, Murree, Pakistan, pp. 1-5. https://doi.org/10.1109/IBCAST59916.2023.10712845

[2] Preza, E., Velázquez, R., Macías-Quijas, R., Hernández, E., Visconti, P. (2021). Linear and nonlinear control approaches for the cart inverted pendulum problem. In 2021 12th International Symposium on Advanced Topics in Electrical Engineering (ATEE), Bucharest, Romania, pp. 1-6. https://doi.org/10.1109/ATEE52255.2021.9425095

[3] Karahan, M., Kasnakoglu, C. (2022). Stability analysis and optimum controller design for an inverted pendulum on cart system. In 2022 International Conference on Smart Information Systems and Technologies (SIST), Nur-Sultan, Kazakhstan, pp. 1-4. https://doi.org/10.1109/SIST54437.2022.9945731

[4] Geethamani, R., Ragul, B., Ramanathan, A.N., Rishiganesh, R. (2022). Stability analysis of a walking robot using an inverted pendulum model. In 2022 8th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, pp. 411-413. https://doi.org/10.1109/ICACCS54159.2022.9785001

[5] Duan, L., Su, X., Tang, Y., Yang, H., Zhang, H. (2021). Application of PID tracking control in inverted pendulum system. In 2021 IEEE 4th Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC), Chongqing, China, pp. 1815-1819. https://doi.org/10.1109/IMCEC51613.2021.9482036

[6] Masoumian, A., Kazemi, P., Montazer, M.C., Rashwan, H.A., Valls, D.P. (2020). Designing and analyzing the PID and fuzzy control system for an inverted pendulum. In 020 6th International Conference on Mechatronics and Robotics Engineering (ICMRE), Barcelona, Spain, pp. 199-203. https://doi.org/10.1109/ICMRE49073.2020.9065161

[7] Rithirun, C., Charean, A., Sawaengsinkasikit, W. (2021). Comparison between PID control and fuzzy PID control on invert pendulum system. In 2021 9th International Electrical Engineering Congress (iEECON), Pattaya, Thailand, pp. 337-340. https://doi.org/10.1109/iEECON51072.2021.9440344

[8] Kafiev, I., Romanov, P., Romanova, I. (2020). Fuzzy logic based control system for automated guided vehicle. In 2020 International Multi-Conference on Industrial Engineering and Modern Technologies (FarEastCon), Vladivostok, Russia, pp. 1-6. https://doi.org/10.1109/FarEastCon50210.2020.9271513

[9] M, M., Pradeepa, H. (2022). Fuzzy based controller to enhance transient and steady state stability for multimachine power system. International Journal of Engineering Trends and Technology, 70(3): 118-125. https://doi.org/10.14445/22315381/IJETT-V70I2P213

[10] Md, S., Agarwal, R. (2023). Stabilization and control of inverted pendulum cart system using fuzzy logic controller. In 2023 3rd International Conference on Intelligent Technologies (CONIT), Hubli, India, pp. 1-5. https://doi.org/10.1109/CONIT59222.2023.10205703

[11] Cikan, M., Kekezoglu, B. (2022). Comparison of metaheuristic optimization techniques including Equilibrium optimizer algorithm in power distribution network reconfiguration. Alexandria Engineering Journal, 61(2): 991-1031. https://doi.org/10.1016/j.aej.2021.06.079

[12] Qin, L., Wang, X., Wang, Y. (2022). Research on electric vehicle DC speed regulation based on PSO optimization. In 2022 5th World Conference on Mechanical Engineering and Intelligent Manufacturing (WCMEIM), Ma'anshan, China, pp. 156-163. https://doi.org/10.1109/WCMEIM56910.2022.10021425

[13] Malarvili, S., Mageshwari, S. (2021). Artificial intelligent parameter based PSO for maximum power point tracking of PV systems under PSC. In 2021 IEEE 17th International Colloquium on Signal Processing & Its Applications (CSPA), Langkawi, Malaysia, pp. 86-91. https://doi.org/10.1109/CSPA52141.2021.9377286

[14] Shami, T.M., El-Saleh, A.A., Alswaitti, M., Al-Tashi, Q., Summakieh, M.A., Mirjalili, S. (2022). Particle swarm optimization: A comprehensive survey. IEEE Access, 10: 10031-10061. https://doi.org/10.1109/ACCESS.2022.3142859

[15] Chen, Z.G., Zhan, Z.H., Liu, D., Kwong, S., Zhang, J. (2020). Particle swarm optimization with hybrid ring topology for multimodal optimization problems. In 2020 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Toronto, ON, Canada, pp. 2044-2049. https://doi.org/10.1109/SMC42975.2020.9282962

[16] Yingxin, Z., Jianwen, H., Zhuoer, W. (2021). Bat-based algorithm for intelligent regulation of traffic light eco-intersection design. In 2021 IEEE Asia-Pacific Conference on Image Processing, Electronics and Computers (IPEC), Dalian, China, pp. 828-831. https://doi.org/10.1109/IPEC51340.2021.9421308

[17] Bhongade, S., Tomar, A., Goigowal, S.R. (2020). Minimization of optimal reactive power dispatch problem using BAT algorithm. In 2020 IEEE First International Conference on Smart Technologies for Power, Energy and Control (STPEC), Nagpur, India, pp. 1-5. https://doi.org/10.1109/STPEC49749.2020.9297806

[18] Singh, P., Boora, K., Kumar, V. (2023). Harmonic minimization of multilevel inverter using Bat algorithm. In 2023 IEEE 15th International Conference on Computational Intelligence and Communication Networks (CICN), Bangkok, Thailand, pp. 1-5. https://doi.org/10.1109/CICN59264.2023.10402300

[19] Hoang, H.T. (2006). Intelligent Control. Vietnam National University Press.

[20] Saxena, A., Dubey, Y.M., Kumar, M. (2020). PSO and fuzzy based tuning mechanism for optimization of transient response in high-performance drilling machine. In 2020 7th International Conference on Signal Processing and Integrated Networks (SPIN), Noida, India, pp. 1147-1152. https://doi.org/10.1109/SPIN48934.2020.9071215

[21] Nguyen, N.K., Pham, V.N., Ho, T.C., Dao, T.M.P. (2022). Designing an effective hybrid control strategy to balance a practical inverted pendulum system. International Journal of Engineering Trends and Technology, 70(5): 80-87. https://doi.org/10.14445/22315381/IJETT-V70I5P210

[22] Porbiya, P., Kulkarni, S.P. (2021). Speed control of DC motor using MRAC, PSO and PSO fuzzy controller. In 2021 International Conference on Smart Generation Computing, Communication and Networking (SMART GENCON), Pune, India, pp. 1-8. https://doi.org/10.1109/SMARTGENCON51891.2021.9645887

[23] Vu, P., Le, D., Vo, N., Tlusty, J. (2010). A novel weight-improved particle swarm optimization algorithm for optimal power flow and economic load dispatch problems. In IEEE PES T&D 2010, New Orleans, LA, USA, pp. 1-7. https://doi.org/10.1109/TDC.2010.5484396

[24] Ellahi, M., Abbas, G. (2020). A hybrid metaheuristic approach for the solution of renewables-incorporated economic dispatch problems. IEEE Access, 8: 127608-127621. https://doi.org/10.1109/ACCESS.2020.3008570

[25] Limon, M.F.A., Shiblee, M.F.H., Rouf, A., Iqbal, M.S. (2023). Hybrid ABC-PSO algorithm based static synchronous compensator for enhancing power system stability. In 2023 10th IEEE International Conference on Power Systems (ICPS), Cox's Bazar, Bangladesh, pp. 1-6. https://doi.org/10.1109/ICPS60393.2023.10428854

[26] Rezaei, H., Bozorg-Haddad, O., Chu, X. (2017). Grey wolf optimization (GWO) algorithm. In Advanced Optimization by Nature-Inspired Algorithms, pp. 81-91. https://doi.org/10.1007/978-981-10-5221-7_9