# how to measure the displacement with accelerometer with Daq?

2 views (last 30 days)
Ali Albaidhani on 17 Mar 2022
Commented: Ali Albaidhani on 21 Mar 2022
Hello everyone,
I'm trying to measure the displacement with an acceleromter that is connected to a daq-Device. My Daq device does not support "accelerometer" measuerment and i can only measure "voltage" with it, so i have to acquire the input-signal with a charge amplifier. Im using Charge amplifier Type 2635 from Brühl & Kjaer, to amplify the signal and plot it on Matlab. im Using transducer Sens. of 1 pC/m/s^2, with output gain of 100 mV/Unit. However, im not getting the right Values for the acceleration. Im also using cumtrapz to calculate the velocity and the displacement.
Here is my code on how i read the input signal:-
%-------------------------------
clear all;
clc;
addinput(dq, "Dev2", "ai11", "Voltage");
dq.Rate = 1000;
data = readwrite(dq, 3000); %Here im trying to let the signal run for 3 secs.
a=data.Dev2_ai11 *(1/100); % here i multiply the input signal with 1/(output gain) to get the acceleration
v=cumtrapz(a);
d=cumtrapz(v);
figure(1)
clf
subplot(311)
plot(data.Time, a);
subplot(312)
plot(data.Time, v);
subplot(313)
plot(data.Time, d);
%-------------------------------
Please tell me what im doing wrong or if there any other suggestion to solve this problem.
Regards
Ali
##### 2 CommentsShow NoneHide None
Mathieu NOE on 18 Mar 2022
Edited: Mathieu NOE on 18 Mar 2022
hello Ali
a few points :
1/ make sure that you have taken into account the DAQ "gain" that is what you get (in your file) vs what your analog signal amplitude (before it's sampled by the ADC). A simple test is to record a sine wave of known amplitude (like 1 volt peak) and see what you have from your file.
2/ when you do the integration with cumtrapz , you should not forget the sampling increment dt = 1/ dq.Rate
so it should be :
v=cumtrapz(dt,a);
d=cumtrapz(dt,v);
3/ does your displacement task involve the static or only the dynamic portion from the accel signal ? as far I can see here, you have picked a piezo accel which is only able to deliver an AC signal (ne DC signal can be generated from piezo accel, only mems or DC capable accel will give you a DC output).
in short : a piezo accel is not the right choice if you are willing to measure "true" displacement (DC + AC signal)
Ali Albaidhani on 21 Mar 2022
hello Mathieu,
You are right about the piezo accel. The problem here is that my DAQ-Device does not support ac coupling. It only measures DC Signals.
Is it possible to program the device in a way to make it able to measure AC signals?

### Categories

Find more on National Instruments Frame Grabbers in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!