Acceleration to displacement data based on accelerometer
4 ビュー (過去 30 日間)
古いコメントを表示
Hi,
Can anyone help to guide me on how to find the displacement value based on the acceleration result from accelerometer ? I already try to use several method that have been found but it seems not provide the good result and not understand much the given method. The attach excel file is acceleration output value from a wheel that have rotation of 400 rpm and my previous code that I used.
Thanks in advance !
num=csvread("Book5.csv");
Fn = Fs/2;
Tr = linspace(num(1,1), num(1,end), size(num,1));
Dr = resample(num(:,2), Tr);
Dr_mc = Dr - mean(Dr,1);
FDr_mc = fft(Dr_mc, [], 1);
Fv = linspace(0, 1, fix(size(FDr_mc,1)/2)+1)*Fn;
Iv = 1:numel(Fv);
figure
plot(Fv, abs(FDr_mc(Iv,:))*2)
grid
xlabel('Frequency (Hz)')
ylabel('Amplitude')
0 件のコメント
回答 (1 件)
Chunru
2023 年 4 月 12 日
編集済み: Chunru
2023 年 4 月 12 日
num=readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1352749/Book5.csv");
head(num);
% initialize the velocity and position
v0 = [0 0 0];
s0 = [0 0 0]; % 3d
vt = v0 + cumtrapz(num{:, 1}, num{:, 2:end});
st = s0 + cumtrapz(num{:, 1}, vt);
whos
plot3(st(:,1), st(:,2), st(:,3), 'r.')
box on; grid on;
xlabel("x"); ylabel("y"); zlabel("z")
figure
plot(num{:, 1}, num{:, 2:end})
figure
plot(num{:, 1}, st);
figure;
plot(num{:, 1}, vt);
mean(num{:, 2:end}, 'omitnan')
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Propagation and Channel Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!