Abstract:The heat pump air conditioning system of electric vehicles has the characteristics of time variation, nonlinearity and hysteresis, and the traditional proportional-integral-derivative (PID) control method cannot achieve the ideal control effect. For the backpropagation (BP) neural network, the forward and backpropagation stage formulas are derived, the detailed control algorithm design is given, and a self-learning BP neural network PID controller is designed on the basis Xi of the traditional PID controller. For the heat pump air conditioning system model**, the results show that the controller has the advantages of high stability and good robustness, which is better than the traditional PID control effect. Finally, the BP-PID algorithm is combined with pulse width modulation (PWM) control, and the software and hardware principles of the system are designed, and the stability time is reduced from 155 s to 145 s compared with the traditional PID control, so as to realize the temperature control of air conditioning and prepare for the development of subsequent models.The range of electric vehicles has become one of the focuses of attention. The energy efficiency coefficient of heat pump air conditioner is 2 3 times that of positive temperature coefficient thermistor (PTC), which can increase the cruising range by more than 20%. The heat pump air conditioning system is composed of an electric air compressor, heating, ventilation and air conditioning (HVAC) assembly, air conditioning controller, solenoid valve, etc., and the door switch and driving speed have an impact on the temperature control, so the system has time variability, nonlinearity and hysteresis. The ordinary propor-tion integration differentiation (PID) control can only achieve a good control effect only when the parameters are set accurately and the system does not change drastically, so the ordinary PID has a very unsatisfactory effect on the temperature control of the heat pump air conditioning system.
With its functions of highly nonlinear mapping, self-organization, and self-learning Xi, artificial neural network can understand the structural parameters, uncertainty and nonlinearity of the system, and give the control laws required by the system, so the controller composed of neural network has good adjustment ability and robustness. In this paper, by taking advantage of the good approximation characteristics and generalization ability of the back pro-pagation (BP) neural network, a parameter self-learning PID controller of the neural network is designed by establishing Xi a three-layer network model, which effectively solves the problem of parameter adjustment of the PID controller, and the controller is used in the temperature control of heat pump air conditioning and is carried out with MATLAB, and the control effect is better. Finally, combined with the algorithm, the software and hardware design of the temperature control system are carried out.
The control structure of the BP neural network PID heat pump air conditioner is shown in Figure 1. In the figure, r is the temperature setting input;e is for control deviation;u is the controller output;y is the cabin temperature. The BP-based neural network PID maker consists of two parts:
Fig.1 Diagram of the control structure of BP-PID heat pump air conditioning.
1) The traditional digital PID controller carries out closed-loop control of the controlled object, and the three parameters KP, KI, KD are the best adjustment mode.
2) BPNN is a BP neural network, which outputs three parameter values of KP, KI and KD through the algorithm according to the actual operation of the system.
Incremental PID controller:
where kp, ki, and kd are proportional-integral-derivative coefficients, respectively.
BP neural network is a multi-layer feedforward network with hidden layers, that is, the input layer, the hidden layer and the output layer, and each layer is connected by weight. The structure is shown in Figure 2.
Fig.2 Diagram of BP neural network structure.
The Xi process of BP neural network is a process of correcting the weight while propagating backwards of error, which essentially consists of two stages:
1) Forward propagation stage: The input information is transmitted from the input layer to the output layer after being processed by the hidden layer, and the output layer calculates the actual output value of each neuron.
2) Error backpropagation stage: If the output layer does not reach the desired output, the error value is calculated, transferred to backpropagation, and the weight of neurons in each layer is adjusted according to the gradient descent method.
The classic 4-5-3 structure is adopted, that is, the number of nodes in the input layer of the BP network is 4, the number of nodes in the hidden layer is 5, and the number of nodes in the output layer is 3, and the number of nodes in the input layer and the hidden layer all depend on the complexity of the controlled system.
Since the kp, ki, and kd parameters cannot be negative, the activation function of the output layer takes the non-negative sigmoid function
The activation function of the hidden layer takes the positive and negative symmetric sigmoid function
2.2.1. Positive propagation stage.
In the following equations, the superscripts (1), (2), and (3) represent the input layer, the hidden layer, and the output layer, respectively.
They are the weights of the implicit layer and the weights of the output layer.
The output of the input layer is.
The inputs and outputs of the hidden layer are.
The input and output of the output layer are.
2.2.2. Error backpropagation stage.
Adjust the output layer weights first, and then the hidden layer weights. The formula for the adjustment of the weight of the output layer has been given in many literatures, and the formula for the adjustment of the weight of the implicit layer will be deduced below.
When e(k)=r(k)-y(k)≠0, the error backpropagation stage is carried out. where r(k) and y(k) are the set temperature input of the air conditioner and the actual output temperature of the air conditioner, respectively. The performance indicator function is.
Modify the weight coefficient of the network according to the gradient fastest descent method, that is, search and adjust according to the negative gradient direction of the weight according to J, and add an inertia term, then there is.
where is the Xi rate;is the coefficient of inertia.
Since a change in the output of a neuron in the hidden layer will affect the input of all cells connected to that cell, there is.
Because. Unknown, approximate with a symbolic function.
Instead, there is.
It is obtained from Eq. (1) and Eq. (6).
It can be obtained by the law of chains.
Through the above analysis, the adjustment formula for the weight of the implied layer can be obtained:
In the same way, the formula for adjusting the weight of the output layer is as follows.
Eq. (13) In Eq. (16), g'(x)= g'(x)[1-g(x)],f'(x)=g'(x)[1-g2(x)]/2
In summary, the temperature control algorithm of PID heat pump air conditioner based on BP neural network is as follows:
1) Determine the BP network structure, that is, determine the number of input layer nodes m and the number of hidden layer nodes q, and give.
And. , the Xi rate and coefficient of inertia are selected, where k=1;2) The temperature setting input r (k) and the furnace temperature output y (k) are obtained by sampling, and the calculation error e(k) = r (k) - y (k);3) The network input is given, and the input and output of the hidden layer and the output layer neuron are calculated according to Eq. (4) and Eq. (6), and the output of the output layer is the three parameters of the PID controller4) Calculate the output u(k) of the controller according to equation (1) and participate in the control and calculation;5) Modify the weights of the output layer and the hidden layer according to Eq. (13) and Eq. (16).6) Let k=k+1, return to 2), continue.
In this paper, the heat pump air conditioner is taken as the control object, and its ideal mathematical model can be expressed as:
where k is the gain of the object;tp is the time constant of inertia;is a pure lag time constant. There are 4 neurons in the network input layer, the input is x=[r(k), y(k), e(k),1], and the network Xi rate =017, coefficient of inertia = 008。Take the model:
If the sampling time is 20 s, the discretized difference equations are respectively.
The ordinate represents the relative ratio of r to y, and a step signal is applied, at which point the temperature is set to 20. As shown in Fig. 3 and Fig. 4, the BP-PID controller makes the system enter the steady state for 152 s and the control process is stable, while the ordinary PID controller makes the system enter the steady state for 158 s and there is a maximum overshoot of 10%.
At 302 s, when the door is opened for 10 s and then closed, the BP-PID controller makes the system enter the steady state for 48 s with little fluctuation, while the ordinary PID controller makes the system enter the steady state for nearly 90 s with a maximum of 32% overshoot.
Compared with ordinary PID controllers, the BP-PID controller can make the heat pump air conditioner reach the set temperature faster, the temperature regulation process is overset, and the environment changes better.
Fig.3 BP-PID control response diagram of model 1.
Fig.4. Diagram of the common PID control response of model 1.
The block diagram of the heat pump air conditioner temperature control system is shown in Figure 5
Fig.5. Block diagram of heat pump air conditioning control system.
The micro controller unit (MCU) of this heat pump air conditioning system uses STM32F103 as the main controller. The input signals include vehicle speed, air conditioning mode, air conditioning compressor speed signal, temperature feedback signal, vehicle thermal management request signal, battery temperature signal, temperature setting signal, etc., and the output signal includes solenoid valve switch signal, blower pulse width modulation (PWM) signal, electronic expansion valve switch signal, etc.
Among them, the temperature setting signal and temperature feedback signal correspond to the input of the BP-PID controller, and the PWM control signal of the air-conditioning compressor corresponds to the output of the BP-PID controller.
The core algorithm is the combination of BP-PID algorithm and PWM control. The BP neural network outputs the optimal values of KP, KI, KD, and then brings in equation (1) to obtain the corresponding output U(K) of the incremental PID controller, and the variable U(K) is the change of the PWM duty cycle, and the PWM is output by the common timer Timer3 in STM32 F103RCT6. See 22.1 subsection, the total program flow is shown in Figure 6.
Figure 6 Flow chart of the total procedure.
In this paper, the algorithm design of BP-PID controller and the model of heat pump air conditioning system show that the combination of neural network and PID control, using its strong self-learning Xi ability and arbitrary function approximation ability, can adjust the PID parameters, and effectively improve the control effect of ordinary PID for heat pump air conditioning system, which has time-variable, nonlinear and hysteresis systems. The BP-PID controller is combined with the PWM control algorithm, and the software and hardware principles are designed for the heat pump air conditioning system, the temperature is set at 20 and stabilized at 145 s, while the traditional PID control needs 155 s to achieve stability, and the temperature overshoot index is better than the traditional PID control through the subjective evaluation of the compressor working state.
Author: Han Chaochao.Yibin Kaiyi Automobile***
Disclaimer: Sharing this article is only to spread automobile-related technical knowledge, and its copyright belongs to the original author, thank you for the hard work of the original author;If you have any infringement objections, please contact us to negotiate or delete, thank you!