基于STM32的恒温箱温度控制系统外文翻译资料

 2022-08-12 03:08

Thermo Tank Temperature Control System Based On STM32

Biao QIU(····) , Shi-guang LI(····), Zheng-zhong GAO(····), Xu ZHANG(····), Yu RUI(····)

(School of Information and Electrical Engineering, Shandong University of Science and Technology, Qingdao 266510, China)

Abstract-this paper introduced a thermo tank temperature control system based on STM32, Firstly, the temperature acquisition is realized by the high-precision electrical bridge based on constant current source. Then the augmented PID algorithm realized by software is adopted Butterworth filter is used to convert the output PWM of STM32 to current signal which is used to control the semiconductor control rectifier to adjust the temperature. Calibration check and practical application both indicated that the system was reliable, high-precision, practicable and could meet reality needs.

Key words-STM32; thermo tank; temperature acquisition; PID

ManuscriptNumber: 1674-8042(2011)01-0064-03

Dio: 10.3969/j.issn.1674-8042.2011.01.16

1 introduction

Thermo tank can be divided into low temperature thermo tank and high temperature thermo tank according to temperature range. Heating control thermo tank is one kind of high temperature thermo tank and has a wide range of applications in industrial, medical and scientific areas. As some special thermo tank control system require high precision in temperature acquisition and control, the system designed in this paper can measure temperatures from 16℃ to 80℃ and its precision is superior to plusmn;0.05℃. As ARM is gradually occupying the microelectronics market for its powerful function and low cost, it is of important practical significance and value to design a temperature control system based on ARM with high precision, simple structure and low cost.

2 Basic control principles of thermo tank

In this system, temperature acquisition of the inner thermo tank is realized by using platinum resistance as temperature sensor and bridge circuit based on constant current source. Then compare the actual temperature with the temperature set by touch screen. By using augmented PID algorithm to adjust, STM32 outputs 16-bit PWM signals. Then convert PWM signal to voltage signal to control the conduction angle of Semiconductor Control Rectifier(SCR) which controls the heating tubes. System control principle is shown in Fig.1.

Considering the system accuracy and stability requirements, features of this system include: powerful and high speed ARM STM32F103 as the controller, augmented PID algorithm, and full use of on-chip resources of microcomputer such as ADC, USART and 16-bit PWM output for great control accuracy.

Fig 1 System control principle

3 hardware design

This system includes temperature acquisition bridge circuit, STM32F103, color LCD touch screen control circuit, filtering circuit and SCR. In addition, the system has a good man-machine interaction function and can realize real-time monitoring and control by using 5.6 inches color LCD and touch screen. Temperature control system structure is shown in Fig.2.

Fig 2 System structure

3.1 temperature acquisition and A/D conversion

Among the thermal resistance temperature sensors, platinum resistance, with advantage as high precision, stable performance, corrosion resistance and easy to use, is the ideal temperature acquisition component widely used in industrial environments and control systems. As the temperature acquisition range is 16℃ to 80℃, Pt1000 is chosen as temperature sensor, which resistance changes with temperature according to certain rules and has good high precision and stable performance.

Unbalanced bridge measurement is typical in detect circuits using platinum resistance as temperature sensors[1]. However, the nonlinearity between platinum resistance and temperature and nonlinearity of unbalanced bridge lead to acquisition error, thus we improved the temperature acquisition bridge circuit. Use constant current source to power the bridge, connect the two bridge arms with precise operational amplifier that is low noise and low temperature drift, use 4DH2 to constitute constant current source circuit which outputs 0.5 A current, thus the current in platinum resistance is equal to constant current source.

The ADC of STM32F103 is used to convert analog voltage of temperature into digital signal. The 12-bit ADC is a successive approximation analog-to-digital converter and has the function of self-calibration. D/D conversion of each channel can be performed in single, continuous, scan or discontinuous mode, and in this system we use continuous mode. The result of ADC is stored in right-aligned 16-bit data register which improves the conversion speed. In addition, the analog watchdog feature allows the application to detect if the input voltage goes outside the user-defined high or low thresholds.

3.2 TM32F103 on-chip resources

TM32F103 can work in -40℃~105℃ and this meets the requirements of industrial environment. It incorporate the high performance ARM Cortex-M3 32-bits RISC core operating at a 72 MHz frequency, high speed embedded memories (Flash memory up to 128Kbytes and SRAM up to 20Kbytes) to store data and program, and an extensive range of enhanced I/Os, most of which have alternate functions and peripherals connected to two APB buses. It has three general purpose 16-bit timers plus two watchdogs, as well as standard and advanced communication interface USART used to communicate with LCD[2]. More importantly, it offers two 12-bit ADCs with 1mu;s conversion speed which make it suit for fast acquisition and fast processing. It is one of the important reasons for this system to choose TM32F103 as the core controller.

3.3 Filtering and conversion circuits

In order to realize the convention from PWM signal to analog

剩余内容已隐藏,支付完成后下载完整资料


基于STM32的恒温箱温度控制系统

摘要—这篇文章介绍了一个基于STM32的恒温箱温度控制系统,首先,由基于常流源的高精度电桥获取温度,然后,由软件实现的扩充型PID算法在这里得到应用,使用巴特沃兹滤波器(最平坦滤波器)将STM32输出的PWM转换成电流信号来控制半导体整流器从而调节温度,校准检测和实际应用都表明这个系统可靠、精度高、可行性好,并且能够满足现实需要。

关键字—STM32;恒温箱;温度获取;PID。

1 引言

根据温度范围,恒温箱分为低温箱和高温箱两种,加热控制恒温箱是一种高温恒温箱,并且它在工业、医疗和科学领域有着广泛的应用,因为一些特殊恒温箱控制系统在温度测量及控制方面都要求很高的精度,所以这篇文章中所设计的系统能够测量16℃~18℃的温度,并且它的精度高于plusmn;0.05℃。ARM因其强大的功能和低成本的优点正逐渐占领微电子市场,也正因如此,设计一个基于ARM的高精、简单结构和低成本的温度控制系统便具有重要的实际意义和价值。

2恒温箱控制的基本原理

在这个系统中,为获取恒温箱内部的温度,使用铂丝电阻作为温度传感器和基于常流源的桥式电路。然后,将实际温度与通过触摸屏设定的温度作比较。通过使用扩充型PID算法来调节STM32输出的16比特脉冲宽度调制信号,然后将PWM信号转换成电压信号来控制半导体控制整流器(SCR)的导通角,从而控制加热管,系统控制原理示于图1

图1 系统控制原理

3硬件设计

这个系统包括温度获取桥式电路、STM32F103、彩色LCD触摸屏控制电路、滤波电路和SCRC(半导体控制整流器),另外,这个系统使用5.6英寸彩色LCD和触摸屏,有着优良的人机交互功能,并且能够实现实时监测和控制。温度控制系统结构示于图2

图2 系统结构

3.1温度获取和模拟/数字转换

在所有的热敏电阻温度传感器中,铂丝电阻因其高精度、稳定性好、耐腐蚀以及易于使用的优点而成为理想的温度获取原件并在工业环境和控制系统中得到了广泛的应用。基于测温范围为16℃~18℃,Pt1000的组织依确定关系随温度的变化而变化,并且精度高、稳定性好,所以选择它作为温度传感器。

在以铂丝电阻作为温度传感器的测量电路中,非平衡桥测量时一种典型应用。然而,铂丝电阻的阻值与温度之间的非线性关系以及非平衡桥的非线性性会导致获取值出错,因此,我们改进了温度测量桥式电路。使用常电流源给电桥供电,使用具有低噪声和低温漂的高精度可操作放大器连接两个网桥,使用4DH2组建恒流源以输出0.5A电流,因此,流经铂丝电阻的电流等效于恒流源。

STM32F103中的ADC用来将温度的模拟电压值转换成数字信号,这个12比特ADC是一个连续近似模拟到数字的转换器,并且具有自我校准功能。每个通道的A/D转换均可工作在独立、连续扫描或不连续模式下,而在这个系统中,我们使用连续模式,ADC的转换值存储在右排16比特数据寄存器中,从而提高了转换速度,另外,模拟监测机构能够在输入电压超过用户定义的高门限或低门限时进行监测。

3.2TM32F103片上资源

TM32F103能够工作在-40℃~105℃的温度范围内,这符合工业环境的要求,它整合了工作频率为72MHz的高性能ARM Cortex-M3 32比特RSIC核心、用来存储数据和程序的告诉嵌入式存储器(高达128K字节的闪存和高达20K字节的SRAM静态只读存储器)以及更多增强的I/O口,这些接口中的大部分可以工作在不同功能下并且具有连接到2个APB总线的外围设备。它包含3个通用16字节定时器,附加两个监测器。另外还有用来与LCD进行通信的标准型和增强型交流交互OSART,更重要的是,它提供2个转换速度为1mu;S的12比特ADC,这使它适合于高速获取和处理的情况。这是选择TM32F103作为这个系统的核心控制器的一个重要原因。

3.3 滤波和转换电路

为了实现从PWM信号到模拟输出的转换,我们使用第二个低通滤波器滤除高频分量,保留直流分量,并且改变PWM信号的工作周期从而获得用于输出的模拟电压。DS18B20测温原理框图示出了所设计的巴特霍兹滤波器,滤波之后,将PWM信号转换至0—2.5V范围内的电压信号以控制硅控滤波器的传输角,因此我们实现了对加热管的精确控制。

图3 巴特霍兹滤波器

4 软件设计

4.1 PID控制算法

这个系统使用PID控制算法,这个算法是一种已在工作处理控制中广泛应用的基本控制方法,扩充形PID控制算法如下:

然而,如果直接使用这个算法,它会导致很大的溢出而且在启动、停止或是大幅度调试的时候引起整体饱和,为了抑制这个现象的发生,我们使用整型分离作为改进方式,直到世纪温度接近设定值时,整型分离才会工作,当它工作时,可以去除静态错误,从而提高精度,整型分离PID框图示于图4。

图4 整型分离PID算法框图

4.2 触摸屏软件设计

使用触摸屏可使人机交互更加友好、方便和快捷,使用专用的控制芯片ADS7843连接到四线电阻触摸屏AMT9532,结合STM32F103处理触摸信号,触摸屏的软件流程图示于图5。

图5 触摸屏流程图

5 实验结果

使用精度为0.001℃的热度计作为校准时实验结果进行检测,特别方法:

通过触摸屏在温度范围内设定合适的温度,等待LCD上显示的温度数据稳定后,通过由热度计读取的数值与该值作比较,计算其误差,计算公式如下:

误差=|设定值—实际值|/设定值

检测结果示于表1

表1 校准结果

———————————————————————————————

设定值(℃) 显示值(℃) 实际值(℃) 误差(%)

———————————————————————————————

16.00 15.98 15.977 0.2

30.00 30.00 29.988 0.4

40.00 40.01 40.009 0.2

50.00 50.00 50.014 0.3

60.00 60.01 60.011 0.2

70.00 69.97 70.020 0.3

80.00 79.98 80.037 0.5

———————————————————————————————

6 结论

通过使用16比特PWM输出,简单滤波电路、转换电路、软件设计及浮点操作,这个系统实现了普通MCU难以实现的16比特D/A转换,系统温度控制范围为16℃~80℃,并且16比特控制信号的精度达1permil;。实验结果表明,这个系统确实达到了控制要求,其温度精度优于plusmn;0.05℃,实际应用表明这个系统具有实时性、灵活性、稳定的高精度性以及低成本的优点,并且满足工业中高精度、高稳定性和可靠性的要求。

译文:

AT89C51的介绍

描述

AT89C51是一个低电压,高性能CMOS8位单片机带有4K字节的可反复擦写的程序存储器(PENROM)。这种器件采用ATMEL公司的高密度,不容易丢失存储技术生产,并且能够与 MCS-51系列的单片机兼容。片内含有8位中央处理器和闪烁存储单元,有较强的功能的 AT89C51单片机能够被应用到控制领域中。

功能特性

AT89C51提供以下的功能标准:4k字节闪烁存储器,128字节随机存取数据存储器,32个I/O口,2个16位定时/计数器,1个5向量两级中断结构,1个串行通信口,片内震荡器和时钟电路。另外,AT89C51还可以进行0HZ的静态逻辑操作,并支持两种软件的节电模式。闲散方式停止中央处理器的工作,能够允许随机存取数据存储器,定时/计数器,串行通信口及中断系统继续工作。掉电方式保存随机存取数据存储器中的内容,但震荡器停止工作并禁止其它所有部件的工作直到下一个复位。

引脚描述

VCC:电源电压

GND:地

P0

P0口是一组8位漏极开路双向I/O口,即地址/数据总线复用口。作为输出口时,每一个管脚都能够驱动8个TTL电路。当'1'被写入P0口时,每个管脚都能够作为高阻抗输入端。P0口还能够在访问外部数据存储器或程序存储器时,转换地址和数据总线复用,并在这时激活内部的上拉电阻。P0口在闪烁编程时,P0口接收指令,在程序校验时,输出指令,需要接电阻。

P1

P1口一个带内部上拉电阻的8位双向I/O口,P1的输出缓冲级可驱动4个TTL电路。对端口写'1',通过内部的电阻把端口拉到高电平,此时可作为输入口。因为内部有电阻,某个引脚被外部信号拉低时输出一个电流。闪烁编程时和程序校验时,P1 口接收低8位地址。

P2

P2口是一个内部带有上拉电阻的8位双向I/O口,的输出缓冲级可驱动4个TTL电路。对端口写'1',通过内部的电阻把端口拉到高电平,此时,可作为输入口。因为内部有电阻,某个引脚被外部信号拉低时会输出一个电流。在访问外部程序存储器或16位地址的外部数据存储器时,P2口送出高8位地址数据。在访问8位地址的外部数据存储器时,P2口线上的内容在整个运行期间不变。闪烁编程或校验时,P2口接收高位地址和其它控制信号。

P3

P3口是一组带有内部电阻的8位双向I/O口,P3口输出缓冲故可驱动4个TTL电路。对P3口写如'1'时,它们被内部电阻拉到高电平并可作为输入端时,被外部拉低的P3口将用电阻输出电流。

P3口除了作为一般的I/O口外,更重要的用途是它的第二功能,如下表所示:

P3口还接收一些用于闪烁存储器编程和程序校验的控制信号。

RST

复位输入。当震荡器工作时,RET引脚出现两个机器周期以上的高电平将使单片机复位。 ALE/ PROG

当访问外部程序存储器或数据存储器时,ALE输出脉冲用于锁存地址的低8位字节。即使不访问外部存储器,ALE以时钟震荡频率的1/16输出固定的正脉冲信号,因此它可对输出时钟或用于定时目的。要注意的是:每当访问外部数据存储器时将跳过一个ALE脉冲时,闪烁存储器编程时,这个引脚还用于输入编程脉冲。如果必要,可对特殊寄存器区中的8EH单元的D0位置禁止ALE操作。这个位置后只有一条MOVX和MOVC指令ALE才会被应用。此外,这个引脚会微弱拉高,单片机执行外部程序时,应设置ALE无效。

PSEN

程序储存允许输出是外部程序存储器的读选通信号,当AT89C51由外部程序存储器读取指令时,每个机器周期两次PSEN有效,即输出两个脉冲。在此期间,当访问外部数据存储器时,这两次有效的PSEN信号不出现。

EA/VPP

外部访问允许。欲使中央处理器仅访问外部程序存储器,EA端必须保持低电平。需要注意的是:如果加密位LBI被编程,复位时内部会锁存EA端状态。如EA端为高,CPU则执行内部程序存储器中的指令。闪烁存储器编程时,该引脚加上 12V的编程允许电压VPP,当然这必须是该器件是使用12V编程电压VPP。

XTAL1

震荡器反相放大器及内部时钟发生器的输入端。

XTAL2

震荡器反相放大器的输出端。

<strong

剩余内容已隐藏,支付完成后下载完整资料</strong


资料编号:[485617],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。