Traditional speed measurement generally adopts the frequency measurement method or the period measurement method. Due to the inherent defects of the method itself, the traditional speed measurement system has the disadvantage of low accuracy when the frequency variation range of the measured signal is large. This paper introduces the problems existing in the traditional measurement method, analyzes how the multi-cycle synchronous frequency measurement method solves this problem, and gives a specific solution for the speed measurement system implemented by a single-chip microcomputer
, as well as the actual results of the measurement using the system. 1 Test method and test principle
1.1 Traditional measurement method
There are two traditional methods for measuring frequency: one method is the counter frequency measurement method (referred to as the frequency measurement method). This method is to add the measured frequency signal fx to the counting input of the counter, so that the counter counts within the standard time Tc1. The error mainly comes from the ±1 error caused by the counter being able to count integers. Therefore, the error caused by the direct frequency measurement method of the counter is:
The second method is the counter measurement method (referred to as the measurement method). This method sends the standard frequency signal fc2 to the counting input of the counter, so that the measured frequency signal fx controls the counting time Tz of the counter. The ±1 error generated by the counter measurement method is:
From equations (1) and (2), we can see that within the same time Tc, the ±1 error of the frequency measurement method increases as the measured frequency decreases, while the error of the period measurement method increases as the measured frequency increases. Therefore, the frequency measurement method is usually used to measure high-frequency signals, while the period measurement method is used to measure low-frequency signals. However, no matter which method is used, it can only reduce the error to a certain extent but cannot eliminate the error. Moreover, for the measured signal with a large frequency variation range, both methods cannot meet the requirements of high-precision measurement.
1.2 Multi-cycle synchronous frequency measurement method The
multi-cycle synchronous frequency measurement method developed on the basis of the direct frequency measurement method has been increasingly used in the current frequency measurement field. In the multi-cycle synchronous frequency measurement method, the gate time is not a fixed value, but an integer multiple of the measured signal period, that is, synchronized with the measured signal.
First, the gate opening signal is given by the single-chip microcomputer, but the counter does not start counting at this time. Instead, when the rising edge of the measured signal arrives and the actual gate signal synchronized with the measured signal is generated, the two sets of counters actually start counting. Two groups of counters count the measured signal and the standard frequency pulse signal respectively. When the preset gate signal is closed, the counter does not stop counting immediately, but waits until the rising edge of the measured signal reaches the meter to actually end the counting and complete a measurement process. Therefore, the actual gate time is not strictly equal to the set gate time, but the maximum difference does not exceed one cycle of the measured signal. The opening and closing of the counter is synchronized with the measured signal, that is, the gate contains an integer number of cycles of the measured signal, so there is no ±l quantization error in counting the measured signal. The frequency calculation method of the measured signal is:
Where, Nx is the count value of the measured signal; N0 is the count value of the standard signal; f0 is the frequency of the standard signal
. According to formula (3), the error generated by the multi-cycle synchronous frequency measurement method is:
From the above analysis, it can be seen that the multi-cycle synchronous frequency measurement method does not have an error in counting the measured signal. The relative measurement error is related to the frequency of the measured signal, and is only related to the gate time and the frequency of the standard frequency signal. The measurement accuracy can be improved by increasing the gate time or increasing the standard frequency signal. When the gate time and the standard frequency are determined, the relative measurement accuracy is also determined, that is, the measurement accuracy is the same in the entire frequency band of the measured signal. Therefore, the frequency measurement range is theoretically unlimited.
In summary, in order to achieve high-precision frequency measurement in the entire frequency band, the multi-cycle synchronous frequency measurement method should be used.
2 Implementation of the vehicle speed measurement system using the multi-cycle synchronous frequency measurement
method The core of the vehicle speed measurement system is the single-chip microcomputer frequency measurement module. The frequency measurement module transmits the measured signal frequency value (or vehicle speed value) to the vehicle-mounted CAN bus network in real time. The CAN bus transmits the measured frequency value (or vehicle speed value) together with other vehicle performance parameters to the host computer for real-time recording and display. The measurement circuit structure diagram is shown in Figure 1.
Figure 1 Measurement circuit structure
2.1 Implementation of single-chip frequency measurement module
This module uses Motorola M68HCl2 single-chip microcomputer. The single-chip microcomputer has standard timing module (TIM) and input capture (IC) functions. After the IC function is enabled. When the TIM module is running, the 16-bit free timer cycles according to the set clock frequency. When the set edge of a certain measured signal arrives, the input capture logic immediately captures the content of the free timer into the IC/OC register, with a resolution of up to lus or even higher, and sets the interrupt request flag. Then the software can respond to the interrupt or make a process based on the flag. Therefore, the measured frequency signal can be counted by using the capture interrupt function. At the same time, the internal clock of the single-chip microcomputer is used as the standard frequency signal, and the free timer can be used for counting. The
running timer is the core part of the TIM, and its TI operation frequency directly determines the resolution of IC/OC. The M68HCl2 single-chip microcomputer has a phase-locked loop function. Therefore, the use of the phase-locked loop function can greatly increase the frequency of the crystal oscillator inside the single-chip microcomputer, and increase it to 24MHz in actual applications, so that the frequency of the free timer reaches 12MHz.
In summary, after the measured frequency signal is amplified and shaped, it is connected to the microcontroller input capture pin PORTT0, and the measured signal is counted using the microcontroller input capture interrupt function. At the same time, the internal 12MHZ clock of the microcontroller is used as the standard frequency signal, and the timing is performed through the 16-bit free timer, so that the multi-cycle synchronous frequency measurement method can be realized. Among them, fo=12MHz, since ε=±1/f0T, this method will have a very high measurement accuracy. In addition, the microcontroller has 8 independent IC/OC channels, and the M68HCl2 microcontroller can realize the simultaneous measurement of multiple frequency signals.
2.2 System Program Design
The system program mainly includes: phase-locked loop subroutine, preset gate time subroutine, operation processing subroutine, CAN bus data transmission subroutine, etc. The program design idea and flow chart are shown in Figure 2.
3 Experimental results
The system was calibrated using a high-precision and high-stability frequency signal source, and relatively accurate measurement results were obtained. The maximum relative error of the measurement is less than 10-6. The experiment verified that the high-precision measurement of the vehicle speed measurement system within the frequency range of 10Hz to 100kHz can be ensured by adjusting the gate time length on the host computer.
In the actual experiment, an OES-11 photoelectric speed sensor was installed on the vehicle, and the output signal (frequency range within 10-35kHz) was connected to the vehicle speed measurement system. A 0-150km/h uniform speed and acceleration and deceleration experiment was carried out on the drum test bench. The experimental data was measured and recorded once every 0.5ms. The test curve is shown in Figure 3. The measurement results are consistent with the actual situation. The test results show that this system has the advantages of high measurement accuracy, large measurement range, and strong anti-interference, and is suitable for actual vehicle testing.
Figure 2 Measurement procedure flow chart
Figure 3 0-150km/h uniform speed and acceleration/deceleration experiment
4 Conclusion
Compared with the traditional frequency measurement method or period measurement method, the multi-cycle synchronous frequency measurement method can eliminate errors. It can achieve equal precision measurement in the entire frequency band. The vehicle speed measurement system designed by this method can give full play to the functional characteristics of the single-chip microcomputer itself and complete high-precision frequency measurement. At the same time, the host computer can arbitrarily control the gate time to achieve different measurement speeds and measurement accuracy requirements. It has been verified that this vehicle speed measurement system has achieved satisfactory test results with high accuracy in actual vehicle testing.
Previous article:Design of Digital Instrument for Vehicle Based on ADμC845
Next article:Realization of flow characteristic detection of electronic fuel injector
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- DSP interrupt path flow chart
- Understand low-pass, high-pass, band-pass, band-stop, and state-adjustable filters at once!
- An error occurred when updating the PCB. Please help me find out why.
- [Free trial of Pingtouge Bluetooth Mesh Gateway Development Kit] + Gateway module to cloud platform and problem solving
- 【Smart Kitchen】Environmental Sensor Schematic Design
- bq34110 cannot program parameters
- [Topmicro Intelligent Display Module Review] 7. Help with network communication issues
- Make your own wifi switch esp8266 lua development
- Bicycle modification series——by dcexpert
- Question: Which channel do you use to purchase components for your company's products?