Misc. Commands
Miscellaneous Commands¶
These commands are used for various purposes, including error handling, tool changes, and AFC status updates.
[SET_AFC_TOOLCHANGES]
This macro can be used to set the total number of tool changes from the slicer. AFC will keep track of tool changes and print out the current tool change number when a T(n) command is called from G-code.
The following call can be added to the slicer by adding the following lines to the Change filament G-code section in your slicer.
You may already have T[next_extruder]
, just make sure the tool change call is after your T(n) call:
T[next_extruder] { if toolchange_count == 1 }SET_AFC_TOOLCHANGES TOOLCHANGES=[total_toolchanges]{endif }
The following can also be added to your PRINT_END
section in your slicer to set the number of tool changes back to zero:
SET_AFC_TOOLCHANGES TOOLCHANGES=0
Usage
SET_AFC_TOOLCHANGES TOOLCHANGES=<number>
[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.
Usage
CHANGE_TOOL LANE=<lane> PURGE_LENGTH=<purge_length>(optional value)
[AFC_STATUS]
[TURN_OFF_AFC_LED]
[TURN_ON_AFC_LED]
[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 function 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. 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]