Simulation Study of Fuzzy Controller Based on MATLAB
2026-04-06 06:27:00··#1
Abstract: This paper introduces the use of a fuzzy controller to control a first-order linear time-delay system. Fuzzy conditional statements and fuzzy control rules are applied to describe the membership function of the fuzzy set. The result of the controlled object being controlled is simulated in the Simulink environment using the graphical user interface tool of the Fuzzy System Toolbox provided by Matlab. Keywords: Matlab, fuzzy controller , simulation I. Introduction The step response of a first-order linear system with a delay has wide applications in industrial control. Its characteristic is a considerable initial lag, followed by a monotonically increasing rate, eventually reaching a steady state. Dynamic control in industrial production requires not only a certain degree of system stability but also a certain speed in reaching the steady state. Therefore, for a first-order linear time-delay system, this speed requirement is sometimes not met. Using a fuzzy controller to control a first-order linear time-delay system greatly improves the control effect of the original system, and to a certain extent, fully meets the system's speed requirement. The simulation results using Matlab clearly demonstrate the improved control effect. II. Basic Structure and Composition of Fuzzy Controllers A fuzzy controller mainly consists of four parts: fuzzification, fuzzy inference, declarative analysis, and a knowledge base. Fuzzification converts precise input quantities into fuzzy quantities, represented by corresponding fuzzy sets. Fuzzy inference is the core of the fuzzy controller, simulating human reasoning based on fuzzy concepts. This inference process is based on the implication relations and inference rules in fuzzy logic. Declarative analysis transforms the control quantities obtained from fuzzy inference into declarative quantities actually used for control. The knowledge base contains knowledge of specific application domains and required control objectives. It typically consists of a database and a fuzzy control rule base. In fuzzy control, expert knowledge is generally represented by rules described in a set of languages. Expert knowledge usually has the following form: IF (a set of conditions) THEN (a set of conclusions can be drawn). When the universe of discourse is discrete, the number of quantized input quantities is finite. Corresponding control quantities can be calculated offline for different combinations of input conditions, thus forming a control table, reducing the amount of online computation. This fuzzy control method easily meets the requirements of real-time control. In this fuzzy control structure, the error e and its derivative de/dt are typically used as the inputs to the fuzzy controller. As shown in Figure 2: III. Design of the Fuzzy Controller: Let the input of the control system be a unit step signal r, the output be y, the error be e, and the error derivative be de; the input of the controlled object be u; the inputs of the fuzzy controller corresponding to e and de are e1 and de1, respectively, and the output corresponding to u is u1. The universe of discourse of e1, de1, and u1 is [-6, +6], and five linguistic values are taken: "negative large NB", "negative small NS", "zero ZR", "positive small PS", and "positive large PB". NB, NS, PS, and PB use trapezoidal membership functions, and ZR uses a triangular membership function. The membership functions of el, del, and u1 are shown in Figure 3. Based on experience, fuzzy control rules expressed in the form of "if...then..." can be obtained as follows: 1. If (el is NB) and (de l is NB) then (ul is NB) 2. If (el is NB) and (de l is NS) then (ul is NS) 3. If (el is NB) and (de l is ZR) then (ul is NS) ... 23. If (el is PB) and (de l is ZR) then (ul is PS) 24. If (el is PB) and (de l is PS) then (ul is PB) 25. If (el is PB) and (de l is PB) then (ul is PB) There are a total of 25 fuzzy control rules, which can be summarized in a table. IV. Simulation Model of Fuzzy Controller Here, the controlled object is taken as: In the MATLAB command window, enter the command "Fuzzy" to enter the graphical user interface (GUI) window. Based on the above membership functions and control rules, a fuzzy inference system (FIS) editor can be used to create an FIS file named flc.fis. Here, the fuzzy inference and its defuzzification method adopt the MIN-MAX single-center method, that is, the well-known Mamdani inference method. In the SIMULINK environment, drag the corresponding modules into the window with the mouse, connect them, and you will get the fuzzy control system simulation model shown in Figure 5 (see last page). Here, the structure variable of the fuzzy controller is flc, the quantization factor Ke of the error is 6, the quantization factor Kc of the error change is 0.5, and the proportional factor Ku of the control output is 0.4. The limiting range of limiter 1 and limiter 2 is [-6, 6], and their function is to transform the error and error derivative of the control system from the basic universe of discourse to the universe of discourse of the fuzzy controller input variables. Assuming that the maximum allowed input of the controlled object is ±20, limiter 3 is set in front of the controlled object, and its limiting range is [-20, 20]. The relevant simulation parameters can be set using the simulation parameter dialog box. Here, the simulation time is set to 15 seconds, and the sampling period is set to 0.01 seconds. V. System Simulation The structure diagram of the entire system built in the Simulink environment is shown in Figure 4 below: In the MATLAB command window, enter the command: flc=readfis('flc.fis') to establish the structure variable flc of the fuzzy inference system in the basic workspace. Then enter the command: start to start the simulation. At this time, the dynamic response of the system can be observed using an analog oscilloscope. After the simulation, the response curve can be plotted using the `plot(t,y)` command, as shown in Figure 5. In Figure 5, u is the control variable (yellow), f1 is the original curve without fuzzy controller control (green), and f2 is the response curve after adding the fuzzy controller (purple). VI. Conclusion As can be seen from Figure 5, the original system settling time is approximately 14 seconds, while the settling time after using the fuzzy controller is approximately 6 seconds. It is evident that although the system has a slight overshoot after using the fuzzy controller, this small overshoot is within the allowable range for system stability. Furthermore, the fuzzy controller significantly shortens the settling time, thereby improving the system's characteristics. References 1. Sun Zengqi, Zhang Zaixing, Deng Zhidong. Intelligent Control Theory and Technology, Tsinghua University Press, February 2004. 2. Ouyang Liming. MATLAB Control System Design, National Defense Industry Press, September 2001.