Skip to content

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>

Example
SET_AFC_TOOLCHANGES TOOLCHANGES=100

[HUB_LOAD]

This function handles the loading of a specified lane into the hub. It performs several checks and movements to ensure the lane is properly loaded.

Usage

HUB_LOAD LANE=<lane>

Example
HUB_LOAD LANE=lane1

[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)

Example
CHANGE_TOOL LANE=lane1 PURGE_LENGTH=100

[AFC_STATUS]

This function generates a status message for each unit and lane, indicating the preparation, loading, hub, and tool states. The status message is formatted with HTML tags for display.

Usage

AFC_STATUS

Example
AFC_STATUS

[TURN_OFF_AFC_LED]

This macro handles turning off all LEDs for AFC_led configurations. Color for LEDs are saved if colors are changed while they are turned off.

Usage

TURN_OFF_AFC_LED

Example
TURN_OFF_AFC_LED

[TURN_ON_AFC_LED]

This macro handles turning on all LEDs for AFC_led configurations. LEDs are restored to last previous state.

Usage

TURN_ON_AFC_LED

Example
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

Example
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

Example
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>

Example

(Resets lane1 to the hub with a move of 50mm)

AFC_LANE_RESET LANE=lane1 DISTANCE=50
(Resets lane2 to the hub using default settings)
AFC_LANE_RESET LANE=lane2


[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>

Example

(Shows the prompt for resetting lanes with a distance value of 30mm)

AFC_RESET DISTANCE=30
(Shows the prompt for resetting lanes without specifying a distance)
AFC_RESET


[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>

Example
TEST LANE=lane1

[HUB_CUT_TEST]

This function tests the cutting sequence of the hub cutter for a specified lane. It retrieves the lane specified by the 'LANE' parameter, performs the hub cut, and responds with the status of the operation.

Usage

HUB_CUT_TEST LANE=<lane>

Example
HUB_CUT_TEST LANE=lane1