Development of vehicle speed measurement system based on multi-cycle synchronous frequency measurement method

Publisher:CyberJoltLatest update time:2016-09-25 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In the whole vehicle test experiment to evaluate the performance of the car, the speed measurement is the basis. Usually, the output signal of the speed sensor used in the whole vehicle test experiment is a frequency signal. The range is between 10Hz and 100kHz. Therefore, how to accurately measure the frequency signal in the range of 10Hz to 100kHz is an important issue in the whole vehicle test and speed measurement.

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:
1.gif 
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:
2.gif 
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:
3.gif 
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:
t.gif 
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.

t1.gif 
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.

t2.gif 
Figure 2 Measurement procedure flow chart

t3.gif 
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.
Reference address:Development of vehicle speed measurement system based on multi-cycle synchronous frequency measurement method

Previous article:Design of Digital Instrument for Vehicle Based on ADμC845
Next article:Realization of flow characteristic detection of electronic fuel injector

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号