1 / 4
Simple Klipper G-code Button - no wiring - using SD-card detect pin — zdjęcie 1
1 / 4

Simple Klipper G-code Button - no wiring - using SD-card detect pin

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.

A simple way to add a Klipper button (latching) to a printer with a full-size SD-card slot, in my case an Ender3 S1.

Ocena
0 / 5
Polubienia
25
Pobrania
51
Wydruki
1
Wyświetlenia
1240
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Licencja
Creative Commons — Attribution — Share Alike

Introduction:

This is a simple way to add a Klipper button to a printer with a full-size SD-card slot, in my case an Ender3 S1.

The print snaps to the back of an SD card, the SD-detect pin of the printer board is then configured to act as a gcode_button allowing you to execute G-code (see below) or query its state in macros.

I included a few variants of the buttons (STOP, LED, HEAT, blank) and the freeCAD file for remixing.

If you don't want to use a real SD card, print a dummy model, e.g: https://www.printables.com/model/264020-sd-card-model 

I did not merge the button with a dummy SD because this might break easily if printed upright

Print settings:

  • Print face down (with text on the print plate)
  • 0.2mm layer height
  • 10% infill
  • I used petg but pla should also work.

Klipper config:

Add a section like this to your printer.cfg:

# this just prints SD inserted/ejected to the console for testing
[gcode_button sd_switch]
# pin for creality v4 boards
pin: !PC7
# gcode triggered on inserting SD card
press_gcode: RESPOND TYPE=command MSG='SD inserted'
# gcode triggered on ejecting SD card
release_gcode: RESPOND TYPE=command MSG='SD ejected'

On creality v4 boards, the SD-detect pin is PC7 (the exclamation mark ‘!’ just inverts press_gcode and release_gcode). 
If you run a different board, search for "#define SD_DETECT_PIN" in the marlin source code for your printer and replace, e.g. for the skr mini v3, in:

/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h

it says PC3 for the onboard sd card (not tested).

#define SD_DETECT_PIN                     PC3

Some other example configs:

  • STOP printer (M112 - Shutdown)
[gcode_button sd_switch]
pin: !PC7
# gcode triggered on inserting SD card
press_gcode: RESPOND TYPE=command MSG='STOP reset'
# gcode triggered on ejecting SD card, here: M112 shutdown
release_gcode: M112
  • Switch neopixel LEDs on/off
[gcode_button sd_switch]
pin: !PC7
# gcode triggered on inserting SD card
press_gcode: SET_LED LED=bedled RED=1 BLUE=1 GREEN=1
# gcode triggered on ejecting SD card, here: switch neopixels to 
release_gcode: SET_LED LED=bedled RED=0 BLUE=0 GREEN=0
[gcode_button sd_switch]
pin: !PC7
# gcode triggered on inserting SD card
press_gcode: NEOPIXEL_DISPLAY LED="bedled" TYPE=print_percent MODE=glow
# gcode triggered on ejecting SD card, here: switch neopixels to 
release_gcode: NEOPIXEL_DISPLAY LED="bedled" TYPE=printer_speed MODE=glow

Tagi