Microcontroller in the application of motor speed measuring instrument

The single-chip microcomputer is the main part of the whole measurement system and is responsible for the processing and calculation of the front-end pulse signal, and the synchronization and timing of the signal. Secondly, after the measured data is calculated, the obtained speed value is transmitted to the display interface. Digital display value. In this system, the counting range, the timing used, the number of counters, and I/O lines are taken into account .

The four basic steps that motor speed measurement needs to pass are: 1 is the control mode; 2 is the determination counting mode; 3 is the signal input mode; 4 is the reading of the count value; Determination of speed frequency.

The measurement process is that the hall sensor for measuring the rotation speed is coaxially connected with the motor shaft. Each revolution of the shaft generates a certain number of pulses and is output by the Hall device circuit. Become count pulse of revolution counter. At the same time, the Hall sensor circuit output pulse of 12V is photoelectrically coupled and then reduced to 5V, keeping the same logic level of the AT89C51 microcontroller, and controlling the counting time, the counting value of the counter can correspond to the rotation speed of the shaft. The main CPU processes the value data and displays it on the digital tube. The system uses the 0INT interrupt in the 89C51 to count the speed pulses. Timer T0 works in timing mode and works in mode 1. Every 1s reads the external interrupt 0INT count value, this value is the frequency of the pulse signal, can calculate the rotational speed of the electrical machinery.

When the DC motor rotates through the drive section with a disk, the Hall sensor obtains a series of pulse signals based on the magnetic disk on the disk. These pulse signals are counted by the microcontroller system timer/counter 0INT, timer T0 timing. The timer T0 completes 100 times of the overflow interrupt time T divided by the measured pulse number m. After unit conversion, the speed of the DC motor rotation can be calculated. Then determine whether to start the system for measurement. If so, start the system operation. If not, wait for startup. After starting the system, after the hall sensor detects the arrival of the pulse, an external interrupt is initiated, and each pulse is interrupted once, and the number of pulses is recorded. At the same time, start the T0 timer and interrupt it once every 1 second to read the number of recorded pulses, that is, the motor speed. Sample three times in a row and take the average value as one rotation speed value. The value is judged again. If the value is higher than 5000rpm, it will alarm and return to the initialization stage. Otherwise, it will display the normal speed digital tube.

The one-chip computer rotational speed measurement is completed, the timer T0 serves as the internal timer, when the external interrupt comes, reads TH0, TL0, simultaneously clears TH0, TL0 at the same time, causes the timer to cycle the internal pulse again. In addition, for the low speed case, we also set a software counter VTT, when the external interrupt has not yet come and the internal timer has overflowed, when the timer 0 interrupt is generated, increase VTT as the high byte of the three bytes. Divide by three bytes, the above constant is four bytes, so the calculation program is actually calling a four-byte program with two bytes divided by three bytes. For the digital tube to be able to display it, it is necessary to convert the binary number to decimal number. After the decimal number is converted to the uncompressed BCD code, the table look-up procedure can be invoked, and finally the display is sent. SCM speed calculation program Because the function of the system designed this time is to send the Hall sensor signal to the external interrupt port of the SCM, and then perform internal counting of the periodic square wave, call the calculation program to measure the speed. It can be said to be the core part .

Special Casting

Eccentric Shaft Casting,Balance Shaft Parts,Balance Shaft Assembly,Crank Shaft Comp For Balance Shaft Engine

Taizhou Hongxiang Power Machinery Co.,Ltd , https://www.tzhxcamshaft.com