Abstract: Conventional PID controllers offer advantages such as simple algorithms, good robustness, and high reliability, making them widely used in industrial process control. However, when encountering nonlinear and time-varying systems, traditional PID control struggles to achieve satisfactory control results because its parameters are fixed and cannot be changed. To address this issue, fuzzy control theory can be combined with PID control algorithms to construct a fuzzy adaptive PID controller. This allows the PID parameters to be adjusted online according to different requirements, ultimately achieving the goal of using different parameters for different situations. The results were studied and simulated using MATLAB software.
Simulation results show that the parameter-adjustable fuzzy adaptive PID controller achieves better control performance than the conventional PID controller in most control systems, with smaller system overshoot and further improved robustness.
Keywords: fuzzy control; adaptive; PID; simulation
Chinese Library Classification Number: TP273 Document Code: A Article Number:
The emulation of self-adaptive fuzzy PID control system based on Matlab
Zhang De-chang, Yu Shao-juan
(Taiyuan university of science and technology, Taiyuan, 030024)
Abstract: The conventional PID controller is usually have some advantage as simple algorithm, good robustness and high reliability, and so on. But the conventional PID controller is not good at in the type of time-varying nonlinear systems. So a new self-adaptive fuzzy PID controller is presented using the fuzzy technology and PID controller, which realizes the self-adaptive fuzzy PID control system in Simulink environment with a particular case. Simulation results show the self-adaptive fuzzy PID control has advantages of flexibility control, small overshoot and strong robustness and so on.
Keywords: fuzzy control; self-adaptive; PID; simulation
1 Introduction
PID control, with its simple structure and easy debugging, is a widely used control method. It boasts advantages such as simple algorithms and good robustness. However, it also suffers from drawbacks such as nonlinearity, time-varying parameters, and model uncertainty, making it difficult for conventional PID control to achieve the desired results. Fuzzy control, on the other hand, has the advantage of weak dependence on mathematical models. Therefore, it does not require establishing a precise mathematical model of the process. By storing fuzzy rules, evaluation indicators, and initial PID parameters as knowledge in a knowledge base, the PID parameters can be adjusted online in real time based on the actual situation of the control system through knowledge and fuzzy reasoning.
This paper combines fuzzy control and PID control to construct an adaptive fuzzy controller, enabling real-time online adjustment of PID parameters to further enhance the system's adaptability to uncertainties. Simulations were performed using Matlab. Theoretical analysis and simulation results show that the adaptive fuzzy PID control exhibits better control performance than traditional control methods in terms of robustness and system overshoot, achieving more satisfactory control results.
2 Design of Adaptive Fuzzy Controller
2.1 Adaptive Fuzzy PID Controller Structure Design
The adaptive fuzzy PID control system is based on conventional PID control, employing fuzzy inference. The deviation *e* and the rate of change of the deviation *ec* of the controlled variable are used as input variables to a two-dimensional fuzzy controller. Simultaneously, the PID parameters are self-tuned online using fuzzy control laws through the output variables of the fuzzy controller. The design of the fuzzy controller is the core of this system design, as its quality directly affects the selection of parameters and thus the control accuracy of the system. The block diagram of the adaptive fuzzy PID controller is shown in Figure 1.
The biggest difference between fuzzy control systems and other control systems is the fuzzy controller, which is also the core component of the fuzzy control system. Based on the design principles of fuzzy controllers, a fuzzy adaptive PID controller is designed according to the control system structure shown in Figure 1. Finding the fuzzy relationship between the three parameters and the error e and the rate of change of error ec, based on the fuzzy control principle, is crucial for the design of this control system. Furthermore, during system operation, e and ec must be continuously monitored, and the three parameters must be corrected online in real time to meet the different requirements of parameters under different operating conditions, ultimately achieving good dynamic and static control performance.
2.2 Determine the structure of the fuzzy controller
Based on the above analysis of the system, we can adopt a two-input, three-output fuzzy controller, that is, the error and the rate of change of the error e and ec are used as the inputs of the controller, and the proportional, integral and derivative coefficients are used as the outputs of the PID controller.
2.3 Establishment of Input and Output Variables
The linguistic variables for the input error *e* and the rate of change of error *ec* can be set as *E* and *EC*, respectively. Both have a universe of discourse of {-3, -2, -1, 0, 1, 2, 3}, and their corresponding linguistic values are {Negative Large (NB), Negative Medium (NM), Negative Small (NS), Zero (ZO), Positive Small (PS), Positive Medium (PM), Positive Large (PB)}. The linguistic variables for the output proportional coefficient, integral coefficient, and differential coefficient are respectively set, with their universes of discourse of {-3, -2, -1, 0, 1, 2, 3}, and their corresponding linguistic values are {Negative Large (NB), Negative Medium (NM), Negative Small (NS), Zero (ZO), Positive Small (PS), Positive Medium (PM), Positive Large (PB)}. Trigonometric functions are used as the membership functions for the input and output variables.
2.4 Fuzzy Controller Rule Design
Typically, the control formula for a PID controller is:
Based on the control action of PID parameters and the requirements of different deviations e and deviation changes ec on PID parameters, the following tuning principles are given:
(1) When the deviation is large, e should be taken as a larger value in order to improve the speed of response. In order to prevent the error rate of change from being too large instantaneously, a smaller value should be taken. In order to control overshoot, a smaller value is usually required.
(2) When the deviation e and the rate of change of deviation ec are of medium magnitude, smaller values should be taken to reduce the overshoot of the system response, while also ensuring a certain response speed; the value of this should also be smaller, and the value of should be appropriate.
E de | NB | NM | NR | ZE | PS | PM | PB |
NB | PB/ZE/PB | PB/PB/PM | PB/PB/PS | PB/PS/PS | PM/PM/ZE | PM/PS/PM | PS/ZE/PB |
NM | PB/ZE/PS | PB/PM/PM | PB/PB/PS | PM/PM/PS | PM/PS/ZE | PS/PS/PS | ZE/ZE/PS |
NR | PM/ZE/NS | PM/PS/NM | PM/PM/NS | PS/PS/ZE | ZE/ZE/ZE | ZE/ZE/PS | ZE/ZE/PS |
ZE | PS/ZE/NM | PS/ZE/NM | ZE/PS/NS | ZE/ZE/ZE | ZE/NS/NM | NS/ZE/PS | NS/ZE/PM |
PS | ZE/ZE/NM | ZE/ZE/NM | ZE/ZE/ZE | ZE/NM/ZE | NS/NM/PS | NM/ZE/PM | NM/ZE/PM |
PM | ZE/ZE/NS | ZE/NS/NS | NS/NS/PS | NS/NM/PS | NM/NM/PS | NB/NM/PM | NB/ZE/PS |
PB | ZE/ZE/NS | ZE/NS/ZE | NS/NM/PS | NM/NB/PS | NB/NB/PM | NB/NB/PB | NB/ZE/PS |
Table 1 Fuzzy Control Rules
Tab.1 The chart of fuzzy control rule
(3) When the deviation e is small, the value should be increased to make the system have good steady-state characteristics. At the same time, considering the anti-interference ability of the system, the selection of should be combined with the deviation change rate ec. The principle is: in general, it is of medium size; when the deviation change rate ec is small, it should be larger; when the deviation change rate ec is large, it should be smaller.
In order to establish an appropriate fuzzy control rule table, summarizing the technical knowledge and practical experience of engineering designers is the core of fuzzy controller design. Based on the above principles and operational experience, fuzzy control tables for tuning the three parameters are set separately, as shown in Table 1.
2.5 Editing the Fuzzy Controller
Typing "fuzzy" in the command window of Mandani will take you to the fuzzy inference system editor. You can then set the parameters and create a new FIS file, which is the core of the fuzzy controller.
1) Determine the type and structure of the fuzzy controller.
In the FIS editor window (Mandani type), you can select the "AddInput" and "AddOutput" options under "Edit" to determine the structure of the fuzzy controller, and specify the number of inputs and outputs and their variable names.
2) Edit the membership functions of input and output variables.
Selecting any input or output icon in the editor window will open the membership function editing dialog box. Selecting "Add Mfs" under "Edit" will increase the number of membership functions. Select the icon of the variable to be edited, and determine the range of the current variable's quantization level, the quantization of the fuzzy variable, and the type of membership function. Finally, indicate the fuzzy linguistic value of the corresponding fuzzy subset for each variable's membership function. The editing process for the membership functions of each input and output variable is the same. After editing all membership functions, you can close the membership function editing window.
3) Edit fuzzy control rules
When editing fuzzy control rules, double-click the fuzzy control rule icon in the FIS window to open the rule editing window. Then, select the respective language variables in the if, and (or), and then selection boxes, and click Addrule at the bottom of the window. This rule will be written into the rule box. Other rules can be written at once. After all rules are written into the rule box, close the window to complete the editing of the fuzzy controller. Finally, save the file as a.fis (*.fis). Figure 2 shows the structure diagram of the fuzzy system logic control.
3. Establishment of System Simulation Model
Return to the Matlab command window and type "simulink" to enter the Simulink environment. Create the complete model as shown in Figure 7. Then double-click the FuzzyLogicController icon and type "a" in the pop-up dialog box to run it.
4. Simulation Results Analysis
This article takes a controlled object in an industrial control process as an example. The selected input is a unit step response, and the transfer function is .
Figure 7 shows the structure diagrams of the step response of the controlled object using traditional PID control and fuzzy adaptive PID control, respectively. As can be seen from the simulation diagram in Figure 8, due to the addition of fuzzy control judgment statements, the latter has better control performance in terms of overshoot and settling time than the former, but the rise time becomes slower. Traditional PID control, at a certain moment during system operation, may cause system oscillations if the system's adaptive capability is poor when affected by an external disturbance. However, due to the parameter self-tuning function of the adaptive fuzzy controller, the system has strong adaptive capability and can recover promptly when an external disturbance occurs, without oscillations.
5. Conclusion
Compared with traditional PID control, fuzzy adaptive PID control has the advantages of low computational complexity and ease of implementation. During the control process, the controller can achieve better control performance through adaptive adjustments. Simulation results show that this method leverages the advantages of both PID and fuzzy control, achieving stability in a shorter time with less overshoot. This gives fuzzy adaptive PID control strong adaptive capability and improved robustness. It adapts well to changes in the controlled object and sudden external disturbances during the control process, achieving satisfactory control results even when system parameters change. This demonstrates good self-tuning capability and promising engineering application prospects.
References:
[1] Ma Xiaohong. The design of the fuzzy self-adaptive PID controller[J]. Journal of Daqing Normal University, 2009, 29(3).
[2] Yang Yixing, Cui Dalian, Zhou Aijun. Fuzzy Adaptive PID Controller and Simulation Implementation [J]. Ship Electronic Engineering, April 2010, No. 190
YANGYixing,CUIDalian.Self-adaptiveFuzzyPID
ControllerandRealizingtheControlSysteminSimulinkenvironment[J] . ShipElectronicEngineering , 2009 , 190 .
[3] Yi Jie . Application research and design of fuzzy self-adjusting controller of PID parameter [ J ] . Automation of the Manufacture .