1 / 5
Case for Adafruit QT PY RP2040 and Seeed XIAO RP2040 (for ADXL345) — zdjęcie 1
1 / 5

Case for Adafruit QT PY RP2040 and Seeed XIAO RP2040 (for ADXL345)

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

This is a case for the small RP2040 boards to use them with an ADXL345 for Klipper Resonance Compensation.

Ocena
5 / 5
Polubienia
73
Pobrania
723
Wydruki
4
Wyświetlenia
5190
Oceny
3

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
Accessories
Licencja
Creative Commons — Attribution

Case for Small RP2040 Boards

This is a case for the small RP2040 boards such as the Adafruit QT PY RP2040 or the Seeed XIAO RP2040. These small boards based on the Raspberry Pi RP2040 microcontroller. They have a USB interface and are able to run Klipper firmware. I am using this to interface with an ADXL345 accelerometer for use with Klipper's Resonance Compensation (aka Input Shaper). I wanted something to hold the RP2040 so that it doesn't short out. The underside of the case has holes for two (optional) magnets, which can be used to secure the case to a nearby ferrous object (like the X axis rods, or the heatbed on a Prusa MK3) during measurements.

Hardware

Assembly

  1. Press heat-set inserts into top using heat-set press or soldering iron.
  2. Press magnets into the two large holes in the bottom. They should go in with a little resistance, but should not require gorilla force to insert. If you have issues inserting them, or if they are too loose, I have provided the Fusion 360 source (check the User Parameter, magnet_hole).
  3. Insert a zip tie through the slot in the cable retainer. This is used to provide strain relief for your the cable going to the ADXL345 (or whatever other electronic device you are controlling). The hole is big enough to accept ~5-6mm shrouded, 6-conductor cable.
  4. Insert M2.5 screws in bottom, and into heat-sets on top.

Wiring

See the included file, "Wiring and Klipper Pin Config.pdf" for wiring instructions. Note that Klipper supports a limited number of PIN configurations for the SPI interface on the RP2040 that is used to communicate to the ADXL345. This isn't documented anywhere, so I had to go through the Klipper source code to find it. The SPI pinouts listed there are the ones that Klipper supports. This file lists two potential pinouts for the Seeed Studios board, and one for the Adafruit board.

Klipper Configuration

Start by reading the Klipper document on Measuring Resonances. Note that this document discusses connecting the ADXL345 to the Raspberry Pi. We are going to instead be connecting it to our RP2040 board, which will then connect to the Raspberry Pi via USB. After reading this document, take a look at the documentation on the [adxl345] configuration section.

Once you have wired up the board and placed it in the case, connect it to your Raspberry Pi, build the Klipper firmware for it, and and flash it using the instructions in the Klipper documentation. Find the serial port device name of the RP2040 by doing a `ls /dev/serial/by-id' and looking for a device with "rp2040" in the name. Now add a section like this to your Klipper printer.cfg:

[mcu rp2040]
serial: /dev/serial/by-id/RP2040_SERIAL_PORT_DEVICE_NAME

For each pinout, the aforementioned file has a column named "klipper", that lists the klipper configuration values for the cs_pin and spi_bus configuration entries. So suppose that you are using a Seeed Studio RP2040 board, and you have chosen the "Alt 1" pinout for that board. In Klipper, you would add to your printer.cfg (or an included file), a section like this:

[adxl345]
cs_pin: rp2040:gpio1
spi_bus: spi1c

Testing the Board and determining the Axes map

Once you have the configuration sorted out, and Klipper is starting and recognizing the new board, run this command to read a value from the ADXL345:

ACCELEROMETER_QUERY

Note that there is a bug where the FIRST reading after a power cycle or after connecting the RP2040 to Klipper will always fail. So just run the command a second time, and you should see something like this:

Recv: // adxl345 values (x, y, z): 470.719200, 941.438400, 9728.196800

The axes with the large reading corresponds to the axis oriented downwards (towards the center of earth). You can use this in order to figure out the axes mappings, and then update the Klipper configuration accordingly.

Related Designs

As mentioned above, I designed this case to use for calibrating Klipper's Resonance Compensation on my Prusa MK3 printers with the Bear mod. If you have an MK3, I have uploaded a heatbed holder for an ADXL345. If you have the Bear Extruder, I also have an ADXL345 holder for that.

 

 

Tagi