Saturday, February 5, 2022

Design of high-precision speed measurement circuit based on Hall sensor

Design a wide-range high-precision speed measurement circuit; through the analysis and comparison of three commonly used speed measurement methods. It is determined that the M method and the M/T method are used for speed measurement, which theoretically guarantees the wide range and high accuracy of speed measurement; for simple, fast and accurate speed measurement in circuit design, a hardware switching circuit is used to complete the two speed measurement methods. Overcome the defect of real-time control deterioration caused by the heavy workload of software switching: the off-chip counter 8253 is used to make up for the shortage of 8051 hardware resources, and the Hall element is used to complete the conversion from rotating speed to rotating pulse. Achieved low cost and high performance.

Abstract: Design a wide-range high-precision speed measurement circuit; through the analysis and comparison of three commonly used speed measurement methods. It is determined that the M method and the M/T method are used for speed measurement, which theoretically guarantees the wide range and high accuracy of speed measurement; for simple, fast and accurate speed measurement in circuit design, a hardware switching circuit is used to complete the two speed measurement methods. Overcome the defect of real-time control deterioration caused by the heavy workload of software switching: the off-chip counter 8253 is used to make up for the shortage of 8051 hardware resources, and the Hall element is used to complete the conversion from rotating speed to rotating pulse. Achieved low cost and high performance.

0 Preface

In today’s high-speed rail and subway booming, in order to ensure the safe operation of trains, higher requirements for train operation control are put forward. To safely control a high-speed train, it is necessary to accurately detect the real-time speed of the train.

1 Comparison of speed measurement methods

Various methods can be adopted to detect the running speed of the train. Among them, the detection of the wheel shaft speed is one of the most commonly used methods to detect the running speed of the train. The pulse counting method can be used to detect the rotation speed of the rotating device. In the pulse counting method, one or more fixed pulses can be generated as long as the wheel axle rotates one circle. The rotation pulse is sent to the microprocessor for counting, combined with the arithmetic processing of the software, the rotation speed information can be measured.

The key to the pulse counting method is how to accurately count pulses. There are 3 commonly used methods, namely M method, T method and M/T method.

1.1 M method speed measurement

The M method is the frequency measurement method. The M method is to detect the number of rotation pulses M1 within the specified time T to indirectly measure the speed p Hu, as shown in Figure 1 (a), the calculation formula of the speed N is:

Design of high-precision speed measurement circuit based on Hall sensor

Where n is the number of pulses generated per rotation of the wheel axle.

The detection time of this counting method is a fixed value T. Due to the randomness of the detection start and end time, it will cause an error of ±1 rotation pulse in extreme cases. Therefore, the number of rotation pulses generated at a higher speed or one revolution is more in the case of. The measurement accuracy is high. Therefore, the M method is suitable for detecting high-speed rotating objects.

1.2 T method speed measurement

The T method is the measurement period method. The T method is to measure the time interval between two adjacent rotation pulses, that is, the period of the rotation pulse, and the speed is calculated indirectly by the T method.

The usual method is to count the known high-frequency time-base pulses in one cycle of the rotation pulse, as shown in Figure 1(b), and then calculate the rotation speed of the measured object by formula (2).

Design of high-precision speed measurement circuit based on Hall sensor

In formula (2), N is the rotation speed of the measured object, and n is the number of pulses generated per rotation of the wheel axle. Factory is the frequency of the known high-frequency pulse, and is the number of high-frequency time base pulses contained in one rotation pulse period.

The T method speed measurement is to count the known high-frequency time base pulses within one rotation pulse period, and in extreme cases it will also produce an error of ±1 high-frequency time base pulses.

The T method is used to measure speed, the higher the speed, the greater the measurement error, therefore, the T method is suitable for low-speed detection.

1.3 M/T method

The M/I. method is to measure both the number of rotation pulses M1 and the number of known high-frequency time base pulses within the detection time T, and then calculate the rotation speed of the measured object by formula (3).

Design of high-precision speed measurement circuit based on Hall sensor

The M/T method is a combination of the M method and the T method. In the process of speed measurement, the rotation pulse and the high frequency time base pulse are counted due to the cycle time. As long as “simultaneity” is handled properly. Both high-speed and low-speed detection have high detection accuracy, but this method has a reasonable choice of detection time T. If the detection time T is too small, the speed will be mistakenly measured as 0 at low speed. If T is too large, the speed cannot be measured quickly, which affects the real-time performance of the speed measurement.

In summary, the M method is suitable for detecting high-speed rotating objects, and the T-law is suitable for detecting low-speed rotating objects. The M/I method combines the advantages of the M method and the T method. Theoretically, the speed measurement range is wide, but in actual operation, the selection of the detection time T is a difficult point. The detection time is the selection of the sampling period T, which directly affects the accuracy of the speed measurement. Therefore, it is necessary to measure the speed reliably and accurately in a wide range to avoid false detection of 0 at low speed. The T method and the M/I. method can be combined, that is, the T method is used for speed measurement at low speeds. In the middle and high speeds, the threat T is used for speed measurement.

2 Speed ​​measurement module design

2.1 Module composition

The high-precision, wide-range speed measurement module based on Hall sensors is shown in Figure 2. Select Hall element for speed sensor. The Hall element has many advantages such as small size, light weight, no contact, simple peripheral circuit, wide frequency response, good dynamic performance, long life, and convenient debugging. Therefore, the Hall element is used to convert the wheel shaft speed into a series of rotating pulses. Signal, the speed is proportional to the number of rotation pulse signals.

Design of high-precision speed measurement circuit based on Hall sensor

Through the comparison of different rotational speed pulse measurement methods. Determine the speed measurement method that combines T method and M/T. To ensure a wide range of high-precision speed measurement. The switching between the T method and the M/T method is completed by a hardware switching circuit. The hardware switching circuit generates a gate control signal for controlling the counter in the 8253 under the combined action of the sampling pulse generated by the single-chip microcomputer and the rotation pulse generated by the Hall element. Ensure that the M/T method is used for speed measurement at medium and high speeds, and the T method for speed measurement at low speeds.

The speed measurement system requires a timer to generate sampling pulses and high-frequency time base pulses, and two counters are required to count the high-frequency time base pulses and rotation pulses respectively. There are only two timing counters in 8051, so this system expands a piece of 8253 counting chip, 8051 To is used as a timer, combined with the cycle subroutine to generate sampling pulses and high-frequency time base pulses, and 8253 in the 8051 and hardware switching circuit Under the control of, its O and 1 counters respectively complete the counting function of high-frequency time base pulse and rotation pulse.

2.2 Hardware design

1) Hall switch circuit

A44E is a switching Hall element, its working voltage is 4.5~18 V, its output signal conforms to the 7-element L level standard, and the highest speed measurement frequency is 1 MHz. A44E has 3 pins. The first pin is connected to the power supply. Pin 2 is the ground pin, and pin 3 is the output pin. The Hall test circuit is shown in Figure 3. The rotation pulse output from its 3 pins is sent to the hardware switching circuit and the counter gate control signal of the counter 1 clock of the 8253 and the clock signal of the counter 1 respectively.

Design of high-precision speed measurement circuit based on Hall sensor

2) Hardware switching circuit

The function of the hardware switching circuit is to complete the automatic switching between the two measurement methods. The control relationship of the hardware switching circuit is shown in Figure 4, and the specific hardware circuit is detailed in Reference 5. P1.O outputs a high level at the output sampling pulse. And when the rising edge of the rotation pulse arrives, the hardware switching circuit outputs a high level, controls the gate control terminals of the O and 1 counters of 8253, and starts the counter to start counting; when P1.0 outputs a low level and there is a rotation pulse When the rising edge comes, the switching circuit outputs a low level, the gate control signal of 8253 is invalid, and the counting stops. At the same time, the hardware switching circuit generates an interrupt request signal. After receiving the interrupt request, the 8051 reads the counting results of the two counters in the 8253, and Use equation (3) to calculate the speed. This circuit can ensure that a complete rotation pulse and the number of high-frequency time base pulses in this rotation pulse period are measured at low speed. The 8051 still uses formula (3) to calculate the speed, but at this time elbow l = l, formula (3 ) It is exactly the same as formula (2), and the T method is used to measure the speed.

Design of high-precision speed measurement circuit based on Hall sensor

3) Control of 8253 by 805l

8051 controls 8253 as shown in Figure 5. T0 of 805l is used as a timer, and high-frequency clock pulse is output at I/O port P1.1 and sent to counter 0 of 8253 as a clock signal; T0 is combined with a cycle subroutine, and sampling pulse is output at I/O port P1.O. To the switching circuit, and the rotation pulse jointly control the hardware switching circuit to generate a gating signal to start or stop the O,l two counters of 8253: 8051 TD controls 8253 TJD, when TD is low. 8051 reads the counting results of the two counters of 8253. The i Sui of 8051 controls the Li of 8253. When the i side is low, the 8051 writes the value into the 8253 counter; use I/O port P2.7.

P2.6 controls the port control selection signal A1A0 of the 8253, which controls the read and write operations of the O, 1, and 3 counters and the control word register in the 8253. In this design, only the 0, 1 counters of the 8253 are used. When AlA0=00, read and write the counter 0 of the 8253 under the control of the read and write signal, A1A0=Ol, read and write the counter 1 of the 8253 under the control of the read and write signal; P2.0 controls the chip select terminal of the 8253 CS.

Design of high-precision speed measurement circuit based on Hall sensor

2.3 Software design

Figure 6 shows the measurement process of the rotation speed based on the 8051 off-chip count.

Design of high-precision speed measurement circuit based on Hall sensor

3 Conclusion

The speed measurement system designed in this paper adopts the combination of the T method and the M/T method, which avoids the problem of low speed misdetection of zero or poor real-time performance caused by improper selection of the measurement time T in the M/T method. The method guarantees a wide range of accurate speed measurement. The switching of the speed measurement method adopts hardware switching. It overcomes the shortcomings of software switching that the real-time control deteriorates due to the heavy workload of the software. The use of Hall sensors to generate rotating pulses has the advantages of low cost, high performance, and strong anti-interference ability.

The Links:   LFH8P4032B M150XN07-V5

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.