Skip to main content

Accelerometer Usage

Usage Tutorial

Dependency Installation

Caution

Important Notes

  • If your device is running FlyOS-FAST system, the required dependencies are pre-installed, you can skip this step.
  • If using a non-FLY host computer, please ensure the following installation steps are completed.
  • It is recommended to use SSH tools like MobaXterm or PuTTY for connection before proceeding.

Installation Steps

  1. Execute the following commands in sequence to install the dependency packages.
  2. Installation time depends on CPU performance and network conditions, usually taking 10–20 minutes. Please wait patiently until installation completes.
  3. If the device has insufficient RAM, installation may fail.

Install system dependencies:

sudo apt install python3-numpy python3-matplotlib libatlas-base-dev

Install Klipper virtual environment dependencies:

~/klippy-env/bin/pip install matplotlib numpy

Accelerometer Testing

Prerequisites

  • The printer has performed Homing operations.
  • Ensure the accelerometer is correctly enabled in the Klipper configuration file.

Test Command

Enter the following command in the Klipper console:

ACCELEROMETER_QUERY

If multiple accelerometers are connected, you can specify a chip for testing:

ACCELEROMETER_QUERY CHIP=<ADXL chip name>

Replace <ADXL chip name> with the actual accelerometer identifier (e.g., adxl345).

Troubleshooting Common Issues

  1. First execution fails: Some Klipper versions may have command recognition delays. If no data is returned on the first execution, run the same command again.
  2. Command not recognized: If the command remains unrecognized after multiple attempts, it may be due to an outdated Klipper version. Suggested actions:
    • Update Klipper to the latest version
    • Or reflash the latest system version (e.g., FlyOS-FAST latest)

Result Interpretation

  • Normal output: If a continuous data stream is returned (as shown in the figure below), the accelerometer is working correctly and resonance compensation measurement can proceed.
  • Error output: If a timeout, no data, or communication error occurs, check in order:
    1. Whether the accelerometer wiring is secure
    2. Whether the sensor configuration and SPI settings in the configuration file are correct
    3. Whether the power supply is stable
Loading...

  • Note: Some older versions of Klipper require executing ACCELEROMETER_QUERY twice to retrieve acceleration values.

Accelerometer Calibration

Calibration Steps

  1. Ensure the printer has homed.
  2. Enter the following command in the console to start automatic calibration of the X and Y axes:
    SHAPER_CALIBRATE
  3. After calibration is complete, save the configuration:
    SAVE_CONFIG

Single-Axis Calibration

If you need to calibrate only a single axis, use:

SHAPER_CALIBRATE AXIS=X

Or replace X with Y.

Warning

Safety Tips

  • The printer may produce intense vibrations during calibration. If vibrations are too severe, immediately press the emergency stop button or send the M112 command for emergency stop.

Adjusting Vibration Intensity

If vibrations are too strong during testing, you can reduce the accel_per_hz parameter value (default is 75):

[resonance_tester]
accel_per_hz: 50

Note: The above steps are applicable for resonance compensation configuration in most Klipper-based 3D printers. Adjust according to your actual hardware and system environment.

Loading...