Temperature Control System Based on DSP and Digital Temperature Sensor

Publisher:创新思绪Latest update time:2010-07-26 Source: 现代电子技术 Keywords:DSP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 words

Since the 1960s, digital signal processors (DSP) have developed rapidly along with computer and communication technology, and their application fields have become more and more extensive. In terms of temperature control, especially the temperature control of solid-state lasers, the temperature accuracy requirements are relatively strict due to the influence of its working environment and conditions. Previously, temperature control at home and abroad basically used temperature sensitive resistors to measure the temperature, and then used air cooling or water cooling to achieve the temperature control effect, which was not accurate enough and had a large volume. This paper designs a temperature measurement system based on DSP chip TMS320F2812 and digital temperature sensor DSl8B20. According to the measured temperature and the set parameters, the control quantity is calculated using the fuzzy PID algorithm. The control quantity is used to adjust the duty cycle of the PWM wave generated by the DSP event manager and act on the semiconductor refrigerator to achieve the temperature control effect, realizing a temperature control system with high control accuracy and small volume.

1. Hardware composition

1.1 DS18820 Functional Structure and Usage

DS18820 is a one-line digital temperature sensor produced by DALLAS, with a 3-pin T0-92 small package; the temperature measurement range is -55 ~ +125 ℃; it can be programmed to 9 ~ 12-bit A / D conversion accuracy, and the temperature measurement resolution can reach 0.0625 ℃; the CPU only needs one port line to communicate with many DS18B20, occupying fewer ports of the microprocessor, which can save a lot of leads and logic circuits. The above features make DS18B20 very suitable for long-distance multi-point temperature detection systems.

The pin arrangement of DS18B20 is shown in Figure 1. DQ is the digital signal input/output terminal; GND is the ground; VDD is the external power supply input terminal (grounded in parasitic power wiring mode). The temperature sensor in DS-18B20 can measure the temperature, providing it in the form of 16-bit sign-extended binary complement readings, expressed in the form of 0.0625℃/LSB, where S is the sign bit. For example, the digital output of +125℃ is 07DOH, the digital output of +25.0625℃ is 0191H, the digital output of -25.0625℃ is FF6FH, and the digital output of -55℃ is FC90H.

DS18B20 pin arrangement

1.2 Introduction to DSP

The DSP used here is TMS320F2812, which is a low-cost, high-performance 16-bit fixed-point DSP newly launched by TI of the United States. It is designed for control application systems. Its main frequency can reach 150 MHz. The crystal oscillator used in this system is 45 MHz. The peripheral device interface is integrated in the chip, and it mainly plays a control and calculation role.

1.3 Introduction to semiconductor refrigerator

Semiconductor coolers are made based on the Peltier effect. They are made of two different metals to form a pair of thermocouples. When a direct current is applied to the thermocouple, heat absorption and heat release will occur at the thermocouple junction due to the different directions of the direct current. The structure of the cooler is shown in Figure 2.

Refrigerator structure

An N-type and a P-type semiconductor particle are welded into a thermocouple with a metal connecting piece. When the DC current flows from the N pole to the P pole, the upper end absorbs heat, which is called the cold end, and the lower end releases heat, which is called the hot end. If the current direction is reversed, the hot and cold ends will switch to each other.

1.4 Hardware Connection

There are two main ways to connect DS18B20 to DSP: parasitic power supply and external power supply. This article adopts external power supply, where the DQ port of 18B20 is connected to the GPIOA0 port of F2812, and the specific connection is shown in Figure 3.

DSl8B20 and DSP connection

2 Temperature measurement

To perform temperature control, we must first measure the temperature value of the controlled target. In this system, the digital temperature sensor DS18B20 is combined with DSP, and the program is written using CCS. The development platform of this system is CCS 2.2. The preliminary installation and chip settings are omitted here. The program flow is shown in Figure 4.

Program flow chart

The control of DS18B20 includes three timings: reset, write timing, and read timing.

Reset: The host bus sends a reset pulse at t0 (a low-level signal with a minimum duration of 480 μs), then releases the bus at t1 and enters the receiving state; the DS1820 waits for 15 to 60 μs after detecting the rising edge of the bus, and then sends a presence pulse at t2 (a low-level signal lasting 60 to 240 μs).

Write timing: The write timing of DS18B20 is divided into two processes: write 0 timing and write 1 timing. The requirements for write 0 timing and write 1 timing are different. When writing 0 timing, the bus must be pulled down for at least 60 μs to ensure that DS18B20 can correctly sample the "0" level on the I/O bus between 15 and 45 μs. When writing 1 timing, the single bus must be released within 15 μs after being pulled down. The duration of writing data should be greater than 60 μs and less than 120 μs, and the time interval between two write operations should be greater than 1 μs.

Read timing: The read timing of DS18B20 is also divided into two processes: read 0 timing and read 1 timing. The read timing of DS18B20 is that after DSP pulls the single bus low, the single bus must be released within 15 seconds to allow DS18B20 to transfer data to the single bus. DS18B20 needs at least 60μs to complete a read timing process.

It should be noted that when writing a program, whether it is resetting or reading and writing, you must pay attention to configuring the state of the GPIOA0 port (input or output). At the same time, the timing is very important. The delays in this article are summarized after many tests. Depending on the crystal oscillator of the DSP chip, the delay program will change, otherwise the DSl8B20 will not work properly.

3. Temperature Control

3.1 Pulse Width Modulation PWM Output

The event management module of TMS320F2812 can output 16 PWM signals in total. In this paper, only one PWM signal with adjustable duty cycle is needed, and the square wave signal is designed to be output from the PWM1 pin. In this paper, general timer 1 (T1) is selected as the time base; full comparison unit 1 saves the modulation value; the counting method adopts the continuous increase counting mode. The PWM duty cycle value is compared with the triangle wave data of T1, and the PWM signal is output to control the operation of the semiconductor cooling chip. The register settings are as follows (the high-speed peripheral clock is 22.5 MHz):

program

The PWM period designed in this paper is 1.825 ms, and the counter count range of TMS320F2812 is 0~5DC. Therefore, when the value loaded into the CMPR1 register is 0 or 5DCH, the output is always high or low. Now take writing 1500 to CMPR1 as an example, the output period of the PWM1 pin is a square wave of 1.825 ms.

3.2 Temperature control software design

According to the previous description, DS18B20 is used to read the temperature sampling value, and then the data is processed by the parameter self-tuning fuzzy-PID algorithm: according to the conditions of E and Ec, △KP, KI, KD are derived from the fuzzy control law and the fuzzy table, and the size of KP, KI, KD is calculated according to formula (1), and then the initial value of U and △U are calculated, and the control quantity U is calculated in real time by formula (2). Through parameter conversion, U is converted into PWM parameters, the value of EvaRegs.CMPRl is modified, and the duty cycle of PWM is changed, thereby controlling the cooling/heating power of TEC.

official

The program flow chart is shown in Figure 5.

Program flow chart

3.3 Experimental results

After completing the above program writing, the simulator is first used to simulate temperature measurement. When the room temperature obtained by the standard thermometer is 31.2℃, the temperature value detected by the quick observation window in the CCS software is 31.1875℃. The experiment proves that when the outside temperature is 31℃ and the default setting (stable temperature is 25℃) is used, the temperature control system can stabilize the temperature of the controlled object at 25℃, the temperature stabilization time is less than 100s, and the accuracy can reach below 0.1℃, meeting the requirements of industrial control.

4 Conclusion

The temperature control system was developed by using the high-speed processing capability of DSP, combined with the accurate temperature reading capability of DS18B20, and CCS. The Fuzzy-PID algorithm is applied in this temperature control system. The design goal is to minimize the transition time and overshoot of the system under the same control accuracy conditions to improve the control effect. The composite control is adopted to enable the system to effectively suppress the influence of pure lag, and still achieve good control effect when the parameters change greatly and there is interference.

Keywords:DSP Reference address:Temperature Control System Based on DSP and Digital Temperature Sensor

Previous article:Design of biped robot motion control system based on DSP
Next article:Speech Recognition Based on ADSP2181 and Its Fixed-point DSP Implementation

Recommended ReadingLatest update time:2024-11-16 20:57

Design of multi-channel data acquisition system based on DSP and MAX147
1. Introduction Due to its advanced parallel structure, DSP chips are increasingly widely used in the fields of signal processing and data acquisition. The maximum operating frequency of TI's DSP chip TMS320VC5402PGE100 is 100MHZ. It has two high-speed, full-duplex, multi-channel buffered serial interfaces (McBSP). It
[Embedded]
Design of local meteorological monitoring device for power transmission lines based on DSP and CPLD
1 Overview The state of the transmission line directly determines the safe and stable operation of the entire power grid. Real-time monitoring of the micro-meteorological parameters of the transmission line can provide necessary on-site information for the normal dispatching of the power grid, as well as the predict
[Embedded]
Design of local meteorological monitoring device for power transmission lines based on DSP and CPLD
Asynchronous DSP core design: lower power consumption, higher performance
  Today, the primary measure of processor performance is clock frequency. The vast majority of integrated circuit (IC) designs are based on synchronous architectures , which use a globally consistent clock. This architecture is so popular that many people believe it is the only way to design digital circuits. However,
[Embedded]
Asynchronous DSP core design: lower power consumption, higher performance
Using digital oscilloscope to debug embedded I2C bus
The I2C bus is a two-wire serial bus introduced by PHLIPS in the 1980s. It was originally developed for audio and video equipment, and is now mostly used in various embedded systems to connect microcontrollers and their peripherals. The I2C bus only uses two communication lines (one is the serial data line "SDA
[Test Measurement]
Using digital oscilloscope to debug embedded I2C bus
Hardware Design of Brushless DC Motor Controller Based on DSP
With the development of power electronics technology, new permanent magnet materials and DSP (digital signal processor) with fast computing capability, the application of brushless DC motor is becoming more and more popular. Brushless DC motor has excellent speed regulation performance similar to that of DC motor, a
[Industrial Control]
Hardware Design of Brushless DC Motor Controller Based on DSP
Design of multiple schemes for communication between DSP and single chip microcomputer
  Combining DSP and MCU into a dual CPU processor platform can fully utilize DSP's processing capabilities for large-capacity data and complex algorithms, as well as the control capabilities of the MCU interface. Fast and correct communication between DSP and MCU is the key issue in building a dual CPU processor
[Embedded]
Design of multiple schemes for communication between DSP and single chip microcomputer
Design of audio processing system based on DSP and ARM
1 Introduction With the rapid development of computer technology, electronic technology and communication technology, audio processing technology has also been widely used in many fields. For example, mobile phones and IP phones in the communication field, MP3 and CD players in consumer electronics, and speech recog
[Embedded]
Design of audio processing system based on DSP and ARM
Research on image-based fire detection technology based on DSP
introduction Fire is one of the most common serious disasters, which often causes great harm to people's lives and property. At present, smoke detectors, infrared detectors, ultraviolet detectors, etc. are mainly used for flame detection, but these detection devices still have many problems in detection
[Security Electronics]
Research on image-based fire detection technology based on DSP
Latest Embedded 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号