基于ATmega16单片机的流量控制器的开发
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
大多数传感器的输出(通常是微弱的电压或电流信号)和被检测的信号之间为非线性关系。气体流量传感器也是如此,因而在每一个流量计出厂前必须对它标定。标定的一种方法是:给出流量计量程范围内的若干个流量作为测试点(下面简称测点),记录对应每一个测点的传感器的输出,再分段线性化,就得到了量程范围内的一张流量&传感器输出表——标定表;当使用这个流量计测量流量时,流量计根据内部的传感器输出查标定表就得到了此时的流量。我所做的工作就是通过调整步进电机和变频器在气体管道上给出一个测点流量。
     在本次设计以前,对每一个测点的调节是由操作人员观察标准气体流量表(以下简称标准表)的读数,然后手动调整变频器和步进电机来实现的。变频器控制管道风速,步进电机驱动器控制阀门大小,以此来决定管道的气体流量。但人工操作的主要缺点就是速度慢,生产效率低。为此,本人设计了基于ATmega16单片机的气体流量控制器。它可以接收测点的输入,然后读取标准表获取实际的流量,根据实际流量和目标流量(测点流量)之间的偏差调整变频器的输出频率和步进电机的步数,最终使气体管道的流量达到测点流量。
     流量控制器的核心是单片机,它直接关系到控制器设计的可靠性、复杂性以及开发周期。选用ATmega16单片机具有很多好处。它具备1 MIPS/MHz(百万条指令每秒/兆赫兹)的高速处理能力,并具有强大的片内外设。因此,本系统虽然只进行了较少的外围电路设计却能够实现复杂的系统功能,包括变频器的数字PID控制、步进电机驱动器的控制、三个LED的显示、四个按键的输入扫描、同PC的RS232通信等。此外,ATmega16单片机更适宜用高级语言编程,从而能够大大缩短软件的开发周期。本次设计采用了ImageCraft公司的ICCAVR C语言编译器。在软件设计上,采用了时间触发嵌入式系统设计模式。先
The outputs of most sensors which are generally small voltage or current signals are nonlinear with the tested signals. So is the flow sensor in a gas flowmeter. We must scale the flowmeter before we use it. Here's a way of scaling a flowmeter. Firstly, we need to pick several flowrate samples among the range of the flowmeter to implement them one by one on the scaling platform; secondly, we record the corresponding voltage outputs of the flowmeter; finally, we make the piece-wise linearization to the outputs of the flowmeter based on its whole range and get a Flow-Voltage table, the scaling table. If we carry out a flow measurement with the flowmeter, the flowmeter will look up the scaling table according to its voltage output and get the flowrate magnitude. My work is the implementation of the selected flowrate in the air pipeline of the scaling platform through the adjustment of stepping motor and frequency-converter.
    The task used to be done by an operator before this design was accomplished. The operator uses the stepping motor to tune the valve and the frequency-converter to control the air speed in the pipeline so that he can adjust the flowrate to his destined magnitude. But there are some weaknesses in this scaling mode that the adjusting time is unbearable long and it takes the operator to do the repeated job if we need scale many flowmeters of the same type. So I designed a gas flowrate controller based on ATmegal6, a microcontroller produced by ATMEL co. of U.S.A. The controller can accept the flowrate inputs set by an operator, and then read the standard flowrate that could measure the current flowrate in a high degree of
引文
1 [美]Stuart R.Ball P.E.著,苏建平 李鹏飞 刘谦 等译.嵌入式微处理器系统设计实例(第三版)[M].北京:电子工业出版社,2004.
    2 何永泰.基于单片机ATmega128的嵌入式工业控制器设计[D].昆明理工大学.2004.
    3 李群芳,肖看.单片机原理、接口及应用——嵌入式系统技术基础[M].北京:清华大学出版社,2005.
    4 [英]Michael J.Pont著,周敏 译.时间触发嵌入式系统设计模式:使用8051系列微控制器开发可靠应用[M].北京:中国电力出版社,2004.
    5 TSI4100 Series http://www.tsi.com/Product.aspx?Pid=13
    6 SH2046M驱动器说明.http://www.houdeli.comlproducts.html
    7 ACS140 User's Guide. DataBook http://www.abb.com.cn/
    8 没有仿真器的情况下如何开发AVR.http://www.sl.com.cn/
    9 沈文,Eagle lee,詹卫前.AVR单片机C语言开发入门指导[M].北京:清华大学出版社,2003.
    10 金春林,邱慧芳,张皆喜.AVR系列单片机C语言编程与应用实例[岫.北京:清华大学出版社,2003.
    11 为何要使用C而不是汇编开发AVR.http://www.ouravr.com.cn/doc_why_c_no_asm.html
    12 马潮,詹卫前,耿德根.ATmega8原理及应用手册[M].北京:清华大学出版社,2002.
    13 [英]Michael J.Pont著,陈继辉 译.C语言嵌入式系统开发[M].北京:中国电力出版社,2003.
    14 杨宁.单片机与控制技术[M].北京:北京航空航天大学出版社,2005.
    15 葛伟亮.自动控制元件[M].北京:北京理工大学出版社,2004.
    16 康华光.电子技术基础 数字部分[M].北京:高等教育出版社,2000.46~49.
    17 康华光.电子技术基础 模拟部分[M].北京:高等教育出版社,2000.355~357.
    18 [美]Richard Barnett,Larry O’Cull,Sarah Cox著,周俊杰 译.嵌入式C编程与Atmel AVR[M].北京:清华大学出版社,2003.
    19 谢剑英.微型计算机控制技术[M].北京:国防工业出版社,1997:145-153.
    20 自制AVRISP下载型烧录器.http://www.ouravr.com/es_AVRISP_diy.html
    21 TEXAS INSTRDMENTS. 74HC244 DataBook. 2000.
    22 ANALOG DEVICES. AD8542 DataBook. 2000.
    23 杨俊春.AVR单片机中的SPI接口[J].应用科技,2005,32(2):43-46.
    24 耿德根,宋建国,马潮,叶勇建.AVR高速嵌入式单片机原理与应用[M].北京:北京航空航天大学出版社,2002:9-18.
    25 National Semiconductor. LM833 DataBook. 1997.
    26 MAXIM. MAX3232 DataBook. 1999.
    27 Burr-Brown. REF3040 DataBook. 2004.
    28 TEXAS.INSTRUMENTS. TLC5615 DataBook. 1997.
    29 TOSHIBA. TLP521-4 Databook. 1998.
    30 TEXAS INSTRUMENTS. ULN2003A DataBook. 2001.
    31 Nigel Brooke,Maxim Integrated Products,UK.乔宗标 译.串行数据标准:选择与使用.
    32 孙佳俊.基于AVR单片机控制的压力调节装置[J].山东理工大学学报(自然科学版),2004,18(2):76-80.
    33 徐熠,董德存.基于AVR的智能流量监测盒的研究[J].微型电脑应用,2005,21(6):35-37.
    34 王以伦,王洪涛,邓宝林.嵌入式C编程与AVR单片机的同步串行通信[J].中国科技信息.2005,(20)18,30.
    35 Reverter, Ferran. Uncertainty reduction techniques in microcontroller-based time measuremnts[J]. Sensors & Actuators, 2006, 127(1): 74-79.
    36 [美]迪安.K.弗雷德里克 著,张彦斌 译.反馈控制问题 使用MATLAB及其控制系统工具箱[M].西安:西安交通大学出版社,2001:48-52.
    37 林海华.基于ATmega8515L的舞蹈机器人控制系统设计与研究[D].西北工业大学.2005.
    38 李贵山,杨键平.印刷电路板设计中的抗干扰措施与电池兼容性研究[J].电子工艺技术,2001,22(6):248~251.
    39 ST, L78M05 DataBook. 2003.
    40 “我们的AVR”技术论坛.http://218.16.124.196/bbs/bbs_list.jsp?bbs_id=1000&bbs_page_no=146
    41 TEXAS INSTRUMENTS. 6N137 DataBook. 1986.
    42 ATMEL. ATmegal6 DataBook. 2001.
    43 E. J. González. A set of microprocessor-based procedures for an industrial engineering course[J]. Computer Applications in Engineering Education, 2004, 12(3): 145-151.
    44 Frédéric Boussinot. FairThreads: mixing cooperative and preemptive threads in C[J]. Concurrency and Computation: Practice and Experience, 2006, 18(5):445-469.
    45 盛文利.单片机C语言的精确延时程序设计[J].单片机与嵌入式系统应用.2004,(10):67-69.
    46 Takahiro Kawamura. Development of a distributed cooperative scheduling system based on negotiations between scheduling agents[J]. Systems and Computers in Japan, 2000, 31(1):505-513.
    47 Toshihiko Suguri. Load balancing in distributed autonomous cooperative systems[J]. Systems and Computers in Japan, 2000, 31(6):74-89.
    48 Kaushik Ghosh. Composing high-performance schedulers: a case study from real-time simulation[J]. Concurrency: Practice and Experience, 1999, 11(5):221-245.
    49 Cooling, J.E.. Languages for the programming of real-time embedded systems A survey and comparison[J]. Microprocessors and Microsystems, 1996,20(2):67-77.
    50 Eker, Johan. A flexible interactive environment for embedded controllers[J]. Control Engineering Practice, 2000, 8(2):139-146.
    51 Verber, D.. Language and compiler supported timing analysis in real-time control[J]. Control Engineering Practice, 1996, 4(10):1427-1433.
    52 Szemethy. Case Study: Model Transformations for Time-triggered Languages[J]. Electronic Notes in Theoretical Computer Science, 2006, 152(3):175-190.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700