Design and simulation of fuzzy PID control system for liquid level of double-capacity water tank (Matlab/Simulink)

A few days ago, I found a very good artificial intelligence learning website. It is easy to understand, humorous, and has no advertisements. (Click to jump to artificial intelligence learning materials)


WeChat public account: Chuangxiang Diary
Send: double-capacity fuzzy
Get the complete report without watermark + simulation source file + related literature


1. Problem description

Design and simulation of liquid level control system for double tanks

insert image description here

1. Based on the principle of liquid level balance, establish a mathematical model of the liquid level control system of the double-capacity water tank, and use the balance point linearization method to establish a linearized model; 2. Use the fuzzy PID control method to
adjust the parameters of the PID controller online to achieve dual The liquid level adjustment of the water tank provides a detailed control scheme;
3. Use Simulink to build a simulation block diagram to realize the system simulation, adjust the PID parameters online, and analyze the system performance.


2. Model establishment

The structure diagram of the double-capacity water tank system is shown in Figure 1-1. The opening of the upper water tank inlet valve V_i (the liquid resistance is R_i) controls the inflow Q_i of the upper water tank, and the outflow of the water outlet valve V_1 (the liquid resistance is R_1) is Q_1. The liquid level H_1 of the upper water tank is determined by Q_i and Q_1; the inflow of the water inlet valve V_1 of the lower water tank is Q_1, the outflow of the water outlet valve V_2 (liquid resistance is R_2) is Q_2, and the liquid level H_2 of the lower water tank is determined by the water inlet Q_1 and the water outlet The water quantity Q_2 is jointly determined. During the control process, V_1 and V_2 remain unchanged. The main control task of the system is to control the liquid level H_2 of the lower tank by adjusting the opening of V_i so that the measured value is equal to the set value. According to the dynamic material balance relationship, the following equations are listed :
insert image description here

insert image description here


3. Control scheme

The double-capacity water tank control system adopts the fuzzy PID control method, and its system structure block diagram is shown in Figure (3-1).
insert image description here

1. Implementation steps of the fuzzy PID control scheme
(1) Enter fuzzy in the Matlab command line window to call out the fuzzy logic designer window for compilation.
(2) Set the number of inputs and outputs, as shown in Figure (3-2), and set the number of inputs to 2, the range is [-3,3], the number of outputs to 3, the range is [-1, 1].

insert image description here

(3) Edit its membership function according to relevant information, as shown in Figure (3-3).
insert image description here

(4) Carry out fuzzy rule design according to the following rules (NB is negative big, NM is negative middle, NS is negative small, ZO is zero, PS is positive small, PM is positive middle, PB is positive big), the horizontal axis of the table below is EC , and the vertical axis is E.

insert image description here
insert image description here

Write rules according to the above table, such as:
If (E is NB) and (EC is NB) then (∆K_p is PB)(∆K_i is NB)(∆K_d is PS) (1)
If (E is NB) and ( EC is NM) then (∆K_p is PB)(∆K_i is NB)(∆K_d is NS) (2)
If (E is NB) and (EC is NS) then (∆K_p is PM)(∆K_i is NM )(∆K_d is NB) (3)
… There are a total of 49 rules, which are not listed here, as shown in Figure (3-4).

insert image description here

After formulating the rules, save them and export them to the workspace for later use.

2. Carry out parameter self-tuning of fuzzy PID.
According to relevant data, the principle of PID parameter tuning with K_p0, K_i0, and K_d0 as initial values ​​is

insert image description here

In the formula, K_p, K_i, K_d are the gains of the fuzzy self-tuning PID output; K_p0, K_i0, K_d0 are the initial values ​​of the gains; ΔK_p, ΔK_i, ΔK_d are the adjustments of the gains.

insert image description here

Figure (3-5) shows the overall structure of fuzzy PID control. The respective values ​​after sum are gain outputs K_p, K_i, K_d. 7, 0.04, and 14 in the figure are the initial gain values ​​K_p0, K_i0, and K_d0, respectively. Their values ​​are obtained by the traditional PID empirical method, and follow the following formula: find the best parameter setting, and check in order from small to
large
; Then add the differential;
the curve oscillates frequently, and the proportional dial should be enlarged;
the curve floats around the big bay, and the proportional dial is
turned small; the curve deviates and recovers slowly, and the integration time decreases;
the curve fluctuation period is long, and the integration time is extended;
the curve If the oscillation frequency is fast, reduce the differential first;
if the dynamic difference is large, the fluctuation will be slow. The differential time should be lengthened;
the ideal curve has two waves, the front is high and the back is low by 4 to 1;
if you look at the two adjustments and analyze more, the adjustment quality will not be low.
After the initial value is obtained, since the set output domain is [-1 1], it is necessary to multiply the corresponding value range after demux, and the multiplied output value is the adjustment amount of gain ΔK_p, ΔK_i, ΔK_d .


4. Simulation verification

insert image description here
In Matlab/Simulink, build the simulation model of the double-capacity water tank fuzzy PID control system shown in Figure (4-1), edit each editor of the fuzzy controller, and write 49 fuzzy control rules into the fuzzy control rule editor , and finally get the clear value of the data output to realize the online tuning of the PID parameters. The simulation results are shown in Figure (4-2). The blue line is the system response, and the yellow line is the unit step reference. The response overshoot is 0.397, and the steady state time is 1496s.

insert image description here


5. System Analysis

Conventional PID control is the most commonly used in traditional control theory. Its algorithm is simple and practical, and it has good control effect and robustness in control. Only by continuously adjusting the PID parameters online can better control effects be obtained. In practical applications, due to the erratic changes of PID parameters, there are no definite mathematical models and rules to follow. Fuzzy control can make full use of the successful practical operation experience of operators in real-time nonlinear adjustment. Therefore, this system uses fuzzy controllers to carry out PID parameter online Setting, give full play to the excellent control function of the PID controller to make the system achieve the best effect.

Guess you like

Origin blog.csdn.net/m0_46653805/article/details/125581576