摘 要
随着单片机技术的日新月异,使得许多控制功能及算法可以采用软件技术来完成,为直流电动机的控制提供了更大的灵活性,并使系统能达到更高的性能。采用单片机构成控制系统,可以节约人力资源和降低系统成本,从而有效的提高工作效率,可以实现复杂的控制,控制灵活性和适应性好,无零点漂移,控制精密高,可提供人机界面,多机联网工作。
本文通过按键及上位机输入电动机的转速,输入后单片机能够根据PID控制算法控制电动机的速度稳定在该速度值运行,且能够通过数码管实时显示当前的速度值;通过上位机界面实时绘制电动机当前的转速曲线;PID控制算法的参数能够通过按键及上位机界面进行设定;设计串口通信程序;基于LabWindows/CVI进行上位机界面设计,要求:(1)能够对转速及各种控制参数进行设定;(2)能够绘制电机转速的实时速度曲线。
关键词:直流电机;单片机;软件设计
Abstract
With the microcontroller technology advances, makes a number of control functions and algorithms software technology, provides greater flexibility for DC motor control, and the system can achieve higher performance. Using single-chip computer control system can save human resources and reduce system cost, so as to effectively improve work efficiency can be achieved complex control, control flexibility and adaptability, no zero drift control precision high, man-machine interface, multi-machine networking.
Button and enter the motor speed of the host computer, enter the microcontroller PID control algorithm to control motor speed stability in the value of the speed run through the digital real-time display of the current speed value; through the PC interface, real-time rendering motor currentthe speed curve; PID control algorithm parameters can be set through the key and the PC interface; design serial communication program; based on LabWindows / CVI host computer interface design requirements: (1) speed and various control parameters setbe; (2) be able to draw the curve of the the motor speed real-time speed.
Keywords: DC motor; microcontroller; software design
目 录
摘 要 I
Abstract II
1绪论 III
1.1研究背景及意义 III
1.2国内外研究现状 IV
1.5系统设计内容 V
2系统方案设计 V
2.1系统的设计要求及主要技术指标 V
2.2系统总体方案 VI
2.3总体方案论述 VI
3系统软件上机位设计 VII
3.1上机位设计 VII
3.2各模块程序说明 IX
3.2.1温度采集模块 IX
3.2.2电动机转速及转向控制模块 X
3.2.3温度显示模块 XII
结 论 XIV
参考文献 XV
致 谢 XVI
附录A系统总程序 XVII
附录B系统仿真图 XXVI