Adding parameters to END_PRINT
Hi folks,
just don´t want to change the END_PRINT macro or pull it out and add it to an own cfg.
I really would like to move z to a defined hight like 200 before the motors are switched off.
Further more, I would really like to ad a call for a special gcode at the end of the END_PRINT:
This gcode will wait until the heaters are cooled down and then shut down Klipper and after some waiting time it calls my Tasmota to switch off.
What should I do to get this working from your perspective?
11 Replies
Look at the various built in variables and hooks you can override https://os.ratrig.com/docs/configuration/macros
Configuring RatOS Macros | RatOS
RatOS comes with a bunch of flexible predefined macro's that can be customized via variables and macro hooks.
So far okay, I got that.
Nevertheless wouldn´t it be nice to have this as a variable in the printer.cfg, as it is for the printhead:
variable_end_print_park_in: "back"
like:
variable_end_print_z_park_in: 200
Other than that...
There is a macro hook called: _USER_END_FEATURE
When is this hook called? Is it used at all?
I know... If you have something printed which is higher than 200, you would run into an issue. So this needs to get calculated from the current hight.
Okay, so let´s forget about the _USER_END_PRINT_AFTER_HEATERS_OFF hook.
But I still would like to have at least the possibility to call some gcode after the print is ready and the END_PRINT is done.
Couldn´t we get added the _USER_END_FEATURE at the end of the END_PRINT?
As long it is empty nothing would happen, but the user would be able to add something instead of just manually run an additional gcode afterwards...
@Helge Keck is this something one could think of?
use
_USER_END_PRINT_PARK
macro to set your z height
and for the rest jsut create another macro and put it after END_PRINT in your slicer and you are doneyeah - like what I do
https://github.com/jscancella/myKlipperFiles/blob/main/vcore3-printer.cfg#L309-L322
Okay, that´s the other way round... but that is some solution at least.
Thanks guys... didn´t think about using the slicer for that.
You can supply any parameter you want to END_PRINT, they will be passed down to the _USER hooks.
For example
printer.cfg
Will print
Park in center
before END_PRINT
calls _END_PRINT_PARK
to park the print head.
If you want to change the behavior of the endprint parking, i would override _END_PRINT_PARK specifically. If it's dependent on parameters, override _END_PRINT_PARK with a blank gcode parameter, and handle all the logic in _USER_END_PRINT_PARK.I´m still waiting for my heater for the hotend so could not test yet.
I just added this to my own_macros.cfg which is included in the printer.cfg:
[gcode_macro _USER_END_PRINT_PARK]
gcode:
G1 z 300
That'll do 👍
Well... so far so good, but I do have still an issue with the END_PRINT.
If I call my script to shut down printer and stuff after the print is ready with this macro:
which is called in Orca after the END_PRINT as seen in my screenshot, the print does never reach 100%. It get stuck at 99% and the print is saved as error.
Installed is v2.1.0-RC2-109-g975b128f
Any idea how to wait for print finish (100%) to make sure all things are done?
try it with a delayed gcode macro
should do the trick
and after
END_PRINT
in the slicer you call it with
I´ll give it a try today. Thanks for the hint.
OKay, I edited my macros now like this:
Update: That did the trick, thanks mate.
I just had to add "CHAMBER_HEATER_OFF" after "gcode:" because the chamber heater kept heating for any reason. After that I had no issues.