Temperature control has broad application prospects in industries and daily life. Many application fields require high-precision constant temperature control. Due to its nonlinearity, time lag and uncertainty, traditional control cannot achieve good control effects. Fuzzy control is a rule-based control that directly adopts language-based control rules. The starting point is the control experience of field operators or the knowledge of relevant experts. It has strong robustness, and the influence of interference and parameter changes on the control effect is greatly reduced. Therefore, it is particularly suitable for precise control of 0-100℃ temperature.
The MSP430 series microcontroller is a 16-bit, ultra-low power hybrid microcontroller with a reduced instruction set. The MSP430F149 microcontroller uses a reduced instruction set (RISC), with rich addressing modes (7 source operand addressing, 4 destination operand addressing), concise 27 core instructions and a large number of analog instructions. A large number of registers and on-chip data memory can participate in a variety of operations, and there are also efficient table lookup processing instructions; it has a high processing speed, and the instruction cycle is 125 ns under 8MHz crystal drive. These features ensure that highly efficient source programs can be compiled. The MSP430F149 microcontroller has different combinations of some peripheral modules such as 10-bit/12-bit ADC, 16-bit Sigma-Delta A/D, direct addressing module (DMA), ports 1 to 6, basic timer, etc. Among them, the watchdog can quickly reset the program when it is out of control; the analog comparator compares the analog voltage, and with the timer, an A/D converter can be designed. The system uses the MSP430F149 microcontroller, which can save hardware circuits such as A/D, reduce its cost, and greatly enhance its reliability.
1 System Design
The system uses the MSP430F149 microcontroller as the control core. The temperature measurement is completed by the platinum resistance constant current conditioning circuit. The output voltage of the conditioning circuit is sent to the microcontroller, and the A/D conversion is realized inside the microcontroller. The sampled data is filtered and scaled, and the temperature value is displayed by a 3-digit digital tube. The temperature setting value is input by a 4-bit independent keyboard circuit, and after the setting value is sent to the single-chip microcomputer, it is displayed by another 3-bit digital tube. The system design block diagram is shown in Figure 1.
2 Main hardware circuit design
2.1 Platinum resistor temperature measurement conditioning circuit
In this system, the actual temperature value is measured by the constant current working conditioning circuit of the platinum resistor. In order to overcome the nonlinear characteristics of the platinum resistor, a negative feedback nonlinear correction network is added to the signal conditioning circuit. As shown in Figure 2, the platinum resistor uses RT100 with a nominal value of 100Ω as the temperature sensor. A1, A2 and A3 use low temperature drift op amp OP07. Since there is current flowing through the platinum resistor sensor, when the temperature is 0℃, there is a voltage drop on the platinum resistor sensor. This voltage is the bias voltage of the platinum resistor sensor and is part of the output voltage of op amp A1, so that the output of the constant current working conditioning circuit is not actually 0, so it is necessary to zero this bias voltage. R3 in the figure is the zero adjustment resistor. In the figure, op amp A3 and resistors R1, R4 and R6 constitute a negative feedback nonlinear correction network. R5 is used to adjust the gain of op amp A2.
[page]
2.2 Temperature Control Circuit
The system heating wire and fan both adopt the circuit form shown in Figure 3. The circuit uses a DC electromagnetic relay driven by a transistor. When P5.4 of the microcontroller is at a low level, the relay RL1 is energized, and when P5.4 is at a high level, the relay RL1 is released. This control logic can prevent the relay from energizing during power-on reset or microcontroller controlled reset. The relay is driven by a transistor 2N222A, which can provide the required drive current.
3 Fuzzy control rule table and software flow chart
3.1 Establish fuzzy control rule table
Temperature error E and temperature error change rate Ec are used as input variables of the fuzzy controller, and temperature control quantity U is used as output variable of the fuzzy controller. The basic domains of temperature error E, temperature error change rate Ec and temperature control quantity U (unit: ℃) in the system are [-5, +5], [-2, +2] and [0, 1] respectively. The language value of the input language variable is 7, and the output control quantity is used to control the relay drive circuit. The duty cycle fuzzy control quantity is set to five single-point fuzzy quantities of 0, 1/4, 1/2, 3/4, and 1 and a single-point fuzzy quantity for controlling fan blowing. The language value of the output language variable is 6. When U=0, the P3.5 port of the single-chip computer is set to a low level to make the fan control circuit work; when U=1, the heating wire control circuit works, and the relay is fully turned off within 1 cycle; when U=2, the heating wire control circuit works, and the relay is turned on within 1/4 cycle and turned off within 3/4 cycle; when U=5, the heating wire control circuit works, and the relay is fully turned on within 1 cycle. This control system uses trigonometric functions, ascending semi-trapezoidal functions and descending semi-trapezoidal functions as the membership functions of the input language value, and uses pulse functions as the membership functions of the output language value. The fuzzy control rules are shown in Table 1.
The input-output relationship of the fuzzy controller language rules can be obtained by reasoning from fuzzy rules, and the relationship is a nonlinear relationship surface. When the deviation is large, the change of the control quantity should try to reduce the deviation quickly; when the deviation is small, in addition to eliminating the deviation, the stability of the system should also be considered to prevent the system from overshooting and even causing system oscillation.
3.2 Software Flowchart
The main program software flow is shown in Figure 4.
Temperature acquisition and display, keyboard processing, etc. are implemented as relatively independent functional modules during programming, and are called according to the set process during the autonomous program operation. After completing the corresponding tasks, return to the main program.
4 Simulation analysis
Add the compiled HEX file to the Proteus simulation software, and use the analysis chart analysis system to analyze the duty cycle of the heater control signal and the fan control signal output port. When the input voltage is 2.7 V, the system output shows that the actual temperature is 54°C, and the system set temperature is 55°C. At this time, P5.4 outputs a heater control signal with a duty cycle of 2:1; and when the actual temperature of the system is greater than the set temperature, the system outputs an appropriate fan control signal to dissipate heat at a constant power, indicating that the design requirements are met.
5 Conclusion
This system uses a low-power MSP430 series microcontroller as the control core. The entire control circuit is relatively simple. The program is designed using a fuzzy control algorithm. The set temperature value and the measured temperature value are displayed in real time. The control accuracy can reach ±0.5°C, which has wide practicality in actual production and life.
Previous article:Calculation method of power consumption of microcontroller
Next article:Development of a lighting dimming control system based on single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 19:51
- Popular Resources
- Popular amplifiers
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
- Faint
- About STC8A8K64S4A12EEPROM allocation
- [Newbie Help] Regarding the circuit of single-chip microcomputer controlling bidirectional thyristor, I have a few questions to ask you
- MSP430F5529 generates PWM waves with CCS
- How to suppress IGBT collector overvoltage spike
- Bluetooth Mesh Technology and Home Automation
- After Cypress PSO6 was launched, ST, Siliconlabs, Nordic, NXP, and Dialo were compared.
- The spare change I saved N years ago has become a treasure!!!
- Design and Implementation of VGA Video Acquisition System Based on TMS320DM355
- 33Striving Child - Altera Series Chapter 33 Design of Odd Frequency Division