# Below are my ADXL357 accelerometer reading when calculating vibrations of a engine. I have a feeling that the g is being calculated wrong

#### Master_AMbedded

Joined Dec 18, 2023
4
Hi
I am using ADXL357 accelerometer, and i am trying to record sensitivity in terms of g.
here is the algorithm for taking out raw value and calculation of g through it

sensitivity = 19.5
# Convert raw readings to acceleration in g
return (raw_reading * sensitivity) / 1000000

# Split data
xdata = (xdata1 >> 4) + (xdata2 << 4) + (xdata3 << 12)
ydata = (ydata1 >> 4) + (ydata2 << 4) + (ydata3 << 12)
zdata = (zdata1 >> 4) + (zdata2 << 4) + (zdata3 << 12)

# Apply two complement
if xdata >= 0x80000:
xdata = ~xdata + 1
if ydata >= 0x80000:
ydata = ~ydata + 1
if zdata >= 0x80000:
zdata = ~zdata + 1
# Convert raw readings to acceleration in g
acc_x = convert_to_g(xdata, sensitivity_X)
acc_y = convert_to_g(ydata, sensitivity_Y)
acc_z = convert_to_g(zdata, sensitivity_Z)
and on using this algorith, here is the plot of the acceleration in terms of FFT, RMS and with time. The mounting position of the sensor is Z-axis is perpendicular to g and X axis is aligned with the earth's gravity.
So i want to know that is this the right way, or am i doing something wrong?

#### Attachments

• 35.7 KB Views: 7
• 36.2 KB Views: 7
• 33.6 KB Views: 6
• 31.8 KB Views: 7
• 30.6 KB Views: 6
• 30 KB Views: 6

#### KeithWalker

Joined Jul 10, 2017
3,097
The FFTs look like what I would expect. I think you are doing it the right way. The offset and scale differences in the X axes of the three FFT graphs threw me for a few minutes but the data looks OK.

#### KeithWalker

Joined Jul 10, 2017
3,097
What do you have the acellerometer mounted on?

#### Master_AMbedded

Joined Dec 18, 2023
4
The FFTs look like what I would expect. I think you are doing it the right way. The offset and scale differences in the X axes of the three FFT graphs threw me for a few minutes but the data looks OK.
issue is that at different RPMs of the engine i am getting almost same FFT and ending up with almost similar RPM values whereas as the values shown by tachometer is way different.
let me share the observations with you. Also the mounting position is that X axis is facing towards the earth.
The formulae applied is (peak-reading * 60)/2
1. tachometer 700 RPM- 15.6 as per FFT hence calculated RPM is 468
2. tachometer 1500 RPM - 17.8 as per FFT, hence calculated RPM is 534
3. tachometer 1900 RPM - 15.65 as per FFT, hence calculated RPM is 470
4. tachometer 2000 RPM - 17.8 as per FFT calculation, hence calculated RPM is 534

#### Attachments

• 27.5 KB Views: 4
• 39 KB Views: 4
• 63.1 KB Views: 4
• 37.8 KB Views: 3

#### Master_AMbedded

Joined Dec 18, 2023
4
What do you have the acellerometer mounted on?
its mounted on the diesel engine of a car

#### KeithWalker

Joined Jul 10, 2017
3,097
Is the data in the G/T graphs all of the data that you are using to generate the FFTs? The first has a dc offset and the other two only show the positive values. The whole +/- AC waveform must be used, so a DC offset must be added to the AC signal before it is digitized. The offset can be subtracted during the amplitude calculations.

#### Master_AMbedded

Joined Dec 18, 2023
4
Is the data in the G/T graphs all of the data that you are using to generate the FFTs? The first has a dc offset and the other two only show the positive values. The whole +/- AC waveform must be used, so a DC offset must be added to the AC signal before it is digitized. The offset can be subtracted during the amplitude calculations.
Yes i am using all of the data being generated by the accelerometer.
Did you see the script I used above to calculate the g?
i have a feeling that the g itself is wrong

#### KeithWalker

Joined Jul 10, 2017
3,097
Yes i am using all of the data being generated by the accelerometer.
Did you see the script I used above to calculate the g?
i have a feeling that the g itself is wrong
You mention that you are using all of the accelerometer data, so why are you not displaying it all?
The frequencies observed in the FFT plot should be in direct relation to the rotational speed of the engine. I can not comment in detail because I am not aware of the FFT details and the geometry of the engine. How many cylinders does it have? Is it in-line, "V" or radial? What is the position of the three accelerometer axes relative to the cylinders and crankshaft? How accurately are you measuring the engine speed? On the G/T graphs, can you display a much shorter time sample so we can see the fundamental frequency of the data?

#### MisterBill2

Joined Jan 23, 2018
18,584
If the accelerometer is attached to some bracket part that has a strong resonance then that will be the frequency that is seen, The RPM signal may not be as strong as the resonant frequency. Or it may not be in the same axis.
If the accelerometer has a response down to zero frequency then inverting it can provide a +1 G and - 1G calibration. I always did that for reference when making recordings, back when I was a tech, Many years ago.