From 742a5713c551f968922918617a58f37f17888af4 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Fri, 25 Sep 2026 13:34:50 -0400 Subject: [PATCH 01/11] klipper: add _MACHINE_VARS motion geometry to CC1/CC2 machine.cfg --- .../klipper/files/centauri-carbon-1/machine.cfg | 11 ++++++++++- .../klipper/files/centauri-carbon-2/machine.cfg | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg index b7dbac43..c498b595 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg @@ -359,4 +359,13 @@ press_gcode: # CANVAS board detected. {% set pulldown_resistor_value = printer.configfile.settings.extruder.pulldown_resistor %} {% if pulldown_resistor_value != 100000 %} { action_emergency_stop("Fire hazard detected: CANVAS board detected without the pulldown resistor being configured. Please set elegoo_canvas to True in cosmos.conf or manually configure the pulldown_resistor value on the extruder!") } - {% endif %} \ No newline at end of file + {% endif %} + +# Motion geometry consumed by macros.cfg (defaults there match these values; +# this section is the documented canonical list) +[gcode_macro _MACHINE_VARS] +variable_tray_x: 202 +variable_wipe_x_start: 187 +variable_kick_x: 186 +variable_kick_f: 8000 +gcode: diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index f0549aa7..4c259131 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -427,3 +427,15 @@ press_gcode: {% endif %} release_gcode: RESPOND TYPE=echo MSG="Front cover has been re-attached" + +# Motion geometry consumed by macros.cfg (defaults there match the CC1 values) +[gcode_macro _MACHINE_VARS] +variable_tray_x: 204 +variable_wipe_x_start: 188 +variable_kick_x: 254 +variable_kick_f: 3000 +# CC2 cutter is front-right: park at (245,25), ram to kick_x, seat at Y3 +variable_kick_park_x: 245 +variable_kick_park_y: 25 +variable_kick_corner_y: 3 +gcode: From ed5addbbfc1fe3fcda689dda849de55d7dfe1c54 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Fri, 25 Sep 2026 13:41:55 -0400 Subject: [PATCH 02/11] macros: parameterize tray, wipe and kick geometry per machine --- .../recipes-apps/klipper/files/macros.cfg | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg index 906cbd96..5a15a98b 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg @@ -321,6 +321,7 @@ gcode: [gcode_macro CLEAN_NOZZLE] gcode: {% set global = printer['gcode_macro _global_var'] %} + {% set mv = printer['gcode_macro _MACHINE_VARS']|default({}) %} {% set pre_toolhead_target = printer.extruder.target|int %} {% set target = params.TARGET|default(global.extruder_temp.cleaning if pre_toolhead_target < global.extruder_temp.cleaning else pre_toolhead_target)|int %} M104 S{target} @@ -333,13 +334,14 @@ gcode: M106 S255 # Wipe G1 F9000 + {% set wipe_x = mv.wipe_x_start|default(187)|int %} {% for wipes in range(4) %} {% for i in range(8) %} - {% set x = 187 - (i * 2) %} + {% set x = wipe_x - (i * 2) %} {% set y = 264 if i % 2 == 0 else 262 %} G1 X{x} Y{y} {% endfor %} - G1 X187 + G1 X{wipe_x} {% endfor %} G1 Y250 # Clear command queue @@ -349,14 +351,16 @@ gcode: [gcode_macro MOVE_TO_TRAY] gcode: + {% set mv = printer['gcode_macro _MACHINE_VARS']|default({}) %} + {% set tray_x = mv.tray_x|default(202) %} _CG28 AXIS=XY - {% if printer.gcode_move.position.x > 201.5 and printer.gcode_move.position.x < 202.5 and printer.gcode_move.position.y > 263.5 and printer.gcode_move.position.y < 264.5 and "xy" in printer.toolhead.homed_axes %} + {% if printer.gcode_move.position.x > tray_x-0.5 and printer.gcode_move.position.x < tray_x+0.5 and printer.gcode_move.position.y > 263.5 and printer.gcode_move.position.y < 264.5 and "xy" in printer.toolhead.homed_axes %} RETURN ; Already at the tray {% endif %} G90 ; Absolute positioning - G0 X202 F12000 + G0 X{tray_x} F12000 G0 Y250 F12000 ; Move near to the try G0 Y264 F1200 ; Move slowly back to the tray @@ -367,7 +371,9 @@ variable_end_kick_x: 186 gcode: {% set global = printer['gcode_macro _global_var'] %} {% set self = printer["gcode_macro KICK"] %} - {% set end_kick_x = self.end_kick_x|float %} + {% set mv = printer['gcode_macro _MACHINE_VARS']|default({}) %} + {% set end_kick_x = mv.kick_x|default(self.end_kick_x) %} + {% set kick_f = mv.kick_f|default(8000)|int %} {% set retract_amount = global.retract_amount|float %} {% if "xy" not in printer.toolhead.homed_axes %} @@ -381,15 +387,21 @@ gcode: G90 ; Absolute positioning M83 ; E relative + {% if mv.kick_park_x is defined %} + _CG28 AXIS=XY + G0 X{mv.kick_park_x} Y{mv.kick_park_y} F12000 ; Cutter is not at the tray on this machine + M400 + {% else %} MOVE_TO_TRAY ; Move to the tray + {% endif %} G1 E-{retract_amount} F300 ; Retract slightly to reduce pressure during kick M106 S255 ; Full blast fan to solidify plastic - G4 P2000 ; Wait 2 seconds for fan to do its work - G1 F8000 ; Set feedrate - G1 X{self.end_kick_x} ; Swipe over the v-slot (into) - G1 X193 ; Swipe over the v-slot (out of) - G1 X{self.end_kick_x} ; Swipe over the v-slot (into) - M107 ; Turn off fan + G4 P3000 ; Wait 3 seconds for fan to do its work + G1 X{end_kick_x} F{kick_f} ; Kick toward the cutter + {% if mv.kick_corner_y is defined %} + G1 Y{mv.kick_corner_y} F600 ; Seat into the cutter corner + {% endif %} + M106 S0 ; Turn off fan G1 Y250 F6000 ; Exit From ce0625de3952acdc8d536553043a9743253c916f Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Fri, 25 Sep 2026 13:49:39 -0400 Subject: [PATCH 03/11] macros: unify KICK park path across CC1/CC2 --- .../klipper/files/centauri-carbon-1/machine.cfg | 2 ++ .../recipes-apps/klipper/files/macros.cfg | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg index c498b595..663e2200 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg @@ -368,4 +368,6 @@ variable_tray_x: 202 variable_wipe_x_start: 187 variable_kick_x: 186 variable_kick_f: 8000 +variable_kick_park_x: 202 +variable_kick_park_y: 264 gcode: diff --git a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg index 5a15a98b..401dbf9c 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg @@ -384,16 +384,21 @@ gcode: {action_raise_error("Extruder not hot enough to kick")} {% endif %} + {% if mv.kick_park_x is defined %} + {% set kick_park_x = mv.kick_park_x %} + {% set kick_park_y = mv.kick_park_y %} + {% else %} + {% set kick_park_x = 202 %} + {% set kick_park_y = 264 %} + {% endif %} + G90 ; Absolute positioning M83 ; E relative - {% if mv.kick_park_x is defined %} _CG28 AXIS=XY - G0 X{mv.kick_park_x} Y{mv.kick_park_y} F12000 ; Cutter is not at the tray on this machine + G0 X{kick_park_x} F12000 ; Park at the cutter (X first to avoid clipping the tray) + G0 Y{kick_park_y} F12000 M400 - {% else %} - MOVE_TO_TRAY ; Move to the tray - {% endif %} G1 E-{retract_amount} F300 ; Retract slightly to reduce pressure during kick M106 S255 ; Full blast fan to solidify plastic G4 P3000 ; Wait 3 seconds for fan to do its work From ea100d00f53d1aa841d9f17f0f554479cec9b4e2 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Fri, 25 Sep 2026 13:51:30 -0400 Subject: [PATCH 04/11] macros: slow final 14mm Y approach in KICK park --- meta-opencentauri/recipes-apps/klipper/files/macros.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg index 401dbf9c..9d9eb3e5 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg @@ -397,7 +397,9 @@ gcode: _CG28 AXIS=XY G0 X{kick_park_x} F12000 ; Park at the cutter (X first to avoid clipping the tray) - G0 Y{kick_park_y} F12000 + {% set approach_y = kick_park_y - 14 if kick_park_y > 128 else kick_park_y + 14 %} + G0 Y{approach_y} F12000 + G0 Y{kick_park_y} F1200 ; Slow final approach into the tray/cutter M400 G1 E-{retract_amount} F300 ; Retract slightly to reduce pressure during kick M106 S255 ; Full blast fan to solidify plastic From a21930ad83b81520c04bbc2d82cabcf1a8e44591 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Fri, 25 Sep 2026 18:56:46 -0400 Subject: [PATCH 05/11] klipper: disable CC2 chamber sensor until DSP mcu has ADC --- .../klipper/files/centauri-carbon-2/machine.cfg | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index 4c259131..24a074fc 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -368,12 +368,14 @@ runout_gcode: white_pin: PB5 initial_WHITE: 1 -[temperature_sensor chamber] -sensor_pin: PB13 -sensor_type: NTC 100K beta 3950 -pullup_resistor: 22000 -min_temp: 0 -max_temp: 125 +# Disabled: vendor CC2 box NTC is PC3 on the mainboard MCU (vendor printer.cfg), +# but the cosmos DSP-port mcu has no ADC mapped for it; config rejected by the mcu. +# [temperature_sensor chamber] +# sensor_pin: PC3 +# sensor_type: NTC 100K beta 3950 +# pullup_resistor: 22000 +# min_temp: 0 +# max_temp: 125 [fan_generic aux_fan] pin: PD15 From 31319b0dc87399789e3e9617f5ced2062f9cd366 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Fri, 25 Sep 2026 23:17:37 -0400 Subject: [PATCH 06/11] klipper: document CC2 chamber NTC on PH0, keep disabled --- .../klipper/files/centauri-carbon-2/machine.cfg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index 24a074fc..0e1d1eef 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -368,10 +368,11 @@ runout_gcode: white_pin: PB5 initial_WHITE: 1 -# Disabled: vendor CC2 box NTC is PC3 on the mainboard MCU (vendor printer.cfg), -# but the cosmos DSP-port mcu has no ADC mapped for it; config rejected by the mcu. +# Disabled: CC2 box NTC is PH0 (SoC GPADC0) per vendor printer_dsp_new.cfg, but +# the kalico DSP-mcu firmware shuts down when ADC sampling starts on PH0. +# Needs GPADC support in kalico-firmware-dsp before enabling. # [temperature_sensor chamber] -# sensor_pin: PC3 +# sensor_pin: PH0 # sensor_type: NTC 100K beta 3950 # pullup_resistor: 22000 # min_temp: 0 From df33743437759dfd212e933a3e77aee500718624 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Sat, 26 Sep 2026 14:49:50 -0400 Subject: [PATCH 07/11] klipper: use CC2 DSP-board geometry for tray and cutter --- .../klipper/files/centauri-carbon-2/machine.cfg | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index 0e1d1eef..de2325eb 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -432,13 +432,14 @@ release_gcode: RESPOND TYPE=echo MSG="Front cover has been re-attached" # Motion geometry consumed by macros.cfg (defaults there match the CC1 values) +# CC2 DSP-board values from vendor printer_dsp_new.cfg: tray/wiper on the LEFT, +# cutter front-right. (Base printer.cfg is the old board rev; do not use it.) [gcode_macro _MACHINE_VARS] -variable_tray_x: 204 -variable_wipe_x_start: 188 -variable_kick_x: 254 +variable_tray_x: 52 +variable_wipe_x_start: 80 +variable_kick_x: 254.5 variable_kick_f: 3000 -# CC2 cutter is front-right: park at (245,25), ram to kick_x, seat at Y3 variable_kick_park_x: 245 variable_kick_park_y: 25 -variable_kick_corner_y: 3 +variable_kick_corner_y: 2.5 gcode: From 6f82b5523c81fa023f9273e8723d550774e8afa2 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Sat, 26 Sep 2026 14:56:06 -0400 Subject: [PATCH 08/11] klipper: move CC1 kick to the front-right cutter corner --- .../klipper/files/centauri-carbon-1/machine.cfg | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg index 663e2200..0126e06e 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/machine.cfg @@ -366,8 +366,12 @@ press_gcode: # CANVAS board detected. [gcode_macro _MACHINE_VARS] variable_tray_x: 202 variable_wipe_x_start: 187 -variable_kick_x: 186 -variable_kick_f: 8000 -variable_kick_park_x: 202 -variable_kick_park_y: 264 +# CC1 cutter is the front-right corner: vendor does Y30 -> X255 -> seat Y3 +# (change_filament.cpp). kick_x == park_x makes the ram a no-op; the cut is +# the corner seat. +variable_kick_x: 255 +variable_kick_f: 4500 +variable_kick_park_x: 255 +variable_kick_park_y: 30 +variable_kick_corner_y: 3 gcode: From 102177768d1811aae4770bff471bde8d6134a4cb Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Sat, 26 Sep 2026 15:08:32 -0400 Subject: [PATCH 09/11] macros: optional post-cut Z shake, enabled on CC2 --- .../klipper/files/centauri-carbon-2/machine.cfg | 3 +++ .../recipes-apps/klipper/files/macros.cfg | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index de2325eb..bf41ba33 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -442,4 +442,7 @@ variable_kick_f: 3000 variable_kick_park_x: 245 variable_kick_park_y: 25 variable_kick_corner_y: 2.5 +# Vendor shake_gcode (printer_dsp_new.cfg): Z-hop then 20x +-0.5mm to fling the +# severed nub off the nozzle after the cut +variable_kick_shake_times: 20 gcode: diff --git a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg index 9d9eb3e5..107d23d1 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg @@ -410,6 +410,16 @@ gcode: {% endif %} M106 S0 ; Turn off fan + {% if mv.kick_shake_times is defined %} + G91 ; Relative positioning for the shake + G1 Z2 F1200 ; Hop off + {% for i in range(mv.kick_shake_times|int) %} + G1 Z0.5 F1200 + G1 Z-0.5 F1200 + {% endfor %} + G90 ; Back to absolute + {% endif %} + G1 Y250 F6000 ; Exit M400 ; Wait for movements to complete From fdf2c841ecba750e81ea645963c32f5b0e9c2911 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Sun, 27 Sep 2026 19:08:09 -0400 Subject: [PATCH 10/11] macros: define global in PURGE --- meta-opencentauri/recipes-apps/klipper/files/macros.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg index 107d23d1..5fed1218 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg @@ -951,6 +951,7 @@ gcode: [gcode_macro PURGE] gcode: + {% set global = printer['gcode_macro _global_var'] %} {% set purge_length = params.PURGE_LENGTH|default(200, true)|float %} {% if printer.extruder.target < 180 or not printer.extruder.can_extrude %} From 947a306f5fa88e9050e8e5c1370e16a259767cc1 Mon Sep 17 00:00:00 2001 From: Paul Swenson Date: Sun, 27 Sep 2026 19:11:58 -0400 Subject: [PATCH 11/11] macros: document James's v-slot KICK variant in comment --- .../recipes-apps/klipper/files/macros.cfg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg index 5fed1218..f4aef9fa 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/macros.cfg @@ -424,6 +424,20 @@ gcode: M400 ; Wait for movements to complete +# The active KICK above follows the stock vendor cut: park at the cutter +# corner, press in, seat (Elegoo app change_filament.cpp: Y30 -> X255 -> Y3 on +# CC1; (245,25) -> X254.5 -> Y2.5 on CC2). James replaced the cut with a +# v-slot swipe in 4025623 (2026-09-18, "Wipe after print; reconcile KICK and +# CLEAN_NOZZLE; Don't unload after cancel", PR #329); his version, commented +# out, was: +# +# G4 P2000 ; Wait 2 seconds for fan to do its work +# G1 F8000 ; Set feedrate +# G1 X{self.end_kick_x} ; Swipe over the v-slot (into) +# G1 X193 ; Swipe over the v-slot (out of) +# G1 X{self.end_kick_x} ; Swipe over the v-slot (into) +# M107 ; Turn off fan + [gcode_macro _LOAD_FILAMENT_STEP_PUSH] gcode: RESPOND TYPE=command MSG="action:prompt_begin Load Filament"