ADXL345 Data Reading and Saving in .csv file

Basic Information:

Printer Model: Creality K1

Hi everyone,

I am a young mechanical engineer, owner of a Creality K1.
During my studies, I came across a course on dynamic FEM analysis, and seeing the x- and y-axis problems of the K1, I decided to study it as an exam project.
I should recreate the FEM model of the core x-y structure and then perform a modal and dynamic analysis of it.

To do this I would need to somehow derive time acceleration data from the ADXL345 mounted in the printhead, and then use it as an excitation time history for my FEM model, so as to compare the simulative data obtained with the frequency response function coming out of the printer.

For the part of reading and saving the data coming from the ADXL345, however, I don’t know where to go from here; I’ve seen that it communicates in CAN-BUS with the MCU to execute the input shaper, and I’ve also read a bit of python scripts found in the printer’s /usr/share/klipper/klippy folder, but I haven’t been able to get anything yet.

If any of you have already done something like this (I mean reading and saving the raw accelerometer data) I would be grateful if you could help me out, even by sending an example script (that reads the data in a certain time window and saves it to a .csv file).

Thanks in advance to anyone who would like to help me!

With the already built-in capabilities, you have two options:

Option 1:

TEST_RESONANCES AXIS=X OUTPUT=raw_data

This will perform the regular resonance measurement and output its result also as CSV

Option 2:

ACCELEROMETER_MEASURE CHIP=...

This will start a generic measurement cycle. Replace “…” with your IMU device.
Now perform any movements / tests you want to do. Finally, end the measurement cycle with the following command:

ACCELEROMETER_MEASURE CHIP=... NAME=blabla

Replace “blabla” with the filename, under which you want to save your data

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.