CN109782010B - Vehicle speed measuring method and device based on acceleration sensor - Google Patents

Vehicle speed measuring method and device based on acceleration sensor Download PDF

Info

Publication number
CN109782010B
CN109782010B CN201910170215.0A CN201910170215A CN109782010B CN 109782010 B CN109782010 B CN 109782010B CN 201910170215 A CN201910170215 A CN 201910170215A CN 109782010 B CN109782010 B CN 109782010B
Authority
CN
China
Prior art keywords
buffer
trend
data
axis
wave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910170215.0A
Other languages
Chinese (zh)
Other versions
CN109782010A (en
Inventor
胡月舟
张宇
袁协
谢飞鹏
余彦培
冯佳佳
聂敏林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Joysuch Information Technology Co ltd
Original Assignee
Suzhou Joysuch Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Joysuch Information Technology Co ltd filed Critical Suzhou Joysuch Information Technology Co ltd
Priority to CN201910170215.0A priority Critical patent/CN109782010B/en
Publication of CN109782010A publication Critical patent/CN109782010A/en
Application granted granted Critical
Publication of CN109782010B publication Critical patent/CN109782010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Vehicle Body Suspensions (AREA)

Abstract

The invention provides a vehicle speed measuring method based on an acceleration sensor, which is easy to implement, low in cost, convenient to maintain and high in reliability, does not need to know the initial speed of a vehicle, can calculate the speed at any time, and is high in accuracy; reading acceleration sensor data, performing low-pass filtering and high-pass filtering on any one of the obtained acceleration data on the X axis and the obtained acceleration data on the Y axis, and then performing smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape; and searching the number of wave crests and wave troughs in the obtained acceleration data, the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed through the rotating speed of the wheel. In addition, the invention also provides a vehicle speed measuring device based on the acceleration sensor.

Description

Vehicle speed measuring method and device based on acceleration sensor
Technical Field
The invention relates to the technical field of vehicle speed measurement, in particular to a vehicle speed measurement method and a vehicle speed measurement device based on an acceleration sensor.
Background
In some fields, such as large-scale chemical plants, in order to ensure the safety of transportation in the plant, maintain the traffic order in the plant, and prevent traffic accidents, it is necessary to perform fine management on the working vehicles, such as speed management, allowable work area management, and driver management on different working vehicles. Among them, vehicle speed management is one of the most basic functions. To manage the vehicle speed, accurate measurement of the vehicle speed is first required. The conventional vehicle speed measuring method mainly includes: the principle and the defects of the speed measuring methods are as follows:
1) the speed measurement of the coil is carried out according to the time when the vehicle passes through the parallel coil. The detection method has the defects that the construction quantity of the induction coil buried in the ground is large, the coil needs to be buried again once the road surface is changed, and in addition, the maintenance work of the coil is huge in the high-latitude freezing period, the low-latitude summer road surface and places with poor road surface quality.
2) And the video speed measurement measures and calculates the vehicle speed through the analysis of continuous video images. The method has the advantages of no restriction of road surface condition, no need of damaging the road surface during installation, or no need of embedding induction coils under the road surface. The disadvantage is that the identification of moving vehicles is difficult, and the video technology is influenced by light and weather.
3) The radar speed measurement obtains the movement speed of the measured object according to the calculation of the frequency shift quantity of the received reflected wave, and the method needs to be carried out in
4) The sound wave speed measurement is realized by sending out ultrasonic waves through an ultrasonic wave transmitting device, and the vehicle speed is calculated according to the time difference when the receiver receives the ultrasonic waves. The disadvantage is that the service life is at most a few weeks in a very dusty and harsh environment.
5) The laser speed measurement method has the advantages that laser is emitted through the laser emitting device, the vehicle speed is calculated according to the time difference of received reflected light, the vehicle can be pointed, and the defects that the laser is harmful to human eyes greatly, the safety is low, and manual operation is generally needed are overcome.
6) The GPS speed measurement is carried out on the vehicle at the vehicle speed through a GPS positioning signal, and the vehicle speed measurement method has the defects that the GPS speed measurement method can only be used in places with good GPS signals, and in addition, the GPS has large speed measurement error on vehicles running at low speed.
7) The acceleration sensor uses a linear acceleration sensor for integral speed measurement, collects the acceleration of the vehicle, and carries out integral speed calculation on the acceleration, and the defects are that the initial speed needs to be known, and the accumulated error is large.
In addition, most of the speed measurement methods need to install corresponding speed measurement equipment on a road, the equipment cost is high, and extra equipment management cost is introduced, so that the methods are more suitable for measuring the speed of the vehicles on the fixed road, and the methods are not suitable for regional vehicle speed detection management applications, such as vehicle speed management in a chemical plant.
Disclosure of Invention
In order to solve the problems, the invention provides a vehicle speed measuring method based on an acceleration sensor, which is easy to implement, low in cost, convenient to maintain, high in reliability, high in accuracy and particularly suitable for regional vehicle speed detection management, and the initial speed of a vehicle does not need to be known, and the speed can be calculated at any time.
The technical scheme is as follows: a vehicle speed measurement method based on an acceleration sensor is characterized by comprising the following steps:
step 1: the method comprises the steps that an acceleration sensor is arranged at the position of the axle center of a wheel, the axle center of the wheel is used as an original point, an X axis and a Y axis are established on a vertical plane where the acceleration sensor is located, a Z axis is perpendicular to the vertical plane where the acceleration sensor is located, and acceleration data are collected through the acceleration sensor;
step 2: reading acceleration sensor data to obtain acceleration data on an X axis and acceleration data on a Y axis, performing low-pass filtering and high-pass filtering on any one of the acceleration data on the X axis and the acceleration data on the Y axis, and then performing smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
and step 3: and (3) searching the number of wave crests and wave troughs in the acceleration data obtained in the step (2) and the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed according to the rotating speed of the wheel.
Further, step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data collected by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the acceleration sensor and a required speed measuring range;
step 202: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 203: the X-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 204: and smoothing the data obtained after the step 203 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape.
Further, step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer)
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in 304, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 307: and calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough which are screened out by the step 306, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 308: calculating the vehicle speed VX-HPF according to the wheel speed rpm and the wheel radius:
VX-HPF 2 pi r, where r is the wheel radius.
Further, step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data acquired by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the sensor and the required speed measuring range;
step 202: the Y-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
YLPF_current=α*YRAW_current+(1-α)*YLPF_previous
wherein YLPF _ current is the current Y-axis low-pass filtering data; YRAW _ CURRENT is the original data of this Y-axis sampling; YLPF _ previous is last Y-axis low-pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 203: the Y-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
YHPF_current=YRAW_current-YLPF_current
YHPF _ current is current Y-axis high-pass filtering data, YLPF _ current is current Y-axis low-pass filtering data, and YRAW _ current is current original data sampled by the Y axis;
step 204: and smoothing the data obtained after the step 203 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape.
Further, step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer)
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in 304, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 307: and (4) calculating the wheel rotating speed rpm according to the peak and trough searching results screened in the step 306, wherein the wheel rotating speed rpm is expressed as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 308: calculating the vehicle speed VY-HPF according to the wheel speed rpm and the wheel radius:
VY-HPFrpm 2 π r, where r is the wheel radius.
Further, the condition that crest, trough carry out the screening is the physical characteristics of crest, trough, include:
a) the absolute value of the acceleration value is greater than 0.5 g;
b) the interval between the wave crest and the wave trough is larger than the minimum interval, and the minimum interval is determined by the sampling rate of the sensor and the allowable maximum speed measurement range;
c) the wave trough is located between two peak waves, and the wave crest is located between two wave troughs.
Further, setting the sampling frequency to be FsampleHz, the maximum speed measurement range is V km/h, and the number of sampling points in the minimum interval is Intervalmin=3.6*π*R*FsampleV, R is the wheel radius.
And step 4, arranging a second acceleration sensor on the wheel, measuring the vehicle speed through the second acceleration sensor, and calibrating the vehicle speed obtained in the step 3.
Further, the step 4 comprises the following specific steps:
step 410: placing a second acceleration sensor at a position which is R1 away from the axle center of the wheel, establishing a coordinate system in a vertical plane, taking the axle center of the wheel as an original point, pointing the Y axis to the axle center along the vertical direction, and enabling the X axis direction to be vertical to the Y axis direction;
step 420: reading acceleration data by a second acceleration sensor, acceleration a by Y-axisYTo calculate the vehicle speed VY-LPF, expressed as follows:
acentripetal direction=aY=ω2*R1=VY-LPF2/R22*R1
Wherein, aCentripetal directionThe method comprises the steps that the centripetal acceleration is adopted, omega is the angular velocity of a wheel, V is the linear velocity of the wheel, R1 is the distance from an acceleration sensor to the axle center of the wheel, R2 is the radius of the wheel, the rotating speed of the wheel is calculated through the centripetal acceleration of the Y axis, and the speed VY-LPF is obtained;
step 430: reading acceleration data through a second acceleration sensor to obtain the acceleration number of the X axis; carrying out low-pass filtering and high-pass filtering on the acceleration data on the X axis, and then carrying out smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape; searching the number of wave crests and wave troughs in the acceleration data, the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed VX-LPF according to the rotating speed of the wheel;
step 440: and (3) calibrating the vehicle speed obtained in the step (3) through the vehicle speed VX-LPF and the vehicle speed VY-LPF to obtain a final vehicle speed Vfinal, and setting a threshold VTH (2G R2)2*R1)1/2=(2*9.8*R22*R1)1/2;
When VY-LPF is less than VTH, the final speed measurement result Vfinal is VX-LPF;
when VY-LPF > is VTH, the final speed measurement result Vfinal is (VX-HPF + VY-LPF)/2 or Vfinal is (VY-HPF + VY-LPF)/2.
Further, step 430 specifically includes the following steps:
step 4301, storing the acceleration sensor raw data acquired by the second acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the second acceleration sensor and a required speed measurement range;
step 4302: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 4303: performing high-pass filtering on the X-axis acceleration data in the buffer obtained after the step 4302, and expressing the data by using the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 4304: smoothing the data obtained in the step 4303 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
step 4305: the first order difference of the acceleration data obtained in step 4304 is calculated and expressed as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 4306: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer)
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 4307: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 4308: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 4309: traversing the Diff _ Trend _ Buffer obtained in the step 4308, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 4310: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 4311: calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough screened in the step 4310, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 4312: calculating the vehicle speed VX-LPF according to the wheel speed rpm and the wheel radius:
VX-LPF is rpm 2 pi r, where r is the wheel radius.
The utility model provides a vehicle speed measuring equipment based on acceleration sensor, its characterized in that, includes MCU, acceleration sensor, the bluetooth that the communication is connected, acceleration sensor is used for gathering the acceleration data of vehicle, MCU is used for handling acceleration data, extracts speed measurement information, calculates the speed result, and passes through the bluetooth will test the speed result broadcast, still include the battery for the power supply.
The vehicle speed measuring method based on the acceleration sensor does not need to install fixed speed measuring equipment on a road, the speed measuring device is directly installed on the wheel, the vehicle speed can be measured, the method is low in cost, easy to implement, convenient to maintain and high in reliability, the initial speed of the vehicle does not need to be known by an algorithm, the speed can be calculated at any time, the accuracy is high, and the vehicle speed measuring method based on the acceleration sensor is particularly suitable for regional vehicle speed detection management, convenient to install and use and convenient to communicate.
Drawings
Fig. 1 is a schematic diagram of the establishment of a coordinate system of a vehicle speed measurement method based on an acceleration sensor according to embodiment 1;
fig. 2 is a schematic diagram of the establishment of a coordinate system of a vehicle speed measurement method based on an acceleration sensor according to embodiment 2;
FIG. 3 is a schematic diagram of the acceleration data obtained in step 2;
fig. 4 is a frame diagram of the velocity measuring apparatus of the present invention.
Detailed Description
Specific example 1:
referring to fig. 1, the vehicle speed measuring method based on the acceleration sensor of the present invention includes the following steps:
step 1: the method comprises the steps that an acceleration sensor 1 is arranged at the position of the axle center of a wheel, the axle center of the wheel is used as an original point, an X axis and a Y axis are established on a vertical plane where the acceleration sensor is located, a Z axis is perpendicular to the vertical plane where the acceleration sensor is located, and acceleration data are collected through the acceleration sensor;
step 2: reading acceleration sensor data to obtain acceleration data on an X axis and acceleration data on a Y axis, performing low-pass filtering and high-pass filtering on any one of the acceleration data on the X axis and the acceleration data on the Y axis, and then performing smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
and step 3: and (3) searching the number of wave crests and wave troughs in the acceleration data obtained in the step (2) and the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed according to the rotating speed of the wheel.
Based on the acceleration data on the X axis, the step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data collected by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the acceleration sensor and a required speed measuring range;
step 202: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 203: the X-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 204: the data obtained after step 203 is smoothed by sliding mean filtering, so as to obtain acceleration data in a sine wave shape, as shown in fig. 3.
The step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer),
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in 304, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: the crest, the trough of looking for are screened, get rid of the error result that causes because data jitter, with final crest trough search result, including the figure of crest trough and the position save of each crest trough in the buffer, the crest, the trough carry out the physical characteristics that the condition screened is crest, trough, include:
a) the absolute value of the acceleration value is greater than 0.5 g;
b) the interval between the wave crest and the wave trough is larger than the minimum interval, and the minimum interval is determined by the sampling rate of the sensor and the allowable maximum speed measurement range;
c) the wave trough is located between two peak waves, and the wave crest is located between two wave troughs.
Setting the sampling frequency to FsampleHz, the maximum speed measurement range is V km/h, the number of sampling points in the minimum Interval is Intervalmin(ii) 3.6 × pi × R × Fsample/V, R being the wheel radius;
step 307: and calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough which are screened out by the step 306, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of peaks in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith peak in the Buffer, top _ position [0] is the first of the screened effective peaks, and top _ position [ top _ cnt-1] is the last of the screened effective peaks.
Step 308: calculating the vehicle speed VX-HPF according to the wheel speed rpm and the wheel radius:
VX-HPF 2 pi r, where r is the wheel radius.
Based on the acceleration data on the Y axis, the step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data acquired by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the sensor and the required speed measuring range;
step 202: the Y-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
YLPF_current=α*YRAW_current+(1-α)*YLPF_previous
wherein YLPF _ current is the current Y-axis low-pass filtering data; YRAW _ CURRENT is the original data of this Y-axis sampling; YLPF _ previous is last Y-axis low-pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 203: the Y-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
YHPF_current=YRAW_current-YLPF_current
YHPF _ current is current Y-axis high-pass filtering data, YLPF _ current is current Y-axis low-pass filtering data, and YRAW _ current is current original data sampled by the Y axis;
step 204: and smoothing the data obtained after the step 203 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape.
The step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer)
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in the step 304, if the Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: the crest, the trough of looking for are screened, get rid of the error result that causes because data jitter, with final crest trough search result, including the figure of crest trough and the position save of each crest trough in the buffer, the crest, the trough carry out the physical characteristics that the condition screened is crest, trough, include:
a) the absolute value of the acceleration value is greater than 0.5 g;
b) the interval between the wave crest and the wave trough is larger than the minimum interval, and the minimum interval is determined by the sampling rate of the sensor and the allowable maximum speed measurement range;
c) the wave trough is located between two peak waves, and the wave crest is located between two wave troughs.
Setting the sampling frequency to FsampleHz, the maximum speed measurement range is V km/h, the number of sampling points in the minimum Interval is Intervalmin(ii) 3.6 × pi × R × Fsample/V, R being the wheel radius;
step 307: and (4) calculating the wheel rotating speed rpm according to the peak and trough searching results screened in the step 306, wherein the wheel rotating speed rpm is expressed as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 308: calculating the vehicle speed VY-HPF according to the wheel speed rpm and the wheel radius:
VY-HPFrpm 2 π r, where r is the wheel radius.
Referring to fig. 4, the acceleration sensor in this embodiment may be implemented by relying on a speed measurement device, and includes an MCU 3, an acceleration sensor 4, and a bluetooth 5, which are in communication connection with each other, where the acceleration sensor is configured to collect acceleration data of a vehicle, the MCU 3 is configured to process the acceleration data, extract speed measurement information, calculate a speed result, and broadcast the speed measurement result through the bluetooth 5, and further includes a battery 6 and a peripheral circuit 7.
The speed measuring equipment is arranged on a wheel hub in a magnet adsorption mode, an accelerometer is ensured to be positioned in the center of the wheel during installation, the speed measuring equipment rotates along with the wheel, an X, Y shaft of the acceleration sensor is under the action of gravity and traction force in the advancing direction of a vehicle, the component of the gravity on a X, Y shaft has periodicity due to the rotation periodicity of the wheel, the rotation speed of the wheel can be obtained by calculating the periodicity of the rotation, and then the vehicle speed can be calculated according to the radius of the wheel.
Specific example 2:
in some scenes, for example, the wheels do not rotate, but in the case of vibration, the X/Y axis high-pass data of the acceleration sensor is not a sine wave, but peaks and troughs exist, and a speed measurement deviation is generated according to the algorithm, so that the speed measurement accuracy is improved by adopting the vehicle speed measurement method based on the acceleration sensor.
Referring to fig. 2, a vehicle speed measuring method based on an acceleration sensor includes the following steps:
step 1: the method comprises the following steps of (1) arranging an acceleration sensor 1 at the position of the axle center of a wheel, establishing an X axis and a Y axis on a vertical plane where the acceleration sensor 1 is arranged by taking the axle center of the wheel as an original point, arranging a Z axis perpendicular to the vertical plane where the acceleration sensor 1 is arranged, and acquiring acceleration data through the acceleration sensor 1;
step 2: reading acceleration sensor data to obtain acceleration data on an X axis and acceleration data on a Y axis, performing low-pass filtering and high-pass filtering on any one of the acceleration data on the X axis and the acceleration data on the Y axis, and then performing smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
and step 3: searching the number of wave crests and wave troughs in the acceleration data obtained in step 2, and the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the speed of the vehicle according to the rotating speed of the wheel;
and 4, arranging a second acceleration sensor 2 on the wheel, measuring the vehicle speed through the second acceleration sensor 2, and calibrating the vehicle speed obtained in the step 3.
Based on the acceleration data on the X axis, the step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data collected by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the acceleration sensor and a required speed measuring range;
step 202: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 203: the X-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 204: and smoothing the data obtained after the step 203 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape.
The step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer),
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in 304, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: the crest, the trough of looking for are screened, get rid of the error result that causes because data jitter, with final crest trough search result, including the figure of crest trough and the position save of each crest trough in the buffer, the crest, the trough carry out the physical characteristics that the condition screened is crest, trough, include:
a) the absolute value of the acceleration value is greater than 0.5 g;
b) the interval between the wave crest and the wave trough is larger than the minimum interval, and the minimum interval is determined by the sampling rate of the sensor and the allowable maximum speed measurement range;
c) the wave trough is located between two peak waves, and the wave crest is located between two wave troughs.
Setting the sampling frequency to FsampleHz, maximum velocity measurement range V km/h, minimum Intervalmin(ii) 3.6 × pi × R × Fsample/V, R being the wheel radius;
step 307: and calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough which are screened out by the step 306, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of peaks in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith peak in the Buffer, top _ position [0] is the first of the screened effective peaks, and top _ position [ top _ cnt-1] is the last of the screened effective peaks.
Further, the step 4 comprises the following specific steps:
step 410: placing a second acceleration sensor at a position which is R1 away from the axle center of the wheel, establishing a coordinate system in a vertical plane, taking the axle center of the wheel as an original point, pointing the Y axis to the axle center along the vertical direction, and enabling the X axis direction to be vertical to the Y axis direction;
step 420: reading acceleration data by a second acceleration sensor, acceleration a by Y-axisYTo calculate the vehicle speed VY-LPF, expressed as follows:
acentripetal direction=aY=ω2*R1=VY-LPF2/R22*R1
Wherein, aCentripetal directionFor centripetal acceleration, ω is wheel angular velocity, V is wheel linear velocity, R1 is the distance of the acceleration sensor from the wheel axis, R2 is the wheel radius, the X, Y axis of the acceleration sensor is subject to gravity and vehicle forward direction traction, while the Y axis is also subject to centripetal force of wheel rotation. When the rotating speed of the wheel exceeds a certain range, the action of the centripetal force is far greater than the action of gravity and the traction force in the advancing direction of the vehicle, and the rotating speed of the wheel is calculated through the centripetal acceleration of the Y axis to obtain the vehicle speed VY-LPF.
Step 430: reading acceleration data through a second acceleration sensor to obtain the acceleration number of the X axis; carrying out low-pass filtering and high-pass filtering on the acceleration data on the X axis, and then carrying out smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape; and searching the number of wave crests and wave troughs in the acceleration data, the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed VX-LPF according to the rotating speed of the wheel.
Step 430 is specifically as follows:
step 4301, storing the acceleration sensor raw data acquired by the second acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the second acceleration sensor and a required speed measurement range;
step 4302: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency;
step 4303: performing high-pass filtering on the X-axis acceleration data in the buffer obtained after the step 4302, and expressing the data by using the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 4304: smoothing the data obtained in the step 4303 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
step 4305: the first order difference of the acceleration data obtained in step 4304 is calculated and expressed as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 4306: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer)
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 4307: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 4308: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 4309: traversing the Diff _ Trend _ Buffer obtained in the step 4308, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 4310: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 4311: calculating the wheel rotating speed rpm according to the peak and trough searching result screened in the step 4309, which is expressed as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 4312: calculating the vehicle speed VX-LPF according to the wheel speed rpm and the wheel radius:
VX-LPF is rpm 2 pi r, where r is the wheel radius.
Step 440: and (3) calibrating the vehicle speed obtained in the step (3) through the vehicle speed VX-LPF and the vehicle speed VY-LPF to obtain a final vehicle speed Vfinal, and setting a threshold VTH (2G R2)2*R1)1/2=(2*9.8*R22*R1)1/2;
When VY-LPF is less than VTH, the final speed measurement result Vfinal is VX-LPF;
when VY-LPF > is VTH, the final speed measurement result Vfinal is (VX-HPF + VY-LPF)/2.
The vehicle speed measuring method based on the acceleration sensor directly installs the speed measuring equipment on the vehicle to be measured, has simple and flexible use method, does not need to install the speed measuring equipment on the road, and has low cost;
according to the vehicle speed measuring method based on the acceleration sensor, the speed is calculated in a mode that the acceleration sensor measures the rotating speed of the wheel, compared with the mode that the speed is calculated by an acceleration integral algorithm, the vehicle speed measuring method based on the acceleration sensor is wider in application range, and even if the vehicle speed measuring method is in uniform motion, the vehicle speed can be tested. In addition, the algorithm for calculating the speed by using the acceleration integral needs an initial speed, if the initial speed is not correct, the speed measurement error is caused, and the algorithm designed by the invention has no problem.

Claims (10)

1. A vehicle speed measurement method based on an acceleration sensor is characterized by comprising the following steps:
step 1: the method comprises the steps that an acceleration sensor is arranged at the position of the axle center of a wheel, the axle center of the wheel is used as an original point, an X axis and a Y axis are established on a vertical plane where the acceleration sensor is located, a Z axis is perpendicular to the vertical plane where the acceleration sensor is located, and acceleration data are collected through the acceleration sensor;
step 2: reading acceleration sensor data to obtain acceleration data on an X axis and acceleration data on a Y axis, performing low-pass filtering and high-pass filtering on any one of the acceleration data on the X axis and the acceleration data on the Y axis, and then performing smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
and step 3: and (3) searching the number of wave crests and wave troughs in the acceleration data obtained in the step (2) and the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed according to the rotating speed of the wheel.
2. The method for measuring the speed of the vehicle based on the acceleration sensor as claimed in claim 1, wherein the step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data collected by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the acceleration sensor and a required speed measuring range;
step 202: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency; step 203: the X-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 204: and smoothing the data obtained after the step 203 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape.
3. The method for measuring the speed of the vehicle based on the acceleration sensor as claimed in claim 2, wherein the step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer),
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula: diff _ Trend _ Buffer [ i ] ═ Trend _ Buffer [ i +1] -Trend _ Buffer [ i ]
Wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in 304, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 307: and calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough which are screened out by the step 306, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 308: calculating the vehicle speed VX-HPF according to the wheel speed rpm and the wheel radius:
VX-HPF 2 pi r, where r is the wheel radius.
4. The method for measuring the speed of the vehicle based on the acceleration sensor as claimed in claim 3, wherein the step 2 comprises the following steps:
step 201, storing the acceleration sensor raw data acquired by an acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the sensor and the required speed measuring range;
step 202: the Y-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
YLPF_current=α*YRAW_current+(1-α)*YLPF_previous
wherein YLPF _ current is the current Y-axis low-pass filtering data; YRAW _ CURRENT is the original data of this Y-axis sampling; YLPF _ previous is last Y-axis low-pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency; step 203: the Y-axis acceleration data in the buffer obtained after step 202 is high-pass filtered and represented by the following formula:
YHPF_current=YRAW_current-YLPF_current
YHPF _ current is current Y-axis high-pass filtering data, YLPF _ current is current Y-axis low-pass filtering data, and YRAW _ current is current original data sampled by the Y axis;
step 204: and smoothing the data obtained after the step 203 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape.
5. The method for measuring the speed of the vehicle based on the acceleration sensor as claimed in claim 4, wherein the step 3 comprises the following steps:
step 301: calculating the first order difference of the acceleration data obtained in step 2, and expressing the first order difference as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 302: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer),
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 303: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 304: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 305: traversing the Diff _ Trend _ Buffer obtained in 304, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 306: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 307: and calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough which are screened out by the step 306, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 308: calculating the vehicle speed VY-HPF according to the wheel speed rpm and the wheel radius:
VY-HPFrpm 2 π r, where r is the wheel radius.
6. The method for measuring the speed of a vehicle based on an acceleration sensor according to claim 3 or 5, characterized in that: the condition that crest, trough carry out the screening is the physical characteristics of crest, trough, include:
a) the absolute value of the acceleration value is greater than 0.5 g;
b) the interval between the wave crest and the wave trough is larger than the minimum interval, and the minimum interval is determined by the sampling rate of the sensor and the allowable maximum speed measurement range;
c) the wave trough is positioned between the two peak waves, and the wave peak is positioned between the two wave troughs;
setting the sampling frequency to FsampleHz, the maximum velocity measurement range Vkm/h, the number of sampling points in the minimum Interval is Intervalmin=3.6*π*R*FsampleV, R is the wheel radius.
7. The method for measuring the speed of a vehicle based on an acceleration sensor according to claim 3 or 5, characterized in that: and 4, arranging a second acceleration sensor on the wheel, measuring the vehicle speed through the second acceleration sensor, and calibrating the vehicle speed obtained in the step 3.
8. The method for measuring the speed of the vehicle based on the acceleration sensor as claimed in claim 7, wherein: the step 4 comprises the following specific steps:
step 410: placing a second acceleration sensor at a position which is R1 away from the axle center of the wheel, establishing a coordinate system in a vertical plane, taking the axle center of the wheel as an original point, pointing the Y axis to the axle center along the vertical direction, and enabling the X axis direction to be vertical to the Y axis direction;
step 420: reading acceleration data by a second acceleration sensor, acceleration a by Y-axisYTo calculate the vehicle speed VY-LPF, expressed as follows:
acentripetal direction=aY=ω2*R1=VY-LPF2/R22*R1
Wherein, aCentripetal directionThe method comprises the steps that the centripetal acceleration is adopted, omega is the angular velocity of a wheel, V is the linear velocity of the wheel, R1 is the distance from an acceleration sensor to the axle center of the wheel, R2 is the radius of the wheel, the rotating speed of the wheel is calculated through the centripetal acceleration of the Y axis, and the speed VY-LPF is obtained;
step 430: reading acceleration data through a second acceleration sensor to obtain the acceleration number of the X axis; carrying out low-pass filtering and high-pass filtering on the acceleration data on the X axis, and then carrying out smoothing processing by adopting sliding mean filtering to obtain acceleration data in a sine wave shape; searching the number of wave crests and wave troughs in the acceleration data, the positions of the wave crests, the wave troughs and the positions in the data to calculate the rotating speed of the wheel, and calculating the vehicle speed VX-LPF according to the rotating speed of the wheel;
step 440: and (3) calibrating the vehicle speed obtained in the step (3) through the vehicle speed VX-LPF and the vehicle speed VY-LPF to obtain a final vehicle speed Vfinal, and setting a threshold VTH (2G R2)2*R1)1/2=(2*9.8*R22*R1)1/2
When VY-LPF is less than VTH, the final speed measurement result Vfinal is VX-LPF;
when VY-LPF > is VTH, the final speed measurement result Vfinal is (VX-HPF + VY-LPF)/2 or Vfinal is (VY-HPF + VY-LPF)/2.
9. The method for measuring the speed of the vehicle based on the acceleration sensor as claimed in claim 8, wherein: step 430 is specifically as follows:
step 4301, storing the acceleration sensor raw data acquired by the second acceleration sensor into a buffer, wherein the length of the buffer is determined according to the sampling rate of the second acceleration sensor and a required speed measurement range;
step 4302: the X-axis acceleration data in the buffer is low-pass filtered and is represented by the following equation:
XLPF_current=α*XRAW_current+(1-α)*XLPF_previous
wherein, XLPF _ current is the X-axis low-pass filtering data of this time; XRAW _ current is the original data of the X-axis sampling; XLPF _ previous is the last X-axis low pass filtered data; α is a low-pass filter coefficient, 0< α <1, α ═ t/(t + dT); t is a filter time constant and is the single sampling time of the acceleration sensor, and dT is the sampling frequency; step 4303: performing high-pass filtering on the X-axis acceleration data in the buffer obtained after the step 4302, and expressing the data by using the following formula:
XHPF_current=XRAW_current-XLPF_current
wherein, XHPF _ current is the X-axis high-pass filtering data of this time, XLPF _ current is the X-axis low-pass filtering data of this time, and XRAW _ current is the original data of the X-axis sampling of this time;
step 4304: smoothing the data obtained in the step 4303 by adopting sliding mean filtering to obtain acceleration data in a sine wave shape;
step 4305: the first order difference of the acceleration data obtained in step 4304 is calculated and expressed as the following formula:
Diff_Buffer[i]=Buffer[i+1]-Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 4306: the sign-taking operation is performed on the first-order difference data Diff _ Buffer, and is expressed as the following formula:
Trend_Buffer=sign(Diff_Buffer),
the first-order difference data Diff _ Buffer is represented as traversal, and if Diff _ Buffer [ i ] >0, Trend _ Buffer [ i ] ═ 1; if Diff _ Buffer <0, Trend _ Buffer [ i ] ═ 1, otherwise Trend _ Buffer [ i ] ═ 0;
step 4307: traversing Trend _ Buffer in a reverse order, and if Trend _ Buffer [ i ] <0 and Trend _ Buffer [ i +1] >0, Trend _ Buffer [ i ] < 1; if Trend _ Buffer [ i ] ═ 0 and Trend _ Buffer [ i +1] <0, Trend _ Buffer [ i ] ═ 1;
step 4308: calculating the first-order difference of Trend _ Buffer, namely Diff _ Trend _ Buffer, and expressing the difference as the following formula:
Diff_Trend_Buffer[i]=Trend_Buffer[i+1]-Trend_Buffer[i]
wherein i belongs to 1,2, …, N-1, N is the length of the buffer;
step 4309: traversing the Diff _ Trend _ Buffer obtained in the step 4308, if Diff _ Trend _ Buffer [ i ] is-2, then i +1 is a peak value, and the corresponding peak value is Buffer [ i +1 ]; if Diff _ Trend _ Buffer [ i ] is 2, i +1 is a valley bit, and the corresponding valley is Buffer [ i +1 ];
step 4310: screening the found wave crests and wave troughs, removing error results caused by data jitter, and storing final wave crest and wave trough searching results including the number of the wave crests and the wave troughs and the positions of the wave crests and the wave troughs in the buffer;
step 4311: calculating the rpm of the wheel according to the searching result of the wave crest and the wave trough screened in the step 4310, and expressing the rpm as the following formula:
rpm=(top_cnt-1)*SAMPLE_RATE/(top_position[top_cnt-1]-top_position[0])
wherein, top _ cnt is the number of wave crests in the Buffer, SAMPLE _ RATE is the sampling RATE of the acceleration sensor, top _ position [ i ] is the position of the ith wave crest in the Buffer, top _ position [0] is the first of the screened effective wave crests, and top _ position [ top _ cnt-1] is the last of the screened effective wave crests;
step 4312: calculating the vehicle speed VX-LPF according to the wheel speed rpm and the wheel radius:
VX-LPF is rpm 2 pi r, where r is the wheel radius.
10. A speed measuring device is characterized in that: the vehicle speed measurement method comprises an MCU, an acceleration sensor and a Bluetooth, wherein the MCU, the acceleration sensor and the Bluetooth are in communication connection, the acceleration sensor is used for collecting acceleration data of a vehicle, the MCU is used for processing the acceleration data, the vehicle speed measurement method of claim 1 is adopted, speed measurement information is extracted, a speed result is calculated, and the speed measurement result is broadcasted through the Bluetooth.
CN201910170215.0A 2019-03-07 2019-03-07 Vehicle speed measuring method and device based on acceleration sensor Active CN109782010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910170215.0A CN109782010B (en) 2019-03-07 2019-03-07 Vehicle speed measuring method and device based on acceleration sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910170215.0A CN109782010B (en) 2019-03-07 2019-03-07 Vehicle speed measuring method and device based on acceleration sensor

Publications (2)

Publication Number Publication Date
CN109782010A CN109782010A (en) 2019-05-21
CN109782010B true CN109782010B (en) 2021-07-30

Family

ID=66486698

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910170215.0A Active CN109782010B (en) 2019-03-07 2019-03-07 Vehicle speed measuring method and device based on acceleration sensor

Country Status (1)

Country Link
CN (1) CN109782010B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114354968A (en) * 2021-12-29 2022-04-15 北京瑞普云智物联科技有限公司 Roller rotating speed measuring method and information statistical system
CN114264839A (en) * 2021-12-30 2022-04-01 燕山大学 Rotating body rotating speed measuring method applying accelerometer
CN114735013B (en) * 2022-04-26 2024-06-04 深蓝汽车科技有限公司 Method and system for extracting vehicle speed curve of typical working condition of whole vehicle, vehicle and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4748303B2 (en) * 2005-05-17 2011-08-17 横浜ゴム株式会社 Vehicle travel speed measuring method and apparatus
JP4930356B2 (en) * 2007-12-14 2012-05-16 横浜ゴム株式会社 Rotation speed detection system
CN101655504B (en) * 2009-09-09 2011-06-15 中国科学院电工研究所 Vehicle speed estimation method of motor vehicle self-adaption cruise system
CN108445250B (en) * 2017-02-16 2021-03-30 上海汽车集团股份有限公司 Vehicle speed detection method and device
CN109387657A (en) * 2017-08-09 2019-02-26 比亚迪股份有限公司 Full attitude transducer and vehicle
CN108583170B (en) * 2018-05-23 2021-01-05 浙江吉利汽车研究院有限公司 Tire self-positioning system and method

Also Published As

Publication number Publication date
CN109782010A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
CN109782010B (en) Vehicle speed measuring method and device based on acceleration sensor
CN102069824B (en) Positioning device and method for rail traffic vehicle
Alessandroni et al. Smartroadsense: Collaborative road surface condition monitoring
CN101923782B (en) Method for acquiring transportation traffic speed based on geomagnetic sensing technology
CN105446336A (en) Robot inspection system and inspection method for cold region transformer substation
WO2016188363A1 (en) Road condition physical information drawing and inquiring method based on electronic map
CN106871924A (en) A kind of VMT Vehicle-Miles of Travel computational methods based on satellite positioning signal
US9842438B1 (en) Mileage and speed estimation
CN111127906B (en) Intelligent road surface management system and method based on Internet of things
CN111582160B (en) Vehicle track extraction method and device based on distributed optical fiber sensing system
CN103465938A (en) Fast and accurate positioning device and method for railway transit vehicles
CN111252110B (en) Track beam detection system and detection method for straddle type single-track inspection vehicle
CN209961329U (en) Vibration detection system for road condition analysis
CN111979859B (en) Track irregularity detection system and method
CN103290768A (en) Flatness Measuring Instrument and Measuring Method
CN105509668B (en) Track wave grinds detection system
CN207891697U (en) Highway subgrade based on Ground Penetrating Radar detects vehicle
CN110952427A (en) Modularized intelligent road sensing equipment and system based on driving feeling
US11276255B2 (en) Mileage and speed estimation
Chen et al. Real-time road pothole mapping based on vibration analysis in smart city
CN111751629B (en) Highway ETC performance short-term test car system
CN101788288A (en) Positioning system and positioning method for pavement cracks
JP3748420B2 (en) FCD system and apparatus using beacon
CN105629328A (en) Vehicle-mounted South Pole inland ice-covered surface landforms characteristic monitoring device
CN211734979U (en) Modularized intelligent road sensing equipment based on driving feeling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant