From dff5192908b3505efad7ac6a5993c571e4ccab1c Mon Sep 17 00:00:00 2001 From: Cyril Date: Tue, 24 Dec 2024 20:41:56 +0100 Subject: [PATCH] Update --- docs/firmwares/firmware-recovery-k1.md | 1 - .../install-and-update-rooted-firmware-k1.md | 2 + .../firmwares/restore-previous-firmware-k1.md | 2 + .../restore-a-previous-firmware-k1.md | 4 + .../Changelogs/K1/Changelog_1.3.3.46.txt | 13 + .../GS_01_CR4CU220812S12/factory_printer.cfg | 421 ++++++++++ .../GS_01_CR4CU220812S12/gcode_macro.cfg | 738 +++++++++++++++++ .../1.3.3.46/GS_01_CR4CU220812S12/printer.cfg | 433 ++++++++++ .../GS_01_CR4CU220812S12/printer_params.cfg | 34 + .../GS_01_CR4CU220812S12/sensorless.cfg | 201 +++++ .../K1C_CR4CU220812S12/factory_printer.cfg | 421 ++++++++++ .../K1C_CR4CU220812S12/gcode_macro.cfg | 741 ++++++++++++++++++ .../1.3.3.46/K1C_CR4CU220812S12/printer.cfg | 355 +++++++++ .../K1C_CR4CU220812S12/printer_params.cfg | 34 + .../K1C_CR4CU220812S12/sensorless.cfg | 201 +++++ .../K1C_CR4CU220812S12_1/factory_printer.cfg | 421 ++++++++++ .../K1C_CR4CU220812S12_1/gcode_macro.cfg | 741 ++++++++++++++++++ .../1.3.3.46/K1C_CR4CU220812S12_1/printer.cfg | 355 +++++++++ .../K1C_CR4CU220812S12_1/printer_params.cfg | 34 + .../K1C_CR4CU220812S12_1/sensorless.cfg | 201 +++++ .../K1_CR4CU220812S10/gcode_macro.cfg | 416 ++++++++++ .../K1/1.3.3.46/K1_CR4CU220812S10/printer.cfg | 309 ++++++++ .../K1_CR4CU220812S10/printer_params.cfg | 33 + .../1.3.3.46/K1_CR4CU220812S10/sensorless.cfg | 196 +++++ .../K1_CR4CU220812S11/gcode_macro.cfg | 437 +++++++++++ .../K1/1.3.3.46/K1_CR4CU220812S11/printer.cfg | 303 +++++++ .../K1_CR4CU220812S11/printer_params.cfg | 33 + .../1.3.3.46/K1_CR4CU220812S11/sensorless.cfg | 194 +++++ .../K1_CR4CU220812S12/factory_printer.cfg | 421 ++++++++++ .../K1_CR4CU220812S12/gcode_macro.cfg | 738 +++++++++++++++++ .../K1/1.3.3.46/K1_CR4CU220812S12/printer.cfg | 349 +++++++++ .../K1_CR4CU220812S12/printer_params.cfg | 34 + .../1.3.3.46/K1_CR4CU220812S12/sensorless.cfg | 201 +++++ .../K1_CR4CU220812S12_1/factory_printer.cfg | 421 ++++++++++ .../K1_CR4CU220812S12_1/gcode_macro.cfg | 738 +++++++++++++++++ .../1.3.3.46/K1_CR4CU220812S12_1/printer.cfg | 349 +++++++++ .../K1_CR4CU220812S12_1/printer_params.cfg | 34 + .../K1_CR4CU220812S12_1/sensorless.cfg | 201 +++++ .../K1_MAX_CR4CU220812S11/gcode_macro.cfg | 441 +++++++++++ .../K1_MAX_CR4CU220812S11/printer.cfg | 309 ++++++++ .../K1_MAX_CR4CU220812S11/printer_params.cfg | 33 + .../K1_MAX_CR4CU220812S11/sensorless.cfg | 194 +++++ .../K1_MAX_CR4CU220812S12/factory_printer.cfg | 421 ++++++++++ .../K1_MAX_CR4CU220812S12/gcode_macro.cfg | 738 +++++++++++++++++ .../K1_MAX_CR4CU220812S12/printer.cfg | 433 ++++++++++ .../K1_MAX_CR4CU220812S12/printer_params.cfg | 34 + .../K1_MAX_CR4CU220812S12/sensorless.cfg | 201 +++++ .../factory_printer.cfg | 421 ++++++++++ .../K1_MAX_CR4CU220812S12_1/gcode_macro.cfg | 738 +++++++++++++++++ .../K1_MAX_CR4CU220812S12_1/printer.cfg | 433 ++++++++++ .../printer_params.cfg | 34 + .../K1_MAX_CR4CU220812S12_1/sensorless.cfg | 201 +++++ .../factory_printer.cfg | 421 ++++++++++ .../K1_MAX_SE_CR4CU220812S12/gcode_macro.cfg | 738 +++++++++++++++++ .../K1_MAX_SE_CR4CU220812S12/printer.cfg | 433 ++++++++++ .../printer_params.cfg | 34 + .../K1_MAX_SE_CR4CU220812S12/sensorless.cfg | 201 +++++ .../K1_SE_CR4CU220812S12/factory_printer.cfg | 421 ++++++++++ .../K1_SE_CR4CU220812S12/gcode_macro.cfg | 727 +++++++++++++++++ .../1.3.3.46/K1_SE_CR4CU220812S12/printer.cfg | 355 +++++++++ .../K1_SE_CR4CU220812S12/printer_params.cfg | 34 + .../K1_SE_CR4CU220812S12/sensorless.cfg | 201 +++++ 62 files changed, 18955 insertions(+), 1 deletion(-) create mode 100644 downloads/Changelogs/K1/Changelog_1.3.3.46.txt create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/sensorless.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/factory_printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/gcode_macro.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer_params.cfg create mode 100644 downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/sensorless.cfg diff --git a/docs/firmwares/firmware-recovery-k1.md b/docs/firmwares/firmware-recovery-k1.md index beb8cf82..19672960 100644 --- a/docs/firmwares/firmware-recovery-k1.md +++ b/docs/firmwares/firmware-recovery-k1.md @@ -27,7 +27,6 @@ If your motherboard is partially bricked, it's possible to restore the firmware     :material-google-drive: [Ingenic 1.3.0.39 (Google Drive)](https://drive.google.com/file/d/1zlV_gpXGbqq8l_wbcNEygb2r-DPEHV9g/view?usp=drive_link) - ## Drivers Installation
diff --git a/docs/firmwares/install-and-update-rooted-firmware-k1.md b/docs/firmwares/install-and-update-rooted-firmware-k1.md index 188b9a51..ea98c64b 100644 --- a/docs/firmwares/install-and-update-rooted-firmware-k1.md +++ b/docs/firmwares/install-and-update-rooted-firmware-k1.md @@ -36,6 +36,8 @@ Please follow the instruction below strictly before to install latest firmware.     :material-google-drive: [1.3.3.36 (Google Drive)](https://drive.google.com/file/d/1SiOEZU2pM553ZniUa9tt9XMyrZ8FKbT_/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.36.txt) +    :material-google-drive: [1.3.3.46 (Google Drive)](https://drive.google.com/file/d/1G7VbYWHmuFZzdqpkSGDlBuUVdSaruJR-/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.46.txt) + ## Installation & Update
diff --git a/docs/firmwares/restore-previous-firmware-k1.md b/docs/firmwares/restore-previous-firmware-k1.md index 054e45e7..547771e6 100644 --- a/docs/firmwares/restore-previous-firmware-k1.md +++ b/docs/firmwares/restore-previous-firmware-k1.md @@ -20,6 +20,8 @@ You can easily restore current Firmware to a previous one.     :material-google-drive: [1.3.3.36 (Google Drive)](https://drive.google.com/file/d/1SiOEZU2pM553ZniUa9tt9XMyrZ8FKbT_/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.36.txt) +    :material-google-drive: [1.3.3.46 (Google Drive)](https://drive.google.com/file/d/1G7VbYWHmuFZzdqpkSGDlBuUVdSaruJR-/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.46.txt) + ## Restoration
diff --git a/docs/helper-script/restore-a-previous-firmware-k1.md b/docs/helper-script/restore-a-previous-firmware-k1.md index 8c26bf12..200b8004 100644 --- a/docs/helper-script/restore-a-previous-firmware-k1.md +++ b/docs/helper-script/restore-a-previous-firmware-k1.md @@ -18,6 +18,10 @@ You can easily restore current Firmware to a previous Firmware directly from the     :material-google-drive: [1.3.3.29 (Google Drive)](https://drive.google.com/file/d/1NxsR7_bMTwDUZZVag909ea3NbAyd4k1f/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.29.txt) +    :material-google-drive: [1.3.3.36 (Google Drive)](https://drive.google.com/file/d/1SiOEZU2pM553ZniUa9tt9XMyrZ8FKbT_/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.36.txt) + +    :material-google-drive: [1.3.3.46 (Google Drive)](https://drive.google.com/file/d/1G7VbYWHmuFZzdqpkSGDlBuUVdSaruJR-/view?usp=drive_link) / :material-note-text: [Changelog](https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script-Wiki/main/downloads/Changelogs/K1/Changelog_1.3.3.46.txt) + ## Prepare USB drive
diff --git a/downloads/Changelogs/K1/Changelog_1.3.3.46.txt b/downloads/Changelogs/K1/Changelog_1.3.3.46.txt new file mode 100644 index 00000000..de406597 --- /dev/null +++ b/downloads/Changelogs/K1/Changelog_1.3.3.46.txt @@ -0,0 +1,13 @@ +V1.3.3.46 Firmware Update + +1. Optimize connectivity issues with Creality Cloud camera. +2. Change the LIDAR from always-on power to power-on-demand. +3. Add failure animation for UI therope fan and motherboard fan during startup self-check. +4. Update built-in Gcode. +5. Fix UI black screen issue caused by repeated detection during auto-leveling and when manually setting leveling points to more than 7x7. +6. Fix status bar incorrectly displaying camera connection when no camera is connected at startup. +7. Fix screen-off issue during screen operation. + +Tips: +1. Please do a factory reset if you used the root script to install other components, otherwise it might cause errors. +2. Upgrade won't remove fluidd/mainsail, but will overwrite printer configs. Save configs if needed. diff --git a/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/factory_printer.cfg new file mode 100644 index 00000000..483d0517 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/factory_printer.cfg @@ -0,0 +1,421 @@ +# GS-01 +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/11/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/gcode_macro.cfg new file mode 100644 index 00000000..7908a219 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/gcode_macro.cfg @@ -0,0 +1,738 @@ +# GS-01 +# CreateDate: 2023/11/21 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 300.0 +variable_max_y_position: 300.0 +variable_max_z_position: 300.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} + # {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer.cfg new file mode 100644 index 00000000..737c9cae --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer.cfg @@ -0,0 +1,433 @@ +# GS-01 +# Printer_size: 300x300x300 +# Version: v1.0.3 +# CreateDate: 2023/11/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 340 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC8 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 37 +pid_Ki: 0.18 +pid_Kd: 280 +min_temp: 0 +max_temp: 135 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[output_pin power] +pin: PC9 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0.05 # //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 + +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 6,6 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer_params.cfg new file mode 100644 index 00000000..f563d08e --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/printer_params.cfg @@ -0,0 +1,34 @@ +# GS-01 +# Printer_size: 300x300x300 +# Version: v1.0.0 +# CreateDate: 2023/11/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +fan0_pin: nozzle_mcu:PB4 # throat fan +# fan0_pin: nozzle_mcu:PB3 # model fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 300 +variable_bed_size_y: 300 +variable_bed_size_z: 300 +# 支持最高温度 +variable_nozzle_temp: 320 +variable_bed_temp: 120 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/sensorless.cfg new file mode 100644 index 00000000..1e6acd2d --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/GS_01_CR4CU220812S12/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2023/11/21 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 260.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/factory_printer.cfg new file mode 100644 index 00000000..100ccaa0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/gcode_macro.cfg new file mode 100644 index 00000000..2b39ef2c --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/gcode_macro.cfg @@ -0,0 +1,741 @@ +# K1C +# CreateDate: 2023/09/05 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer.cfg new file mode 100644 index 00000000..5492b7cb --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer.cfg @@ -0,0 +1,355 @@ +# K1C +# Printer_size: 220x220x250 +# Version: v2.0.5 +# CreateDate: 2023/09/05 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 227 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 + +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 115 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.06 +tilt_corr_dis: 0 +tri_min_hold: 2500 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 87 +clr_noz_start_y: 225 +clr_noz_len_x: 46 +clr_noz_len_y: 1 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2500,20000 +tri_max_hold: 6000,60000 + +clr_noz_quick: true +clr_quick_high:0.7 +clr_xy_quick_spd:100 +clr_quick_times:10 +clr_quick_react_dis:5 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 600 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 10 +square_corner_velocity: 5.0 +max_z_accel: 300 +square_corner_max_velocity: 200.0 +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer_params.cfg new file mode 100644 index 00000000..499fbb63 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/printer_params.cfg @@ -0,0 +1,34 @@ +# K1C +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2023/09/05 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +# fan0_pin: nozzle_mcu:PB3 # model fan +fan0_pin: nozzle_mcu:PB4 # throat fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/sensorless.cfg new file mode 100644 index 00000000..75df3da9 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2023/09/05 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 9 %} + {% set y_park = 9 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 210.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/factory_printer.cfg new file mode 100644 index 00000000..100ccaa0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/gcode_macro.cfg new file mode 100644 index 00000000..d00bbc00 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/gcode_macro.cfg @@ -0,0 +1,741 @@ +# K1C +# CreateDate: 2024/11/18 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer.cfg new file mode 100644 index 00000000..24a8ded9 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer.cfg @@ -0,0 +1,355 @@ +# K1C +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2024/11/18 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 227 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 + +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 115 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.06 +tilt_corr_dis: 0 +tri_min_hold: 2500 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 87 +clr_noz_start_y: 225 +clr_noz_len_x: 46 +clr_noz_len_y: 1 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2500,20000 +tri_max_hold: 6000,60000 + +clr_noz_quick: true +clr_quick_high:0.7 +clr_xy_quick_spd:100 +clr_quick_times:10 +clr_quick_react_dis:5 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 600 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 10 +square_corner_velocity: 5.0 +max_z_accel: 300 +square_corner_max_velocity: 200.0 +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer_params.cfg new file mode 100644 index 00000000..98a40e81 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/printer_params.cfg @@ -0,0 +1,34 @@ +# K1C +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2024/11/18 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +# fan0_pin: nozzle_mcu:PB3 # model fan +fan0_pin: nozzle_mcu:PB4 # throat fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/sensorless.cfg new file mode 100644 index 00000000..f2bd20e8 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1C_CR4CU220812S12_1/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2024/11/18 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 9 %} + {% set y_park = 9 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 210.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/gcode_macro.cfg new file mode 100644 index 00000000..76a332d1 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/gcode_macro.cfg @@ -0,0 +1,416 @@ +# K1 +# CreateDate: 2023/03/15 +# history: 1. date: 2023.03.17 +# modify: [gcode_macro END_PRINT] +# 2. date: 2023.03.20 +# delete: [gcode_macro Qmode].printer_state +# 3. date: 2023.03.23 +# modify: [gcode_macro LOAD_MATERIAL] +# [gcode_macro QUIT_MATERIAL] + + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 50 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E150 F180 + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E20 F180 + G1 E-30 F180 + G1 E-50 F2000 + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=200 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + M106 P0 S80 + M106 P1 S0 + M106 P2 S0 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + M106 P0 S{(printer['gcode_macro Qmode'].fan0_value * 255 + 0.5)|int} + M106 P1 S{(printer['gcode_macro Qmode'].fan1_value * 255 + 0.5)|int} + M106 P2 S{(printer['gcode_macro Qmode'].fan2_value * 255 + 0.5)|int} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% if 'S' in params|upper %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% if 'P' in params|upper %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% if 'T' in params|upper %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + M204.1 {get_params} + {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 255 %} + {% if params.P is defined %} + {% if fan < fans %} + {% set fan = params.P|int %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set value = params.S|int %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + {% if value == 0 %} + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan{fan}_flag VALUE=0 + {% endif %} + +[gcode_macro M107] +gcode: + {% if params.P is defined %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan{params.P|int}_flag VALUE=0 + {% else %} + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan0_flag VALUE=0 + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan2_flag VALUE=0 + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + {action_respond_info("end_temp!\n")} + # SET_PIN PIN=fan2 VALUE=0 + {% if printer["gcode_macro WAIT_TEMP_START"].fan0_flag == 1 %} + M106 P0 S0 + {% endif %} + {% if printer["gcode_macro WAIT_TEMP_START"].fan2_flag == 1 %} + M106 P2 S0 + {% endif %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + {% else %} + {action_respond_info("cur_temp = %s \n" % (cur_temp))} + # SET_PIN PIN=fan2 VALUE=255 + {% if printer["gcode_macro WAIT_TEMP_START"].fan0_flag == 1 %} + M106 P0 S255 + {% endif %} + {% if printer["gcode_macro WAIT_TEMP_START"].fan2_flag == 1 %} + M106 P2 S255 + {% endif %} + {% if (printer["gcode_macro WAIT_TEMP_START"].fan0_flag|int == 0) and (printer["gcode_macro WAIT_TEMP_START"].fan2_flag|int == 0) %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + {% endif %} + +[gcode_macro WAIT_TEMP_START] +variable_fan0_flag: 0 +variable_fan1_flag: 0 # unused, to resolve error +variable_fan2_flag: 0 +gcode: + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan0_flag VALUE=1 + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan2_flag VALUE=1 + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + +[gcode_macro WAIT_TEMP_END] +gcode: + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan0_flag VALUE=0 + SET_GCODE_VARIABLE MACRO=WAIT_TEMP_START VARIABLE=fan2_flag VALUE=0 + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro START_PRINT] +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% set leveling_calibration = printer.custom_macro.leveling_calibration|int %} + {% if leveling_calibration == 0 %} + CX_PRINT_LEVELING_CALIBRATION EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} LEVELING_CALIBRATION={leveling_calibration} + # {% set leveling_calibration = 1 %} + {% else %} + CX_CLEAN_CALIBRATION_FLAGS + {% endif %} + CX_PRINT_DRAW_ONE_LINE + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + M220 S100 + M204 S500 + TURN_OFF_HEATERS + M107 + M107 P1 + {% if "xyz" in printer.toolhead.homed_axes %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + G1 Z{z_safe} F1200 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + WAIT_TEMP_START + M84 + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 1.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value1 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro INPUTSHAPER] +gcode: + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} Z5 F6000 + SHAPER_CALIBRATE + CXSAVE_CONFIG + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + M106 P2 S{(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer.cfg new file mode 100644 index 00000000..80cdc3b3 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer.cfg @@ -0,0 +1,309 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.9 +# CreateDate: 2023/03/15 +# Nozzle_mcu: chip: STM32G071CBU6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: AT32F421F6P7 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: STM32F401RCT6 +# version: CR4CU220812S10 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 225 +position_min: -5 +position_max: 225 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin: PA10 +tx_pin: PA9 +interpolate: True +run_current: 1.5 +hold_current: 1.0 +uart_address: 0 +sense_resistor: 0.15 +stealthchop_threshold: 0 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 220 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin: PA10 +tx_pin: PA9 +interpolate: True +run_current: 1.5 +hold_current: 1.0 +uart_address: 2 +sense_resistor: 0.15 +stealthchop_threshold: 0 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 60:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA10 +tx_pin: PA9 +run_current: 0.8 +diag_pin: ^PB14 +uart_address: 1 +sense_resistor: 0.15 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 80 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB14 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB10 +tx_pin: nozzle_mcu: PB11 +run_current: 0.5 +uart_address: 3 +sense_resistor: 0.15 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control = pid +pid_kp = 27 +pid_ki = 0.08 +pid_kd = 0 +min_temp: 0 +max_temp: 125 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PA8,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[output_pin fan0] +pin: nozzle_mcu:PB15 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 110,110,10 + +[hx711s] +count: 4 +use_mcu: leveling_mcu +sensor0_clk_pin: leveling_mcu:PA5 +sensor1_clk_pin: leveling_mcu:PA2 +sensor2_clk_pin: leveling_mcu:PA6 +sensor3_clk_pin: leveling_mcu:PA7 +sensor0_sdo_pin: leveling_mcu:PA1 +sensor1_sdo_pin: leveling_mcu:PA0 +sensor2_sdo_pin: leveling_mcu:PA3 +sensor3_sdo_pin: leveling_mcu:PA4 + +[prtouch] +z_offset: 0 +base_count: 40 +pi_count: 32 +min_hold: 2000 +max_hold: 6000 +s_hot_min_temp: 140 +s_hot_max_temp: 200 +s_bed_max_temp: 60 +pa_fil_len_mm: 5 +pa_fil_dis_mm: 30 +pa_clr_dis_mm: 30 +bed_max_err: 4 +max_dis_bef_g28: 0 +dead_zone_bef_g28: 2 +g28_sta0_speed: 1.8 +g28_sta1_speed: 1.8 +g29_rdy_speed: 3 +g29_speed: 1.8 +show_msg: false +g28_wait_cool_down: true +need_measure_gap: true +fix_z_offset:0 + +[filter] +hft_hz: 1 +lft_k1: 0.95 +lft_k1_oft: 0.95 +lft_k1_cal: 0.95 + +[dirzctl] +use_mcu: mcu +step_base: 2 + +[bed_mesh] +speed: 300 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer_params.cfg new file mode 100644 index 00000000..f2ed9df0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/printer_params.cfg @@ -0,0 +1,33 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.9 +# CreateDate: 2023/03/15 +# Nozzle_mcu: chip: STM32G071CBU6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: AT32F421F6P7 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: STM32F401RCT6 +# version: CR4CU220812S10 + +# [fan_feedback] +# fan0_pin: nozzle_mcu:PC6 # model fan +# # fan1_pin: nozzle_mcu:PA9 # throat fan +# print_delay_time: 5 +# current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/sensorless.cfg new file mode 100644 index 00000000..b8a9935b --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S10/sensorless.cfg @@ -0,0 +1,196 @@ +# Createdate: 2023/03/08 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + # BED_MESH_SET_DISABLE + {% if printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + STEPPER_Z_SENEORLESS MOVE_DIST=15 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + BED_MESH_SAVE + BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_RESTORE + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/gcode_macro.cfg new file mode 100644 index 00000000..5490c879 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/gcode_macro.cfg @@ -0,0 +1,437 @@ +# K1 +# CreateDate: 2023/03/15 +# history: 1. date: 2023.03.17 +# modify: [gcode_macro END_PRINT] +# 2. date: 2023.03.20 +# delete: [gcode_macro Qmode].printer_state +# 3. date: 2023.03.23 +# modify: [gcode_macro LOAD_MATERIAL] +# [gcode_macro QUIT_MATERIAL] + + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 50 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E150 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E20 F180 + G1 E-30 F180 + G1 E-50 F2000 + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=200 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + M106 P0 S80 + M106 P1 S0 + M106 P2 S0 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + M106 P0 S{(printer['gcode_macro Qmode'].fan0_value * 255 + 0.5)|int} + M106 P1 S{(printer['gcode_macro Qmode'].fan1_value * 255 + 0.5)|int} + M106 P2 S{(printer['gcode_macro Qmode'].fan2_value * 255 + 0.5)|int} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% if 'S' in params|upper %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% if 'P' in params|upper %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% if 'T' in params|upper %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + M204.1 {get_params} + {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% endif %} + {% if fan == 1 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% endif %} + {% if fan == 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% if params.P is defined %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + {action_respond_info("end_temp!\n")} + WAIT_TEMP_END + {% else %} + {action_respond_info("cur_temp = %s \n" % (cur_temp))} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 X{x_park} Y{y_park} Z2.0 F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + G28 Z + +[gcode_macro START_PRINT] +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + G1 Z{z_safe} F1200 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + M220 S100 + M204 S500 + TURN_OFF_HEATERS + M107 P1 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 1.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value1 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} Z5 F6000 + SHAPER_CALIBRATE + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer.cfg new file mode 100644 index 00000000..76a0d007 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer.cfg @@ -0,0 +1,303 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.6 +# CreateDate: 2023/03/15 +# Nozzle_mcu: chip: STM32G071CBU6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: AT32F421F6P7 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: STM32F401RCT6 +# version: CR4CU220812S11 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +# [temperature_sensor chamber_temp] +# sensor_type: EPCOS 100K B57560G104F +# sensor_pin: PC5 +# min_temp: 0 +# max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB14 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB10 +tx_pin: nozzle_mcu: PB11 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control = pid +pid_kp = 27 +pid_ki = 0.08 +pid_kd = 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PA8,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[output_pin fan0] +pin: nozzle_mcu:PB15 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.06 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer_params.cfg new file mode 100644 index 00000000..44ffc65d --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/printer_params.cfg @@ -0,0 +1,33 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.4 +# CreateDate: 2023/03/15 +# Nozzle_mcu: chip: STM32G071CBU6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: AT32F421F6P7 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: STM32F401RCT6 +# version: CR4CU220812S11 + +# [fan_feedback] +# fan0_pin: nozzle_mcu:PC6 # model fan +# # fan1_pin: nozzle_mcu:PA9 # throat fan +# print_delay_time: 5 +# current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/sensorless.cfg new file mode 100644 index 00000000..e2c1b6c9 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S11/sensorless.cfg @@ -0,0 +1,194 @@ +# Createdate: 2023/03/08 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + BED_MESH_PROFILE LOAD="default" + {% endif %} + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/factory_printer.cfg new file mode 100644 index 00000000..100ccaa0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/gcode_macro.cfg new file mode 100644 index 00000000..e8467f25 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/gcode_macro.cfg @@ -0,0 +1,738 @@ +# K1 +# CreateDate: 2023/03/21 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} + # {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer.cfg new file mode 100644 index 00000000..29358f06 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer.cfg @@ -0,0 +1,349 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.26 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 115 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer_params.cfg new file mode 100644 index 00000000..6dc51ffd --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/printer_params.cfg @@ -0,0 +1,34 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +# fan0_pin: nozzle_mcu:PB3 # model fan +fan0_pin: nozzle_mcu:PB4 # throat fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/sensorless.cfg new file mode 100644 index 00000000..78db401a --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2023/03/08 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 9 %} + {% set y_park = 9 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 210.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/factory_printer.cfg new file mode 100644 index 00000000..100ccaa0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/gcode_macro.cfg new file mode 100644 index 00000000..0071ce93 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/gcode_macro.cfg @@ -0,0 +1,738 @@ +# K1 +# CreateDate: 2024/03/07 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} + # {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer.cfg new file mode 100644 index 00000000..f8a7d76d --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer.cfg @@ -0,0 +1,349 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.1 +# CreateDate: 2024/03/07 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +driver_TBL: 0 +driver_TOFF: 1 +driver_HEND: 0 +driver_HSTRT: 0 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +driver_TBL: 0 +driver_TOFF: 1 +driver_HEND: 0 +driver_HSTRT: 0 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 115 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer_params.cfg new file mode 100644 index 00000000..a0d0f39e --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/printer_params.cfg @@ -0,0 +1,34 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2024/03/07 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +# fan0_pin: nozzle_mcu:PB3 # model fan +fan0_pin: nozzle_mcu:PB4 # throat fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/sensorless.cfg new file mode 100644 index 00000000..afbee131 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_CR4CU220812S12_1/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2024/03/07 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 9 %} + {% set y_park = 9 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 210.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/gcode_macro.cfg new file mode 100644 index 00000000..7f4d3092 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/gcode_macro.cfg @@ -0,0 +1,441 @@ +# K1-MAX +# CreateDate: 2023/03/15 +# history: 1. date: 2023.03.17 +# modify: [gcode_macro END_PRINT] +# 2. date: 2023.03.20 +# delete: [gcode_macro Qmode].printer_state +# 3. date: 2023.03.23 +# modify: [gcode_macro LOAD_MATERIAL] +# [gcode_macro QUIT_MATERIAL] + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 300.0 +variable_max_y_position: 300.0 +variable_max_z_position: 300.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 50 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E150 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E20 F180 + G1 E-30 F180 + G1 E-50 F2000 + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=200 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + M106 P0 S80 + M106 P1 S0 + M106 P2 S0 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + M106 P0 S{(printer['gcode_macro Qmode'].fan0_value * 255 + 0.5)|int} + M106 P1 S{(printer['gcode_macro Qmode'].fan1_value * 255 + 0.5)|int} + M106 P2 S{(printer['gcode_macro Qmode'].fan2_value * 255 + 0.5)|int} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% if 'S' in params|upper %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% if 'P' in params|upper %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% if 'T' in params|upper %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + M204.1 {get_params} + {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% endif %} + {% if fan == 1 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% endif %} + {% if fan == 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% if params.P is defined %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + {action_respond_info("end_temp!\n")} + WAIT_TEMP_END + {% else %} + {action_respond_info("cur_temp = %s \n" % (cur_temp))} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +# The macro of LASER_CALIBRATION is for application use and has not been implemented +# The macro of FLOW_DETECTION is for application use and has not been implemented +gcode: + CX_PRINT_LEVELING_CALIBRATION + LASER_CALIBRATION + FLOW_DETECTION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 X{x_park} Y{y_park} Z2.0 F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + G28 Z + +[gcode_macro START_PRINT] +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + G1 Z{z_safe} F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + M220 S100 + M204 S500 + TURN_OFF_HEATERS + M107 P1 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 1.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value1 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} Z5 F6000 + SHAPER_CALIBRATE + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer.cfg new file mode 100644 index 00000000..a15ec832 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer.cfg @@ -0,0 +1,309 @@ +# K1-MAX-DVT +# Printer_size: 300x300x300 +# Version: v1.0.5 +# CreateDate: 2023/03/15 +# Nozzle_mcu: chip: STM32G071CBU6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: AT32F421F6P7 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: STM32F401RCT6 +# version: CR4CU220812S11 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB14 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB10 +tx_pin: nozzle_mcu:PB11 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: !PC8 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 45.211 +pid_Ki: 0.15 +pid_Kd: 1200 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PA8,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[output_pin fan0] +pin: nozzle_mcu:PB15 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[output_pin power] +pin: PC9 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +step_base: 2 +z_offset: 0 +noz_ex_com: 0.06 +tilt_corr_dis: 0.05 +tri_min_hold: 3000 +tri_max_hold: 8000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer_params.cfg new file mode 100644 index 00000000..6c0c2e2f --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/printer_params.cfg @@ -0,0 +1,33 @@ +# K1-MAX-DVT +# Printer_size: 300x300x300 +# Version: v1.0.2 +# CreateDate: 2023/03/15 +# Nozzle_mcu: chip: STM32G071CBU6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: AT32F421F6P7 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: STM32F401RCT6 +# version: CR4CU220812S11 + +# [fan_feedback] +# fan0_pin: nozzle_mcu:PC6 # model fan +# # fan1_pin: nozzle_mcu:PA9 # throat fan +# print_delay_time: 5 +# current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 300 +variable_bed_size_y: 300 +variable_bed_size_z: 300 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/sensorless.cfg new file mode 100644 index 00000000..29e79704 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S11/sensorless.cfg @@ -0,0 +1,194 @@ +# Createdate: 2023/03/08 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + BED_MESH_PROFILE LOAD="default" + {% endif %} + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/factory_printer.cfg new file mode 100644 index 00000000..100ccaa0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/gcode_macro.cfg new file mode 100644 index 00000000..3b51ab2a --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/gcode_macro.cfg @@ -0,0 +1,738 @@ +# K1-MAX +# CreateDate: 2023/03/21 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 300.0 +variable_max_y_position: 300.0 +variable_max_z_position: 300.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} + # {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer.cfg new file mode 100644 index 00000000..b198d3b5 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer.cfg @@ -0,0 +1,433 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.30 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC8 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 37 +pid_Ki: 0.18 +pid_Kd: 280 +min_temp: 0 +max_temp: 125 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[output_pin power] +pin: PC9 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0.05 # //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 + +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 6,6 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer_params.cfg new file mode 100644 index 00000000..20009055 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/printer_params.cfg @@ -0,0 +1,34 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.0 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +fan0_pin: nozzle_mcu:PB4 # throat fan +# fan0_pin: nozzle_mcu:PB3 # model fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 300 +variable_bed_size_y: 300 +variable_bed_size_z: 300 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/sensorless.cfg new file mode 100644 index 00000000..ac93723f --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2023/03/08 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 260.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/factory_printer.cfg new file mode 100644 index 00000000..181258b3 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2024/01/11 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/gcode_macro.cfg new file mode 100644 index 00000000..866bd5b9 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/gcode_macro.cfg @@ -0,0 +1,738 @@ +# K1-MAX +# CreateDate: 2024/01/11 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 300.0 +variable_max_y_position: 300.0 +variable_max_z_position: 300.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} + # {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer.cfg new file mode 100644 index 00000000..061e447e --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer.cfg @@ -0,0 +1,433 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.3 +# CreateDate: 2024/01/11 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +driver_TBL: 0 +driver_TOFF: 1 +driver_HEND: 0 +driver_HSTRT: 0 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +driver_TBL: 0 +driver_TOFF: 1 +driver_HEND: 0 +driver_HSTRT: 0 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC8 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 37 +pid_Ki: 0.18 +pid_Kd: 280 +min_temp: 0 +max_temp: 125 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[output_pin power] +pin: PC9 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0.05 # //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 + +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 6,6 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer_params.cfg new file mode 100644 index 00000000..5d6b853f --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/printer_params.cfg @@ -0,0 +1,34 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2024/01/11 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +fan0_pin: nozzle_mcu:PB4 # throat fan +# fan0_pin: nozzle_mcu:PB3 # model fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 300 +variable_bed_size_y: 300 +variable_bed_size_z: 300 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/sensorless.cfg new file mode 100644 index 00000000..f92ef1d6 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_CR4CU220812S12_1/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2024/01/11 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 260.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/factory_printer.cfg new file mode 100644 index 00000000..8a84c0f3 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1 MAX SE +# Printer_size: 300x300x300 +# Version: v1.0.0 +# CreateDate: 2023/09/20 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/gcode_macro.cfg new file mode 100644 index 00000000..9e8b7874 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/gcode_macro.cfg @@ -0,0 +1,738 @@ +# K1 MAX SE +# CreateDate: 2023/09/20 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 300.0 +variable_max_y_position: 300.0 +variable_max_z_position: 300.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +variable_cam_off_temp: 60 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan1'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + SET_PIN PIN=fan1 VALUE={tmp} + {% endif %} + + {% set tmp = printer['output_pin fan2'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + SET_PIN PIN=fan2 VALUE={tmp} + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + {% if printer['output_pin fan1'].value != 0 %} + {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + {% endif %} + {% if printer['output_pin fan2'].value != 0 %} + {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} + # {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M141] +description: Set Chamber temperature with slicers +gcode: + {% if 'S' in params|upper %} + {% if printer["temperature_fan chamber_fan"].speed > 0.0 %} + SET_PIN PIN=fan1 VALUE=255 + {% else %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% if params.S|int > 0 %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + {% else %} + SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35 + {% if params.S|int == 0 %} + SET_PIN PIN=fan1 VALUE=0 + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer.cfg new file mode 100644 index 00000000..be1651fb --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer.cfg @@ -0,0 +1,433 @@ +# K1 MAX SE +# Printer_size: 300x300x300 +# Version: v1.0.6 +# CreateDate: 2023/09/20 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[duplicate_pin_override] +pins: PC0, PC5 + +[temperature_fan chamber_fan] +pin: PC0 +cycle_time: 0.0100 +hardware_pwm: false +max_power: 1 +shutdown_speed: 0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 70 +control: watermark +max_delta: 2 +target_temp: 35.0 +max_speed: 1.0 +min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC8 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 37 +pid_Ki: 0.18 +pid_Kd: 280 +min_temp: 0 +max_temp: 135 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[output_pin power] +pin: PC9 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0.05 # //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 + +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 6,6 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer_params.cfg new file mode 100644 index 00000000..db68d3c5 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/printer_params.cfg @@ -0,0 +1,34 @@ +# K1 MAX SE +# Printer_size: 300x300x300 +# Version: v1.0.0 +# CreateDate: 2023/09/20 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +fan0_pin: nozzle_mcu:PB4 # throat fan +# fan0_pin: nozzle_mcu:PB3 # model fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 300 +variable_bed_size_y: 300 +variable_bed_size_z: 300 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/sensorless.cfg new file mode 100644 index 00000000..aaff9dc4 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_MAX_SE_CR4CU220812S12/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2023/09/20 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 8 %} + {% set y_park = 8 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 260.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500 diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/factory_printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/factory_printer.cfg new file mode 100644 index 00000000..100ccaa0 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/factory_printer.cfg @@ -0,0 +1,421 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +pr_version: 2 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.09 #0.09 喷头加热补偿值 +tilt_corr_dis:0# //0.05 #热床差补偿值 +tri_min_hold: 6000,10000 #2000,10000 +tri_max_hold: 13000,60000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 130 +clr_noz_start_y: 303 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.50,0.15 +g29_down_min_z: 50 + +correct_tri_hold: 8000 +correct_step_mm: 0.02 +#tri_wave_ip:172.22.40.244 + +#进入调平状态用到的参数 +tri_min_hold_1:6000,10000 +tri_min_hold_2:6000,10000 +tri_min_hold_3:6000,10000 +tri_min_hold_4:6000,10000 +tri_min_hold_5:6000,10000 +tri_min_hold_6:6000,10000 + +tri_min_hold_7:6000,10000 +tri_min_hold_8:6000,10000 +tri_min_hold_9:6000,10000 +tri_min_hold_10:6000,10000 +tri_min_hold_11:6000,10000 +tri_min_hold_12:6000,10000 + +tri_min_hold_13:6000,10000 +tri_min_hold_14:6000,10000 +tri_min_hold_15:6000,10000 +tri_min_hold_16:6000,10000 +tri_min_hold_17:6000,10000 +tri_min_hold_18:6000,10000 + +tri_min_hold_19:6000,10000 +tri_min_hold_20:6000,10000 +tri_min_hold_21:6000,10000 +tri_min_hold_22:6000,10000 +tri_min_hold_23:6000,10000 +tri_min_hold_24:6000,10000 + +tri_min_hold_25:6000,10000 +tri_min_hold_26:6000,10000 +tri_min_hold_27:6000,10000 +tri_min_hold_28:6000,10000 +tri_min_hold_29:6000,10000 +tri_min_hold_30:6000,10000 + +tri_min_hold_31:6000,10000 +tri_min_hold_32:6000,10000 +tri_min_hold_33:6000,10000 +tri_min_hold_34:6000,10000 +tri_min_hold_35:6000,10000 +tri_min_hold_36:6000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/gcode_macro.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/gcode_macro.cfg new file mode 100644 index 00000000..5e712e8c --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/gcode_macro.cfg @@ -0,0 +1,727 @@ +# K1C +# CreateDate: 2023/09/05 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 1 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState +# {% if printer['output_pin fan2'].value > 0.0 %} +# SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} +# M107 P2 +# {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: +# {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState +# {% if fan2_value > 0.0 %} +# {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} +# M106 P2 S{s_value} +# SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 +# {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + RESTORE_E_CURRENT + M109 S{printer.custom_macro.default_extruder_temp} + M83 + G1 E100 F300 + G1 E-15 F3000 + G1 E-22.4700 F2400 + G1 E-6.4200 F1200 + G1 E-3.2100 F720 + G1 E5.0000 F356 + G1 E-5.0000 F384 + G1 E5.0000 F412 + G1 E-5.0000 F440 + G1 E5.0000 F467 + G1 E-5.0000 F495 + G1 E5.0000 F523 + G1 E-5.0000 F3000 + G1 E-15 F3000 + SET_E_MIN_CURRENT + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +variable_max_accel: 2500 +variable_max_accel_to_decel: 2500 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + # SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + # SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0 + SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0 + G4 P1000 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=2500 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=150 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + + {% set tmp = printer['output_pin fan0'].value * 255 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp} + {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + SET_PIN PIN=fan0 VALUE={tmp} + {% endif %} + + # {% set tmp = printer['output_pin fan1'].value * 255 %} + # SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255} + # {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + # {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + # SET_PIN PIN=fan1 VALUE={tmp} + # {% endif %} + + # {% set tmp = printer['output_pin fan2'].value * 255 %} + # SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255} + # {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + # {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + # SET_PIN PIN=fan2 VALUE={tmp} + # {% endif %} + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + SET_QMODE_FLAG FLAG=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + + {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR} + + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + G4 P1000 + + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + SET_QMODE_FLAG FLAG=0 + + {% if printer['output_pin fan0'].value != 0 %} + {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)} + SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0 + {% endif %} + # {% if printer['output_pin fan1'].value != 0 %} + # {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)} + # SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value} + # SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0 + # {% endif %} + # {% if printer['output_pin fan2'].value != 0 %} + # {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)} + # SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value} + # SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0 + # {% endif %} + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + # {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %} + {% if 'S' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% endif %} + {% if 'P' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% endif %} + {% if 'T' in params|upper %} + {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %} + {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %} + {% else %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + {% endif %} + M204.1 {get_params} +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} + {% endif %} + {% endif %} + {% if fan == 1 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} + {% endif %} + {% endif %} + {% if fan == 2 %} + {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% if printer['gcode_macro Qmode'].flag | int == 1 %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} + {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% else %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} + {% endif %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + SET_PIN PIN=fan0 VALUE=0 +# {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} +# {% if params.P is defined %} +# {% if params.P|int < fans %} +# SET_PIN PIN=fan{params.P|int} VALUE=0 +# {% else %} +# SET_PIN PIN=fan0 VALUE=0 +# {% endif %} +# {% else %} +# SET_PIN PIN=fan0 VALUE=0 +# SET_PIN PIN=fan2 VALUE=0 +# {% endif %} + +# [gcode_macro M141] +# description: Set Chamber temperature with slicers +# gcode: +# SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + WAIT_TEMP_END + {% else %} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + {action_respond_info("wait temp start\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + {action_respond_info("wait temp end\n")} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + Qmode_exit + EXCLUDE_OBJECT_RESET + PRINT_PREPARE_CLEAR + M220 S100 + SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} +# # save fan2 value and turn off fan2 +# SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} +# {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} +# {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 +# M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT +# {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} +# # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} +# # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} +# # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} +# {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} +# M106 P2 S{s_value} +# {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} +# # save fan2 value and turn off fan2 +# SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} +# {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} +# {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + # M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} +# {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} +# # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} +# # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} +# # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} +# {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} +# M106 P2 S{s_value} +# {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer.cfg new file mode 100644 index 00000000..c7e7f525 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer.cfg @@ -0,0 +1,355 @@ +# K1C +# Printer_size: 220x220x250 +# Version: v2.0.8 +# CreateDate: 2023/09/05 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +# [temperature_sensor chamber_temp] +# sensor_type: EPCOS 100K B57560G104F +# sensor_pin: PC5 +# min_temp: 0 +# max_temp: 125 + +# [duplicate_pin_override] +# pins: PC0, PC5 + +# [temperature_fan chamber_fan] +# pin: PC0 +# cycle_time: 0.0100 +# hardware_pwm: false +# max_power: 1 +# shutdown_speed: 0 +# sensor_type: EPCOS 100K B57560G104F +# sensor_pin: PC5 +# min_temp: 0 +# max_temp: 70 +# control: watermark +# max_delta: 2 +# target_temp: 35.0 +# max_speed: 1.0 +# min_speed: 0.0 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 40 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 227 +homing_speed: 30 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 75 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 + +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 115 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +# [output_pin fan1] +# pin: PC0 +# pwm: True +# cycle_time: 0.0100 +# hardware_pwm: false +# value: 0.00 +# scale: 255 +# shutdown_value: 0.0 + +# [output_pin fan2] +# pin: PB1 +# pwm: True +# cycle_time: 0.0100 +# hardware_pwm: false +# value: 0.00 +# scale: 255 +# shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.06 +tilt_corr_dis: 0 +tri_min_hold: 2500 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 87 +clr_noz_start_y: 225 +clr_noz_len_x: 46 +clr_noz_len_y: 1 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2500,20000 +tri_max_hold: 6000,60000 + +clr_noz_quick: true +clr_quick_high:0.7 +clr_xy_quick_spd:100 +clr_quick_times:10 +clr_quick_react_dis:5 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 600 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 10 +square_corner_velocity: 5.0 +max_z_accel: 300 +square_corner_max_velocity: 200.0 +[pause_resume] +# recover_velocity: 500. + +[exclude_object] diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer_params.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer_params.cfg new file mode 100644 index 00000000..499fbb63 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/printer_params.cfg @@ -0,0 +1,34 @@ +# K1C +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2023/09/05 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.2.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.1.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +# fan0_pin: nozzle_mcu:PB3 # model fan +fan0_pin: nozzle_mcu:PB4 # throat fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + +# 产品定义参数 +[gcode_macro product_param] +# 模型成型尺寸 +variable_bed_size_x: 220 +variable_bed_size_y: 220 +variable_bed_size_z: 220 +# 支持最高温度 +variable_nozzle_temp: 300 +variable_bed_temp: 100 +variable_chamber_temp: 60 +gcode: diff --git a/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/sensorless.cfg b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/sensorless.cfg new file mode 100644 index 00000000..75df3da9 --- /dev/null +++ b/downloads/Stock Config Files/K1/1.3.3.46/K1_SE_CR4CU220812S12/sensorless.cfg @@ -0,0 +1,201 @@ +# Createdate: 2023/09/05 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 9 %} + {% set y_park = 9 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 210.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + # BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is not defined or x_axes[2] is not defined %} + BED_MESH_CLEAR + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + {% endif %} + BED_MESH_PROFILE LOAD="default" + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500