docs: document ADXL355 accelerometer support

Signed-off-by: Sven Thiele <thiele61@gmx.de>
This commit is contained in:
Sven Thiele 2026-03-02 12:42:15 +01:00
parent 966f97ecc1
commit 7bdf43e186
4 changed files with 89 additions and 15 deletions

View file

@ -345,6 +345,26 @@ and might later produce asynchronous messages such as:
The "header" field in the initial query response is used to describe
the fields found in later "data" responses.
### adxl355/dump_adxl355
This endpoint is used to subscribe to ADXL355 accelerometer data.
Obtaining these low-level motion updates may be useful for diagnostic
and debugging purposes. Using this endpoint may increase Klipper's
system load.
A request may look like:
`{"id": 123, "method":"adxl355/dump_adxl355",
"params": {"sensor": "adxl355", "response_template": {}}}`
and might return:
`{"id": 123,"result":{"header":["time","x_acceleration","y_acceleration",
"z_acceleration"]}}`
and might later produce asynchronous messages such as:
`{"params":{"overflows":0,"data":[[3292.432935,-535.44309,-1529.8374,9561.4],
[3292.433256,-382.45935,-1606.32927,9561.48375]]}}`
The "header" field in the initial query response is used to describe
the fields found in later "data" responses.
### angle/dump_angle
This endpoint is used to subscribe to

View file

@ -1836,6 +1836,35 @@ cs_pin:
# measurements.
```
### [adxl355]
Support for ADXL355 accelerometers. This support allows one to query
accelerometer measurements from the sensor. This enables an
ACCELEROMETER_MEASURE command (see [G-Codes](G-Codes.md#adxl345) for
more information). The default chip name is "default", but one may
specify an explicit name (eg, [adxl355 my_chip_name]).
```
[adxl355]
cs_pin:
# The SPI enable pin for the sensor. This parameter must be provided.
#spi_speed: 5000000
# The SPI speed (in hz) to use when communicating with the chip.
# The default is 5000000.
#spi_bus:
#spi_software_sclk_pin:
#spi_software_mosi_pin:
#spi_software_miso_pin:
# See the "common SPI settings" section for a description of the
# above parameters.
#axes_map: x, y, z
# See the "adxl345" section for information on this parameter.
#rate: 4000
# Output data rate for ADXL355. ADXL355 supports the following data
# rates: 4000, 2000, 1000, 500, 250, 125, 62.5, 31.25, 15.625,
# 7.813, and 3.906. The default is 4000.
```
### [icm20948]
Support for icm20948 accelerometers.
@ -1958,8 +1987,9 @@ section of the measuring resonances guide for more information on
# are reachable by the toolhead.
#accel_chip:
# A name of the accelerometer chip to use for measurements. If
# adxl345 chip was defined without an explicit name, this parameter
# can simply reference it as "accel_chip: adxl345", otherwise an
# an accelerometer chip was defined without an explicit name, this
# parameter can simply reference it by section name (for example,
# "accel_chip: adxl345" or "accel_chip: adxl355"), otherwise an
# explicit name must be supplied as well, e.g. "accel_chip: adxl345
# my_chip_name". Either this, or the next two parameters must be
# set.

View file

@ -71,40 +71,47 @@ modules are automatically loaded.
### [adxl345]
The following commands are available when an
[adxl345 config section](Config_Reference.md#adxl345) is enabled.
[adxl345 config section](Config_Reference.md#adxl345) or
[adxl355 config section](Config_Reference.md#adxl355) is enabled.
#### ACCELEROMETER_MEASURE
`ACCELEROMETER_MEASURE [CHIP=<config_name>] [NAME=<value>]`: Starts
accelerometer measurements at the requested number of samples per
second. If CHIP is not specified it defaults to "adxl345". The command
second. If CHIP is not specified, Klipper uses the default configured
accelerometer chip. The command
works in a start-stop mode: when executed for the first time, it
starts the measurements, next execution stops them. The results of
measurements are written to a file named
`/tmp/adxl345-<chip>-<name>.csv` where `<chip>` is the name of the
accelerometer chip (`my_chip_name` from `[adxl345 my_chip_name]`) and
`/tmp/<chip_type>-<chip>-<name>.csv` where `<chip_type>` is the
accelerometer section type (for example, `adxl345` or `adxl355`) and
`<chip>` is the name of the accelerometer chip (`my_chip_name` from
`[adxl345 my_chip_name]` or `[adxl355 my_chip_name]`) and
`<name>` is the optional NAME parameter. If NAME is not specified it
defaults to the current time in "YYYYMMDD_HHMMSS" format. If the
accelerometer does not have a name in its config section (simply
`[adxl345]`) then `<chip>` part of the name is not generated.
`[adxl345]` or `[adxl355]`) then `<chip>` part of the
name is not generated.
#### ACCELEROMETER_QUERY
`ACCELEROMETER_QUERY [CHIP=<config_name>] [RATE=<value>]`: queries
accelerometer for the current value. If CHIP is not specified it
defaults to "adxl345". If RATE is not specified, the default value is
used. This command is useful to test the connection to the ADXL345
accelerometer for the current value. If CHIP is not specified,
Klipper uses the default configured accelerometer chip. If RATE is
not specified, the default value is used. This command is useful
to test the connection to the configured
accelerometer: one of the returned values should be a free-fall
acceleration (+/- some noise of the chip).
#### ACCELEROMETER_DEBUG_READ
`ACCELEROMETER_DEBUG_READ [CHIP=<config_name>] REG=<register>`:
queries ADXL345 register "register" (e.g. 44 or 0x2C). Can be useful
queries accelerometer register "register" (e.g. 44 or 0x2C). Can be
useful
for debugging purposes.
#### ACCELEROMETER_DEBUG_WRITE
`ACCELEROMETER_DEBUG_WRITE [CHIP=<config_name>] REG=<register>
VAL=<value>`: Writes raw "value" into a register "register". Both
"value" and "register" can be a decimal or a hexadecimal integer. Use
with care, and refer to ADXL345 data sheet for the reference.
with care, and refer to the accelerometer data sheet for the reference.
### [angle]

View file

@ -1,10 +1,10 @@
# Measuring Resonances
Klipper has built-in support for the ADXL345, MPU-9250, LIS2DW and LIS3DH compatible
Klipper has built-in support for the ADXL345, ADXL355, MPU-9250, LIS2DW and LIS3DH compatible
accelerometers which can be used to measure resonance frequencies of the printer
for different axes, and auto-tune [input shapers](Resonance_Compensation.md) to
compensate for resonances. Note that using accelerometers requires some
soldering and crimping. The ADXL345 can be connected to the SPI interface
soldering and crimping. The ADXL345 and ADXL355 can be connected to the SPI interface
of a Raspberry Pi or MCU board (it needs to be reasonably fast). The MPU family can
be connected to the I2C interface of a Raspberry Pi directly, or to an I2C
interface of an MCU board that supports 400kbit/s *fast mode* in Klipper. The
@ -15,7 +15,7 @@ When sourcing accelerometers, be aware that there are a variety of different PCB
board designs and different clones of them. If it is going to be connected to a
5V printer MCU ensure it has a voltage regulator and level shifters.
For ADXL345s, make sure that the board supports SPI mode (a small number of
For ADXL345 and ADXL355 boards, make sure that the board supports SPI mode (a small number of
boards appear to be hard-configured for I2C by pulling SDO to GND).
For MPU-9250/MPU-9255/MPU-6515/MPU-6050/MPU-6500/ICM20948s and LIS2DW/LIS3DH there
@ -257,6 +257,23 @@ probe_points:
It is advised to start with 1 probe point, in the middle of the print bed,
slightly above it.
For ADXL355 over SPI on the Raspberry Pi, use the same setup with an
`[adxl355]` section:
```
[mcu rpi]
serial: /tmp/klipper_host_mcu
[adxl355]
cs_pin: rpi:None
#rate: 4000
[resonance_tester]
accel_chip: adxl355
probe_points:
100, 100, 20 # an example
```
#### Configure ADXL345 With Pi Pico
##### Flash the Pico Firmware