基于单片机和LabVIEW的电机测速系统设计
基于单片机和LabVIEW的电机测速系统设计(任务书,开题报告,论文19000字)
摘要
电机被广泛应用在各种电动设备中,是电动设备的核心部件,而转速是各类电机运行工程中的一个重要特性参数量。基于单片机对脉冲信号的强大处理能力和LabVIEW在测量领域的广泛用途,设计了电机测速系统。
首先比较当下电机测速的方法,选取了光电编码器测速法,并采用M法(测频率法)进行脉冲计数从而间接测量电机转速。然后确定单片机作为下位机和LabVIEW作为上位机的设计方案,在Proteus中选取相应的硬件进行仿真测试。在下位机设计中,通过单片机端口发出不同占空比的矩形波来精准控制电机转速,利用单片机外部中断口采集脉冲信号,并将转换得到的转速数据发送到显示部分。在上位机设计中,在实现单片机和LabVIEW串口通信后,LabVIEW处理并显示单片机发送的转速数据。LabVIEW有着强大的数据处理能力,用户可以通过它并根据需要来设计出各种仪器。最后通过分析仿真结果,验证了设计的电机测速系统可以准确测量和显示电机的转速。
关键词:单片机;LabVIEW;串口通信;转速测量
Abstract
Motor is widely used in all kinds of electric equipment, is the core component of electric equipment, and speed is an important characteristic parameter in all kinds of motor operation engineering. Based on the powerful processing ability of MCU to pulse signal and the wide application of LabVIEW in measurement field, a motor speed measurement system is designed. [资料来源:Doc163.com]
Firstly, comparing the current methods of motor speed measurement, optoelectronic encoder speed measurement method is selected, and M method (frequency measurement method) is used to count pulses to indirectly measure motor speed. Then the design scheme of MCU as slave computer and LabVIEW as upper computer is determined, and the corresponding hardware is selected in Proteus for simulation test. In the design of the lower computer, the motor speed is precisely controlled by sending rectangular waves with different duty ratios through the ports of the single chip computer, and the pulse signal is collected by the external interrupt port of the single chip computer, and the converted speed data is sent to the display part. In the design of PC, after the serial communication between MCU and LabVIEW is realized, the speed data sent by MCU is processed and displayed by LabVIEW. LabVIEW has a powerful data processing capability, through which users can design various instruments according to their needs. Finally, by analyzing the simulation results, it is verified that the designed motor speed measurement system can accurately measure and display the motor speed. [资料来源:http://doc163.com]
Key words: Microcomputer; LabVIEW;Serial Communication; Speed measurement
目录
第1章绪论 1
1.1引言 1
1.2电机测试技术发展现状 1
1.3虚拟仪器技术 3
1.4本文主要内容 5
第2章总体方案设计 6
2.1系统的总体方案 6
2.2电机间接测速方法 7
[来源:http://Doc163.com]
2.3基于脉冲计数的测速方法 10
2.3.1 M法测速 10
2.3.2 T法测速 10
2.3.3 M/T法测速 11
第3章系统硬件设计 13
3.1单片机最小系统设计 13
3.2电机驱动设计 14
3.2.1电机的选择 14
3.2.2电机的控制 17
3.3显示部分设计 19
3.3.1 LCD1602显示 19
3.3.2 LabVIEW显示 20
第4章下位机软件设计 22
4.1电机驱动模块设计 22
4.2采集功能模块设计 24
4.3串口通信模块设计 26
4.3.1串行口基本工作原理 26
4.3.2确定波特率 26
4.3.3串口通信的实现 27
第5章上位机软件设计 29
5.1串口通信模块设计 29
5.2数据显示模块设计 31
[资料来源:https://www.doc163.com]
第6章仿真测试 34
第7章结论与展望 38
参考文献 39
附录A 41
附录B 49
致谢 52
[资料来源:http://doc163.com]