This document contains info on how code is divided between the trad_rack klippy module and the config, how to customize Trad Rack's behavior through gcode templates, and what the trad_rack_optional config file does.
Table of Contents
Most of Trad Rack's functionality is handled through the trad_rack klippy module. This functionality includes any behaviors that are considered "universal" enough that they should require no customization besides simple config value changes, but (hopefully) no more than that. All other behaviors that may require more extensive customization, such as filament tip-shaping or cutting procedures, are handled through gcode templates to allow for more user customization. The following gcode templates are currently available:
pre_unload_gcode
: Gcode command template that is run before the toolhead is unloaded. The default is to run no extra commands.post_unload_gcode
: Gcode command template that is run after the toolhead is unloaded. The default is to run no extra commands.pre_load_gcode
: Gcode command template that is run before the toolhead is loaded. The default is to run no extra commands.post_load_gcode
: Gcode command template that is run after the toolhead is loaded. The default is to run no extra commands.pause_gcode
: Gcode command template that is run whenever Trad Rack needs to pause the print (usually due to a failed load or unload). The default is to run the PAUSE gcode command.resume_gcode
: Gcode command template that is run whenever the TR_RESUME command needs to resume the print. The default is to run the RESUME gcode command.
trad_rack_optional.cfg
provides a recommended example implementation of pre_unload_gcode
and post_load_gcode
.1 It is highly recommended to include this file
when getting started with Trad Rack; it provides several useful
features, and the provided slicer profiles (as well
as the suggested
changes to make to existing slicer profiles)
were made with the assumption that this file is being used. However,
you are encouraged to modify or replace this file to fit your needs.
[gcode_macro TR_Variables]
contains several variables that allow for
quick customization. This includes adjusting positions as well as
enabling or disabling features. See the comments next to these
variables for more details.
[gcode_macro Shape_Tip]
is used for shaping the tip of the filament
before unloading. This can include mimicing ramming and unload
behavior from the slicer, filament cutting, etc.
By default, the Shape_Tip
macro is called in pre_unload_gcode
before unloading only if a print is not in progress (since it is
assumed that your print gcode file will contain tip-shaping gcode of
its own). It is also possible to use the Shape_Tip
macro during a
print; see the
Slicing document for
more details.
By default, the Shape_Tip
macro will call Slicer_Unload
. This is
another macro defined in
trad_rack_optional.cfg
that mimics ramming and/or unload behavior from PrusaSlicer or
SuperSlicer. If you want the Shape_Tip
macro to do something else
instead (for example if you are using a filament cutter and don't need
the typical tip-shaping procedure), you can replace the call to
Slicer_Unload
with something else.
trad_rack_optional.cfg adds the following macros. See the comments in the file for information on how these macros are meant to be used and what parameters they expect:
-
TR_Variables
: Contains variables for quick customization ofpre_unload_gcode
andpost_load_gcode
. See main settings. -
Shape_Tip
: Macro that gets called inpre_unload_gcode
whenever Trad Rack inserts its own gcode for tip-shaping. See tip shaping. -
Set_Slicer_Unload_Preset
: Applies setting presets for theSlicer_Unload
macro. Presets can be defined by creating new variables in[gcode_macro Set_Slicer_Unload_Preset]
. -
Slicer_Unload
: Mimics the ramming and/or unload behavior of PrusaSlicer or SuperSlicer. Settings can be adjusted by directly adjusting the macro's variables or by usingSet_Slicer_Unload_Preset
. Most variable names match the "parameter names" used in the slicer. -
_Wait_for_Toolchange_Temp
: Helper macro forSlicer_Unload
. -
Home_and_Wipe_Nozzle
: Used inpre_unload_gcode
(ifvariable_use_wiper
is set toTrue
in[gcode_macro TR_Variables]
). See the comment in[gcode_macro TR_Variables]
next tovariable_use_wiper
for more details. -
Save_Pressure_Advance
: Saves the current pressure advance value so that it can be restored after tip-shaping. See the Slicing document for how this macro is meant to be used. This macro may be useful if you set pressure advance only at the start of a print. -
Restore_Pressure_Advance
: Used bypost_load_gcode
to restore the pressure advance value saved bySave_Pressure_Advance
after a toolchange.
Footnotes
-
post_unload_gcode
,pre_load_gcode
,pause_gcode
, andresume_gcode
are left at their default values. ↩