Step 14.12 — Bring up the on-board accelerometer¶
Step 12 of 36 with a helper · Chapter 14 — Calibration and tuning
(no image — see text)
Parts: none.
Do: Check both Python environments. SHAPER_CALIBRATE runs inside Klipper's own klippy-env, and the graph script at 14.14 runs on the Pi's system Python:
~/klippy-env/bin/python -c 'import numpy'
python3 -c 'import numpy, matplotlib'
Check
ACCELEROMETER_QUERY returns three axis values with roughly 9800, free-fall in mm/s², on one of them, and MEASURE_AXES_NOISE returns figures in the ~1–100 range.
Helper Reads the MEASURE_AXES_NOISE figures aloud and checks each one is under 100.
What you're looking at
Now, and not before — the machine has printed successfully, the belts are at final tension, and the frame has been hot.
The ADXL345 is an accelerometer: a chip that measures how hard it is being shaken, in three axes. On this build it is soldered onto the toolboard itself, so there is nothing to mount and nothing to wire.
On a MainsailOS image both print nothing and return: it installs numpy into klippy-env, and numpy and matplotlib system-wide. klippy-env has no matplotlib, so never test for it there. If the first errors, ~/klippy-env/bin/pip install numpy; if the second errors, sudo apt install python3-numpy python3-matplotlib libopenblas-dev. That is what MainsailOS itself runs. Do not copy Klipper's numpy<1.26 pin or its libatlas-base-dev on a Trixie image: the pinned numpy does not support Trixie's Python 3.13, and libatlas-base-dev was merged into libopenblas-dev and no longer exists. src · MainsailOS
Then confirm — do not edit — that the 350 mm probe point in [resonance_tester] is live; Ch 12 Step 12.27 uncommented it and Checkpoint 12 required it (the stock config ships all three build sizes commented out):
[adxl345]
cs_pin: nhk:PB10
spi_software_sclk_pin: nhk:PA5
spi_software_mosi_pin: nhk:PA2
spi_software_miso_pin: nhk:PA6
[resonance_tester]
accel_chip: adxl345
accel_per_hz: 100
sweeping_accel: 400
sweeping_period: 0
probe_points:
175, 175, 20
Then ACCELEROMETER_QUERY and MEASURE_AXES_NOISE (no restart needed — nothing was edited).
Tip
1000 or more from MEASURE_AXES_NOISE means a sensor, power or wiring problem, or a badly imbalanced fan. On Invalid adxl345 id, run it again; SPI init is flaky on the first attempt.
Caution
Rev D+ / LDO: The accelerometer is on the Nitehawk-SB V2 board itself. There is no separate ADXL345 breakout and no printed ADXL mount to fit — the V1 documentation's ADXL mount does not apply to this kit (survey §4.1). The [adxl345] pins above are already correct in leviathan-printer-rev-d-sbv2.cfg; if yours read nhk:gpio21/18/20/19 you are on the V1 config.
Good stopping point · ~15 min since the last one
accelerometer answers, noise is in the 1–100 band, and the 350 mm [resonance_tester] probe point is confirmed live. Nothing has been shaped yet.
Source: Klipper docs § Installation instructions · MainsailOS modules/generic/50-klipper · Klipper docs § Checking the setup · leviathan-printer-rev-d-sbv2.cfg · Klipper docs § ACCELEROMETER_QUERY · Video: Extras! @0:42:02