Design of temperature controller based on MSP430F149 single chip microcomputer and fuzzy control

Publisher:hzx312895379Latest update time:2011-12-19 Keywords:MSP430F149 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
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.

a.jpg



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.

b.jpg [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.

c.jpg



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.

d.jpg


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.

Keywords:MSP430F149 Reference address:Design of temperature controller based on MSP430F149 single chip microcomputer and fuzzy control

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

Application of FLASH in MSP430F149 Embedded System
NAND Flash is a non-volatile memory using NAND structure technology. It has the characteristics of ROM memory. The data stored in the chip can be maintained for 10 years without loss in the case of power failure, and the chip pins and access have similar characteristics to RAM. NAND FLASH memory multiplexes the data
[Microcontroller]
Design and implementation of a simple wind tunnel control system
1 System Solution 1.1 Overall system design The system uses the MSP430 microcontroller as the core module. The motor drive module drives the fan blades to blow air into the round tube to blow up the ping-pong ball. The ultrasonic module detects the position of the ping-pong ball in the round tube and returns the pos
[Microcontroller]
Design and implementation of a simple wind tunnel control system
Design of GPS positioning data acquisition system based on MSP430F149
O Introduction GPS (Global Positioning System) is widely used in the fields of positioning, navigation, distance measurement, timing remote sensing, etc. with its high precision, all-weather and all-day characteristics, and has been rapidly developed. Design a GPS positioning data acquisition system based o
[Microcontroller]
Design of GPS positioning data acquisition system based on MSP430F149
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号