how to convert a accelerometer data to displacements

28 次查看(过去 30 天)
I have an accelerometer data which i have collected from gyroscope. I like to convert those acceleration to displacements as disturbances for calculating the dynamics of suspension. The problem is when i tried to convert the acceleration data to displacement by using two integrators in series the displacement data seems non realistic. In actual acceleration data i found there are decelerations as well but in displacement output i see all positive values. Please suggest me some techniques.......
  4 个评论
Mahshid karimi
Mahshid karimi 2015-4-2
How we can do spotting any trends in FFT peaks as a "function" of water depth Using function command?

请先登录,再进行评论。

采纳的回答

Dr. Seis
Dr. Seis 2011-10-6
Doing this sort of conversion is best done in the frequency domain. This should work now. Two things weren't working before:
1. Before I defined N as "nextpow2(N1)" instead of "2^nextpow2(N1)
2. I forgot to handle the case where f(i) = 0, we cannot divide by 0 !!
function disp_time_data = acc2disp(acc_time_data,dt)
% acc_time_data should be acceleration amplitudes evenly spaced in time
% dt in units of seconds per sample
N1 = length(acc_time_data);
N = 2^nextpow2(N1);
if N > N1
acc_time_data(N1+1:N) = 0; % pad array with 0's
end
df = 1 / (N*dt); % frequency increment
Nyq = 1 / (2*dt); % Nyquist frequency
acc_freq_data = fftshift(fft(acc_time_data));
disp_freq_data = zeros(size(acc_freq_data));
f = -Nyq:df:Nyq-df; % I think this is how fftshift organizes it
for i = 1 : N
if f(i) ~= 0
disp_freq_data(i) = acc_freq_data(i)/(2*pi*f(i)*sqrt(-1))^2;
else
disp_freq_data(i) = 0;
end
end
disp_time_data = ifft(ifftshift(disp_freq_data));
disp_time_data = disp_time_data(1:N1);
return
Try my sine wave example:
dt = 0.01; % seconds per sample
N = 512; % number of samples
t = 0 : dt : (N-1)*dt; % in seconds
wave_freq = 1; % in Hertz
acc_time_data = sin(2*pi*wave_freq*t);
The numerical answer obtained should be close to the analytical result by double-integrating by hand, i.e.:
disp_time_data_analytical = -1/(2*pi*wave_freq)^2*sin(2*pi*wave_freq*t);
The difference comes from the fact that we are chopping off the sine wave abruptly. You will notice that the "true" answer is super-imposed on a low-frequency sine wave - this is why it may be important to run a high-pass filter on the displacement result. It is possible to avoid this by removing any trend from the data, tapering each side of your timeseries down to 0, and then padding each side evenly with 0's (up to the next power of 2) before "converting" from acceleration to displacement.
  11 个评论
John
John 2018-2-14
I believe you need to set disp_freq_data(1) to zero also.
MANTHAN SHAH
MANTHAN SHAH 2022-6-28
Hello Dr. Seis, Thanks for answering this. I appreciate your efforts towards the community. I am new with Matlab and working with vibrational data too. I was wondering how to tune the displacement data we get? As the output from this code is completely different from what it supoosed to be.

请先登录,再进行评论。

更多回答(1 个)

Fangjun Jiang
Fangjun Jiang 2011-10-6
There is really no solution for this problem except that you need to check the quality of your accelerometer signal data. Is it noisy?
You can make up an ideal acceleration signal first and feed that signal to you double-integrator model to verify that you have everything right, for example, sample time, initial value, coefficient, etc.
  14 个评论
Mohamed Sayed
Mohamed Sayed 2013-12-3
could you please re-share the uploaded file again with us, as i think the (4shared) link you are sharing is expired. thanks in advance.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by