Share this

Fuzzy control of a single-stage inverted pendulum based on a fusion function

2026-04-06 03:49:41 · · #1

1 Introduction

The inverted pendulum is a nonlinear, strongly coupled, and unstable control object, often used as a typical experimental control object to verify various control methods. Fuzzy control belongs to the category of intelligent control and is a major intelligent control technology. It can solve complex, uncertain, and nonlinear automation problems that traditional automation technologies cannot solve; it is a type of nonlinear control. However, fuzzy control also has shortcomings in practical applications—"rule explosion" [1-2]. This paper proposes a fuzzy control algorithm based on a fusion function to address the above problems, considering the multivariable characteristics of the system. The correctness of the algorithm is verified through an inverted pendulum system.

System modeling [3]

Neglecting friction and air resistance, the single-stage inverted pendulum system can be abstracted into a system consisting of a spring, a uniform pendulum rod, a cart, and a mass block, as shown in Figure 1.

A mathematical model is established to obtain the state-space expression of the single-stage inverted pendulum system:

3. Design of the fuzzy controller [4]

The principle of the fuzzy control algorithm based on the fusion function is to fuse the displacement and angle of the linear inverted pendulum system into a single variable 'e' through reasonable calculations; and to fuse the two states into another variable 'ec' through reasonable calculations. The 's' function is written to adjust the values ​​of 'e' and 'ec' online, and the adjusted values ​​are used as the input variables of the fuzzy controller. This controller structure is shown in Figure 2. The input variables 'e' and 'ec' of the fuzzy controller are divided into [NB NMNS ZE PS PMPB], resulting in 49 fuzzy control rules. This transforms the control from a complex multi-input fuzzy controller into a simple two-dimensional fuzzy controller. This control method is simple, facilitates problem detection during adjustment, and helps reduce the number of fuzzy rules. The fuzzy rules are shown in the table below:

Fig.2fuzzycontrol's1-Stageinvertedpendulumschemes

Membership function type and parameter settings for input and output variables of fuzzy controller

Figure 4 Membership function of fuzzy controller ec

Fig.4fuzzycontrollerec'smembershipfunctions

Figure 5 Membership function of the fuzzy controller output variable u

Fig.5fuzzycontrolleroutputvariableu'smembershipfunctions

The fuzzy control algorithm based on the fusion function can be expressed by the following formula:

In the actual system control process, we take it as a diagonal matrix, where Q11=1000, Q33=200, and through calculation, we can obtain...

(2) Construct the function based on the feedback gain matrix

S-functions, as an open language, provide users with the ability to write complex functions and create modules. Based on the need for self-adjustment of the scaling factor and quantization factor parameters in the fuzzy control of a linear single-stage inverted pendulum, the following S-function was written:

Save it as canshuzitiao.m. This file can automatically adjust the values ​​of ke, kec, and ku. When the system's rise speed is slow, this file will automatically adjust K to be larger, thereby speeding up the system's response. When the system overshoots, the file will automatically adjust it to be larger to reduce the overshoot, but the system's response speed will be slower. The output scaling factor K affects the controller's output and is the total gain of the fuzzy controller, thus affecting the characteristics of the fuzzy control system. The resulting module after encapsulation is shown in Figure 6.

Figure 6

Fig. 6

4 Simulation Results

When the initial value is set to 0.005 ms, the simulation step size is 0.005 ms. The simulation results are shown in Figure 7-10.

Simulation curves show that, in the initial state, as shown in Figure 7, the farthest position of the trolley is 0.1m, and as shown in Figure 9, the amplitude of the pendulum's vibration is very small after 1.5 seconds, tending towards 0 radians. The simulation process proves that fuzzy control can achieve balance control of a linear single-stage inverted pendulum.

4.1 System Experiment Results

The real-time control block diagram is shown in Figure 11:

The experimental process shows that, as indicated by the response curves above, the maximum deviation of the trolley from the reference position is less than 0.1m, and the system can operate within a very small range.

The system maintains balance within a certain range, with the trolley vibration amplitude approximately 0.15 m and the pendulum arm vibration amplitude approximately 0.05 radians. Stable control of a linear first-order inverted pendulum is achieved. This demonstrates that the parameter self-adjusting fuzzy controller proposed in this paper possesses good stability and feasibility.

5. Conclusion

This paper studies a linear single-stage inverted pendulum using a fuzzy control algorithm based on a fusion function. By writing an S-function, the quantization factor and scaling factor can be automatically adjusted, improving the adaptability of the fuzzy controller. Simulation and actual system experimental results prove the correctness and feasibility of the scheme.

References:

[1] Xue Anke, Wang Junhong, Chai Li, et al. Current status of simulation and experimental research on inverted pendulum control [Z]. Hangzhou: Institute of Intelligent Information and Control Technology, Hangzhou Institute of Electronic Engineering, 2002.

[2] Li Hongxing. The world’s first physical control system for a four-stage inverted pendulum was successfully tested at our university [J]. Journal of Beijing Normal University (Natural Science Edition), 2002, 38(5): 5-8.

[3] Googol Corporation. GT-400 Inverted Pendulum User Manual. 2003.

[4] Guo Runqiu, Hong Xu, Su Wangwang. Control algorithm for a two-stage inverted pendulum based on fuzzy control theory. Journal of Xi'an University of Electronic Science and Technology, 2006, 33(1):111-115.

[5] Li Zuxin, et al. Application of MATLAB in the design and simulation of fuzzy control systems. Journal of System Simulation, 2003, 15(1): 132-134.

About the author: Wei Shengnan (born April 5, 1985), female (Han nationality), from Tieling City, Liaoning Province, is a postgraduate student at Taiyuan University of Science and Technology, holding a master's degree. Her main research direction is intelligent control.

Mailing Address: Taiyuan University of Science and Technology, Wuliu Road, Wanbailin District, Taiyuan City, Shanxi Province

Mailbox 673, addressed to Wei Shengnan

Postal code 030024

Phone number 18734865965

Read next

CATDOLL 128CM Dolly (TPE Body with Hard Silicone Head)

Height: 128cm Weight: 19kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22