calculate speed and distance from gear wheel pulses sensor
Ältere Kommentare anzeigen
Dear all,
I want to calculate de distance travelled and the instantaneous velocity of a vehicle. Trough a sensor and a dented gear wheel a pulse signal has been recorded. It is known that the vehicle travels 0.1092 m between 2 pulses.
The velocity varies considerably thus the pulses width vary acoordingly, and occasionally, the signal suffers from interference from another device, causing a temporary amplitude increase. A segment is exemplified in figure.1 below:

My approach so far has not fulfilled the analysis objective (distance and velocity calculation/plot).
I've tried to smooth and bandpass the signal as to get rid of HF and be able to identify each pulse as a peak, demonstrated in figure.2 below:
pulseSignalAvg = medfilt1(pulseSignal,60,'truncate');
flo=50;
fhi=210;
order=[48 48];
phase=0;
pulseSignalAvg_Bp = BANDPASS_fFP(pulseSignalAvg, flo, fhi, order, Fs, phase);
[pks,idx_pks]=findpeaks(pulseSignalAvg_Bp,'MinPeakProminence',0.01,'MinPeakDistance',300);
figure(3)
plot(pulseSignalAvg_Bp,'b-');
grid on
hold on
plot(idx_pks,pks,'rx')
plot(pulseSignalAvg,'r-');
xlabel('samples');
ylabel('Amplitude');
title ('bandpass signal Peaks');
legend('Bpass pulses','peaks','smoothed pulses');

In the figure above stretch, the approach works well. I can identify the peaks and calculate the distance, and from the samples between them calculate the velocity. Though this is possible because the velocity at the exemplified stretch is fairly constant at 80km/h, as such the parameters from findpeaks 'MinPeakProminence', 'MinPeakDistance' and bandPass choosen work well. But, for stretches of different velocities results are not suitable. Figure.3 below, shows the same bandpass and findpeaks paremeters results, but for an accelerating stretch, where no longer I could get one peak per pulse.

With this approach, finding a combination of parameters that work for variable velocities seems not achievable...I guess a different approach is required to tackle this problem.
Please find figures 1, 2 and 3 attached, as well as an example pulse signal file (.mat)
I would kindly ask the community for some tips on solving this issue.
Thank you.
regards,
- Fred
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Signal Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



