diff options
author | Yifei Ding <dingyifeiair@gmail.com> | 2022-11-19 06:58:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-19 09:58:24 -0500 |
commit | d17ef95a3c940b674bbda91573066f20200c902d (patch) | |
tree | 3154e56892cfc299968ccd1644f3dd8aca913e32 /docs | |
parent | 8a06528747674ff06d922ba3231b080deda8d1ab (diff) | |
download | kutter-d17ef95a3c940b674bbda91573066f20200c902d.tar.gz kutter-d17ef95a3c940b674bbda91573066f20200c902d.tar.xz kutter-d17ef95a3c940b674bbda91573066f20200c902d.zip |
mpu9250: add MPU6500 (#5767)
Signed-off-by: Yifei Ding <yifeiding@protonmail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Config_Reference.md | 7 | ||||
-rw-r--r-- | docs/Measuring_Resonances.md | 99 | ||||
-rw-r--r-- | docs/img/mpu9250-PI-fritzing.png | bin | 0 -> 104964 bytes | |||
-rw-r--r-- | docs/img/mpu9250-PICO-fritzing.png | bin | 0 -> 59931 bytes |
4 files changed, 92 insertions, 14 deletions
diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 2df6ddf5..4319a056 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -1640,13 +1640,14 @@ cs_pin: ### [mpu9250] -Support for mpu9250 and mpu6050 accelerometers (one may define any -number of sections with an "mpu9250" prefix). +Support for MPU-9250, MPU-9255, MPU-9255, MPU-6050, and MPU-6500 +accelerometers (one may define any number of sections with an +"mpu9250" prefix). ``` [mpu9250 my_accelerometer] #i2c_address: -# Default is 104 (0x68). +# Default is 104 (0x68). If AD0 is high, it would be 0x69 instead. #i2c_mcu: #i2c_bus: #i2c_speed: 400000 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: + + + +#### 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) | + -Fritzing wiring diagrams for some of the ADXL345 boards: - - +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. + ### 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) diff --git a/docs/img/mpu9250-PI-fritzing.png b/docs/img/mpu9250-PI-fritzing.png Binary files differnew file mode 100644 index 00000000..4a48bb06 --- /dev/null +++ b/docs/img/mpu9250-PI-fritzing.png diff --git a/docs/img/mpu9250-PICO-fritzing.png b/docs/img/mpu9250-PICO-fritzing.png Binary files differnew file mode 100644 index 00000000..31919ca1 --- /dev/null +++ b/docs/img/mpu9250-PICO-fritzing.png |