aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Measuring_Resonances.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/Measuring_Resonances.md')
-rw-r--r--docs/Measuring_Resonances.md99
1 files changed, 88 insertions, 11 deletions
diff --git a/docs/Measuring_Resonances.md b/docs/Measuring_Resonances.md
index 7f41bd4d..ba9ad3e9 100644
--- a/docs/Measuring_Resonances.md
+++ b/docs/Measuring_Resonances.md
@@ -18,6 +18,31 @@ that it has a voltage regulator and a level shifter.
### Wiring
+An ethernet cable with shielded twisted pairs (cat5e or better) is recommended
+for signal integrety over a long distance. If you still experience signal integrity
+issues (SPI/I2C errors), shorten the cable.
+
+Connect ethernet cable shielding to the controller board/RPI ground.
+
+***Double-check your wiring before powering up to prevent
+damaging your MCU/Raspberry Pi or the accelerometer.***
+
+#### SPI Accelerometers
+
+Suggested twisted pair order:
+
+```
+GND+MISO
+3.3V+MOSI
+SCLK+CS
+```
+
+##### ADXL345
+
+
+**Note: Many MCUs will work with an ADXL345 in SPI mode(eg Pi Pico), wiring and
+configuration will vary according to your specific board and avaliable pins.**
+
You need to connect ADXL345 to your Raspberry Pi via SPI. Note that the I2C
connection, which is suggested by ADXL345 documentation, has too low throughput
and **will not work**. The recommended connection scheme:
@@ -31,25 +56,46 @@ and **will not work**. The recommended connection scheme:
| SDA | 19 | GPIO10 (SPI0_MOSI) |
| SCL | 23 | GPIO11 (SPI0_SCLK) |
-An alternative to the ADXL345 is the MPU-9250 (or MPU-6050). This
-accelerometer has been tested to work over I2C on the RPi at 400kbaud.
-Recommended connection scheme for I2C:
+Fritzing wiring diagrams for some of the ADXL345 boards:
+
+![ADXL345-Rpi](img/adxl345-fritzing.png)
+
+#### I2C Accelerometers
+
+Suggested twisted pair order:
+
+```
+3.3V+SDA
+GND+SCL
+```
+
+##### MPU-9250/MPU-9255/MPU-6515/MPU-6050/MPU-6500
+
+Alternatives to the ADXL345 are MPU-9250/MPU-9255/MPU-6515/MPU-6050/MPU-6500.
+These accelerometers have been tested to work over I2C on the RPi or RP2040(pico)
+at 400kbaud.
+
+Recommended connection scheme for I2C on the Raspberry Pi:
| MPU-9250 pin | RPi pin | RPi pin name |
|:--:|:--:|:--:|
-| 3V3 (or VCC) | 01 | 3.3v DC power |
+| VCC | 01 | 3.3v DC power |
| GND | 09 | Ground |
| SDA | 03 | GPIO02 (SDA1) |
| SCL | 05 | GPIO03 (SCL1) |
+![MPU-9250 connected to RPI](img/mpu9250-PI-fritzing.png)
-Fritzing wiring diagrams for some of the ADXL345 boards:
-
-![ADXL345-Rpi](img/adxl345-fritzing.png)
+Recommended connection scheme for I2C(i2c0a) on the RP2040:
+| MPU-9250 pin | RP2040 pin | RPi pin name |
+|:--:|:--:|:--:|
+| VCC | 39 | 3v3 |
+| GND | 38 | Ground |
+| SDA | 01 | GP0 (I2C0 SDA) |
+| SCL | 02 | GP1 (I2C0 SCL) |
-Double-check your wiring before powering up the Raspberry Pi to prevent
-damaging it or the accelerometer.
+![MPU-9250 connected to PICO](img/mpu9250-PICO-fritzing.png)
### Mounting the accelerometer
@@ -96,10 +142,13 @@ Afterwards, check and follow the instructions in the
[RPi Microcontroller document](RPi_microcontroller.md) to setup the
"linux mcu" on the Raspberry Pi.
+#### Configure ADXL345 With RPi
+
Make sure the Linux SPI driver is enabled by running `sudo
raspi-config` and enabling SPI under the "Interfacing options" menu.
-For the ADXL345, add the following to the printer.cfg file:
+Add the following to the printer.cfg file:
+
```
[mcu rpi]
serial: /tmp/klipper_host_mcu
@@ -115,9 +164,12 @@ probe_points:
It is advised to start with 1 probe point, in the middle of the print bed,
slightly above it.
-For the MPU-9250, make sure the Linux I2C driver is enabled and the baud rate is
+#### Configure MPU-6000/9000 series With RPi
+
+Make sure the Linux I2C driver is enabled and the baud rate is
set to 400000 (see [Enabling I2C](RPi_microcontroller.md#optional-enabling-i2c)
section for more details). Then, add the following to the printer.cfg:
+
```
[mcu rpi]
serial: /tmp/klipper_host_mcu
@@ -132,6 +184,28 @@ probe_points:
100, 100, 20 # an example
```
+#### Configure MPU-6000/9000 series With PICO
+
+PICO I2C is set to 400000 on default. Simply add the following to the
+printer.cfg:
+
+```
+[mcu pico]
+serial: /dev/serial/by-id/<your PICO's serial ID>
+
+[mpu9250]
+i2c_mcu: pico
+i2c_bus: i2c1a
+
+[resonance_tester]
+accel_chip: mpu9250
+probe_points:
+ 100, 100, 20 # an example
+
+[static_digital_output pico_3V3pwm] # Improve power stability
+pin: pico:gpio23
+```
+
Restart Klipper via the `RESTART` command.
## Measuring the resonances
@@ -158,6 +232,9 @@ is some other ID, it is indicative of the connection problem with ADXL345,
or the faulty sensor. Double-check the power, the wiring (that it matches
the schematics, no wire is broken or loose, etc.), and soldering quality.
+**If you are using MPU-6000/9000 series accelerometer and it show up as `mpu-unknown`, use with
+caution! They are probably refurbished chips!**
+
Next, try running `MEASURE_AXES_NOISE` in Octoprint, you should get some
baseline numbers for the noise of accelerometer on the axes (should be
somewhere in the range of ~1-100). Too high axes noise (e.g. 1000 and more)