Aiming at the problems of response of traditional PID control, long transition time and inaccurate and large error of fuzzy control, a fuzzy PID control algorithm applied to air conditioning controller is proposed. The structure of the fuzzy PID control algorithm is designed. The design and implementation steps of the fuzzy PID control algorithm are studied by using the M function tool of MATLAB and the fuzzy reasoning toolbox. Through the contrast test of temperature control before and after the modification of a single air conditioner using the fuzzy PID control algorithm, it is concluded that the adjusting time from initial state to set value is reduced from 10 minutes to 7 minutes after the adoption of the algorithm, and the temperature change in the steady state process is more stable, and the range of change is reduced from ( ) 1.5 ( ) to ( ) 0.6 ( ) C), which reduces the adjusting time of the system. Intermediate and controlled overshoot can shorten the transition time and can be used in intelligent air conditioning system. Air conditioning came into our country in the 1980s, and now in the 21st century, air conditioning has become a common household appliances product in people’s daily life. At present, people’s demand for air-conditioning controllers is increasing, and their performance requirements are also increasing. Combining with the development situation at home and abroad, air conditioning controller will develop towards the trend of high cost performance, multi-function, networking, low power consumption and intellectualization. According to the development trend of air conditioning, aiming at the problems of response of traditional PID control algorithm, long transition time and inaccurate control of fuzzy control algorithm, a fuzzy PID control algorithm based on air conditioning controller is proposed. PID control has gone through more than 80 years since it came into being. It is mainly used in the deterministic control system which can establish accurate mathematical model. In the modern industrial control system, more than 95% of the control loops adopt the PID structure [2]. In practical engineering applications, the conventional PID parameter adjustment steps are tedious, especially to find the appropriate I and D parameters. In the actual debugging process, many tests will be carried out to find the appropriate parameters [3]. Therefore, the system uses the classical Ziegler-Nichols method to determine the initial P, I and D parameters of the system, and then further improves and optimizes the relevant parameters according to the effect of the system operation. Fuzzy control is a computer intelligent control technology, which is based on fuzzy set theory, fuzzy logic reasoning and fuzzy linguistic variables. According to the difference of reasoning rules, fuzzy control generally includes Mamdani and Takagi-Sugeno. At present, other types of fuzzy control are the improvement and optimization of these two types. Mamdani-type fuzzy control method simulates the control process of the operation team. It transforms the language rules into quantitative control process. It does not need to know the precise mathematical model of the controlled object. The control process is clear and easy to operate and realize on site.
Therefore, Mamdani type fuzzy control algorithm is adopted in this system. Combining the advantages of the PID control algorithm and the fuzzy control algorithm in the control system, in order to realize the comfortable and energy-saving control of the air-conditioning controller, the system adopts the fuzzy PID control algorithm combined with the fuzzy control algorithm. The algorithm structure block diagram is shown in Figure 1. As shown in Figure 1, the system’s fuzzy-PID control structure block diagram is composed of the fuzzy controller part, the PID controller part and the feedback part. All kinds of sensor information are collected and processed by composite digital filters, such as limiting filter, sliding average filter and first-order lag filter. When the sensor information deviation is large, the system intelligently switches to the fuzzy control. Firstly, the error [e] and the error change rate [e’] are limited to the basic domain. By fuzzification, knowledge base, fuzzy reasoning and de-fuzzification, the accurate control quantity is output, the response time of the system is reduced, and the system transition process is shortened. When the collected sensor information deviation is small and the system enters the steady-state process, the system intelligently switches to the PID control, uses the PID control algorithm, reduces the system error, improves the control accuracy, and then realizes the comfortable and energy-saving control function of the air-conditioning controller. After more than 70 years of development, Ziegler-Nichols method is widely used in the field of industrial PID [7]. This design adopts step response tuning method: by applying a step signal to the controlled object in the open-loop situation, the step response signal is measured by experimental method, and the corresponding step response curve as shown in Figure 2 is drawn. From the step response curve in Figure 2, the static amplification factor [k], capacity lag time [L] and time constant [T] can be calculated. According to the determined parameters of [k], [L], [T], the relevant parameters of PID control can be calculated by setting the parameter table of Ziegler-Nichols shown in table 1: [Kp], [Ti] and [Td]. The system takes the ambient temperature of the room where the air conditioning controller is located as the controlled parameter. In the actual use process, the ambient temperature will generally be affected by many uncertain factors. In order to establish the relevant control model conveniently, we neglect the relevant uncertain factors, assuming that only the designed air conditioning controller outputs the environmental temperature of the room where the control is located, i.e. step signal, and then statistics the temperature and time data of the environment in which the air conditioning controller is located, and draw the corresponding step response curve. In formula 1, [K] is the static amplification factor, [L] is the capacity lag time, [T] is the time constant. Therefore, using the first-order transfer function with delay as the mathematical model, we write the code that can call the M file as shown in Figure 3.
It can be seen that the invocation format of M function Ziegler of PID control in this design is: [Gc, Kp, Ti, Td = Ziegler vars], and its input variable format is [vars = K, L, T, N]. By default, [N] takes 1. By adjusting the supply voltage frequency of the internal motor of the frequency converter compressor, the system can change the speed of the frequency converter compressor, thereby adjusting the temperature control. The controlled variable is the temperature of the environment in which the air conditioner is located, and the control variable is the frequency of the supply voltage of the variable frequency compressor.
The control objective is to keep the temperature of the environment in which the air conditioner is located at a predetermined value, such as 26 degrees Celsius. Therefore, the primary task of the system’s fuzzification is to complete the transformation of temperature deviation [e], temperature deviation change rate [ec], and power supply voltage frequency increment [u] of compressor motor, that is, to transform the universe from the actual range of variation of system parameters to the fuzzy universe. It can be seen that the air conditioning controller system has three variables, two inputs and one output. The input variables include temperature deviation [e] and deviation change rate [ec], and the output variable is power supply voltage frequency increment [u] of compressor motor. Among them, [Tset] is the temperature setting value, in units of temperature; [T] is the actual temperature measurement value at the [k] sampling time, in units of temperature; [ek] is the temperature deviation at the [k] sampling time, in units of temperature; [T] is the sampling period, in units of S. [T] is the temperature deviation at the [k] sampling time, in units of temperature; [T] is the temperature deviation at the [k-1] sampling time, in units of temperature. According to the experience and convenience of testing, in the basic field of language variables, the actual deviation of ambient temperature is [-20,20], unit temperature; the change rate of actual temperature deviation [ec] is [-2,2], unit temperature; and the increment of power supply voltage frequency [u] of compressor motor is [-35,35], unit Hz. In practical application, the knowledge base of fuzzy control includes database and rule base [9]. According to the debugging experience and test data in the historical field, as shown in Table 2, the fuzzy language control rule table of the speed control of the variable frequency compressor of this system is presented. In the actual fuzzy control system, the system must have a certain output value, so de-fuzzification is the process of converting the fuzzy output from the process of fuzzy reasoning into precise output after clarification.
The weighted average method widely used in industrial control and automation is used in this design, and the area center method of “centroid” is used in the process of ambiguity resolution in MATLAB. According to the above description, a fuzzy controller named fuzzy.fis is established in MATLAB. A new simulation model named fuzzy1.slx is created in Simulink as shown in Figure 5. At the same time, a my. test model is built in SystemTest, the relevant parameters are set, the fuzzy 1. SLX simulation model and the fuzzy. FIS of the fuzzy controller are loaded, and the test is saved and run. After the test is completed, input the code shown in Figure 6 in the command line window of MATLAB to view and sort out the fuzzy control query table. In the application of this system, in order to save software resources and improve the operation speed, only need to save the fuzzy control query table in the embedded MCU. By calculating the look-up table, the input temperature deviation [e] and the temperature deviation change rate [ec] are analyzed and calculated. The control data [Ui], combined with the quantization factor [Ku], is obtained by [ui=Ui_Ku]. The accurate output control value [ui] of the power supply voltage and frequency increment of the compressor motor in this system can be obtained.
In the software implementation of the system’s fuzzy PID algorithm, the comparative value of ambient temperature deviation is modifiable. When the ambient temperature deviation is large, thermostatic element the air conditioning controller switches to the fuzzy control, limits the temperature error [e] and the error change rate [e’] to the basic domain, and processes them by fuzzification, knowledge base, fuzzy reasoning and de-fuzzification. Finally, the accurate control quantity is output. When the collected temperature deviation is small and the system enters the steady-state process, the air conditioning controller is switched to PID control to reduce the system error and improve the control accuracy. The program flow chart of the fuzzy PID algorithm is shown in Fig. 7. This design is reformed with a beautiful 3P vertical cabinet DC converter air conditioner, the specific model is. The starting ambient temperature of the room is 29 C, and the working frequency of the frequency converter compressor is set to 50 Hz. A set of values of the ambient temperature change in the room where the air conditioning controller is located are measured. The response curve of the ambient temperature difference in the room where the air conditioning controller is located can be drawn through sorting out as shown in figure 8. From figure 8, it can be roughly estimated that the lag time [T] is 300 s, the inertial time constant [L] is 100 s, and the amplification coefficient [K] is 5. Write the M function test code as shown in Figure 9. Input the relevant parameters of [K], [L], [T] and call the M function ziegler.
Running the above M function test code in Matlab, we can get the initial parameters of the designed PID control [Kp = 0.72], [Ti = 200] and [Td = 50]. The response curve of the current parameters is shown in Figure 10. From the current parameters of the PID response curve, we can see that when the system only uses the PID algorithm, the system will run for more than 4000 seconds to achieve a balanced state, which is unacceptable in the actual use process.
On the basis of the initial PID parameters, through debugging the fuzzy PID control algorithm, the design chooses the setting value of ambient temperature deviation as 3 degrees Celsius, [Kp=0.66], [Ti=41] and [Td=22] for comparative testing. Using a beautiful 3P vertical cabinet DC converter air conditioning, the test environment is about 40 square meters of office, the air conditioning temperature setting value is 27, choose the conventional working mode. Fig. 11 shows the temperature change curve of air conditioning operation environment before and after modification with the fuzzy PID control algorithm. According to the figure, it takes about 10 minutes for the air conditioning system to transit from the initial state to the set value of 27 degrees Celsius before modification, and the subsequent temperature changes dramatically, ranging from <1.5 degrees Celsius. When the fuzzy PID control algorithm is adopted, the room temperature transition from the initial state to the set value takes only 7 minutes, and the subsequent temperature changes smoothly, ranging from ( 0.6 C). By comparing the above data, it can be seen that the adjustment time of the air conditioning controller system from the initial state to the set value is reduced by 3 minutes after adopting the fuzzy PID control algorithm, and the temperature change in the steady state process is more stable. Therefore, the fuzzy PID control algorithm is adopted in the air conditioning controller system, which reduces the adjustment time and overshoot of the air conditioning system, shortens the transition time of the system into steady state, and achieves satisfactory control effect. The research and application of fuzzy-PID control algorithm based on air-conditioning controller have improved the problems of response of traditional PID control algorithm, long transition time and inaccurate control of fuzzy control algorithm, and realized comfortable and energy-saving control of air-conditioning. Through physical testing and practical use, the system runs stably, operates simply and consumes low power, reduces the regulation time and control overshoot of the system, shortens the transition time, and can be widely used.