基于stm32的温度控制 下载本文

摘 要

当前快速成形(RP)技术领域,基于喷射技术的“新一代RP技术”已经取代基于激光技术的“传统的RP技术”成为了主流;快速制造的概念已经提出并得到了广泛地使用。熔融沉积成型(FDM)就是当前使用最广泛的一种基于喷射技术的RP技术。

本文主要对FDM温度控制系统进行了深入的分析和研究。温度测控在食品卫生、医疗化工等工业领域具有广泛的应用。随着传感器技术、微电子技术、单片机技术的不断发展,为智能温度测控系统测控功能的完善、测控精度的提高和抗干扰能力的增强等提供了条件。本系统采用的STM32F103C8T6单片机是一高性能的32位机,具有丰富的硬件资源和非常强的抗干扰能力,特别适合构成智能测控仪表和工业测控系统。本系统对STM32F103C8T6单片机硬件资源进行了开发,采用K型热敏电阻实现对温度信号的检测,充分利用单片机的硬件资源,以非常小的硬件投入,实现了对温度信号的精确检测与控制。

文中首先阐述了温度控制的必要性,温度是工业对象中的主要被控参数之一,在冶金、化工、机械、食品等各类工业中,广泛使用各种加热炉、烘箱、恒温箱等,它们均需对温度进行控制,成型室及喷头温度对成型件精度都有很大影响。然后详细讲解了所设计的可控硅调功温度控制系统,系统采用STM32F103C8T6单片机作微控制器构建数字温度控制器,调节双向可控硅的导通角,控制电压波形,实现负载两端有效电压可变,以控制加热棒的加热功率,使温度保持在设定值。系统主要包括:数据的采集,处理,输出,系统和上位机的通讯,人机交互部分。该系统成本低,精度高,实现方便。

该系统加热器温度控制采用模糊PID控制。模糊PID控制的采用能够在控制过程中根据预先设定好的控制规律不停地自动调整控制量以使被控系统朝着设定的平衡状态过渡。

关键词:熔融沉积成型(FDM);STM32;温度控制;TCA785

I

Abstract

In the present field of Rapid Prototyping,the \technology is replacing the \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

II

目 录

摘 要................................................................................................................................ I Abstract ................................................................................................................................ II 1 绪论 ................................................................................................................................. 1 1.1 FDM工艺原理及应用 ................................................................................................ 1 1.2 FDM国内外基本研究概况 ........................................................................................ 2 1.3 课题目的及意义 ......................................................................................................... 3 2 温度控制系统方案分析 ................................................................................................. 5 2.1 温度控制的必要性 ..................................................................................................... 5 2.2 温度控制系统的理论构成 ......................................................................................... 5 2.3 STM32和ADC ........................................................................................................... 7 2.4温度控制系统的实现 .................................................................................................. 9 3 温度控制电路各部分的实现 ....................................................................................... 11 3.1温度检测电路 ............................................................................................................ 11 3.2加热部分 .................................................................................................................... 17 3.3键盘显示部分 ............................................................................................................ 21 3.4软件部分 .................................................................................................................... 21 3.5通讯总线的研究 ........................................................................................................ 22 4 总结与展望 ................................................................................................................... 24 4.1全文总结 .................................................................................................................... 24 4.2研究展望 .................................................................................................................... 24 致 谢.............................................................................................................................. 26 参考文献.............................................................................................................................. 27

III

1 绪论

1.1 FDM工艺原理及应用 1.1.1 熔丝沉积技术原理

早在十九世纪80年代末,美国学者Scott Crump博士第一次提出一种新的思想,该思想就是熔丝沉积技术的原型。该思想舍弃了激光器,提出了利用喷头的技术,其基本工作原理是:在控制系统作用下喷头进行两轴半运动,包括X-Y联动以及Z向运动,选取特殊材料可以在喷头中被加热接近流体状;处于熔融状态下的材料在喷头扫描过程中被喷出,并急速冷却形成一层加工面,层与层直接不断的叠加连接在一起制作成一个空间实体。

图1-1FDM的工作原理

1.1.2 熔丝沉积技术的应用

FDM采用降维制造原理,将原本很复杂的三维模型根据一定的层厚分解为多个二维图形,然后采用叠层办法还原制造出三维实体样件。由于整个过程不需要模具,所以大量应用于产品开发,功能测试,无模制造,小批量制造方面。主要应用在汽车,航空航天,家用电器,电动工具,院校,模具制造,玩具制造,手版设计等领域[1-2]。

FDM技术可在产品开发过程中的提供设计验证与功能验证,检验产品可制造性、可装配性,通过各种转换技术,可将RP模型快速转换成各种模具,大幅度地缩短产品更新换代的周期。快速成型机能为看样定货、供货询价、市场宣传等方面及时提供精确的样品,大大提高企业的营销效率。 快速成型技术问世不到十年,已实现了相当大的市场,发展非常迅速,已成为现代工业设计、模型、模具和零件制造强有力手段,在轻工、汽车摩托车领域得到了越来越广泛的应用。鉴于快速成型技术的特殊性,可以直接生产特殊复杂零件,CT扫描信息的实物化,因而快速成型技术在航空、航天及医疗领域正逐步体现出巨大的优越性。 1.1.3 熔丝沉积技术的发展趋势

1