Design of Constant Temperature Control System Based on Fuzzy Control

Publisher:Ziyu2022Latest update time:2011-03-31 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: In order to overcome the influence of thermal inertia and high-temperature heat dissipation, a constant temperature control system is designed based on a fuzzy control algorithm and a single-chip microcomputer, and the hardware structure and software control scheme are introduced. The experiment shows that the system realizes accurate measurement and control of temperature, with a static error of less than 0.2℃ and a standard deviation of constant temperature control of less than 0.3℃. At the same time, the system also has the advantages of fast response speed, high cost performance and strong portability.
Keywords: constant temperature control; fuzzy control; single-chip microcomputer; AD590

Constant temperature control is widely used in daily industrial production. Fuzzy control technology is to imitate human thinking methods and use uncertain fuzzy information to make decisions to achieve the best control effect. Fuzzy control is concerned with the goal rather than the precise mathematical model, that is, it studies the controller itself rather than the controlled object. Therefore, special control media can be used to study the controller itself. Based on this, this system uses a single-chip microcomputer as the core controller to study the fuzzy control algorithm and realize accurate constant temperature control. The communication software between the single-chip microcomputer and the host computer is designed to realize the functions of remote temperature control and temperature curve visualization.

1 System Function and Hardware Design
This system uses water temperature as the measurement medium, AT89C51 single-chip microcomputer as the core controller, and AD590 temperature sensor as the collector to realize the functions of temperature collection, control, transmission, and display. The system uses fuzzy algorithm to control the heating time of the heating wire, thereby achieving the control of water temperature. At the same time, the host computer software can perform real-time control and display of temperature curves, etc. The system block diagram is shown in Figure 1.
a.JPG

1.1 Temperature acquisition module
The temperature acquisition module realizes the functions of temperature signal acquisition, signal conditioning, and analog/digital conversion. It mainly uses the integrated temperature sensor AD590M as the acquisition body, and the voltage follower, differential subtractor, voltage amplifier, inverter and other circuits are used as signal conditioning, and then input into the 10-bit A/D converter TLC1549 for analog/digital conversion. The circuit diagram is shown in Figure 2. AD590 is a current-type integrated temperature sensor with strong anti-interference ability. Its output current is proportional to the temperature value and is based on absolute temperature zero (-273℃). Its linear current output is 1μA/K. The current signal can be converted into a voltage signal using a 10 kΩ resistor. The measurement range of this system is 0-100℃, so the output voltage range is 2.73-3.73 V. In order to increase the impedance of the back-end circuit and reduce the shunt of the current signal, a voltage follower is used as signal isolation. The input differential subtractor subtracts 2.73 V and after 5 times voltage amplification , the corresponding output voltage range is 0-6 V. The voltage signal is input into the 10-bit successive approximation analog-to-digital converter TLC1549. Its reference voltage is 5 V, so the resolution of the input voltage (unit: mV) is:
d.JPG

b.JPG

Therefore, the theoretical resolution of temperature sampling in this system is:
c.JPG
Since the sensor signal is weak and easily affected by the external electromagnetic environment, twisted pair cables must be used to transmit the sensor signal.
1.2 Human-computer interaction and remote management module
The system has developed a rich human-computer interaction interface, which is divided into local management and remote management, which simplifies the complexity and convenience of operation to the greatest extent. On the local end, there are three function buttons, namely: set temperature plus 0.1℃, set temperature minus 0.1℃, and temperature control switch. Two three-digit seven-segment digital tubes display: set temperature and real-time acquisition temperature respectively.
The system realizes communication between the host computer and the single-chip computer through the serial port conversion chip MAX232. As the remote management end, the host computer realizes the functions of displaying temperature change curve, displaying current temperature, displaying set temperature, displaying maximum positive and negative errors, zooming in or out of curves, and saving curves.

1.3 Temperature control and over-limit alarm module
The system uses a single-chip microcomputer to control the heating time of the heating wire within a heating cycle to control the water temperature. After the single-chip microcomputer port signal is isolated by an optical coupler, the three-pole tube is used to drive the closing and opening of the electromagnetic relay to control the heating time. When the temperature exceeds 100℃ or the real-time temperature change exceeds 10℃, the single-chip microcomputer will drive the buzzer to give a long-term alarm prompt. When the set temperature change exceeds 10℃, the buzzer will give a short-term alarm prompt.

2 Software system design
The control idea of ​​the system is: according to the fuzzy control model and the actual application situation, a fuzzy query table is inferred. The fuzzy query table represents the heating cycle time for different states. The single-chip microcomputer retrieves the fuzzy query table according to the change of the real-time sampling temperature and adjusts the heating cycle to achieve the purpose of temperature control.
2.1 Main program
The main program is always in a state of waiting to receive serial port signals and judging whether data needs to be sent. After the timer interrupt performs average value filtering on the sampled temperature every second, the serial port sending flag is set and sent in the main program. When the MCU receives the first byte of the PC signal, it calls the data receiving subroutine to receive the remaining data into the buffer, and determines the type of the received data to perform the corresponding operation.
In order to avoid serial port interference signals, the system adopts a mixed serial port communication of response mode and unidirectional transmission to improve the stability of communication and the real-time performance of the system. The host computer uses the response mode to send commands, and the MCU uses the unidirectional communication mode to upload real-time temperature information. The communication protocol consists of a packet header, command, data length, data packet, and check bit.
2.2 1ms timing interrupt program
The 1ms timing interrupt serves as the system's total clock. A digital tube is refreshed every 1 ms, and a key is scanned every 10 ms. In the last 100 ms of every 1 s, the temperature value is sampled every 10 ms, and the 10 sampled values ​​are bubble sorted. The average value after removing the maximum and minimum values ​​is sent to the display buffer as the final value of this real-time sampling. If the constant temperature control switch is turned on, the constant temperature control program will be called every 1 s. If the alarm switch is turned on, the speaker output is inverted every 1 s. The watchdog will be reset before the timing interrupt returns.
2.3 Establishment of fuzzy control model
The system uses a dual-input single-output fuzzy control mode. The two input language variables E and EC represent the temperature error and the rate of change of the temperature error respectively, and the output language variable U represents the closing time of the relay. The language variable E is assigned 8 values, namely positive small (PS), positive zero (PO), negative zero (NO), negative small (NS), negative medium (NM), negative large (NL), negative large (NXL), and negative extra large (NXXL). Considering that there is no cooling measure in the system, the assignment of E is not symmetrical. EC is assigned 7 values, namely positive large (PL), positive medium (PM), positive small (PS), zero (PO), negative small (NS), negative medium (NM), and negative large (NL). U is assigned 4 values: zero (O), positive small (PS), positive medium (PM), and positive large (PL). In order to compensate for the overshoot of temperature control, the quantization value of E is -10~2, and the quantization values ​​of EC and U are -6~6 and 0~6 respectively. Each value adopts a triangular membership function model, as shown in Figures 3 to 5.

f.JPG

g.JPG

Relying on experience to establish control rules, but the control quantity obtained is not a fuzzy quantity and cannot be used directly as a control output. C language is used for defuzzification processing to obtain a fuzzy query table, which is repeatedly adjusted during the test, and finally the fuzzy query table is obtained as shown in Table 1.
2.4 Fuzzy control program
In the program of the single-chip microcomputer, the variable TOUT is set to represent the constant temperature control cycle, and TSET represents the rhyme heating output time in a constant temperature control cycle, that is, U in the table. Every TOUT time, the fuzzy reasoning program will be called to calculate the error E and the error change rate EC. Among them:
E = real-time sampling temperature value - set temperature value
EC = current error - last error
When the error is large, there is no need to perform fuzzy control, just judge whether to heat at full speed or stop heating. When the error enters the preset control range, quantize E, EC, and query the fuzzy query table by the quantized value to obtain the heating time TSET that should be output in this cycle.
In the test, it was found that the effect of using a single E, EC domain was not satisfactory, and the system sensitivity was low. Considering the influence of heating inertia and high-temperature heat dissipation, a two-level control method was adopted. In the first level of control, the domain of E and EC is large, and it can be quickly heated to the vicinity of the constant temperature setting temperature; then enter the second level of control, narrow the domain of E and EC, and improve the sensitivity of control. After testing, this method can stabilize the constant temperature error within ±0.3℃ during the control process of each temperature level.
3 System experiment and error analysis
3.1 Sensor zero point calibration
The system uses the current type temperature sensor AD590 and a single point adjustment circuit. Under ideal conditions, a 10kΩ resistor is connected in parallel to the ice-water mixture (0℃), and the output voltage is 2.73V, which is the sensor zero point. At the same time, in order to ensure the accuracy of the system, a single point adjustment circuit is used for further adjustment.
3.2 System experiment
This system is used to perform repeatability tests on tap water. Due to the influence of local air pressure and impurities in water, when water reaches the boiling point, it still cannot reach 100℃, so the test range of the system is set to 40~90℃. When the system reaches a constant temperature and stops heating, a static data measurement is randomly performed; within the next 100 minutes, a constant temperature control data measurement is performed every 5 minutes. The static data is shown in Table 2, the constant temperature control data is shown in Table 3, and the 50℃ constant temperature control host computer curve is shown in Figure 6.
h.JPG

It can be seen from Table 3 that the static error of the system is ±0.2℃. The standard deviation of the last 10 data of each group of data in Table 3 is calculated, and the results are shown in Table 4. It can be seen that the average error is less than ±0.3℃.

i.JPG

4 Conclusion
This system designs a constant temperature control system based on fuzzy control algorithm and single-chip microcomputer. Using the single-chip microcomputer as the core controller, a rich and friendly human-computer interaction environment is developed: the visibility of the temperature change curve and remote controllability are very suitable for industrial remote management requirements. It has low cost and good scalability, and is very easy to expand into a multi-channel acquisition system; at the same time, the fuzzy query table method is used to improve the portability of the system. Experiments show that this system can keep the water temperature constant within the range of 40-90℃, with a control error of less than 0.5℃ and a static error of less than 0.2℃. It can be widely promoted and transplanted into industry.

Reference address:Design of Constant Temperature Control System Based on Fuzzy Control

Previous article:Design of intelligent thermometer based on SPCE061A
Next article:Based on the development and design of an intelligent shrinkage machine

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号