Skip to content

KTC ‐ Command Reference

Andrei Ignat edited this page Mar 18, 2024 · 3 revisions
Command Description
KTC_TOOLCHANGER_ENGAGE Engage or lock the tool.
KTC_TOOLCHANGER_DISENGAGE Disengage or unlock from the tool.
KTC_Tn Select the tool with number n.
KTC_DESELECT_ALL Recursivley deselects all tools.
KTC_TOOL_SET_TEMPERATURE [TOOL=<tool_name>] [ACTV_TMP= STDB_TMP Set tool temperature. If TOOL parameter is omited then current tool is set.
KTC_SET_AND_SAVE_PARTFAN_SPEED Set the partcooling fan speed current or specified tool. Fan speed is carried over between toolchanges.
KTC_TEMPERATURE_WAIT_WITH_TOLERANCE Waits for all temperatures, or a specified tool or heater's temperature. This command can be used without any additional parameters and then waits for bed and current extruder. Only one of either TOOL or HEATER may be used.

#f03c15 #c5f015 #1589F0 Basic Toolchanger functionality

Command Description
KTC_TOOLCHANGER_ENGAGE Engage or lock the tool.
* Toolchanger.state must be at least INITIALIZING.
- Runs 'engage_gcode:' if it is specified. Otherwise will set toolchanger.status to ENGAGED.
KTC_TOOLCHANGER_DISENGAGE Disengage or unlock from the tool.
KTC_Tn Select the tool with number n.
KTC_DESELECT_ALL
KTC_TOOL_SET_TEMPERATURE Set tool temperature. If TOOL parameter is omited then current tool is set.
KTC_SET_AND_SAVE_PARTFAN_SPEED Set the partcooling fan speed current or specified tool. Fan speed is carried over between toolchanges.
KTC_TEMPERATURE_WAIT_WITH_TOLERANCE Waits for all temperatures, or a specified tool or heater's temperature. This command can be used without any additional parameters and then waits for bed and current extruder. Only one of either TOOL or HEATER may be used.

#f03c15 #c5f015 #1589F0 Basic Toolchanger functionality

Command Description                                     Parameters                                    
KTC_TOOLCHANGER_ENGAGE Engage or lock the tool.
KTC_TOOLCHANGER_DISENGAGE Disengage or unlock from the tool.
KTC_Tn Activates heater, pick up and readyy the tool. If tool is mapped to another one then that tool will be selected instead. RESTORE_AXIS=[XYZ] Restore specified axis position to the latest saved.
KTC_DESELECT_ALL Unloads and parks the current tool without picking up another tool, leaving the toolhead free and unlocked. Actual active extruder eill still be last used one as Klipper needs an active extruder.
KTC_TOOL_SET_TEMPERATURE Set tool temperature. If TOOL parameter is omited then current tool is set. TOOL=[0..n] Optional if other than current loaded tool
ACTV_TMP=... Set Active temperature, optional
STDB_TMP =... Standby temperature, optional
CHNG_STATE=[0|1|2] Change Heater State, optional:
(0 = Off) | (1 = Standby) | (2 = Active)
SHTDWN_TIMEOUT=... Time in seconds to wait with the heater in standby before changing it to off, optional.
STDB_TIMEOUT=... Time in seconds to linger at Active temp. after setting the heater to standby when the standby temperature is lower than current tool temperature, optional.
SHTDWN_TIMEOUT is used for example so a tool used only on first few layers shuts down after 30 minutes of inactivity and won't stay at 175*C standby for the rest of a 72h print.
STDB_TIMEOUT= Time to linger at Active temp. after setting the heater to standby. Could be used for a tool with long heatup times and is only put in standby short periods of thme throughout a print and should stay at active temperature longer time.
KTC_SET_AND_SAVE_PARTFAN_SPEED Set the partcooling fan speed current or specified tool. Fan speed is carried over between toolchanges. S=[0-255 | 0-1] Fan speed with either a maximum of 255 or 1.
P=[0-n] Tool number if not current tool to set fan to.
KTC_TEMPERATURE_WAIT_WITH_TOLERANCE Waits for all temperatures, or a specified tool or heater's temperature. This command can be used without any additional parameters and then waits for bed and current extruder. Only one of either TOOL or HEATER may be used. TOOL=[0-n] Tool number to wait for, optional.
HEATER=[0-n] Heater number. 0="heater_bed", 1="extruder", 2="extruder1", 3="extruder2", etc. Only works if named as default, this way, optional.
TOLERANCE=[0-n] Tolerance in degC. Defaults to 1*C. Wait will wait until heater is in range of set temperature +/- tolerance.

#f03c15 #c5f015 #1589F0 Offset commands

Command Description                             Parameters                           &nbsp
KTC_GLOBAL_OFFSET_SAVE Set a global offset that can be applied to all tools. Can use absolute offset or adjust relative to current offset. X=... Set the new offset for the axis.
Y=... As above.
Z=... As above.
----------
X_ADJUST=... Adjust the offset position incramentally.
Y_ADJUST=... As above.
Z_ADJUST=... As above.
KTC_TOOL_OFFSET_SAVE Set the offset of an individual tool. Can use absolute offset or adjust relative to current offset. TOOL=[0-n] Tool number, optional. If not provided, the current tool is used.
----------
X=... Set the new offset for the axis.
Y=... As above.
Z=... As above.
----------
X_ADJUST=... Adjust the offset position incramentally.
Y_ADJUST=... As above.
Z_ADJUST=... As above.

#f03c15 #c5f015 #1589F0 Tool remapping commands

Command Description Parameters
KTC_TOOLS_DISPLAY Dump the current mapping of tools to other KTCC tools.
KTC_TOOL_MAP_NR Remap a tool to another one. RESET=[0|1] If 1 the stored tooö remap will be reset.
TOOL=[0-n] The toolnumber to remap.
SET=[0-n] The toolnumber to remap to.

#f03c15 #c5f015 #1589F0 Advanced commands, rarely used

Command Description Parameters
KTC_SET_ACTIVE_TOOL Set the current loaded tool manually to the specified. When loading a tool manually T=[-2-n] Tool to set as current. ( -2 = Unknown tool ), ( -1 = Toollock unlocked without tool )
KTC_SET_STATE .
KTC_TOOL_SET_STATE .
KTC_TOOLCHANGER_SET_STATE .
KTC_TOOLCHANGER_SET_SELECTED_TOOL .
KTCC_SET_PURGE_ON_TOOLCHANGE Sets a global variable that can disable all purging (can be used in macros) when loading/unloading tools. For example for automated tool alignement such as TAMV/ZTATP. VALUE=[0|1] If enabled or disabled.
KTC_TOOLCHANGER_INITIALIZE Wait for a ENDSTOP untill it is in the specified state indefinitly or for maximum atempts if specified. Checking state once a second. ENDSTOP=... Name of the endstop to wait for.
TRIGGERED=[0|1] If should be waiting for it to be triggered (1) or open (0).
ATEMPTS=... Number of atempts to make, indefinitly if not specified.
KTC_HEATERS_PAUSE Turns off all heaters configured for tools and saves changes made to be resumed later by KTCC_RESUME_ALL_TOOL_HEATERS. This does not affect heated beds or other heaters not defined as aan extruder in tools.
KTC_HEATERS_RESUME Resumes all heaters previously turned off by KTCC_SET_ALL_TOOL_HEATERS_OFF. MSG=... The message to be sent

#f03c15 #c5f015 #1589F0 Status, Logging and Persisted state

Command Description Parameters
KTCC_DUMP_STATS Dump the KTCC statistics to console.
KTCC_RESET_STATS Reset all the KTCC statistics. SUERE=[yes|no] If "yes" the stored statistics will be reset.
KTCC_INIT_PRINT_STATS Run at start of a print to initialize and reset the KTCC print statistics
KTCC_DUMP_PRINT_STATS Run at end of a print to dump statistics since last print reset to console.
KTCC_SET_LOG_LEVEL Set the log level for the KTCC LEVEL=[0-3] How much to log to console: ( 0 = Only the Always messages ) ( 1 = Info messages and above ) ( 2 = Debug messages and above ) ( 3 = Trace messages and above )
LOGFILE=[0-3] How much to log to file. Levels as above.
KTCC_LOG_TRACE Send a message to log at this logging level MSG=... The message to be sent
KTCC_LOG_DEBUG Send a message to log at this logging level MSG=... The message to be sent
KTCC_LOG_INFO Send a message to log at this logging level MSG=... The message to be sent
KTCC_LOG_ALWAYS Send a message to log at this logging level MSG=... The message to be sent

#f03c15 #c5f015 #1589F0 Debuging

Command Description Parameters
KTC_DEBUG_HEATERS Dumps information about heaters not being off.
KTC_DEBUG_TOOLS Dumps information about tools. SUERE=[yes|no] If "yes" the stored statistics will be reset.