Accelerometer Usage Tutorial
Due to the hardware design of the LITE2 series, they cannot directly connect to and drive standalone SPI/I²C accelerometer modules (such as ADXL345).
If you need to use the accelerometer function on a device based on the LITE2 series, please choose one of the following two options:
| Option | Recommended Product | Connection/Description |
|---|---|---|
| 1. USB Accelerometer | FLY-USB-LIS2DW | An LIS2DW accelerometer with a USB interface, which can be used by directly plugging it into the USB port of the host computer, no need to connect to the mainboard. |
| 2. Tool Board with Built-in Accelerometer | An expansion tool board integrated with LIS2DW or ADXL345 | Communicates with the mainboard via CAN or other interfaces, where the accelerometer is recognized and utilized as part of the tool board. |
Important Reminder: Do not attempt to connect modules such as ADXL345 directly to the pins of the C8P mainboard. To ensure compatibility and normal functionality, it is recommended to use the FLY-USB-LIS2DW USB accelerometer, which is specifically designed for external accelerometers.
Dependency Installation
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
- Execute the following commands in sequence to install the dependency packages.
- Installation time depends on CPU performance and network conditions, usually taking 10–20 minutes. Please wait patiently until installation completes.
- 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
- 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.
- 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:
- Whether the accelerometer wiring is secure
- Whether the sensor configuration and SPI settings in the configuration file are correct
- Whether the power supply is stable
- Note: Some older versions of
Klipperrequire executingACCELEROMETER_QUERYtwice to retrieve acceleration values.
Accelerometer Calibration
Calibration Steps
- Ensure the printer has homed.
- Enter the following command in the console to start automatic calibration of the X and Y axes:
SHAPER_CALIBRATE
- 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.
Safety Tips
- The printer may produce intense vibrations during calibration. If vibrations are too severe, immediately press the emergency stop button or send the
M112command 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.