基于DSP高速测温仪控制系统设计论文_第1页
基于DSP高速测温仪控制系统设计论文_第2页
基于DSP高速测温仪控制系统设计论文_第3页
基于DSP高速测温仪控制系统设计论文_第4页
基于DSP高速测温仪控制系统设计论文_第5页
已阅读5页,还剩46页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、长 春 工 业 大 学 毕业设计、毕业论文毕业设计、毕业论文 题 目 基于 dsp 高速测温仪控制系统设计 学 院 人文信息学院 专业班级 电气工程及其自动化 070922 班 指导教师 张袅娜 姓 名 张家瑞 2011 年 6 月 3 日 摘摘 要要 本文主要论述了 dsp 芯片在高速测温系统中的应用。该测温仪具有对高速加 热或降温过程进行高速测量的功能,测量的温度值经过 fft 滤波处理后送显示或 打印。 本文首先介绍了测温仪器的发展现状,并结合广泛的市场调研论证了在我 国用 dsp 芯片研制高速测温仪的必要性和可行性。接着在介绍了 dsp 芯片的发展 与应用领域、dsp 芯片的主要结构特

2、点及分类的基础上,针对高速测温仪系统的 特点进行 dsp 芯片的选型,并对所选芯片tms320f240 的结构和特征进行了详 细说明。然后详细说明了测温仪所要实现的功能,在测温仪所要实现的功能的基 础上对测温仪各部分硬件进行了设计与优化。在硬件设计基础上,利用代码调试 器完成了各部分的软件设计。同时也解释了本系统其它部分芯片选择的原因。在 考虑到系统将要实现的功能和所选择的芯片之后,给出了系统各部分的简略框图。 然后详细说明了本系统的研制过程,包括硬件设计、软件设计、抗干扰设计、 程序的编写等。 最后经过了硬件和软件调试,实现了预期的高速测温的功能。而且展望了本 仪器的应用前景及可以进一步完善

3、的地方。 关键词:关键词:dsp 高速测温 abstractabstract this paper mainly discusses the high-speed dsp chip in the application temperature measuring system. the colorimeter to high-speed heating or cooling with the function of high speed measurement process, measurement of the temperature value through fft filtering

4、 processing send display or printing after. this paper firstly introduces the development status of temperature measurement instrument, and combined with extensive market research demonstrates the dsp chip in our country developed with high-speed colorimeter necessity and feasibility. then in introd

5、uces the development and application of digital signal processor (dsp) the main field, dsp chip the structural characteristics and classification, based on the characteristics of high-speed highlighted. it system on the selection, and dsp chip tms320f240 of selected chip - the structure and features

6、 a detailed explanation. then detail the colorimeter to achieve the function, in the colorimeter to achieve the function on the basis of the hardware of various parts are highlighted. it out the design and optimization. in the hardware design basis, using code debugger completed each part of the sof

7、tware design. this system would also explain the reason for the choice of other parts of a chip. considering the system will achieve the function and choice, after the chip all parts of the system were given briefly diagram. then explained the process of development of the system, including hardware

8、 design, software design, anti-interference design, program compilation, etc. eventually, after hardware and software debugging, achieving the desired temperature function of high speed. and looks forward to the application prospect and the instrument can be further perfect place. keywords:keywords:

9、 dsp high-speed temperature measurement 目目 录录 第第 1 1 章章 概概 述述.1 1.1 设计目的 .1 1.2 温度测量技术的现状和展望 .1 1.3 dsp 芯片的发展 .2 1.4 dsp 芯片的选择 .4 第第 2 2 章章 方案论证方案论证.6 2.1 单片机选择 .7 2.2 温度传感器选择 .8 2.3 存储器 .9 第第 3 3 章章 系统的电路设计系统的电路设计.10 3.2 时钟电路 .10 3.3 复位电路 .11 3.4 向前通道测量电路 .11 3.4.1 传感器的选择.12 3.4.2 放大倍数的确定.12 3.4.3

10、模数转换器.13 3.5 存储器接口 .14 3.6 电源电路 .17 3.7 显示器接口电路 .17 3.8 打印机接口电路 .19 3.9 热电偶冷端补偿电路 .20 第第 4 4 章章 系统的软件设计系统的软件设计.21 4.1 采样部分程序设计 .22 4.2 显示程序设计 .23 4.3 热电偶冷端补偿测温程序 .24 4.4 软件编写采用的语言 .25 第第 5 5 章章 系统的抗干扰设计系统的抗干扰设计.27 5.1 硬件抗干扰设计 .27 5.2 软件抗干扰设计 .28 5.2.1 干扰对测控系统造成的后果.29 5.2.2 软件抗干扰对策 .30 总总 结结.32 致致 谢谢

11、.33 参考文献参考文献.34 附录附录 1 1:原理图:原理图 .36 附录附录 2 2:adad 转换子程序转换子程序.37 附录附录 3 3:显示子程序:显示子程序 .38 附录附录:4:4:热电偶冷端温度补偿测温子程序:热电偶冷端温度补偿测温子程序.40 附录附录:5:5:fftfft 算法子程序算法子程序 .43 第第 1 1 章章 概概 述述 1.11.1 设计目的设计目的 1 通过程序设计更加了解了对 dsp 软件相关知识的学习与应用 2 学习了编程语言并且能熟练掌握有关内容和应用 3 能够把 dsp 和电路相结合分析 1.21.2 温度测量技术的现状和展望温度测量技术的现状和展

12、望 科学技术的发展已经与测量技术的发展紧密联系在了一起,科学技术为测量 技术提供更多选择条件,温度测量是工业、农业、国防和科研等部门常用的测量 项目。它在工农业生产和现代科学研究及技术开发过程中也是一个非常重要的测 量参数。在生产和科学研究中,为了更够测量更精确的测量结果,需要用定值方 式给物体冷热程度给与描述。所以要建立适当的标尺来衡量物体的冷热程度,更 便捷地描述物体各种性能随温度变化关系。现在温度检测技术已经在科学发展中 起到了非常重要作用。 温度测量首先是有温度传感器来实现的。测量仪器由温度传感器和信号处理 两部分组成。温度测量的过程就是通过通过温度传感器将被测对象的温度值转换 成其它

13、形式的信号,传递给信号处理路进行信号处理转换成温度值显示出来。温 度传感器随着温度变化而引起变化的物理参数有:膨胀、电阻。电容、热电动势、 磁性能、频率、光学特性及热噪音等等。随着生产的发展,目前全国通用的温度 传感器及测量仪有如下几种: 1)热膨胀式温度计 具有结构简单,制造和使用方便,价格低和精度高等优 点。缺点是不能远距离测温,结构易坏; 2)电阻温度计 具有测量精度高,性能良好,灵敏度高,应用广,能够较远 距离测温,并能实现温度自动控制和记录等优点; 3)热电偶 其特点是测量精度高,结构简单易懂,动态响应快,野远距离测 量,测量范围广; 4)辐射式测温仪表 其测量精度不如热电偶温度计高

14、,测量误差大,测量范 围大约在 400 3200。该仪表有全辐射高温计,单辐射高温计和比色温度计 三种; 5)石英温度传感器测温仪 其稳定性很好,灵敏度可达 0.001以上,缺点 是响应速度较慢,测温速度大约一秒一次,不适合快速测温; 工业中测温仪大部分采用单片机作微处理器。普通的单片机指令周期为 2us。因为其内部不能满足某些特殊要求的高速测温。有些单片机速度快却不能完 成 fft 等复杂滤波算法,不能高速测温。也有采用工控机来进行高速测温,但是 工控机受外界干扰严重不能实现现场测温,该一起不方便携带。 1.31.3 dspdsp 芯片的发展芯片的发展 数字信号处理器(digital sig

15、nal processing,简称 dsp)是一门应用科学 又应用在各种领域的新兴科学。在 20 世纪以前虽然随着计算机和信息技术的发展 的同时数字信号处理技术也得到很好发展,由于当时网络不发达数字信号处理理 论没有广泛应用。80 年代初 dsp 产品推出以来,其发展迅速,生产厂家众多,产 品种类繁多,工作速度不断提高,其主要应用实现数字信号处理算法。dsp 芯片 有如下特点: 1)在一个指令周期内能完成一次乘法和一次加法; 2)程序和数据是单独存放的,可以同时访问指令和数据; 3)片内有 ram 可通过数据总线同时访问两片; 4)具有跳转的硬件支持; 5)能很快进行中断处理和硬件 i/o 支

16、持; 6)可以并行执行多个操作; 7)能流水操作; 目前市场最常见的 dsp 芯片有美国 ti 公司生产的 tms320 系列,ad 公司的 adsp 系列,motorola 公司的 dsp 系列,日本 nec 公司的 pd 系列及 at 2)测量范围是-55+125 ; 3)供电范围 3v5.5v; 4)将温度转换成 12 位数字最长时间为 750ms; 5)非易失性温度报警; 6)温度计可编程 9-12 位; 故只要将其数据线与 dsp 的一 i/o 口相接即可,再将其电源线和地线分别接 上。 第第 4 4 章章 系统的软件设计系统的软件设计 系统完成功能是将现场两点的温度数据经过采集处理

17、,先转换成数字信号, 在拟合成温度值后显示出来。显示时可根据需要显示一点或两点温度。如果温度 超出了测量范围,那么显示“9999” 。流程图如图 4-1。 系统初始化 采样 超温? 存储 滤波处理 拟合成温度值 同时 显示 两点 温度 显示 某点 温度 打 印 报 警 图 4-1 测温系统总流程图 4.14.1 采样部分程序设计采样部分程序设计 经过放大器两级把热电偶采集得到的电压放大后经过滤波送人 dsp。放大后 的电信号直接接入 dsp 内部自带的 ad 转换器将电信号转换成数字信号即 ad 值, 最后根据电压与 ad 值得关系及热电偶的热电势与温度之间的关系将 ad 值转换为 温度值。如

18、图 4-2。见附录一。 adc初始化 adctrl1、adctrl2的设置 i=0 ad采样转变 读ad值 i=i+1 i6; temp 1 temp 2=temp 26; temp 2 附录附录 3 3:显示子程序:显示子程序 /*-显示初始化-*/ void init_ display () delay (60000); set_ co (); set_ write (); set_ rd (); set data (); delay (5); write command(0 x24);/*初始化命令*/ write_ command (1); write_ command (3); wr

19、ite _command (5); for (n=0; n 1 0; n+) write byte(n,32);/*清屏*/ /*-显示温度-*/ void dips _data (unsigned char p, unsigned char data) unsigned char d0, dl, d2, d3; float t; read_ distemper (); /*ds18b20*/ t=-12.2178+1.4196*data+temp7; if (t=9999) d0=data/1000; dl= (data%1000)/100; d2= (data% 1000) % 100)/

20、 10; d3= (data% 1000) % 100) % 10; write_ byte (0+p, d0); write_ byte (l+p, d1); write _byte (2+p, d2); write _byte (3+p, d3); else write_ byte (0+p, 9); write_ byte (1+p, 9); write_ byte (2+p, 9); write_ byte (3+p, 9); 附录附录:4:4:热电偶冷端温度补偿测温子程序:热电偶冷端温度补偿测温子程序 /*-ds 18b20 initialization-*/ void init_d

21、s () asm(“ldp #0e1h”); asm(“lacc 7092h ”); asm (“ and #0ff7th ”);/*set up iopc7*/ asm (“sach 7092h ”); asm(“ sacl 7092h ”); asm (“lacc 709ah ”); asm (“or #8000h ”); /*iopc7 =output/ clear _birds (); delay (2000);/*delay 600us*/ send_ birds (); delay (200); /*delay 60us/*/ clear birds; delay (500);/*

22、delay 240us*/ send birds; delay (1000); /*delay 480us*/ /*- write ds18b20- */ void writhed (unsigned char com) int nn, jjj; send_ bitds (); clear_bitds (); delay (32); /*delay l6us*/ com for (nn=0; nn8; nn+) jjj=com if (jjj=0 x80) send_bitds (); else clear_bitds(); corn=com=0; nn-) asm(“ ldp #0e1h”)

23、; asm(“ lacc 709ah”); asm(“ldp # 1 00h”); asm(“ sach 8034h”); asm( “sacl 8034h” ”);/*temp3 at 8034h*/ jjj=tempi temp4=temp4+jjj;/*temp4=adds 8 位*/ /*-read ds 18b20-*/ void read_dstemper () init_ds (); write_ds (0 xcc);/*skip command*/ write_ ds (0 x44);/*temperature transformation*/ delay (10000); d

24、elay (10000);/*delay 1000ms*/ init_ds (); write_ds (0 xcc); write_ds (0 xbe); read_dsad (); temp5=temp4; read_ dsad (); temp6=temp4; temp6=temp68; temp7= (temp6+temp5)/16; /*temp7=temperature*/ 附录附录:5:5:fftfft 算法子程序算法子程序 #include stdafx.h #include “stdafx.h” #include “fdt.h” #include “fdtset.h” #include “fdtdoc.h” #include “fdtview.h” #include “math.h” struct compx float real, imag ; struct compx s 2216; struct compx ee (struct compx, struct compx); void fft(struct compx*,int); struct compx ee(struct compx b1,struct compx b2) struct compx b3; b3.real=bl.real*b2.real-bl

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论