Simulation of Motor Speed ​​Measurement System Based on AT89C51 Single Chip Microcomputer

Publisher:脑力激荡Latest update time:2017-09-02 Source: elecfansKeywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The simulation system of the single-chip microcomputer motor speed measurement system uses the T1 counter in the single-chip microcomputer to count the speed pulses. Timer T1 works in the external event counting mode to count the speed pulses; T0 works in the timer mode. The count value is read once every 1 s. This value is the frequency of the pulse signal. According to formula (1), the speed of the motor can be calculated. The software system of the speed detection device mainly includes: the speed measurement main program, the data processing subroutine and the display subroutine. After the single-chip microcomputer is powered on, the system enters the ready state. First, it is initialized, then the pulse data is read for calculation, and the speed is displayed on the LCD. Enthusiasts who need this simulation and C language program can learn from the website in the upper left corner of the article picture.

Simulation of Motor Speed ​​Measurement System Based on AT89C51 Single Chip Microcomputer

The simulation of the single-chip microcomputer motor speed measurement system adopts the frequency measurement method "M method" to measure the motor speed. That is, within a certain measurement time T, the number of pulses m1 generated by the pulse generator (instead of the input pulse) is measured to measure the speed. The calculation formula is as follows: n=60m/TP, where: P-is the number of pulses generated by the pulse generator when the shaft rotates one circle; n-speed unit: (r/min); T-timing time unit: (seconds). In this method, the measurement accuracy is due to the fact that the timing time T and the pulse cannot be guaranteed to be strictly synchronized, and whether the complete cycle of the external pulse can be measured within T, which may cause a quantization error of one pulse. Therefore, in order to improve the measurement accuracy, T must be long enough. The timing time can be pre-set according to the measurement object. If the setting time is too long, the accuracy can be improved, but in the case of faster speed, the number of pulses counted increases (when the number of code disk holes is fixed), which limits the range of speed measurement. If the setting time is too short, the measurement accuracy will be affected to a certain extent.

Software design ideas for the speed part: The P3.5 port of the AT89S52 microcontroller receives the signal from the sensor. The circuit consists of a display circuit, an AT89S52 microcontroller, a microcontroller clock circuit, a reset circuit, etc. The interrupt service program INT0, the software needs to solve the counting of the timer T0 and the coordination of the external counter T1. Since the speed range of the measurement is large, both low speed and high speed must be taken into account. The software workflow: The sensor detects the number of pulses of the motor turning one turn, which is sent to the microcontroller by the P3.5 port of the microcontroller, and counted by the internal counter T1 of the microcontroller. When the counting is started, a signal TR0=1 is sent. When the internal timer T0 starts, TH0 and TL0 are set to 0.


Keywords:AT89C51 Reference address:Simulation of Motor Speed ​​Measurement System Based on AT89C51 Single Chip Microcomputer

Previous article:Digital tube display 51 single chip microcomputer DS18B20 temperature measurement source program and simulation
Next article:AT89C51 single chip DC motor PWM speed control program

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号