Repository navigation
fix(macros): Fix extrusion mode, error handling and Klipper compatibility - #67
AlexandrTyshchenko wants to merge 1 commit into
Conversation
…lity - TIP_FORMING and M603 assumed relative extrusion but never set M83. In absolute mode (Klipper's default after a restart) the retraction re-extruded 9.4mm and the cooling moves swung 20mm. Use M83 and restore the previous gcode state afterwards. - _ERROR called CANCEL_PRINT, but the rest of PRINT_START (homing, heating, mesh, purge) kept running. Raise an error instead, which stops the macro and lets on_error_gcode cancel the print. - PRINT_END (also run by CANCEL_PRINT) moved Z/XY even when not homed, failing with "Must home axis first" before BASE_CANCEL_PRINT ran. - PRINT_START waited for the bed to reach 0C forever with BED=0. - Remove the M204 override: SET_VELOCITY_LIMIT ACCEL_TO_DECEL was removed from Klipper (20250811), so every M204 dumped the velocity limits to the console. Klipper's own M204 handles S and P/T. - hall_filament_width_sensor: set enable_flow_compensation: False (Klipper 2026-04-08+), otherwise it resets the flow rate to 100% every second once the sensor is enabled at print start.
|
"enable_flow_compensation" works fine for me, are you having any particular issues with it? |
|
It works in the sense that it doesn't break anything, but with this config it can't do anything except reset the flow. In Klipper the compensation window is |
M83. In absolute mode (Klipper's default after a restart) the "retraction" re-extruded 9.4 mm (-15, +9.4, +4.0, +0.8) and the cooling moves swung 20 mm instead of 10. NowM83is set and the previous gcode state is restored afterwards (SAVE_GCODE_STATE/RESTORE_GCODE_STATE).CANCEL_PRINT, but the rest of the already-runningPRINT_START(homing, heating, mesh, purge) continued. It now raises an error (action_raise_error), which stops the macro; during a printvirtual_sdcardthen runson_error_gcode: CANCEL_PRINT.CANCEL_PRINT) moved Z/XY even when not homed, failing with "Must home axis first" beforeBASE_CANCEL_PRINTran. Moves are now skipped unlessxyzis homed.BED=0waited forever for the bed to reach 0 °C (MINIMUM=0 MAXIMUM=0). The wait is skipped when the bed is off.SET_VELOCITY_LIMIT ACCEL_TO_DECELwas removed from Klipper (Config_Changes 20250811), so every slicerM204dumped the velocity limits to the console. Klipper's nativeM204handlesSandmin(P,T).enable_flow_compensation: False. It defaults to True, so afterENABLE_FILAMENT_SENSORSthe sensor sendsM221 S100every second and any flow override (e.g. the Fluidd slider) is reset. The option exists since Klipper 2026-04-08; OpenQ1 already needs newer Klipper for qidi_auto_z_offset.Testing: rendered the macros with Klipper's Jinja2 settings and emulated the extruder position for M82/M83/G92/SAVE/RESTORE, on
mainand on this branch: TIP_FORMING/M603 from M82 now give-15, -5.6, -1.6, -0.8, ±10 cooling, then-90, and return to M82; PRINT_START without an offset stops before G28/heating; PRINT_END renders no moves when unhomed; no bed wait withBED=0. Not tested on hardware.