基于STM32的高精度恒温控制系统设计
基于STM32的室内温度控制系统

直接存储器存取单个程序启动stm32开发板stm32开发板如图22所示ic接口的eeprom芯片24c02容量256字节个ds18b20温度传感器预留接口28英寸液晶屏接口支持触摸屏个usbslave接口用于usb通信个ps2接口外接鼠标键盘等组5v电源供应接入口iv陕西理工学院毕业设计图22stm32开发板组33v电源供应接入口个24g的无线通信接口24l01和jf24c最小系统设计单片机要正常工作必须电源电路提供电源通过震荡电路产生时钟周期同时为了防止系统异常还需加上复位电路可手动让系统重新工作
基于STM32单片机的恒温箱系统设计

以针 对实 验室 来说 , 恒 温箱 的作用 显得 相 当重要 , 对 于我们 实验 室 的研究 过程 以及研 究 结果将 产 生很大 的影
响。同时更加准确的研究结果对于我们 由此产生 的试验成果的实际运用产生积极的作用。
在工 业生 产 中 , 恒 温箱 的应用 是广 泛 的 , 工 厂车 间 的产 品 以及 由此相 关 的工业 生产 都是基 于 恒温环 境 的
[ 6 ] 吴家洲 , 吴波 , 杨叔子. U G软件的二次开发[ J ] . 机床与液压 , 2 0 0 1 ( 5 ) : 8 9 — 9 1 . 责任编辑 : 吴 旭 云
Opt i c a l Co mp o ne nt s Li br a r y o f UG Se c o nd ar y De v e l op me nt
T I AN Mi n g, L I U S i y u
( S c h o d o f O p t o E l e c t r o n i c E n g i n e e i r n g , C h a n g c h u n U n i v e r s i t y o f S c i e n c e a n d T e c h n o l o g y , C h a n g c h u n 1 3 0 0 2 2 , C h i n a )
制冷 片开 始制 冷 。
收 稿 日期 : 2 0 1 5 - 0 6 - 1 5
作者简介 :王桔 ( 1 9 8 0 一 ) , 女, 吉林长春人 , 讲师 , 硕士, 主要从事电子与通信工程方面 的研究 。
1 4
长
春
大
学 学
报
第2 5卷
圉圈
图 1 系 统 设计 方 案
基于STM32单片机的恒温箱系统设计

1 系统 设 计 方 案
本 系统包 括 S T M3 2 F 1 0 3核 心板 、 P T 1 0 0 0温 度传 感 器 、 放 大 电路 、 4 x 4矩 阵键 盘 、 声 光 报 警 电路 、 液 晶 显 示屏 、 驱 动 电路 、 继 电器 控制 电路 、 半导 体 制冷 片及 P T C加 热片 , 如图 1 所示 。
行 温 度控 制 , 当 箱体 内气 温低 于设 定值 时 , 加 热 片开 始 加 热 , 当 箱 内温度 高 于 设 定 值 时 制 冷 片 开 始 工 作 。 关键 词 : S T M3 2 F 1 0 3 V E T ; P T I O 0 0 ; 半导体制冷 片; 温 度 控 制
中图分类号 : T P 3 6 8 . 1
P T 1 0 0 0温 度传 感器 输 出电压 经放 大 电路 放 大后 送 到 S T M3 2 F 1 0 3核 心 板 的模 数转 换 接 V I , 转 化 成 数 字
量后 经 S T M3 2 F 1 0 3单 片机 处理 得到 相应 的温度 信 息 。在 某 一 时刻 箱 内如 果低 于 设 置 温度 则 通 过继 电器 控 制 电路使 P T C加 热 片开始 加热 , 经 H桥 驱 动 电路 正 向驱动 制冷 片使 半导 体制 冷 片开始 加热 箱体 。 当箱 内温
度 高于设 置温 度 时 , S T M3 2 F 1 0 3 单 片机 发 出控 制 指令 , 经驱 动 电路 反 向驱 动制 冷 片 使 半 导体 制 冷 片 开 始 制
冷 。在液 晶显 示屏 上显 示箱 内实 际温度 和设 置 温度 。通过 4 x 4矩 阵键 盘 输入 设 置温 度 , 也 可 以在 触摸 屏 上
【强烈推荐】基于stm32的温度控制毕业论文设计

摘要当前快速成形(RP)技术领域,基于喷射技术的“新一代RP技术”已经取代基于激光技术的“传统的RP技术”成为了主流;快速制造的概念已经提出并得到了广泛地使用。
熔融沉积成型(FDM)就是当前使用最广泛的一种基于喷射技术的RP技术。
本文主要对FDM温度控制系统进行了深入的分析和研究。
温度测控在食品卫生、医疗化工等工业领域具有广泛的应用。
随着传感器技术、微电子技术、单片机技术的不断发展,为智能温度测控系统测控功能的完善、测控精度的提高和抗干扰能力的增强等提供了条件。
本系统采用的STM32F103C8T6单片机是一高性能的32位机,具有丰富的硬件资源和非常强的抗干扰能力,特别适合构成智能测控仪表和工业测控系统。
本系统对STM32F103C8T6单片机硬件资源进行了开发,采用K型热敏电阻实现对温度信号的检测,充分利用单片机的硬件资源,以非常小的硬件投入,实现了对温度信号的精确检测与控制。
文中首先阐述了温度控制的必要性,温度是工业对象中的主要被控参数之一,在冶金、化工、机械、食品等各类工业中,广泛使用各种加热炉、烘箱、恒温箱等,它们均需对温度进行控制,成型室及喷头温度对成型件精度都有很大影响。
然后详细讲解了所设计的可控硅调功温度控制系统,系统采用STM32F103C8T6单片机作微控制器构建数字温度控制器,调节双向可控硅的导通角,控制电压波形,实现负载两端有效电压可变,以控制加热棒的加热功率,使温度保持在设定值。
系统主要包括:数据的采集,处理,输出,系统和上位机的通讯,人机交互部分。
该系统成本低,精度高,实现方便。
1该系统加热器温度控制采用模糊PID控制。
模糊PID控制的采用能够在控制过程中根据预先设定好的控制规律不停地自动调整控制量以使被控系统朝着设定的平衡状态过渡。
关键词:熔融沉积成型(FDM);STM32;温度控制;TCA785AbstractIn the present field of Rapid Prototyping,the "New RP Technology" based on jetting technology is replacing the "Conventional RP Technology" based on laser technology as the mainstream of the Rapid Prototyping Technology.Fused Deposition Modeling(FDM) is the most popular Rapid Prototyping technology based on jetting technology.This paper mainly does research deeply on the temperature control system of FDM system.Temperature controlling is widely to food,sanitation,medical treatment,chemistry and industry.Along with the development of sensor technology,micro-electronicstechnology and singlechip technolog,brainpower temperature controlling system is perfected,precision of measurement and controlling is enhanced and the ability of anti-jamming is swelled.Singlechip STM32F103C8T6 in this paper is a this paper.The tool of temperature test is thermocouple of K style.This system realizes precise measurement and controlling of temperature signal with a little controlparameter in industrial object.Various calefaction stoves,ovens and constant temperature boxes which all need control temperature are widely used in many industry such as metallurgy,chemistry,mechanism and foodstuff.Moulding room and spout temperatureawfully affect the precision of moulding pieces.Then the temperature control systemusing controllable silicon is explain in detail.This system adopts singlechip STM32F103C8T6 which acts as microcontroller.It can regulate the angle of double-direction controllable silicon and control voltage wave shape.So the virtual voltage of load can be changed and the calefaction power of calefaction stick can be controlled.Therefore the temperature canretain the enactment value.This system mainly consists of collection of data,disposal,output,communication of system and computer and communication of and machine.This system andconvenience realization.This system adopts blury PID control.The adoption of blury PID control canceaselessly autoregulates basing initialized controlrule,thus the controlled system willmove to the initialized balance state.Key words:Fused Deposition Modeling, STM32, temperature control, TCA785毕业设计(论文)原创性声明和使用授权说明原创性声明本人郑重承诺:所呈交的毕业设计(论文),是我个人在指导教师的指导下进行的研究工作及取得的成果。
基于STM32单片机并网储能电池恒温控制系统设计

基于STM32单片机并网储能电池恒温控制系统设计近年来,新能源发电广泛并网,储能技术对于提高其电能质量与可靠性具有重要意义,进而成为电力系统的研究热点之一。
蓄电池组作为储能系统的主要设备,其寿命,容量和安全性均与温度紧密相关。
本文采用STM32单片机对并网蓄电池组的温度进行自动控制:温度采集,设定值设定,越值报警,制冷风扇与红外加热仪的控制。
用户通过人机交互界面DWIN-LCD工业串口屏界面设定阈值数值,预调整温度等数值,所有数据自动上传至上位机,通讯速率达到9600bps,系统可及时动作。
标签:储能;STM32单片机;人机交互界面;温度控制0 引言电池储能系统在电力系统中广泛应用,因其快速的对接入点的有功功率和无功功率进行调节,可用来提高电力系统的运行稳定性、提高供电质量,当其容量足够大时,甚至可以发挥电力调峰的作用[1]。
近些来,新能源并入电网,储能技术平抑波形,提高电能可靠性与参与二次调频的优势已经初步体现。
作为储能最核心的蓄电池组的作用更是不可忽视,其最佳工作温度为15℃至25℃,温度下降时,电池反应速率降低,输出功率也会下降;温度上升时,虽然输出功率会上升,但若温度过高,则会破坏电池内部化学平衡,导致材料的性能会退化和循环寿命缩短[2-3]。
但是我国北方冬天远低于15℃,南方夏天远高于25℃因此恒温控制系统对于维持蓄电池的使用寿命和输出功率至关重要。
1 硬件系统设计1.1 硬件需求列表蓄电池金属箱体1个;PLC模块1块;温度传感器1个;数码管2个;红外加热仪2个(1、2加热档各一个);制冷风机2个(1、2加热档各一个);蜂鸣器1个。
1.2 硬件结合方式硬件主体为蓄电池金属箱体。
在箱体内部将蓄电池架空安置,与红外加热仪及风机保持一定距离。
在箱体底部内测安装红外加热仪。
在箱体顶部外侧安装制冷风扇,采用分离装置,将风扇的叶片对准分离装置,以便冷风流通。
本设计的重点为当制冷风扇产生火花时,分离装置避免了蓄电池的明火引燃。
基于stm32的温度控制

摘要当前快速成形(RP)技术领域,基于喷射技术的“新一代RP技术”已经取代基于激光技术的“传统的RP技术”成为了主流;快速制造的概念已经提出并得到了广泛地使用。
熔融沉积成型(FDM)就是当前使用最广泛的一种基于喷射技术的RP 技术。
本文主要对FDM温度控制系统进行了深入的分析和研究。
温度测控在食品卫生、医疗化工等工业领域具有广泛的应用。
随着传感器技术、微电子技术、单片机技术的不断发展,为智能温度测控系统测控功能的完善、测控精度的提高和抗干扰能力的增强等提供了条件。
本系统采用的STM32F103C8T6单片机是一高性能的32位机,具有丰富的硬件资源和非常强的抗干扰能力,特别适合构成智能测控仪表和工业测控系统。
本系统对STM32F103C8T6单片机硬件资源进行了开发,采用K型热敏电阻实现对温度信号的检测,充分利用单片机的硬件资源,以非常小的硬件投入,实现了对温度信号的精确检测与控制。
文中首先阐述了温度控制的必要性,温度是工业对象中的主要被控参数之一,在冶金、化工、机械、食品等各类工业中,广泛使用各种加热炉、烘箱、恒温箱等,它们均需对温度进行控制,成型室及喷头温度对成型件精度都有很大影响。
然后详细讲解了所设计的可控硅调功温度控制系统,系统采用STM32F103C8T6单片机作微控制器构建数字温度控制器,调节双向可控硅的导通角,控制电压波形,实现负载两端有效电压可变,以控制加热棒的加热功率,使温度保持在设定值。
系统主要包括:数据的采集,处理,输出,系统和上位机的通讯,人机交互部分。
该系统成本低,精度高,实现方便。
该系统加热器温度控制采用模糊PID控制。
模糊PID控制的采用能够在控制过程中根据预先设定好的控制规律不停地自动调整控制量以使被控系统朝着设定的平衡状态过渡。
关键词:熔融沉积成型(FDM);STM32;温度控制;TCA785AbstractIn the present field of Rapid Prototyping,the "New RP Technology" based on jetting technology is replacing the "Conventional RP Technology" based on laser technology as the mainstream of the Rapid Prototyping Technology.Fused Deposition Modeling(FDM) is the most popular Rapid Prototyping technology based on jetting technology.This paper mainly does research deeply on the temperature control system of FDM system.Temperature controlling is widely to food,sanitation,medical treatment,chemistry and industry.Along with the development of sensor technology,micro-electronics technology and singlechip technolog,brainpower temperature controlling system is perfected,precision of measurement and controlling is enhanced and the ability of anti-jamming is swelled.Singlechip STM32F103C8T6 in this paper is a high-powered 32-bit chip.It has plenty of hardware resource and strong ability foranti-jamming.It is specially suitable for making brainpower measurement instrumentand industry controlling system.The hardware resource of singlechip STM32F103C8T6 is fully exploited in this paper.The tool of temperature test is thermocouple of K style.This system realizes precise measurement and controlling of temperature signal with a little hardware resource.First,the need of temperature control is expounded.Temperature is a main controlparameter in industrial object.Various calefaction stoves,ovens and constant temperature boxes which all need control temperature are widely used in many industry such as metallurgy,chemistry,mechanism and foodstuff.Moulding room and spout temperatureawfully affect the precision of moulding pieces.Then the temperature control systemusing controllable silicon is explain in detail.This system adopts singlechip STM32F103C8T6 which acts as microcontroller.It can regulate the angle of double-direction controllable silicon and control voltage wave shape.So the virtual voltage of load can be changed and the calefaction power of calefaction stick can be controlled.Therefore the temperature canretain the enactment value.This system mainly consists of collection of data,disposal,output,communication of system and computer and communication of human and machine.This system has some advantages such as low cost,high precision andconvenience realization.This system adopts blury PID control.The adoption of blury PID control canceaselessly autoregulates basing initialized control rule,thus the controlled system willmove to the initialized balance state.Key words:Fused Deposition Modeling, STM32, temperature control, TCA785目录摘要.................................................................................................................................. Abstract (I)1 绪论 01.1 FDM工艺原理及应用 01.2 FDM国内外基本研究概况 (1)1.3 课题目的及意义 (2)2 温度控制系统方案分析 (4)2.1 温度控制的必要性 (4)2.2 温度控制系统的理论构成 (4)2.3 STM32和ADC (6)2.4温度控制系统的实现 (8)3 温度控制电路各部分的实现 (10)3.1温度检测电路 (10)3.2加热部分 (16)3.3键盘显示部分 (20)3.4软件部分 (20)3.5通讯总线的研究 (21)4 总结与展望 (23)4.1全文总结 (23)4.2研究展望 (23)致谢 (26)参考文献 (27)1 绪论1.1 FDM工艺原理及应用1.1.1 熔丝沉积技术原理早在十九世纪80年代末,美国学者Scott Crump博士第一次提出一种新的思想,该思想就是熔丝沉积技术的原型。
基于STM32的恒温水浴温度检测与控制系统设计

文章编号 : 1 6 7 1 —4 5 9 8 ( 2 0 1 7 ) 0 6 —0 0 4 1—0 4
C 计 o 算 m p 机 u t e 测 r 量 M 与 e a s 控 u r e 制 m . e n 2 t 0 1 &C 7 . 2 o 5 n ( t 6 ) r o l
硬 件 电路 和设 计 了 系统 软 件 ,并 进 行 了实 验 验 证 ;该 设 计 采 用 S TM3 2 F 4 0 7作 为 主 控 处 理 器 ,P T1 0 0传 感 器 测 量 温 度 ,三 线 制 调 理 电 路 消 除测 量 误差 , 2 4位 A/ D 芯 片进 行 A/ D 转 换 ,1 2 8 6 4液 晶 进行 实 时显 示 ,并 具 有 语 音 功 能 ;测 温 部 分 采 用 查 表 与 分 段 数 学 建 模 相 结 合 的方 法 。能 够 计 算 得 出较 精 确 的 温 度 值 ,由 于 在 化 工 领域 的 温 度 控 制 中 ,被控 对 象具 有 纯滞 后 的 特 点 , 系 统 中 控 温 部 分 采 用 P I D 算 法 和
s o r .Th r e e wi r e c o n d i t i o n i n g c i r c u i t i s u s e d t o e l i mi n a t e me a s u r e me n t e r r o r . Th e 2 4 b i t A/ D c o n v e r t e r a n d 1 2 8 6 4 l i q u i d c r y s t a l d i s p l a y e r a r e
关 键 词 :恒 温 水 浴 ;S TM3 2 F 4 0 7 ;P T1 0 0 ; PI D ;S mi t h预估 算 法
外文翻译---基于STM32的恒温箱温度控制系统

Thermo Tank Temperature Control System Based On STM32Biao 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; PIDManuscriptNumber:1674-8042(2011)01-0064-03Dio: 10.3969/j.issn.1674-8042.2011.01.161 introductionThermo 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 ±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 tankIn 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 and16-bit PWM output for great control accuracy.Fig 1 System control principle3 hardware designThis 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 structure3.1 temperature acquisition and A/D conversionAmong 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 resourcesTM32F103 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 1μ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 circuitsIn order to realize the convention from PWM signal to analog output, we use the second order low pass filter to filter out the high frequency components and keep DC component and changing duty cycle of PWM signal so that the analog voltage output is got then. Fig.3 shows the designed Butterworth filter. After filtering, convert P WM signal to 0~2.5 V to control thyristor conduction angle[3]. Thus we realized the precise control of heating temperature.Fig 3 Butterworth filter4 Software design4.1PID control algorithmThis system uses PID control algorithm which is a basic control method widely used in industrial process control method widely used in industrial process control. Augmented PID control algorithm[4] isu k - u k- 1 = K P ( e k - e k- 1 ) + K 1 e k + K D ( e k - 2e k- 1 + e k- 2 ) .However, if this algorithm was used directly, it could generate a lare overshoot and cause integral saturation easily when starup, stop or adjust substantially. In order to inhibit the emergence of this phenomenon, we use integral separation as an improvement.Integral separation won't work until actual temperature is approaching the settings. When it works, it can eliminate static error and improve precision[5]. Block diagram of integral separation PID is shown in Fig.4.Fig 4 Integral separate PID algorithm block diagram4.2 Touch screen software designIt makes human-computer interface much more friendly, more convenient and faster by using touch screen. Use dedicated control chip ADS7843 to connect AMT9532, four-wire resistive touch screen, withSTM32F103, process the touch screen signals[6]. Touch screen's software design flow chart is shown in Fig.5.Fig 5 Touch screen flow chartUse standard thermometer with 0.001℃precision as calibration to check the experimental results. Specific methods: set different temperatures within the appropriate range though touch screen, wait until the temperatures shown in the LCD are stable, then calculate the errors based on the actual temperature of standard thermometer with formula:Error=|set-actual|/set.The check results are shown in Tab.1.Tab.1 Calibration results6 conclusionBy using 16-bit PWM output, simple filtering circuit conversion circuit, software design and floating-point operations, this system realized 16-bit D/A. Conversion which is very hard for common MCU to realize.The system temperature range is 6℃~80℃and the resolution of 16-bit control signal could reach to 10‰. The experimentalresults show that the system definitely can reach the control requirement that temperature accuracy is better than ±0.05℃. The application shows that this system has the real-time, flexible, stable high-precision, and low cost advantages, and can meet the industrial requirements of high accuracy, high stability and reliability.References[1] Zhaojun Li, Ping Ji, Xiangguang Lou, 2007, Design of high precision temperature control system. Electronic Measurement Technology. (2): 146-148.[2] ST Microelectronics Corporation, 2007. STM32F103XX Data sheet.[3] Dayong Xia, Xiaohui Zhou, Zeng Zhao, Bofeng Chen, Endian Hu,2007. Temperature control system of single-chip of model MCS-51. Industrial Instrumentation & Automation, (1):43-47.[4] Lin Wu, Enping Lou, Dongqing Hou, Liang Xu, 2006, Wireless temperature and humidity control system based on PID arithmetic. Chinese Journal of Scientific Instrument, 27(21):619-620.[5] Yan Zhao, Guangzhi Yang, 2006. Automatic measuring system in constant temperature for oxygen content based on singlechip. Chinese Journal of Scientific Instrument, s1.[6] Songmei Zhang, Junkai Liang, Longji Liu, 2008. Deign of thermo tank temperature control system based on C8051F. Electronic Measurement Technology, 31(9): 147-149.基于STM32的恒温箱温度控制系统摘要—这篇文章介绍了一个基于STM32的恒温箱温度控制系统,首先,由基于常流源的高精度电桥获取温度,然后,由软件实现的扩充型PID算法在这里得到应用,使用巴特沃兹滤波器(最平坦滤波器)将STM32输出的PWM转换成电流信号来控制半导体整流器从而调节温度,校准检测和实际应用都表明这个系统可靠、精度高、可行性好,并且能够满足现实需要。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2017拄 第5期 仪表技术与传感器
Instrument Technique and Sensor 2017
No.5
基于STM32的高精度恒温控制系统设计 黄琦 ,韩广源 ,吴瑞东 ,刘 毅 ,杨世强 ,张明江。.-,张建忠 , (1.太原理工大学新型传感器与智能控制教育部与山西省重点实验室,山西太原030024; 2.太原理工大学物理与光电工程学院,光电工程研究所,山西太原030024;3.太原世诺科技有限责任公司,山西太原030024)
摘要:针对分布式光纤拉曼测温系统中定标光纤和雪崩光电二极管(APD)的温控要求,设计了一 套基于STM32的高精度恒温控制系统。系统采用上下位机结构.上位机负责设定温度值和显示温度数 据,下位机根据上位机的设定值利用PID算法对恒温箱的温度进行控制。实验结果表明:在22℃的室 温下,定标光纤温度稳定在(10+0.1)℃,APD温度稳定在(5 ̄0.005)oC,上位机可准确反映温度的数值 和变化趋势。整套恒温系统能够满足分布式光纤拉曼测温系统的温控要求。 关键词:STM32;高精度;温度;STemwin;PID算法 中图分类号:TP273 文献标识码:A 文章编号:1002—1841(2017)05—0071-04
Design of High-precious Constant Temperature Control System Based on STM32 HUANG Qi ,HAN Guang—yuan ,WU Rui—dong ,LIU Yi ,YANG Shi—qiang , ZHANG Ming-jiang .ZHANG Jian—zhong ’ (1.Key Laboratory of Advanced Transducers and Intelligent Control System,Ministry of Education and Shanxi Province, Taiyuan University of Technology,Taiyuan 030024,China; 2.College of Physics and Optoelectronics,Institute of Optoelectronic Engineering,Taiyuan University of Technology, Taiyuan 030024,China; 3.Taiyuan Shi Nuo Technology Limited Liability Company,Taiyuan 030024,China)
Abstract:Aiming at the temperature requirements of the calibrating fiber and avalanche photo diode(APD)in distributed optical fiber Raman temperature sensing system,a constant temperature control system with high precision was designed based on STM32.This system adopted upper aM lower computers.The upper computer can set the temperature value and display tempera・ ture,meanwhile,the lower computer can control the incubator temperature with the PID algorithm according to the instruction from the upper computer.The experiment results show that the calibrating fiber and the APD can stabilize at(10 ̄0.1)℃and(5± 0.005)oC at loom temperature of 22 oC.respectively,Besides,the upper computer can accurately reflect the temperature value and its variation trend.It is reasonably believed that the complete set of thermostatic device can meet the temperature demands in distributed optical fiber Raman temperature sensing system. Keywords:STM32;high precision;temperature;STemwin;PID algorithm
0引言 分布式光纤拉曼测温系统是利用后向拉曼散射 光的温度效应进行温度探测的新型传感系统…。系 统以光纤作为传输和传感介质,相对其他的测温方法 具有抗电磁干扰、测量距离长、本质安全等优点,已广 泛应用在油气管道、隧道等领域l2 ]。 在分布式光纤拉曼测温系统中,各器件的参数受 基金项目:国家自然科学基金面上项目(61377089);山西省科 技攻关项目(20140321003—1);山西省高等学校优秀青年学术 带头人支持计划(20121fjyt08);山西省煤基重点科技攻关项目 (MQ2014-09);山西省煤层气联合研究基金资助项目 (2015012005) 收稿日期:2016-07-09 环境温度的影响极易发生改变,严重影响系统的稳定 性和测温准确性.其中定标光纤和APD尤为突 出[2l4 ],故需对两者进行必要的温度控制。常见恒温 箱的温控误差在±0.1℃左右,且仅可对单点的温度进 行反馈控制.无法达到很好的控温精度和温度均匀 性。本文提出了一种基于STM32的温度控制系统,通 过上下位机分工协作,实现了高精度均匀控温,同时 可通过上位机设定所需的温度及查看当前的温度值, 保证了分布式光纤拉曼测温系统的测温精度。 1恒温系统的硬件设计 整个恒温系统如图1所示,主要由上位机电路、下 位机电路和电源管理部分组成。上位机电路实时显 72 Instrument Technique and Sensor May.2017 示下位机传输的数据并绘制成不断更新的曲线,可对 历史数据进行保存并通过USB传输到电脑端进行后 续处理。下位机电路主要根据上位机设定的温度值, 并通过温度传感器测得的温度值不断调整制冷片和 散热模块的功率,实现对温度的闭环控制。电源管理 部分主要对上位机电路和下位机电路进行供电。 电源管理卜_] ,{珊H温黩感lT 位一 — 下—] 位 机r——————J l l L————] 机 rJl-——]r— L—]电 晕吾f数据传输l I数据存储f 散热 II制冷片l路 l 模块 l l 模块 l l 模块l l驱动模块I 图1系统总体结构图 1.1上位机硬件设计 为实现较好的人机交互,上位机主控选用32位 STM32F407IGT6微控制器。此芯片基于高性能的 ARM Codex—M4 RSIC内核 J,时钟频率168 MHz.包 含1 M字节的Flash.192 K字节的SRAM.另有可变静 态存储控制器(FSMC)和USB 2.0全速device控制器 以及安全数字输入输出(SDIO)和控制器局域网络 (CAN)总线,能够满足上位机的设计要求。 上位机电路主要由人机交互模块、数据传输模块 和数据存储模块组成,其控制原理如图2所示。人机 交互模块选用7”TFT屏完成显示和触摸操作(1”= 2.54 cm),控制器为RA8875,其最大支持800x480点 分辨率且集成触摸控制器。RA8875通过sTM32F407 的FSMC控制器驱动可在TFT屏上显示温度的数值 和变化趋势,并可根据用户的触摸操作执行特定的指 令。数据传输模块包含与下位机的数据传输和与PC 端的数据传输,前者选用高可靠性的CAN总线通信, CAN收发芯片选用SN65HVD230:后者通过全速 USB2.0控制器实现PC端对内存卡中数据的读写。 数据存储模块包含2 M字节的外部高速SRAM (IS61WV102416BLL)用于对温度数据的缓存,2 G字 节的Micro SD卡用于历史数据的长期保存。 囤< 回㈤ 固< 图2上位机控制原理图 1.2下位机硬件设计 下位机电路主要实现对恒温箱具体的温度控制。 如图3所示。同样选用硬件资源丰富的 STM32F407IGT6微控制器作为主控芯片_8],其具有l7 个定时器,140个具备中断功能的I/O口,3个串行外 设接口(SPI)且可通过编程将普通I/O口复用为集成 电路(IIC)接口,能够满足下位机的控制要求。 TBC3 ADT74lO A ADT7410 B 。r iver3 D q _户q _p
PIM PD1; 嚣 蹩uo.
c,1 ̄ ̄ PA 9 蹴糍瓤咖
誊萋重量
5 ] l 薹 虿
两 司 I ∞ 星
罾 l CNAOlJT TXD I L'{面
GNDCANHH CANL I VCC CANLH CANHl RXD I r_15V I
G3.N3VD I3.3v P。wer
图3下位机控制原理图 分布式光纤拉曼测温系统的恒温箱采用内外2层 的结构,外层放置定标光纤,内层放置APD,故温度传 感模块分为两部分。外层恒温室空间较大,为实现较 好的温度均匀性,在其底部和顶部分别放置了温度传 感器A,B;而内层恒温室空间较小且通过铜块导热, 故只放置了1个温度传感器C。由于定标光纤设计的 控温误差为±0.1℃,故温度传感器A。B均选用l6位 高精度数字温度传感器ADT7410。其在一40~105 oC范 围内的温度精度为±0.5℃,温度分辨率为0.0078 oC, 采用IIC接口与主控进行通信,简单易用。APD设计 的控温误差为±0.005 oC.而集成温度传感器的温度分 辨率普遍在0.01 oC左右。故温度传感器C选用线性 NTC温度传感器配合高精度模数转换器进行温度测 量。其中线性NTC温度传感器的温度系数为 2 mV/℃,模数转化芯片选用24模数转换器AD7793。 AD7793内置一个低噪声、带有3个差分模拟输入的 ADC,最高23位有效分辨率且内置高精度基准电压, 配合线性NTC温度传感器可以实现0.0005 oC的分 辨率。 恒温箱的温度通过半导体制冷片(TEC)进行控 制,TEC利用半导体材料的珀尔贴效应制成.具有体 积小、精度高、响应速度快等特点[9].在小型温度控制 系统中具有广泛的应用。为保证恒温室的制冷效率