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, water heaters, rice cookers, electric ovens and other household appliances that rely on temperature control technology are also indispensable. It can be said that temperature control technology is everywhere.
Conventional temperature control methods use the set temperature as the critical point. If the temperature exceeds the set range, the temperature is adjusted: heating is performed when the temperature is lower than the set value, and stopping or cooling is performed when the temperature is higher than the set value. This method is simple to implement and low in cost, but the control effect is not ideal. The temperature control 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 situations 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 lag. It is particularly suitable for control systems with large load changes, large capacity lag, 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 control theory techniques 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.
The parameter tuning of PID controller is the core content of control system design. It determines the proportional coefficient, integral time and differential time of PID controller according to the characteristics of the controlled process. There are two main methods for parameter tuning of PID controller: one is theoretical calculation tuning method. It mainly determines the controller parameters through theoretical calculation based on the mathematical model of the system. 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):
In the formula: 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 differential 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), we can get the discrete PID expression:
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 System Hardware Composition
The system consists of four parts: sensor A/D sampling input, single-chip 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 computer, 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, and set each interrupt and timer.
(2) Receive/transmit: This part of the program is mainly responsible for data control and display, and mainly completes two-way communication with the keyboard part through the full-duplex serial port of the 89C52 microcontroller.
(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 calculations (such as decimal to hexadecimal conversion, double-byte and single-byte division operations, etc.), for the convenience of program calling, it is written in the form of a subroutine.
(5)PID algorithm.
4 Experimental testing
The performance and stability of the system need to be completed through specific experimental tests. A 1 kW electric furnace is used 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), and 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
It can be seen from the experimental results 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:Realization of short-distance wireless communication based on AT89C52 single-chip microcomputer
Next article:A temperature controller for passenger car drying room based on fuzzy control based on single chip microcomputer
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
- Allwinner V853 heterogeneous core impression
- I have designed a switching power supply that converts AC220V to DC5V/A. What tests do I need to do to make it a qualified power supply?
- CircuitPython Watch
- EEWORLD University Hall----Live Replay: Application of Infineon Industrial Semiconductors in the Motor Drive Industry
- Lynk & Co 360 Panoramic Computer Disassembly
- TSM320F28335 schematic and package diagram sharing
- Inconsistency in placing component symbols in Kicad and Esschema
- STM32F413 Nucle-144 auctioned on the forum
- [Shanghai Hangxin ACM32F070 development board + touch function evaluation board evaluation] + use of GPIO port
- Today's live: TI uses DLP pico projection technology to design augmented reality smart glasses