Misc. Commands
Miscellaneous Commands¶
These commands are used for various purposes, including error handling, tool changes, and AFC status updates.
[AFC_TOGGLE_MACRO]
[AFC_QUIET_MODE]
Set lower speed on any filament moves.
Mainly this would be used to turn down motor noise during late quiet runs. Only exceptions are during bowden calibration and lane reset, which are manually triggered
Usage
AFC_QUIET_MODE SPEED=<new quietmode speed> ENABLE=<1 or 0>
[HUB_LOAD]
[CHANGE_TOOL]
This function handles the tool change process. It retrieves the lane specified by the 'LANE' parameter, checks the filament sensor, saves the current position, and performs the tool change by unloading the current lane and loading the new lane.
Optionally setting PURGE_LENGTH parameter to pass a value into poop macro.
Optionally setting NEW_EXTRUDER_TEMP to set and wait for that temperature on the new extruder before performing the tool change.
Usage
CHANGE_TOOL LANE=<lane> PURGE_LENGTH=<purge_length>(optional) NEW_EXTRUDER_TEMP=<temp>(optional)
[TURN_OFF_AFC_LED]
[TURN_ON_AFC_LED]
[AFC_SET_EXTRUDER_LED]
Macro call to set print led in toolhead based on extruder name. Led config name needs to be
set to AFC_extruder led_name variable. Status led in toolhead will not be affected if status_led_idx
is set in AFC_extruder config. If nozzle_led_idx is set in AFC_extruder configuration then just
those leds will be turned on. If nozzle_led_idx is not provided then all leds not in defined in
status_led_idx will be turned on.
EXTRUDER - AFC_extruder config name to print leds. If single toolhead, this will always be extruder
TURN_ON - set to 1 to turn on leds, set to 0 to turn off leds. If not supplied, defaults to 1
Usage
AFC_SET_EXTRUDER_LED EXTRUDER=<extruder name> TURN_ON=<0/1>
[RESET_FAILURE]
This function clears the error state of the AFC system by setting the error state to False.
Usage
RESET_FAILURE
Example
RESET_FAILURE
[AFC_RESUME]
During the PREP phase of startup, the user's RESUME macro is renamed and replaced with AFC_RESUME. This function clears the error state of the AFC system, sets the in_toolchange flag to False, runs the resume script, and restores the toolhead position to the last saved position.
This is not a macro that should normally need to be called by the user.
Usage
AFC_RESUME
[AFC_PAUSE]
During the PREP phase of startup, the user's PAUSE macro is renamed and replaced with AFC_PAUSE. This function pauses the print, raises the Z axis by the z-hop amount, and then calls the user's pause macro.
This is not a macro that should normally need to be called by the user.
Usage
AFC_PAUSE
[AFC_LANE_RESET]
This macro resets a specified lane to the hub position in the AFC system. It checks for various error conditions, such as whether the toolhead is loaded or whether the hub is already clear. The function moves the lane back to the hub based on the specified or default distances, ensuring the lane's correct state before completing the reset.
Usage
AFC_LANE_RESET LANE=<lane> DISTANCE=<distance>
[AFC_RESET]
This function opens a prompt allowing the user to select a loaded lane for reset. It displays a list of loaded lanes and provides a reset button for each lane. If no lanes are loaded, an informative message is displayed indicating that a lane must be loaded to proceed with resetting.
Usage
AFC_RESET DISTANCE=<distance>
[TEST]
This function tests the assist motors of a specified lane at various speeds.
Spins the spoolers in reverse like trying to rewind the spool.
It performs the following steps:
1. Retrieves the lane specified by the 'LANE' parameter.
2. Tests the assist motor at full speed, 50%, 30%, and 10% speeds.
3. Reports the status of each test step.
Usage
TEST LANE=<lane>
[HUB_CUT_TEST]
[AFC_STATS]
This macro handles printing toolchange statistics to console.
Optional Values
Set SHORT=1 to have a smaller print that fits better on smaller screens. Setting print_short_stats
variable in [AFC] section in the AFC.cfg file to True will always print statistics in short form.
Usage
AFC_STATS SHORT=<1|0>
[AFC_CHANGE_BLADE]
This macro handles resetting cut total since blade was last changed and updates the data the blade was last changed to current date time when this macro was run.
Extruder variable is optional and will default to 'extruder'
Usage
AFC_CHANGE_BLADE EXTRUDER=<extruder>
[AFC_RESET_STATS]
This macro handles resetting extruder(s) and lane(s) change total's. You can reset
each extruder or lane one by one or use all. When using the command,
moonrakers database will be backedup just incase you want to restore the old data.
When using all for extruders, this will trigger AFC will to start using a different
calculation when printing lane change times. AFC will now keep track of the total
times and divide by the number of changes.
For example the following will reset extruder change times/counts and start using the new calculation.
AFC_RESET_STATS EXTRUDER=all
Usage
AFC_RESET_STATS EXTRUDER=<extruder_name> LANE=<lane_name>
[AFC_CLEAR_MESSAGE]
[AFC_HOME_UNIT]
[AFC_M104]
Overrides Klipper's default M104 command to set extruder temperature without waiting. Extends klippers default behavior by adding support for tool number (T) parameter.
T - Tool number to set temperature for. Defaults to current extruder if not specified.
S - Temperature to set. Defaults to 0 if not specified.
Usage
AFC_M104 T<extruder> S<temperature>
or
M104 T<extruder> S<temperature>
[AFC_M109]
Overrides Klipper's default M109 command to set extruder temperature and wait for it to be reached. Extends klippers default behavior by adding support for tool number (T) and deadband (D) parameters.
T - Tool number to set temperature for. Defaults to current extruder if not specified.
S - Temperature to set. Defaults to 0 if not specified.
D - Deadband in degrees Celsius. When specified, AFC will wait until the extruder is within
+/- this value of the target temperature before continuing.
Usage
AFC_M109 T<extruder> S<temperature> D<deadband>
or
M109 T<extruder> S<temperature> D<deadband>