Displacements from acceleration: newmark methods--> Displacements too high!

Hi, i have Acceleration data from accelerometers and i want to have displacements and velocity, i used Newmark methods. Displacements are too high (final instant, 200 m)!!! What's wrong? Period goes to 0 sec to 600 sec, delta_t=0.005 sec.
Acc=load('File.txt'); na=size(Acc,2) V1=zeros(size(Acc,1),na); %metodo differenze centrali S1=zeros(size(Acc,1),na);
V2=zeros(size(Acc,1),na); %metodo accelerazione media S2=zeros(size(Acc,1),na);
V3=zeros(size(Acc,1),na); %metodo accelerazione lineare S3=zeros(size(Acc,1),na);
gamma1= 0.5; %metodo differenze centrali gamma2=0.5; %metodo accelerazione media
beta1=0; %metodo differenze centrali beta2=0.25; %metodo accelerazione media
dt1=dt=0.005 %sec
for j=1:size(Acc,2) for i=2:size(t,1) V1(i,j)=V1(i-1,j)+(1-gamma1)*dt1*Acc(i-1,j)+gamma1*dt1*Acc(i,j); S1(i,j)=S1(i-1,j)+dt1*V1(i-1,j)+0.5*(dt1)^2*((1-2*beta1)*Acc(i-1,j)+2*beta1*Acc(i,j));
V2(i,j)=V2(i-1,j)+(1-gamma2)*dt1*Acc(i-1,j)+gamma2*dt1*Acc(i,j);
S2(i,j)=S2(i-1,j)+dt1*V1(i-1,j)+0.5*(dt1)^2*((1-2*beta2)*Acc(i-1,j)+2*beta2*Acc(i,j));
V3(i,j)=V3(i-1,j)+dt1*0.5*(Acc(i-1,j)+Acc(i,j));
S3(i,j)=S3(i-1,j)+dt1*V3(i-1,j)+0.5*(dt1^2)*(2/3*Acc(i-1,j)+1/3*Acc(i,j));
end
end

5 Comments

hello again
you have to be aware of what you are doing and the limitations of naive double integration
no sensor and data acquisition are perfect , so they all have non linearity , drift, offset, etc...
first question is : do you intend to have "accurate" static displacement values from an accelerometer that is not calibrated ? how do you ensure that DC and AC response of your sensor are accurate enough - in the meaning the measured output reflect accurately the physical effect ?
any slight DC offset that is not compensated will cause a drift in the velocity signal , and even more drift in the displacement signal;
so if you only want the "dynamic" displacement, you can always remove the low frequency / DC portion of the signal by using high pass filters and / or detrend, but of course this method cannot be used if you have a DC capable accelerometer and you want also the DC displacement; in that case only a good sensor and good calibration can help you reduce the amount of drift but some drift will be anyway present, it's just a matter of time
beside that , you can compare the result of your code (if you're unsure) with cumtrapz
see for example :
Thank you for the reply
Could i ask to you why fc = 0.1/30? what frequences i'm cutting with fc=1?
and what is the difference between:
1) [B,A]= butter(N,2*fc/f,'High');
2) [B,A]= butter(N,fc,'High'); (Error using butter (line 62)
The cutoff frequencies must be within the interval of (0,1). if fc=1 with the 2))
hello
see the doc for butter
digital filters cut off frequencies are normalised by the Nyquist frequency , which is half of the sampling rate Fs
so if you want a low pass at fc =100 Hz, with Fs = 1000, you must pass the normalized cut off freq = 100*2/1000 = 0.2
Thank you ! So, with the code you linked to me, i cut frequencies with values under 1 (inferior limit)(for example)? And if i would like tu cut frequencies above 3hz? (superior limit)
hello
sure you can change the values as soon as you follow the rules given above
be sure that the high pass filter cut off frequency is not too high otherwise you will start loosing some useful low frequency signal. therefore it's always good to make a fft analysis of the accel signal first and look at the spectral content, put the high pass filter not in the frequncy range where the signal has a strong amplitude

Sign in to comment.

Answers (0)

Asked:

on 10 Oct 2022

Commented:

on 13 Oct 2022

Community Treasure Hunt

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

Start Hunting!