基于单片机的转速测量系统 下载本文

内容发布更新时间 : 2024/7/1 7:55:00星期一 下面是文章的全部内容请认真阅读。

摘 要

本论文介绍了一种基于AT89C51单片机平台,采用光电传感器进行电机转速测量的方法,介绍了该测速法的基本原理、实现步骤和软硬件设计。为了设计简单可靠的直流电机测速装置,提出了基于单片机为核心的电机转速测量系统。整个系统的构架包括转速信号的采集,光电转换及信号处理电路设计,整形驱动电路设计,复位电路设计,晶振电路设计,LED显示电路设计。整形放大电路主要是将传感器输出的不稳定的电信号转化成脉冲信号; 转速的计算利用单片机AT89C51 的定时器和计数器。根据系统编写源程序,并通过运行试验证明。该系统结构简单,测量结果稳定可靠,满足电机的测速要求。

关键词:转速测量;单片机;光电传感器;电机

I

Abstract

This paper introduces a platform based on AT89C51, adopt the method of photoelectric sensor to implement motor speed measurement, introduces the basic principle of the speed measuring method, implementation steps and the hardware and software design. In order to design a simple and reliable device for dc motor speed estimation, motor speed measurement system based on single chip microcomputer as the core is put forward. The architecture of the whole system including the speed signal acquisition, rotation speed signal processing, speed calculation and display. Plastic amplifying circuit is mainly the sensor output with outside noise of the unstable signal into pulse signal; Rotational speed of the calculation of AT89C51 single-chip timer and counter. Write the source program according to the system, and by running the experiment proved that the system has simple structure, stable and reliable measurement results, satisfy the requirement of the motor speed.

Keywords:Speed measurement; Single chip microcomputer; Photoelectric sensor;

The motor

II

目 录

1 概述 .......................................................... 1 1.1数字化转速测量系统的发展背景............................... 2 1.2 本设计课题的目的和意义 .................................... 2 2 转速测量系统的原理与方法 ...................................... 3 2.1转速测量原理............................................... 3 2.2转速测量方法............................................... 3 3 系统方案提出和论证 ............................................ 5 3.1方案设计................................................... 5 3.2系统原理................................................... 5 4 系统硬件设计 .................................................. 7 4.1 转速信号采集 .............................................. 7 4.2光电转换及信号处理电路设计................................. 8

4.2.1整形驱动电路设计 ...................................... 9 4.3单片机AT89C51介绍......................................... 9 4.4 最小系统的设计 .......................................... 11

4.4.1复位电路设计 ......................................... 11 4.4.2 晶振电路设计......................................... 13 4.5显示部分电路设计.......................................... 14 5 系统软件设计 ................................................. 16 5.1 主程序初始化 ............................................. 16 5.2主程序流程图子程序流程图.................................. 16 5.3系统总程序................................................ 17 总 结............................................................ 20 参考文献......................................................... 21 致 谢............................................................ 22

1