Some medical testing instruments need to simulate the human body temperature environment to ensure the accuracy of detection. In this paper, STM32 is the main controller, and the motor driving chip DRV8834 is used as the driver to drive the semiconductor cooler (Peltier) to heat or cool the heat sink. . However, due to the problem of inertia temperature error due to conventional temperature control, it is impossible to balance the strict requirements of high precision and high speed. Therefore, the fuzzy adaptive PID control method is used to adjust the PID parameters online and calculate the PID parameters Kp, Ki, Kd to adjust the control pulses. Control the enable of the drive. From the simulink simulation and experimental results, the fuzzy PID control system has high precision and fast response, which can achieve the expected results.
Temperature parameters are one of the commonly used controlled objects in industrial production. They are widely used in chemical production, metallurgical industry, power engineering and food processing. In medical testing equipment, it is often necessary to simulate human body temperature for component detection. The DC motor drive chip DRV8834 is used to drive the cooling and heating process of the Peltier. The rate of change of temperature with time and the direction of change are uncertain and may vary greatly, requiring the actual temperature of the system to quickly and accurately track the set temperature to meet the processing requirements. The time program temperature control system has strong nonlinearity, strong coupling, large time lag and time variation. Although the traditional PID control is simple and easy to implement, the adjustment time is fast and the precision is high, but the anti-interference ability is not strong and easy to produce. Oscillation; fuzzy PID does not require an accurate mathematical model, can better deal with time-varying, nonlinear, hysteresis, etc., has good robustness and fast response.
1 Process analysis and conventional control methodsThe constant temperature control system has functions such as cooling and heating. The temperature sensor DS18B20 in the tank continuously compares the temperature with the set temperature. When the indoor temperature is lower than the set temperature, the heating module works to make the DRV 8834 output positive. To DC, drive the Peltier components to heat them; when the temperature is higher than the set temperature, the DRV8834 outputs reverse DC, driving the Peltier components to operate in the cooling function. The room temperature is oscillated within the set value range and eventually tends to be stable. At the same time, the control system will coordinate the control of the refrigeration and heating system to achieve the goal of minimum box temperature fluctuation and high precision temperature control. Therefore, temperature control becomes the core issue of the constant temperature control system.
2 Hardware circuit design of fuzzy PID temperature control systemAs shown in Figure 1, the system mainly includes the following parts:
1) Digital Temperature Sensor: The DS18B20 is a temperature sensor with a “one-wire bus†interface. Compared with traditional temperature measuring elements such as thermistors, it is a new type of digital temperature sensor with small size, wide voltage and simple interface with microprocessor to realize temperature collection.
2) Controller: It uses STM32 module and memory to complete a large number of PID operations with its rich external resources and frequency up to 72 MHz.
3) Heating module: It adopts the driver chip DRV8834, which is a double bridge stepper or DC motor driver. Since the heater Peltier is controlled by direct current heating or cooling, the DRV8834 is used as a DC motor driver to drive the Peltier.
The DRV8834 can drive two DC motors or one stepper motor. Each H-bridge has a current output of 1.5 A and a peak current of 2.2 A, so the Peltier heating component is driven by 1.5 A. The device provides an internal shutdown function with a fault output pin for overcurrent protection, short circuit protection, undervoltage lockout, and overtemperature. In addition, a low-power sleep mode is provided to conserve power and increase component life.
As shown in Figure 2, the nSLEEP pin controls the sleep mode of the driver chip, the low level enters the sleep mode, and is controlled by the I/O of the STM32; AOUT1 and AOUT2 are the two outputs of the bridge A, (here the two of the Peltier are connected) Input)), and a 0.1 ohm resistor and 1uH inductor in series to simulate the DC motor load; VREFO is the reference voltage output; AVREF and BVREF change the input voltage through the sliding rheostat, and combine the AISEN terminal resistor to set the chopping current. Output, chopping current calculation formula:
Chopper current calculation formula
The AENABL pin is the enable chip of the DRV8834 chip; the DIR pin controls the output direction of the bridge current, where it can control the heating or cooling of the Peltier; the nFAULT pin outputs a high level when the chip is working normally, when the output is low. Indicates that the chip is over temperature, overcurrent, or undervoltage to indicate the operating state of the chip; the VM input is powered by 5 V.
3 Software design of fuzzy PID temperature control system3. 1 Basic principles of fuzzy control
Fuzzy control is based on fuzzy set theory, fuzzy language and fuzzy logic. It is the application of fuzzy mathematics in control systems and is a kind of nonlinear intelligent control.
Based on the conventional PID, the error e and the error rate ec of the temperature feedback value and the target value are taken as inputs. On the one hand, the fuzzy controller is used to calculate the adjustment coefficient of the PID parameter by fuzzy inference method, and online self-tuning is performed to meet Different e and ec requirements for controller parameters.
The software design of temperature control mainly consists of three parts: system initialization, fuzzy PID calculation, and drive circuit control. The control process is shown in Figure 4.
The system initialization includes the initialization of the STM32 system clock, the initialization of the I/O port, the initialization of the digital temperature sensor DS18B20, and the initialization of the display module. The calculation of the fuzzy PID is that the values ​​of e(k) and ec(k) are input to the fuzzy control rule table and then defuzzified to calculate the current values ​​of Kp, Ki, Kd. The control amount of the PID control output is the count value of the STM32 timer to control the duty ratio of the PWM output, and the PWM output is connected to the enable pin of the Peltier driver to control the on/off of the output of the current, thereby controlling the transmission of the Peltier. Heat.
3.2 Fuzzy division and fuzzy
Let the basic domain of the temperature deviation e be [-30°C, +30°C], the basic domain of the temperature deviation change rate ec is [-12, +12], and the basic domain of the output u is [-0.4, +0.4 ], the linguistic variables E, EC, and U of e, ec, and u are all divided into seven variable levels (NB, NM, NS, Z, PS, PM, PB), and the fuzzy domain of each variable is:
{E)={-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6};
{Ec}={-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6};
{U}={-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7}.
For fuzzy controllers, the temperature deviation and its rate of change are all accurate inputs. In order to fuzzify the determined exact quantities, they must be converted into membership functions of the fuzzy set. Since the triangle function is simpler to calculate and has better performance, the membership functions of the input/output variables are distributed in a triangle.
3.3 Fuzzy Control Rules
The principle of determining fuzzy control rules must be that the dynamic and static characteristics of the system output response are optimal. When the error is large or large, the control quantity is selected to eliminate the error as soon as possible; and when the error is small, the control quantity should be selected to prevent overshoot, and the stability of the system is the main starting point.
This study conducted experiments, analysis, and induction based on actual operational experience, and derived a series of control rules:
3.4 simulation comparison of simulink
The fuzzy adaptive PID control is compared with the conventional PID control, which shows the superiority of fuzzy adaptive in temperature control. The Peltier heating fin can be regarded as a first-order inertia with time-delay characteristics. The transfer function is:
Where k is 4, Ï„ is 500, and the delay part is connected in series with a Transport Delay module in simulink, and the delay time is 3 s.
As shown in Fig. 5, the upper part is fuzzy adaptive PID control. The input signal calculates the correction values ​​of Kp, Ki, and Kd through the confused controller, and then adds the empirical values ​​of Kp, Ki, and Kd to act on the transfer function. The lower part is the normal PID control. Observe the control effects of the two control methods through a virtual oscilloscope.
The red curve is the output curve of the ordinary PID control, and the yellow curve is the output curve of the fuzzy adaptive PID control. By comparison, it can be found that the traditional PID control has a serious overshoot and oscillates up and down the expected value, and the adjustment time is long. Fuzzy adaptive PID control solves this problem very well, achieving system stability with the smallest overshoot in the fastest time.
4 ConclusionIn this experiment, the commonly used DC motor driver is applied to the semiconductor refrigeration device through proper adjustment of the circuit, and the circuit is simple and low in cost. The software design uses PID fuzzy control to effectively solve the inertia and delay problems of temperature control. The experiment based on STM32 controller makes full use of its firmware library function to greatly reduce the development cycle and improve efficiency. This system can be used in some occasions where temperature control is used in medical equipment, household appliances, etc., and it is representative.
50Ohm TS9 CRC9 Male Plug Connector For RG316 RG174 RF Coaxial Cable
Xi'an KNT Scien-tech Co., Ltd , https://www.honorconnector.com