Acceleration to displacement data based on accelerometer
    조회 수: 7 (최근 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에서 HDL Verifier에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





