diff --git a/k1/installer.sh b/k1/installer.sh index 49770714..42022472 100755 --- a/k1/installer.sh +++ b/k1/installer.sh @@ -1012,6 +1012,7 @@ function setup_bltouch() { cleanup_probe btteddy cleanup_probe cartotouch cleanup_probe beacon + cleanup_probe klicky # we merge bltouch.cfg into printer.cfg so that z_offset can be set if [ -f /usr/data/printer_data/config/bltouch.cfg ]; then @@ -1050,6 +1051,7 @@ function setup_microprobe() { cleanup_probe btteddy cleanup_probe cartotouch cleanup_probe beacon + cleanup_probe klicky # we merge microprobe.cfg into printer.cfg so that z_offset can be set if [ -f /usr/data/printer_data/config/microprobe.cfg ]; then @@ -1073,6 +1075,39 @@ function setup_microprobe() { return 0 } +function setup_klicky() { + grep -q "klicky-probe" /usr/data/pellcorp.done + if [ $? -ne 0 ]; then + echo + echo "INFO: Setting up klicky ..." + + cleanup_probe bltouch + cleanup_probe btteddy + cleanup_probe cartotouch + cleanup_probe beacon + cleanup_probe microprobe + + cp /usr/data/pellcorp/k1/klicky.cfg /usr/data/printer_data/config/ || exit $? + $CONFIG_HELPER --add-include "klicky.cfg" || exit $? + + # need to add a empty probe section for baby stepping to work + $CONFIG_HELPER --add-section "probe" || exit $? + + cp /usr/data/pellcorp/k1/klicky_macro.cfg /usr/data/printer_data/config/ || exit $? + $CONFIG_HELPER --add-include "klicky_macro.cfg" || exit $? + + cp /usr/data/pellcorp/k1/klicky-${model}.cfg /usr/data/printer_data/config/ || exit $? + $CONFIG_HELPER --add-include "klicky-${model}.cfg" || exit $? + + echo "klicky-probe" >> /usr/data/pellcorp.done + sync + + # means klipper needs to be restarted + return 1 + fi + return 0 +} + function set_serial_cartotouch() { local SERIAL_ID=$(ls /dev/serial/by-id/usb-Cartographer* | head -1) if [ -n "$SERIAL_ID" ]; then @@ -1100,6 +1135,7 @@ function setup_cartotouch() { cleanup_probe microprobe cleanup_probe btteddy cleanup_probe beacon + cleanup_probe klicky cp /usr/data/pellcorp/k1/cartographer.conf /usr/data/printer_data/config/ || exit $? $CONFIG_HELPER --file moonraker.conf --add-include "cartographer.conf" || exit $? @@ -1181,6 +1217,7 @@ function setup_beacon() { cleanup_probe microprobe cleanup_probe btteddy cleanup_probe cartotouch + cleanup_probe klicky cp /usr/data/pellcorp/k1/beacon.conf /usr/data/printer_data/config/ || exit $? $CONFIG_HELPER --file moonraker.conf --add-include "beacon.conf" || exit $? @@ -1269,6 +1306,7 @@ function setup_btteddy() { cleanup_probe microprobe cleanup_probe cartotouch cleanup_probe beacon + cleanup_probe klicky cp /usr/data/pellcorp/k1/btteddy.cfg /usr/data/printer_data/config/ || exit $? $CONFIG_HELPER --add-include "btteddy.cfg" || exit $? @@ -1418,6 +1456,8 @@ LOG_FILE=/usr/data/printer_data/logs/installer-$TIMESTAMP.log probe=cartotouch elif [ -f /usr/data/printer_data/config/beacon.cfg ]; then probe=beacon + elif [ -f /usr/data/printer_data/config/klicky.cfg ]; then + probe=klicky elif grep -q "\[scanner\]" /usr/data/printer_data/config/printer.cfg; then probe=cartotouch elif [ -f /usr/data/printer_data/config/microprobe-k1.cfg ] || [ -f /usr/data/printer_data/config/microprobe-k1m.cfg ]; then @@ -1453,7 +1493,7 @@ LOG_FILE=/usr/data/printer_data/logs/installer-$TIMESTAMP.log shift client=$1 shift - elif [ "$1" = "microprobe" ] || [ "$1" = "bltouch" ] || [ "$1" = "beacon" ] || [ "$1" = "cartographer" ] || [ "$1" = "cartotouch" ] || [ "$1" = "btteddy" ]; then + elif [ "$1" = "microprobe" ] || [ "$1" = "bltouch" ] || [ "$1" = "beacon" ] || [ "$1" = "klicky" ] || [ "$1" = "cartographer" ] || [ "$1" = "cartotouch" ] || [ "$1" = "btteddy" ]; then if [ "$mode" = "fix-serial" ]; then echo "ERROR: Switching probes is not supported while trying to fix serial!" exit 1 @@ -1472,7 +1512,7 @@ LOG_FILE=/usr/data/printer_data/logs/installer-$TIMESTAMP.log if [ -z "$probe" ]; then echo "ERROR: You must specify a probe you want to configure" - echo "One of: [microprobe, bltouch, cartotouch, btteddy, beacon]" + echo "One of: [microprobe, bltouch, cartotouch, btteddy, beacon, klicky]" exit 1 fi @@ -1682,6 +1722,9 @@ LOG_FILE=/usr/data/printer_data/logs/installer-$TIMESTAMP.log elif [ "$probe" = "beacon" ]; then setup_beacon setup_probe_specific=$? + elif [ "$probe" = "klicky" ]; then + setup_klicky + setup_probe_specific=$? else echo "ERROR: Probe $probe not supported" exit 1 diff --git a/k1/klicky-k1.cfg b/k1/klicky-k1.cfg new file mode 100644 index 00000000..5aae5210 --- /dev/null +++ b/k1/klicky-k1.cfg @@ -0,0 +1,10 @@ +[bed_mesh] +speed: 100 +horizontal_move_z: 8 +mesh_min: -3,3 +mesh_max: 192,215 +probe_count: 12,12 +fade_start: 1.0 +fade_end: 10.0 +algorithm: bicubic +bicubic_tension: 0.1 diff --git a/k1/klicky-k1m.cfg b/k1/klicky-k1m.cfg new file mode 100644 index 00000000..9458e327 --- /dev/null +++ b/k1/klicky-k1m.cfg @@ -0,0 +1,10 @@ +[bed_mesh] +speed: 100 +horizontal_move_z: 8 +mesh_min: 1.2,21.1 +mesh_max: 290.2,287.1 +probe_count: 10,10 +fade_start: 1.0 +fade_end: 10.0 +algorithm: bicubic +bicubic_tension: 0.1 diff --git a/k1/klicky.cfg b/k1/klicky.cfg new file mode 100644 index 00000000..9ce02a94 --- /dev/null +++ b/k1/klicky.cfg @@ -0,0 +1,11 @@ +[probe] +pin: ^nozzle_mcu: PA8 +deactivate_on_each_sample: False +x_offset: 0.2 +y_offset: 16.1 +z_offset: 2 +samples: 3 +speed: 5 +lift_speed: 20 +samples_tolerance: 0.05 +samples_tolerance_retries: 3 diff --git a/k1/klicky_macro.cfg b/k1/klicky_macro.cfg new file mode 100644 index 00000000..e79169d3 --- /dev/null +++ b/k1/klicky_macro.cfg @@ -0,0 +1,12 @@ +[gcode_macro BED_MESH_CALIBRATE] +rename_existing: _BED_MESH_CALIBRATE +gcode: + {% if printer["gcode_macro _SAF_BED_MESH_START"] != null %} + _SAF_BED_MESH_START + {% endif %} + + _BED_MESH_CALIBRATE {rawparams} + + {% if printer["gcode_macro _SAF_BED_MESH_END"] != null %} + _SAF_BED_MESH_END + {% endif %} diff --git a/k1/mounts/klicky/Default.properties b/k1/mounts/klicky/Default.properties new file mode 100644 index 00000000..7e39c4d1 --- /dev/null +++ b/k1/mounts/klicky/Default.properties @@ -0,0 +1,25 @@ +# TODO + +-- klicky.cfg +[probe] +x_offset: 0.2 +y_offset: 16.1 +z_offset: 2 + +-- klicky-k1.cfg +[bed_mesh] +mesh_min: 1.2,21.1 +mesh_max: 212.7,207.1 + +-- klicky-k1m.cfg +[bed_mesh] +mesh_min: 1.2,21.1 +mesh_max: 290.2,287.1 + +-- printer-k1.cfg +[stepper_y] +position_max: 222 + +-- printer-k1m.cfg +[stepper_y] +position_max: 302