0 Introduction
Temperature control technology plays a very important role in both industrial production and daily life. In industries such as metallurgy, petroleum, chemical industry, electric power and modern agriculture, temperature is one of the most important and common thermal parameters. In ordinary households, household appliances such as water heaters, rice cookers, and electric ovens that rely on temperature control technology are also indispensable. It can be said that temperature control technology is everywhere.
The conventional temperature control method takes the set temperature as the critical point. If it exceeds the set allowable range, the temperature is controlled: heating is performed if it is lower than the set value, and otherwise it is stopped or cooled. This method is simple to implement and low in cost, but the control effect is not ideal, the control temperature accuracy is not high, it is easy to cause oscillation, and it takes a long time to reach the stable point. Therefore, it can only be used in occasions where the accuracy requirements are not high.
The PID algorithm is used for temperature control, which has the characteristics of high control accuracy and the ability to overcome capacity hysteresis. It is particularly suitable for control systems with large load changes, large capacity hysteresis, and high control quality requirements.
As an indispensable part of the control system, the single-chip microcomputer has been widely used in various fields. Using the single-chip microcomputer for real-time system data processing and control can ensure that the system works in the best state, improve the control accuracy of the system, and help improve the work efficiency of the system. This system uses single-chip microcomputer programming to implement PID algorithm for temperature control.
1 Principles and characteristics of PID control
In engineering practice, the most widely used regulator control law is proportional, integral, and differential control, referred to as PID control, also known as PID regulation. PID controller has become one of the main technologies of industrial control due to its simple structure, good stability, reliable operation, and convenient adjustment. When the structure and parameters of the controlled object cannot be fully mastered, or an accurate mathematical model cannot be obtained, other technologies of control theory are difficult to adopt, and the structure and parameters of the system controller must be determined by experience and on-site debugging, it is most convenient to apply PID control technology.
PID controller parameter tuning is the core content of control system design. It determines the proportional coefficient, integral time, and differential time of the PID controller according to the characteristics of the controlled process. The methods of PID controller parameter tuning can be summarized into two categories: one is the theoretical calculation tuning method. It is mainly based on the mathematical model of the system and determines the controller parameters through theoretical calculation. The calculated data obtained by this method may not be directly used, and must be adjusted and modified through engineering practice. The second is the engineering tuning method, which mainly relies on engineering experience and is directly carried out in the test of the control system. The method is simple and easy to master, and is widely used in engineering practice.
The general formula of PID and the analog control law are shown in formula (1):
Where: u(t) is the output of the controller; e(t) is the deviation, that is, the difference between the set value and the feedback value; KC is the controller's amplification factor, that is, the proportional gain; TI is the controller's integral constant; TD is the controller's differential time constant. The principle of the PID algorithm is to adjust the three parameters KC, TI, and TD to make the system stable.
Since computer control is a sampling control, it can only calculate the control quantity based on the deviation value at the sampling time. Therefore, in the computer control system, equation (1) must first be discretized, and the differential equation of the continuous system must be replaced by a digital difference equation. At this time, the integral term and the differential term can be expressed by summation and increment:
Substituting equations (2) and (3) into equation (1), the discrete PID expression can be obtained:
Where: △t=T is the sampling period, and T must be small enough to ensure that the system has a certain accuracy (sampling theorem); E(K) is the deviation value at the Kth sampling; E(K-1) is the deviation value at the K-1th sampling; P(K) is the output of the regulator at the Kth sampling.
2 Hardware composition of the system
This system consists of four parts: sensor A/D sampling input, single-chip microcomputer control, human-computer interaction, and control signal output. The temperature sensing part is realized by the test sampling circuit, the human-computer interaction is composed of a matrix keyboard and an LCD screen, the PID control algorithm is realized by the 89C52 single-chip microcomputer, and the control signal output part is composed of a power amplifier and a switch control circuit. The system block diagram is shown in Figure 1.
3 Main program flow
The software program is the core of this control system, which includes the entire process control from temperature sampling to signal output, and its schematic diagram is shown in Figure 2.
The program functions mainly consist of the following parts:
(1) Initialization: Set the initial values of each parameter, set each interrupt and timer.
(2) Receiving/transmitting: This part of the program mainly completes the control and display of data, mainly through the full-duplex serial port of the 89C52 microcontroller to complete the two-way communication with the keyboard part.
(3) PC communication: This part completes the connection with the microcomputer control interface RS 232 and the control of communication.
(4) Numerical conversion subroutine: Since the main program uses a lot of numerical conversion and numerical calculation (such as decimal conversion to hexadecimal, double-byte and single-byte division operations, etc.), for the convenience of program calling, it is specially written in the form of a subroutine.
(5) PID algorithm.
4 Experimental test
The performance and stability of the system need to be completed through specific experimental tests. Now use a 1 kW electric furnace to heat 1 L of clean water in an electric cup.
Observe the error between the set value and the measured value (the value when the water temperature reaches stability), calculate the absolute error and relative error, see Table 1.
The set temperature was 50°C and the measured temperature was recorded every 30 s, as shown in Table 2.
From the data in Table 2, it can be seen that the system basically reaches stability after running for 5 minutes.
5 Conclusion
From the experimental results, it can be seen that the error of the system is basically stable at ±0.3℃, which shows that the accuracy of the system is very good. In addition, the temperature is basically stable when the system runs for 5 minutes, and the time required for stabilization is short. It can be seen that the single-chip temperature control system based on the PID algorithm has high accuracy and stability, and the temperature balance time is short in the temperature adjustment stage. Therefore, this system can be applied to various temperature control occasions with high accuracy requirements.
Previous article:Application of Communication Converter Based on Single Chip Microcomputer in Remote Measurement and Control System
Next article:Application of 51 single chip microcomputer in micro printer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Problems with creating sheet symbols for multi-page schematics
- Zigbee Z-Stack 3.0.1 Modify channels using broadcasting
- SHT31 Review + My Review Summary
- Using AT89S series microcontroller
- 【McQueen Trial】Use IPAD to program McQueen's car
- The STM32 FFT library calculates the amplitude normally, but the phase is different each time. Has anyone encountered this problem?
- EEWORLD University----UCD3138 Analog Front End (AFE) Module
- "Show goods" to come to a wave of commonly used development boards
- Measurement of the phase difference between a sine wave and a square wave
- [Sipeed LicheeRV 86 Panel Review] - 6 waft-ui component tests (3)