diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index f7781484..f4b36e70 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -788,8 +788,7 @@ recommended to define a safe_z_home section in printer.cfg to home toward the center of the print area. See the [bed mesh guide](Bed_Mesh.md) and -[command reference](G-Codes.md#mesh-bed-leveling) for additional -information. +[command reference](G-Codes.md#bed_mesh) for additional information. Visual Examples: ``` @@ -903,7 +902,7 @@ Bed tilt compensation. One may define a bed_tilt config section to enable move transformations that account for a tilted bed. Note that bed_mesh and bed_tilt are incompatible; both cannot be defined. -See the [command reference](G-Codes.md#bed-tilt) for additional +See the [command reference](G-Codes.md#bed_tilt) for additional information. ``` @@ -941,8 +940,7 @@ config section to enable a BED_SCREWS_ADJUST g-code command. See the [leveling guide](Manual_Level.md#adjusting-bed-leveling-screws) and -[command reference](G-Codes.md#bed-screws-helper) for additional -information. +[command reference](G-Codes.md#bed_screws) for additional information. ``` [bed_screws] @@ -987,8 +985,8 @@ g-code command. See the [leveling guide](Manual_Level.md#adjusting-bed-leveling-screws-using-the-bed-probe) -and [command reference](G-Codes.md#bed-screws-tilt-adjust-helper) for -additional information. +and [command reference](G-Codes.md#screws_tilt_adjust) for additional +information. ``` [screws_tilt_adjust] @@ -1027,7 +1025,7 @@ additional information. Multiple Z stepper tilt adjustment. This feature enables independent adjustment of multiple z steppers (see the "stepper_z1" section) to adjust for tilt. If this section is present then a Z_TILT_ADJUST -extended [G-Code command](G-Codes.md#z-tilt) becomes available. +extended [G-Code command](G-Codes.md#z_tilt) becomes available. ``` [z_tilt] @@ -1120,7 +1118,7 @@ printer skew across 3 planes, xy, xz, yz. This is done by printing a calibration model along a plane and measuring three lengths. Due to the nature of skew correction these lengths are set via gcode. See [Skew Correction](Skew_Correction.md) and -[Command Reference](G-Codes.md#skew-correction) for details. +[Command Reference](G-Codes.md#skew_correction) for details. ``` [skew_correction] @@ -1199,8 +1197,8 @@ endstop switches. Add a bare "[endstop_phase]" declaration to enable the ENDSTOP_PHASE_CALIBRATE command. See the [endstop phases guide](Endstop_Phase.md) and -[command reference](G-Codes.md#endstop-adjustments-by-stepper-phase) -for additional information. +[command reference](G-Codes.md#endstop_phase) for additional +information. ``` [endstop_phase stepper_z] @@ -1265,7 +1263,7 @@ G-Code macros (one may define any number of sections with a Execute a gcode on a set delay. See the [command template guide](Command_Templates.md#delayed-gcodes) and -[command reference](G-Codes.md#delayed-gcode) for more information. +[command reference](G-Codes.md#delayed_gcode) for more information. ``` [delayed_gcode my_delayed_gcode] @@ -1287,7 +1285,7 @@ gcode: Support saving variables to disk so that they are retained across restarts. See [command templates](Command_Templates.md#save-variables-to-disk) and -[G-Code reference](G-Codes.md#save-variables) for further information. +[G-Code reference](G-Codes.md#save_variables) for further information. ``` [save_variables] @@ -1338,7 +1336,7 @@ a belt printer, can find use in looping sections of the sdcard file. (For example, to print the same part over and over, or repeat the a section of a part for a chain or other repeated pattern). -See the [command reference](G-Codes.md#sdcard-loop) for supported +See the [command reference](G-Codes.md#sdcard_loop) for supported commands. See the [sample-macros.cfg](../config/sample-macros.cfg) file for a Marlin compatible M808 G-Code macro. @@ -1350,7 +1348,7 @@ file for a Marlin compatible M808 G-Code macro. Support manually moving stepper motors for diagnostic purposes. Note, using this feature may place the printer in an invalid state - see the -[command reference](G-Codes.md#force-movement) for important details. +[command reference](G-Codes.md#force_move) for important details. ``` [force_move] @@ -1362,7 +1360,7 @@ using this feature may place the printer in an invalid state - see the ### [pause_resume] Pause/Resume functionality with support of position capture and -restore. See the [command reference](G-Codes.md#pause-resume) for more +restore. See the [command reference](G-Codes.md#pause_resume) for more information. ``` @@ -1377,7 +1375,7 @@ information. Firmware filament retraction. This enables G10 (retract) and G11 (unretract) GCODE commands issued by many slicers. The parameters below provide startup defaults, although the values can be adjusted -via the SET_RETRACTION [command](G-Codes.md#firmware-retraction)), +via the SET_RETRACTION [command](G-Codes.md#firmware_retraction)), allowing per-filament settings and runtime tuning. ``` @@ -1412,7 +1410,7 @@ Support for gcode arc (G2/G3) commands. ### [respond] Enable the "M118" and "RESPOND" extended -[commands](G-Codes.md#send-message-respond-to-host). +[commands](G-Codes.md#respond). ``` [respond] @@ -1432,7 +1430,7 @@ Enable the "M118" and "RESPOND" extended ### [input_shaper] Enables [resonance compensation](Resonance_Compensation.md). Also see -the [command reference](G-Codes.md#resonance-compensation). +the [command reference](G-Codes.md#input_shaper). ``` [input_shaper] @@ -1471,10 +1469,9 @@ the [command reference](G-Codes.md#resonance-compensation). Support for ADXL345 accelerometers. This support allows one to query accelerometer measurements from the sensor. This enables an -ACCELEROMETER_MEASURE command (see -[G-Codes](G-Codes.md#adxl345-accelerometer-commands) for more -information). The default chip name is "default", but one may specify -an explicit name (eg, [adxl345 my_chip_name]). +ACCELEROMETER_MEASURE command (see [G-Codes](G-Codes.md#adxl345) for +more information). The default chip name is "default", but one may +specify an explicit name (eg, [adxl345 my_chip_name]). ``` [adxl345] @@ -1510,7 +1507,7 @@ Support for resonance testing and automatic input shaper calibration. In order to use most of the functionality of this module, additional software dependencies must be installed; refer to [Measuring Resonances](Measuring_Resonances.md) and the -[command reference](G-Codes.md#resonance-testing-commands) for more +[command reference](G-Codes.md#resonance_tester) for more information. See the [Max smoothing](Measuring_Resonances.md#max-smoothing) section of the measuring resonances guide for more information on `max_smoothing` parameter and its use. @@ -1829,8 +1826,7 @@ Support for additional steppers synchronized to the movement of an extruder (one may define any number of sections with an "extruder_stepper" prefix). -See the [command reference](G-Codes.md#extruder-stepper-commands) for -more information. +See the [command reference](G-Codes.md#extruder) for more information. ``` [extruder_stepper my_extra_stepper] @@ -1853,9 +1849,9 @@ Manual steppers (one may define any number of sections with a "manual_stepper" prefix). These are steppers that are controlled by the MANUAL_STEPPER g-code command. For example: "MANUAL_STEPPER STEPPER=my_stepper MOVE=10 SPEED=5". See -[G-Codes](G-Codes.md#manual-stepper-commands) file for a description -of the MANUAL_STEPPER command. The steppers are not connected to the -normal printer kinematics. +[G-Codes](G-Codes.md#manual_stepper) file for a description of the +MANUAL_STEPPER command. The steppers are not connected to the normal +printer kinematics. ``` [manual_stepper my_stepper] @@ -2010,8 +2006,8 @@ section. Generic heaters (one may define any number of sections with a "heater_generic" prefix). These heaters behave similarly to standard heaters (extruders, heated beds). Use the SET_HEATER_TEMPERATURE -command (see [G-Codes](G-Codes.md) for details) to set the target -temperature. +command (see [G-Codes](G-Codes.md#heaters) for details) to set the +target temperature. ``` [heater_generic my_generic_heater] @@ -2445,8 +2441,8 @@ fan that will be enabled whenever its associated sensor is above a set temperature. By default, a temperature_fan has a shutdown_speed equal to max_power. -See the [command reference](G-Codes.md#temperature-fan-commands) for -additional information. +See the [command reference](G-Codes.md#temperature_fan) for additional +information. ``` [temperature_fan my_temp_fan] @@ -2492,8 +2488,7 @@ additional information. Manually controlled fan (one may define any number of sections with a "fan_generic" prefix). The speed of a manually controlled fan is set -with the SET_FAN_SPEED -[gcode command](G-Codes.md#manually-controlled-fans-commands). +with the SET_FAN_SPEED [gcode command](G-Codes.md#fan_generic). ``` [fan_generic extruder_partfan] @@ -2516,7 +2511,7 @@ with the SET_FAN_SPEED Servos (one may define any number of sections with a "servo" prefix). The servos may be controlled using the SET_SERVO -[g-code command](G-Codes.md#servo-commands). For example: SET_SERVO +[g-code command](G-Codes.md#servo). For example: SET_SERVO SERVO=my_servo ANGLE=180 ``` @@ -2548,7 +2543,7 @@ pin: Neopixel (aka WS2812) LED support (one may define any number of sections with a "neopixel" prefix). One may set the LED color via "SET_LED LED=my_neopixel RED=0.1 GREEN=0.1 BLUE=0.1" type extended -[g-code commands](G-Codes.md#neopixel-and-dotstar-commands). +[g-code commands](G-Codes.md#neopixel). ``` [neopixel my_neopixel] @@ -2576,7 +2571,7 @@ pin: Dotstar (aka APA102) LED support (one may define any number of sections with a "dotstar" prefix). One may set the LED color via "SET_LED LED=my_dotstar RED=0.1 GREEN=0.1 BLUE=0.1" type extended -[g-code commands](G-Codes.md#neopixel-and-dotstar-commands). +[g-code commands](G-Codes.md#neopixel). ``` [dotstar my_dotstar] @@ -2651,7 +2646,7 @@ Run-time configurable output pins (one may define any number of sections with an "output_pin" prefix). Pins configured here will be setup as output pins and one may modify them at run-time using "SET_PIN PIN=my_pin VALUE=.1" type extended -[g-code commands](G-Codes.md#custom-pin-commands). +[g-code commands](G-Codes.md#output_pin). ``` [output_pin my_pin] @@ -2738,7 +2733,7 @@ pins: Configuration of Trinamic stepper motor drivers in UART/SPI mode. Additional information is in the [TMC Drivers guide](TMC_Drivers.md) -and in the [command reference](G-Codes.md#tmc-stepper-drivers). +and in the [command reference](G-Codes.md#tmcxxxx). ### [tmc2130] @@ -3663,8 +3658,8 @@ information on menu attributes available during template rendering. Filament Switch Sensor. Support for filament insert and runout detection using a switch sensor, such as an endstop switch. -See the [command reference](G-Codes.md#filament-sensor) for more -information. +See the [command reference](G-Codes.md#filament_switch_sensor) for +more information. ``` [filament_switch_sensor my_sensor] @@ -3703,8 +3698,8 @@ Filament Motion Sensor. Support for filament insert and runout detection using an encoder that toggles the output pin during filament movement through the sensor. -See the [command reference](G-Codes.md#filament-sensor) for more -information. +See the [command reference](G-Codes.md#filament_switch_sensor) for +more information. ``` [filament_motion_sensor my_sensor] diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 6450f0ef..6b903342 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -50,9 +50,1044 @@ to implement it with a custom example, one might use this to implement: `G12`, `G29`, `G30`, `G31`, `M42`, `M80`, `M81`, `T1`, etc. -### G-Code SD card commands +## Additional Commands -Klipper also supports the following standard G-Code commands if the +Klipper uses "extended" G-Code commands for general configuration and +status. These extended commands all follow a similar format - they +start with a command name and may be followed by one or more +parameters. For example: `SET_SERVO SERVO=myservo ANGLE=5.3`. In this +document, the commands and parameters are shown in uppercase, however +they are not case sensitive. (So, "SET_SERVO" and "set_servo" both run +the same command.) + +This section is organized my Klipper module name, which generally +follows the section names specified in the +[printer configuration file](Config_Reference.md). Note that some +modules are automatically loaded. + +### [adxl345] + +The following commands are available when an +[adxl345 config section](Config_Reference.md#adxl345) is enabled. + +#### ACCELEROMETER_MEASURE +`ACCELEROMETER_MEASURE [CHIP=] [NAME=]`: Starts +accelerometer measurements at the requested number of samples per +second. If CHIP is not specified it defaults to "adxl345". The command +works in a start-stop mode: when executed for the first time, it +starts the measurements, next execution stops them. The results of +measurements are written to a file named +`/tmp/adxl345--.csv` where `` is the name of the +accelerometer chip (`my_chip_name` from `[adxl345 my_chip_name]`) and +`` is the optional NAME parameter. If NAME is not specified it +defaults to the current time in "YYYYMMDD_HHMMSS" format. If the +accelerometer does not have a name in its config section (simply +`[adxl345]`) then `` part of the name is not generated. + +#### ACCELEROMETER_QUERY +`ACCELEROMETER_QUERY [CHIP=] [RATE=]`: queries +accelerometer for the current value. If CHIP is not specified it +defaults to "adxl345". If RATE is not specified, the default value is +used. This command is useful to test the connection to the ADXL345 +accelerometer: one of the returned values should be a free-fall +acceleration (+/- some noise of the chip). + +#### ACCELEROMETER_DEBUG_READ +`ACCELEROMETER_DEBUG_READ [CHIP=] REG=`: +queries ADXL345 register (e.g. 44 or 0x2C). Can be useful +for debugging purposes. + +#### ACCELEROMETER_DEBUG_WRITE +`ACCELEROMETER_DEBUG_WRITE [CHIP=] REG= +VAL=`: Writes raw into a register . Both + and can be a decimal or a hexadecimal integer. Use +with care, and refer to ADXL345 data sheet for the reference. + +### [bed_mesh] + +The following commands are available when the +[bed_mesh config section](Config_Reference.md#bed_mesh) is enabled +(also see the [bed mesh guide](Bed_Mesh.md)). + +#### BED_MESH_CALIBRATE +`BED_MESH_CALIBRATE [METHOD=manual] [=] +[=]`: This command probes the bed using +generated points specified by the parameters in the config. After +probing, a mesh is generated and z-movement is adjusted according to +the mesh. See the PROBE command for details on the optional probe +parameters. If METHOD=manual is specified then the manual probing tool +is activated - see the MANUAL_PROBE command above for details on the +additional commands available while this tool is active. + +#### BED_MESH_OUTPUT +`BED_MESH_OUTPUT PGP=[<0:1>]`: This command outputs the current probed +z values and current mesh values to the terminal. If PGP=1 is +specified the X, Y coordinates generated by bed_mesh, along with their +associated indices, will be output to the terminal. + +#### BED_MESH_MAP +`BED_MESH_MAP`: Like to BED_MESH_OUTPUT, this command prints the +current state of the mesh to the terminal. Instead of printing the +values in a human readable format, the state is serialized in json +format. This allows octoprint plugins to easily capture the data and +generate height maps approximating the bed's surface. + +#### BED_MESH_CLEAR +`BED_MESH_CLEAR`: This command clears the mesh and removes all z +adjustment. It is recommended to put this in your end-gcode. + +#### BED_MESH_PROFILE +`BED_MESH_PROFILE LOAD= SAVE= REMOVE=`: This command +provides profile management for mesh state. LOAD will restore the mesh +state from the profile matching the supplied name. SAVE will save the +current mesh state to a profile matching the supplied name. Remove +will delete the profile matching the supplied name from persistent +memory. Note that after SAVE or REMOVE operations have been run the +SAVE_CONFIG gcode must be run to make the changes to persistent memory +permanent. + +#### BED_MESH_OFFSET +`BED_MESH_OFFSET [X=] [Y=]`: Applies X and/or Y offsets +to the mesh lookup. This is useful for printers with independent +extruders, as an offset is necessary to produce correct Z adjustment +after a tool change. + +### [bed_screws] + +The following commands are available when the +[bed_screws config section](Config_Reference.md#bed_screws) is enabled +(also see the +[manual level guide](Manual_Level.md#adjusting-bed-leveling-screws)). + +#### BED_SCREWS_ADJUST +`BED_SCREWS_ADJUST`: This command will invoke the bed screws +adjustment tool. It will command the nozzle to different locations (as +defined in the config file) and allow one to make adjustments to the +bed screws so that the bed is a constant distance from the nozzle. + +### [bed_tilt] + +The following commands are available when the +[bed_tilt config section](Config_Reference.md#bed_tilt) is enabled. + +#### BED_TILT_CALIBRATE +`BED_TILT_CALIBRATE [METHOD=manual] [=]`: This +command will probe the points specified in the config and then +recommend updated x and y tilt adjustments. See the PROBE command for +details on the optional probe parameters. If METHOD=manual is +specified then the manual probing tool is activated - see the +MANUAL_PROBE command above for details on the additional commands +available while this tool is active. + +### [bltouch] + +The following command is available when a +[bltouch config section](Config_Reference.md#bltouch) is enabled (also +see the [BL-Touch guide](BLTouch.md)). + +#### BLTOUCH_DEBUG +`BLTOUCH_DEBUG COMMAND=`: This sends a command to the +BLTouch. It may be useful for debugging. Available commands are: +`pin_down`, `touch_mode`, `pin_up`, `self_test`, `reset`. A BL-Touch +V3.0 or V3.1 may also support `set_5V_output_mode`, +`set_OD_output_mode`, `output_mode_store` commands. + +#### BLTOUCH_STORE +`BLTOUCH_STORE MODE=`: This stores an output mode in the +EEPROM of a BLTouch V3.1 Available output_modes are: `5V`, `OD` + +### [configfile] + +The configfile module is automatically loaded. + +#### SAVE_CONFIG +`SAVE_CONFIG`: This command will overwrite the main printer config +file and restart the host software. This command is used in +conjunction with other calibration commands to store the results of +calibration tests. + +### [delayed_gcode] + +The following command is enabled if a +[delayed_gcode config section](Config_Reference.md#delayed_gcode) has +been enabled (also see the +[template guide](Command_Templates.md#delayed-gcodes)). + +#### UPDATE_DELAYED_GCODE +`UPDATE_DELAYED_GCODE [ID=] [DURATION=]`: Updates the +delay duration for the identified [delayed_gcode] and starts the timer +for gcode execution. A value of 0 will cancel a pending delayed gcode +from executing. + +### [delta_calibrate] + +The following commands are available when the +[delta_calibrate config section](Config_Reference.md#linear-delta-kinematics) +is enabled (also see the [delta calibrate guide](Delta_Calibrate.md)). + +#### DELTA_CALIBRATE +`DELTA_CALIBRATE [METHOD=manual] [=]`: This +command will probe seven points on the bed and recommend updated +endstop positions, tower angles, and radius. See the PROBE command for +details on the optional probe parameters. If METHOD=manual is +specified then the manual probing tool is activated - see the +MANUAL_PROBE command above for details on the additional commands +available while this tool is active. + +#### DELTA_ANALYZE +`DELTA_ANALYZE`: This command is used during enhanced delta +calibration. See [Delta Calibrate](Delta_Calibrate.md) for details. + +### [display] + +The following command is available when a +[display config section](Config_Reference.md#gcode_macro) is enabled. + +#### SET_DISPLAY_GROUP +`SET_DISPLAY_GROUP [DISPLAY=] GROUP=`: Set the active +display group of an lcd display. This allows to define multiple +display data groups in the config, e.g. `[display_data +]` and switch between them using this extended gcode +command. If DISPLAY is not specified it defaults to "display" (the +primary display). + +### [display_status] + +The display_status module is automatically loaded if a +[display config section](Config_Reference.md#display) is enabled. It +provides the following standard G-Code commands: +- Display Message: `M117 ` +- Set build percentage: `M73 P` + +### [dual_carriage] + +The following command is available when the +[dual_carriage config section](Config_Reference.md#dual_carriage) is +enabled. + +#### SET_DUAL_CARRIAGE +`SET_DUAL_CARRIAGE CARRIAGE=[0|1]`: This command will set the active +carriage. It is typically invoked from the activate_gcode and +deactivate_gcode fields in a multiple extruder configuration. + +### [endstop_phase] + +The following commands are available when an +[endstop_phase config section](Config_Reference.md#endstop_phase) is +enabled (also see the [endstop phase guide](Endstop_Phase.md)). + +#### ENDSTOP_PHASE_CALIBRATE +`ENDSTOP_PHASE_CALIBRATE [STEPPER=]`: If no STEPPER +parameter is provided then this command will reports statistics on +endstop stepper phases during past homing operations. When a STEPPER +parameter is provided it arranges for the given endstop phase setting +to be written to the config file (in conjunction with the SAVE_CONFIG +command). + +### [extruder] + +The following commands are available if an +[extruder config section](Config_Reference.md#extruder) is enabled: + +#### ACTIVATE_EXTRUDER +`ACTIVATE_EXTRUDER EXTRUDER=`: In a printer with multiple +extruders this command is used to change the active extruder. + +#### SET_PRESSURE_ADVANCE +`SET_PRESSURE_ADVANCE [EXTRUDER=] +[ADVANCE=] +[SMOOTH_TIME=]`: Set pressure advance +parameters. If EXTRUDER is not specified, it defaults to the active +extruder. + +#### SET_EXTRUDER_STEP_DISTANCE +`SET_EXTRUDER_STEP_DISTANCE [EXTRUDER=] +[DISTANCE=]`: Set a new value for the provided extruder's +"step distance". The "step distance" is +`rotation_distance/(full_steps_per_rotation*microsteps)`. Value is not +retained on Klipper reset. Use with caution, small changes can result +in excessive pressure between extruder and hot end. Do proper +calibration steps with filament before use. If 'DISTANCE' value is not +included command will return current step distance. + +#### SYNC_STEPPER_TO_EXTRUDER +`SYNC_STEPPER_TO_EXTRUDER STEPPER= [EXTRUDER=]`: This +command will cause the given extruder STEPPER (as specified in an +[extruder](Config_Reference#extruder) or +[extruder stepper](Config_Reference#extruder_stepper) config section) +to become synchronized to the given EXTRUDER. If EXTRUDER is an empty +string then the stepper will not be synchronized to an extruder. + +### [fan_generic] + +The following command is available when a +[fan_generic config section](Config_Reference.md#fan_generic) is +enabled. + +#### SET_FAN_SPEED +`SET_FAN_SPEED FAN=config_name SPEED=` This command sets the +speed of a fan. must be between 0.0 and 1.0. + +### [firmware_retraction] + +The following standard G-Code commands are available when the +[firmware_retraction config section](Config_Reference.md#firmware_retraction) +is enabled. These commands allow you to utilize the firmware +retraction feature available in many slicers, to reduce stringing +during non-extrusion moves from one part of the print to another. +Appropriately configuring pressure advance reduces the length of +retraction required. +- `G10`: Retracts the extruder using the currently configured + parameters. +- `G11`: Unretracts the extruder using the currently configured + parameters. + +The following additional commands are also available. + +#### SET_RETRACTION +`SET_RETRACTION [RETRACT_LENGTH=] [RETRACT_SPEED=] +[UNRETRACT_EXTRA_LENGTH=] [UNRETRACT_SPEED=]`: Adjust the +parameters used by firmware retraction. RETRACT_LENGTH determines the +length of filament to retract and unretract. The speed of retraction +is adjusted via RETRACT_SPEED, and is typically set relatively +high. The speed of unretraction is adjusted via UNRETRACT_SPEED, and +is not particularly critical, although often lower than RETRACT_SPEED. +In some cases it is useful to add a small amount of additional length +on unretraction, and this is set via UNRETRACT_EXTRA_LENGTH. +SET_RETRACTION is commonly set as part of slicer per-filament +configuration, as different filaments require different parameter +settings. + +#### GET_RETRACTION +`GET_RETRACTION`: Queries the current parameters used by firmware +retraction and displays them on the terminal. + +### [filament_switch_sensor] + +The following command is available when a +[filament_switch_sensor](Config_Reference.md#filament_switch_sensor) +or +[filament_motion_sensor](Config_Reference.md#filament_motion_sensor) +config section is enabled. + +#### QUERY_FILAMENT_SENSOR +`QUERY_FILAMENT_SENSOR SENSOR=`: Queries the current +status of the filament sensor. The data displayed on the terminal will +depend on the sensor type defined in the configuration. + +#### SET_FILAMENT_SENSOR +`SET_FILAMENT_SENSOR SENSOR= ENABLE=[0|1]`: Sets the +filament sensor on/off. If ENABLE is set to 0, the filament sensor +will be disabled, if set to 1 it is enabled. + +### [firmware_retraction] + +The following standard G-Code commands are available if a +[firmware_retraction config section](Config_Reference.md#firmware_retraction) +is enabled: +- Retract: `G10` +- Unretract: `G11` + +### [force_move] + +The force_move module is automatically loaded, however some commands +require setting `enable_force_move` in the +[printer config](Config_Reference#force_move). + +#### STEPPER_BUZZ +`STEPPER_BUZZ STEPPER=`: Move the given stepper forward +one mm and then backward one mm, repeated 10 times. This is a +diagnostic tool to help verify stepper connectivity. + +#### FORCE_MOVE +`FORCE_MOVE STEPPER= DISTANCE= VELOCITY= +[ACCEL=]`: This command will forcibly move the given stepper +the given distance (in mm) at the given constant velocity (in mm/s). +If ACCEL is specified and is greater than zero, then the given +acceleration (in mm/s^2) will be used; otherwise no acceleration is +performed. No boundary checks are performed; no kinematic updates are +made; other parallel steppers on an axis will not be moved. Use +caution as an incorrect command could cause damage! Using this command +will almost certainly place the low-level kinematics in an incorrect +state; issue a G28 afterwards to reset the kinematics. This command is +intended for low-level diagnostics and debugging. + +#### SET_KINEMATIC_POSITION +`SET_KINEMATIC_POSITION [X=] [Y=] [Z=]`: Force +the low-level kinematic code to believe the toolhead is at the given +cartesian position. This is a diagnostic and debugging command; use +SET_GCODE_OFFSET and/or G92 for regular axis transformations. If an +axis is not specified then it will default to the position that the +head was last commanded to. Setting an incorrect or invalid position +may lead to internal software errors. This command may invalidate +future boundary checks; issue a G28 afterwards to reset the +kinematics. + +### [gcode] + +The gcode module is automatically loaded. + +#### RESTART +`RESTART`: This will cause the host software to reload its config and +perform an internal reset. This command will not clear error state +from the micro-controller (see FIRMWARE_RESTART) nor will it load new +software (see +[the FAQ](FAQ.md#how-do-i-upgrade-to-the-latest-software)). + +#### FIRMWARE_RESTART +`FIRMWARE_RESTART`: This is similar to a RESTART command, but it also +clears any error state from the micro-controller. + +#### STATUS +`STATUS`: Report the Klipper host software status. + +#### HELP +`HELP`: Report the list of available extended G-Code commands. + +### [gcode_arcs] + +The following standard G-Code commands are available if a +[gcode_arcs config section](Config_Reference.md#gcode_arcs) is +enabled: +- Controlled Arc Move (G2 or G3): `G2 [X] [Y] [Z] + [E] [F] I J` + +### [gcode_macro] + +The following command is available when a +[gcode_macro config section](Config_Reference.md#gcode_macro) is +enabled (also see the +[command templates guide](Command_Templates.md)). + +#### SET_GCODE_VARIABLE +`SET_GCODE_VARIABLE MACRO= VARIABLE= VALUE=`: +This command allows one to change the value of a gcode_macro variable +at run-time. The provided VALUE is parsed as a Python literal. + +### [gcode_move] + +The gcode_move module is automatically loaded. + +#### GET_POSITION +`GET_POSITION`: Return information on the current location of the +toolhead. + +#### SET_GCODE_OFFSET +`SET_GCODE_OFFSET [X=|X_ADJUST=] +[Y=|Y_ADJUST=] [Z=|Z_ADJUST=] [MOVE=1 +[MOVE_SPEED=]]`: Set a positional offset to apply to future +G-Code commands. This is commonly used to virtually change the Z bed +offset or to set nozzle XY offsets when switching extruders. For +example, if "SET_GCODE_OFFSET Z=0.2" is sent, then future G-Code moves +will have 0.2mm added to their Z height. If the X_ADJUST style +parameters are used, then the adjustment will be added to any existing +offset (eg, "SET_GCODE_OFFSET Z=-0.2" followed by "SET_GCODE_OFFSET +Z_ADJUST=0.3" would result in a total Z offset of 0.1). If "MOVE=1" is +specified then a toolhead move will be issued to apply the given +offset (otherwise the offset will take effect on the next absolute +G-Code move that specifies the given axis). If "MOVE_SPEED" is +specified then the toolhead move will be performed with the given +speed (in mm/s); otherwise the toolhead move will use the last +specified G-Code speed. + +#### SAVE_GCODE_STATE +`SAVE_GCODE_STATE [NAME=]`: Save the current g-code +coordinate parsing state. Saving and restoring the g-code state is +useful in scripts and macros. This command saves the current g-code +absolute coordinate mode (G90/G91), absolute extrude mode (M82/M83), +origin (G92), offset (SET_GCODE_OFFSET), speed override (M220), +extruder override (M221), move speed, current XYZ position, and +relative extruder "E" position. If NAME is provided it allows one to +name the saved state to the given string. If NAME is not provided it +defaults to "default". + +#### RESTORE_GCODE_STATE +`RESTORE_GCODE_STATE [NAME=] [MOVE=1 +[MOVE_SPEED=]]`: Restore a state previously saved via +SAVE_GCODE_STATE. If "MOVE=1" is specified then a toolhead move will +be issued to move back to the previous XYZ position. If "MOVE_SPEED" +is specified then the toolhead move will be performed with the given +speed (in mm/s); otherwise the toolhead move will use the restored +g-code speed. + +### [hall_filament_width_sensor] + +The following commands are available when the +[tsl1401cl filament width sensor config section](Config_Reference.md#tsl1401cl_filament_width_sensor) +or [hall filament width sensor config section](Config_Reference.md#hall_filament_width_sensor) +is enabled (also see [TSLl401CL Filament Width Sensor](TSL1401CL_Filament_Width_Sensor.md) +and [Hall Filament Width Sensor](Hall_Filament_Width_Sensor.md)): + +#### QUERY_FILAMENT_WIDTH +`QUERY_FILAMENT_WIDTH`: Return the current measured filament width. + +#### RESET_FILAMENT_WIDTH_SENSOR +`RESET_FILAMENT_WIDTH_SENSOR`: Clear all sensor readings. Helpful +after filament change. + +#### DISABLE_FILAMENT_WIDTH_SENSOR +`DISABLE_FILAMENT_WIDTH_SENSOR`: Turn off the filament width sensor +and stop using it for flow control. + +#### ENABLE_FILAMENT_WIDTH_SENSOR +`ENABLE_FILAMENT_WIDTH_SENSOR`: Turn on the filament width sensor and +start using it for flow control. + +#### QUERY_RAW_FILAMENT_WIDTH +`QUERY_RAW_FILAMENT_WIDTH`: Return the current ADC channel readings +and RAW sensor value for calibration points. + +#### ENABLE_FILAMENT_WIDTH_LOG +`ENABLE_FILAMENT_WIDTH_LOG`: Turn on diameter logging. + +#### DISABLE_FILAMENT_WIDTH_LOG +`DISABLE_FILAMENT_WIDTH_LOG`: Turn off diameter logging. + +### [heaters] + +The heaters module is automatically loaded if a heater is defined in +the config file. + +#### TURN_OFF_HEATERS +`TURN_OFF_HEATERS`: Turn off all heaters. + +#### TEMPERATURE_WAIT +`TEMPERATURE_WAIT SENSOR= [MINIMUM=] +[MAXIMUM=]`: Wait until the given temperature sensor is at or +above the supplied MINIMUM and/or at or below the supplied MAXIMUM. + +#### SET_HEATER_TEMPERATURE +`SET_HEATER_TEMPERATURE HEATER= +[TARGET=]`: Sets the target temperature for a +heater. If a target temperature is not supplied, the target is 0. + +### [idle_timeout] + +The idle_timeout module is automatically loaded. + +#### SET_IDLE_TIMEOUT +`SET_IDLE_TIMEOUT [TIMEOUT=]`: Allows the user to set the +idle timeout (in seconds). + +### [input_shaper] + +The following command is enabled if an +[input_shaper config section](Config_Reference.md#input_shaper) has +been enabled (also see the +[resonance compensation guide](Resonance_Compensation.md)). + +#### SET_INPUT_SHAPER +`SET_INPUT_SHAPER [SHAPER_FREQ_X=] +[SHAPER_FREQ_Y=] [DAMPING_RATIO_X=] +[DAMPING_RATIO_Y=] [SHAPER_TYPE=] +[SHAPER_TYPE_X=] [SHAPER_TYPE_Y=]`: +Modify input shaper parameters. Note that SHAPER_TYPE parameter resets +input shaper for both X and Y axes even if different shaper types have +been configured in [input_shaper] section. SHAPER_TYPE cannot be used +together with either of SHAPER_TYPE_X and SHAPER_TYPE_Y parameters. +See [config reference](Config_Reference.md#input_shaper) for more +details on each of these parameters. + +### [manual_probe] + +The manual_probe module is automatically loaded. + +#### MANUAL_PROBE +`MANUAL_PROBE [SPEED=]`: Run a helper script useful for +measuring the height of the nozzle at a given location. If SPEED is +specified, it sets the speed of TESTZ commands (the default is +5mm/s). During a manual probe, the following additional commands are +available: +- `ACCEPT`: This command accepts the current Z position and concludes + the manual probing tool. +- `ABORT`: This command terminates the manual probing tool. +- `TESTZ Z=`: This command moves the nozzle up or down by the + amount specified in "value". For example, `TESTZ Z=-.1` would move + the nozzle down .1mm while `TESTZ Z=.1` would move the nozzle up + .1mm. The value may also be `+`, `-`, `++`, or `--` to move the + nozzle up or down an amount relative to previous attempts. + +#### Z_ENDSTOP_CALIBRATE +`Z_ENDSTOP_CALIBRATE [SPEED=]`: Run a helper script useful for +calibrating a Z position_endstop config setting. See the MANUAL_PROBE +command for details on the parameters and the additional commands +available while the tool is active. + +#### Z_OFFSET_APPLY_ENDSTOP +`Z_OFFSET_APPLY_ENDSTOP`: Take the current Z Gcode offset (aka, +babystepping), and subtract it from the stepper_z endstop_position. +This acts to take a frequently used babystepping value, and "make it +permanent". Requires a `SAVE_CONFIG` to take effect. + +### [manual_stepper] + +The following command is available when a +[manual_stepper config section](Config_Reference.md#manual_stepper) is +enabled. + +#### MANUAL_STEPPER +`MANUAL_STEPPER STEPPER=config_name [ENABLE=[0|1]] +[SET_POSITION=] [SPEED=] [ACCEL=] [MOVE= +[STOP_ON_ENDSTOP=[1|2|-1|-2]] [SYNC=0]]`: This command will alter the +state of the stepper. Use the ENABLE parameter to enable/disable the +stepper. Use the SET_POSITION parameter to force the stepper to think +it is at the given position. Use the MOVE parameter to request a +movement to the given position. If SPEED and/or ACCEL is specified +then the given values will be used instead of the defaults specified +in the config file. If an ACCEL of zero is specified then no +acceleration will be performed. If STOP_ON_ENDSTOP=1 is specified then +the move will end early should the endstop report as triggered (use +STOP_ON_ENDSTOP=2 to complete the move without error even if the +endstop does not trigger, use -1 or -2 to stop when the endstop +reports not triggered). Normally future G-Code commands will be +scheduled to run after the stepper move completes, however if a manual +stepper move uses SYNC=0 then future G-Code movement commands may run +in parallel with the stepper movement. + +### [neopixel] + +The following command is available when a +[neopixel config section](Config_Reference.md#neopixel) or +[dotstar config section](Config_Reference.md#dotstar) is enabled. + +#### SET_LED +`SET_LED LED= RED= GREEN= BLUE= +WHITE= [INDEX=] [TRANSMIT=0] [SYNC=1]`: This sets the +LED output. Each color `` must be between 0.0 and 1.0. The +WHITE option is only valid on RGBW LEDs. If multiple LED chips are +daisy-chained then one may specify INDEX to alter the color of just +the given chip (1 for the first chip, 2 for the second, etc.). If +INDEX is not provided then all LEDs in the daisy-chain will be set to +the provided color. If TRANSMIT=0 is specified then the color change +will only be made on the next SET_LED command that does not specify +TRANSMIT=0; this may be useful in combination with the INDEX parameter +to batch multiple updates in a daisy-chain. By default, the SET_LED +command will sync it's changes with other ongoing gcode commands. +This can lead to undesirable behavior if LEDs are being set while the +printer is not printing as it will reset the idle timeout. If careful +timing is not needed, the optional SYNC=0 parameter can be specified +to apply the changes instantly and not reset the idle timeout. + +### [output_pin] + +The following command is available when an +[output_pin config section](Config_Reference.md#output_pin) is +enabled. + +#### SET_PIN +`SET_PIN PIN=config_name VALUE= CYCLE_TIME=`: +Note - hardware PWM does not currently support the CYCLE_TIME +parameter and will use the cycle time defined in the config. + +### [palette2] + +The following commands are available when the +[palette2 config section](Config_Reference.md#palette2) is enabled. + +Palette prints work by embedding special OCodes (Omega Codes) in the +GCode file: +- `O1`...`O32`: These codes are read from the GCode stream and processed + by this module and passed to the Palette 2 device. + +The following additional commands are also available. + +#### PALETTE_CONNECT +`PALETTE_CONNECT`: This command initializes the connection with the +Palette 2. + +#### PALETTE_DISCONNECT +`PALETTE_DISCONNECT`: This command disconnects from the Palette 2. + +#### PALETTE_CLEAR +`PALETTE_CLEAR`: This command instructs the Palette 2 to clear all of +the input and output paths of filament. + +#### PALETTE_CUT +`PALETTE_CUT`: This command instructs the Palette 2 to cut the +filament currently loaded in the splice core. + +#### PALETTE_SMART_LOAD +`PALETTE_SMART_LOAD`: This command start the smart load sequence on +the Palette 2. Filament is loaded automatically by extruding it the +distance calibrated on the device for the printer, and instructs the +Palette 2 once the loading has been completed. This command is the +same as pressing **Smart Load** directly on the Palette 2 screen after +the filament load is complete. + +### [pid_calibrate] + +The pid_calibrate module is automatically loaded if a heater is defined +in the config file. + +#### PID_CALIBRATE +`PID_CALIBRATE HEATER= TARGET= +[WRITE_FILE=1]`: Perform a PID calibration test. The specified heater +will be enabled until the specified target temperature is reached, and +then the heater will be turned off and on for several cycles. If the +WRITE_FILE parameter is enabled, then the file /tmp/heattest.txt will +be created with a log of all temperature samples taken during the +test. + +### [pause_resume] + +The following commands are available when the +[pause_resume config section](Config_Reference.md#pause_resume) is +enabled: + +#### PAUSE +`PAUSE`: Pauses the current print. The current position is captured +for restoration upon resume. + +#### RESUME +`RESUME [VELOCITY=]`: Resumes the print from a pause, first +restoring the previously captured position. The VELOCITY parameter +determines the speed at which the tool should return to the original +captured position. + +#### CLEAR_PAUSE +`CLEAR_PAUSE`: Clears the current paused state without resuming the +print. This is useful if one decides to cancel a print after a +PAUSE. It is recommended to add this to your start gcode to make sure +the paused state is fresh for each print. + +#### CANCEL_PRINT +`CANCEL_PRINT`: Cancels the current print. + +### [probe] + +The following commands are available when a +[probe config section](Config_Reference.md#probe) or +[bltouch config section](Config_Reference.md#bltouch) is enabled (also +see the [probe calibrate guide](Probe_Calibrate.md)). + +#### PROBE +`PROBE [PROBE_SPEED=] [LIFT_SPEED=] [SAMPLES=] +[SAMPLE_RETRACT_DIST=] [SAMPLES_TOLERANCE=] +[SAMPLES_TOLERANCE_RETRIES=] [SAMPLES_RESULT=median|average]`: +Move the nozzle downwards until the probe triggers. If any of the +optional parameters are provided they override their equivalent +setting in the [probe config section](Config_Reference.md#probe). + +#### QUERY_PROBE +`QUERY_PROBE`: Report the current status of the probe ("triggered" or +"open"). + +#### PROBE_ACCURACY +`PROBE_ACCURACY [PROBE_SPEED=] [SAMPLES=] +[SAMPLE_RETRACT_DIST=]`: Calculate the maximum, minimum, average, +median, and standard deviation of multiple probe samples. By default, +10 SAMPLES are taken. Otherwise the optional parameters default to +their equivalent setting in the probe config section. + +#### PROBE_CALIBRATE +`PROBE_CALIBRATE [SPEED=] [=]`: Run a +helper script useful for calibrating the probe's z_offset. See the +PROBE command for details on the optional probe parameters. See the +MANUAL_PROBE command for details on the SPEED parameter and the +additional commands available while the tool is active. Please note, +the PROBE_CALIBRATE command uses the speed variable to move in XY +direction as well as Z. + +#### Z_OFFSET_APPLY_PROBE +`Z_OFFSET_APPLY_PROBE`: Take the current Z Gcode offset (aka, +babystepping), and subtract if from the probe's z_offset. This acts +to take a frequently used babystepping value, and "make it permanent". +Requires a `SAVE_CONFIG` to take effect. + +### [query_adc] + +The query_endstops module is automatically loaded. + +#### QUERY_ADC +`QUERY_ADC [NAME=] [PULLUP=]`: Report the last +analog value received for a configured analog pin. If NAME is not +provided, the list of available adc names are reported. If PULLUP is +provided (as a value in Ohms), the raw analog value along with the +equivalent resistance given that pullup is reported. + +### [query_endstops] + +The query_endstops module is automatically loaded. The following +standard G-Code commands are currently available, but using them is +not recommended: +- Get Endstop Status: `M119` (Use QUERY_ENDSTOPS instead.) + +#### QUERY_ENDSTOPS +`QUERY_ENDSTOPS`: Probe the axis endstops and report if they are +"triggered" or in an "open" state. This command is typically used to +verify that an endstop is working correctly. + +### [resonance_tester] + +The following commands are available when a +[resonance_tester config section](Config_Reference.md#resonance_tester) +is enabled (also see the +[measuring resonances guide](Measuring_Resonances.md)). + +#### MEASURE_AXES_NOISE +`MEASURE_AXES_NOISE`: Measures and outputs the noise for all axes of +all enabled accelerometer chips. + +#### TEST_RESONANCES +`TEST_RESONANCES AXIS= OUTPUT= +[NAME=] [FREQ_START=] [FREQ_END=] +[HZ_PER_SEC=] [INPUT_SHAPING=[<0:1>]]`: Runs the resonance +test in all configured probe points for the requested and +measures the acceleration using the accelerometer chips configured for +the respective axis. can either be X or Y, or specify an +arbitrary direction as `AXIS=dx,dy`, where dx and dy are floating +point numbers defining a direction vector (e.g. `AXIS=X`, `AXIS=Y`, or +`AXIS=1,-1` to define a diagonal direction). Note that `AXIS=dx,dy` +and `AXIS=-dx,-dy` is equivalent. If `INPUT_SHAPING=0` or not set +(default), disables input shaping for the resonance testing, because +it is not valid to run the resonance testing with the input shaper +enabled. `OUTPUT` parameter is a comma-separated list of which outputs +will be written. If `raw_data` is requested, then the raw +accelerometer data is written into a file or a series of files +`/tmp/raw_data__[_].csv` with (`_` part of +the name generated only if more than 1 probe point is configured). If +`resonances` is specified, the frequency response is calculated +(across all probe points) and written into +`/tmp/resonances__.csv` file. If unset, OUTPUT defaults to +`resonances`, and NAME defaults to the current time in +"YYYYMMDD_HHMMSS" format. + +#### SHAPER_CALIBRATE +`SHAPER_CALIBRATE [AXIS=] [NAME=] [FREQ_START=] +[FREQ_END=] [HZ_PER_SEC=] +[MAX_SMOOTHING=]`: Similarly to `TEST_RESONANCES`, runs +the resonance test as configured, and tries to find the optimal +parameters for the input shaper for the requested axis (or both X and +Y axes if `AXIS` parameter is unset). If `MAX_SMOOTHING` is unset, its +value is taken from `[resonance_tester]` section, with the default +being unset. See the +[Max smoothing](Measuring_Resonances.md#max-smoothing) of the +measuring resonances guide for more information on the use of this +feature. The results of the tuning are printed to the console, and the +frequency responses and the different input shapers values are written +to a CSV file(s) `/tmp/calibration_data__.csv`. Unless +specified, NAME defaults to the current time in "YYYYMMDD_HHMMSS" +format. Note that the suggested input shaper parameters can be +persisted in the config by issuing `SAVE_CONFIG` command. + +### [respond] + +The following standard G-Code commands are available when the +[respond config section](Config_Reference.md#respond) is enabled: +- `M118 `: echo the message prepended with the configured + default prefix (or `echo: ` if no prefix is configured). + +The following additional commands are also available. + +#### RESPOND +- `RESPOND MSG=""`: echo the message prepended with the + configured default prefix (or `echo: ` if no prefix is configured). +- `RESPOND TYPE=echo MSG=""`: echo the message prepended with + `echo: `. +- `RESPOND TYPE=command MSG=""`: echo the message prepended + with `// `. OctoPrint can be configured to respond to these messages + (e.g. `RESPOND TYPE=command MSG=action:pause`). +- `RESPOND TYPE=error MSG=""`: echo the message prepended + with `!! `. +- `RESPOND PREFIX= MSG=""`: echo the message + prepended with ``. (The `PREFIX` parameter will take + priority over the `TYPE` parameter) + +### [save_variables] + +The following command is enabled if a +[save_variables config section](Config_Reference.md#save_variables) +has been enabled. + +#### SAVE_VARIABLE +`SAVE_VARIABLE VARIABLE= VALUE=`: Saves the variable to +disk so that it can be used across restarts. All stored variables are +loaded into the `printer.save_variables.variables` dict at startup and +can be used in gcode macros. The provided VALUE is parsed as a Python +literal. + +### [screws_tilt_adjust] + +The following commands are available when the +[screws_tilt_adjust config section](Config_Reference.md#screws_tilt_adjust) +is enabled (also see the +[manual level guide](Manual_Level.md#adjusting-bed-leveling-screws-using-the-bed-probe)). + +#### SCREWS_TILT_CALCULATE +`SCREWS_TILT_CALCULATE [DIRECTION=CW|CCW] +[=]`: This command will invoke the bed screws +adjustment tool. It will command the nozzle to different locations (as +defined in the config file) probing the z height and calculate the +number of knob turns to adjust the bed level. If DIRECTION is +specified, the knob turns will all be in the same direction, clockwise +(CW) or counterclockwise (CCW). See the PROBE command for details on +the optional probe parameters. IMPORTANT: You MUST always do a G28 +before using this command. + +### [sdcard_loop] + +When the [sdcard_loop config section](Config_Reference.md#sdcard_loop) +is enabled, the following extended commands are available. + +#### SDCARD_LOOP_BEGIN +`SDCARD_LOOP_BEGIN COUNT=`: Begin a looped section in the SD +print. A count of 0 indicates that the section should be looped +indefinitely. + +#### SDCARD_LOOP_END +`SDCARD_LOOP_END`: End a looped section in the SD print. + +#### SDCARD_LOOP_DESIST +`SDCARD_LOOP_DESIST`: Complete existing loops without further +iterations. + +### [servo] + +The following commands are available when a +[servo config section](Config_Reference.md#servo) is enabled. + +#### SET_SERVO +`SET_SERVO SERVO=config_name [ANGLE= | WIDTH=]`: Set +the servo position to the given angle (in degrees) or pulse width (in +seconds). Use `WIDTH=0` to disable the servo output. + +### [skew_correction] + +The following commands are available when the +[skew_correction config section](Config_Reference.md#skew_correction) +is enabled (also see the [Skew Correction](Skew_Correction.md) guide). + +#### SET_SKEW +`SET_SKEW [XY=] [XZ=] +[YZ=] [CLEAR=<0|1>]`: Configures the [skew_correction] +module with measurements (in mm) taken from a calibration print. One +may enter measurements for any combination of planes, planes not +entered will retain their current value. If `CLEAR=1` is entered then +all skew correction will be disabled. + +#### GET_CURRENT_SKEW +`GET_CURRENT_SKEW`: Reports the current printer skew for each plane in +both radians and degrees. The skew is calculated based on parameters +provided via the `SET_SKEW` gcode. + +#### CALC_MEASURED_SKEW +`CALC_MEASURED_SKEW [AC=] [BD=] +[AD=]`: Calculates and reports the skew (in radians and +degrees) based on a measured print. This can be useful for determining +the printer's current skew after correction has been applied. It may +also be useful before correction is applied to determine if skew +correction is necessary. See [Skew Correction](Skew_Correction.md) for +details on skew calibration objects and measurements. + +#### SKEW_PROFILE +`SKEW_PROFILE [LOAD=] [SAVE=] [REMOVE=]`: Profile +management for skew_correction. LOAD will restore skew state from the +profile matching the supplied name. SAVE will save the current skew +state to a profile matching the supplied name. Remove will delete the +profile matching the supplied name from persistent memory. Note that +after SAVE or REMOVE operations have been run the SAVE_CONFIG gcode +must be run to make the changes to persistent memory permanent. + +### [stepper_enable] + +The stepper_enable module is automatically loaded. + +#### SET_STEPPER_ENABLE +`SET_STEPPER_ENABLE STEPPER= ENABLE=[0|1]`: Enable or +disable only the given stepper. This is a diagnostic and debugging +tool and must be used with care. Disabling an axis motor does not +reset the homing information. Manually moving a disabled stepper may +cause the machine to operate the motor outside of safe limits. This +can lead to damage to axis components, hot ends, and print surface. + +### [temperature_fan] + +The following command is available when a +[temperature_fan config section](Config_Reference.md#temperature_fan) +is enabled. + +#### SET_TEMPERATURE_FAN_TARGET +`SET_TEMPERATURE_FAN_TARGET temperature_fan= +[target=] [min_speed=] +[max_speed=]`: Sets the target temperature for a +temperature_fan. If a target is not supplied, it is set to the +specified temperature in the config file. If speeds are not supplied, +no change is applied. + +### [tmcXXXX] + +The following commands are available when any of the +[tmcXXXX config sections](Config_Reference.md#tmc-stepper-driver-configuration) +are enabled. + +#### DUMP_TMC +`DUMP_TMC STEPPER=`: This command will read the TMC driver +registers and report their values. + +#### INIT_TMC +`INIT_TMC STEPPER=`: This command will initialize the TMC +registers. Needed to re-enable the driver if power to the chip is +turned off then back on. + +#### SET_TMC_CURRENT +`SET_TMC_CURRENT STEPPER= CURRENT= HOLDCURRENT=`: +This will adjust the run and hold currents of the TMC driver. +(HOLDCURRENT is not applicable to tmc2660 drivers.) + +#### SET_TMC_FIELD +`SET_TMC_FIELD STEPPER= FIELD= VALUE=`: This will +alter the value of the specified register field of the TMC driver. +This command is intended for low-level diagnostics and debugging only +because changing the fields during run-time can lead to undesired and +potentially dangerous behavior of your printer. Permanent changes +should be made using the printer configuration file instead. No sanity +checks are performed for the given values. + +### [toolhead] + +The toolhead module is automatically loaded. + +#### SET_VELOCITY_LIMIT +`SET_VELOCITY_LIMIT [VELOCITY=] [ACCEL=] +[ACCEL_TO_DECEL=] [SQUARE_CORNER_VELOCITY=]`: Modify the +printer's velocity limits. + +### [tuning_tower] + +The tuning_tower module is automatically loaded. + +#### TUNING_TOWER +`TUNING_TOWER COMMAND= PARAMETER= START= +[SKIP=] [FACTOR= [BAND=]] | [STEP_DELTA= +STEP_HEIGHT=]`: A tool for tuning a parameter on each Z height +during a print. The tool will run the given `COMMAND` with the given +`PARAMETER` assigned to a value that varies with `Z` according to a +formula. Use `FACTOR` if you will use a ruler or calipers to measure +the Z height of the optimum value, or `STEP_DELTA` and `STEP_HEIGHT` +if the tuning tower model has bands of discrete values as is common +with temperature towers. If `SKIP=` is specified, the tuning +process doesn't begin until Z height `` is reached, and below +that the value will be set to `START`; in this case, the `z_height` +used in the formulas below is actually `max(z - skip, 0)`. There are +three possible combinations of options: +- `FACTOR`: The value changes at a rate of `factor` per millimeter. + The formula used is: `value = start + factor * z_height`. You can + plug the optimum Z height directly into the formula to determine the + optimum parameter value. +- `FACTOR` and `BAND`: The value changes at an average rate of + `factor` per millimeter, but in discrete bands where the adjustment + will only be made every `BAND` millimeters of Z height. + The formula used is: + `value = start + factor * ((floor(z_height / band) + .5) * band)`. +- `STEP_DELTA` and `STEP_HEIGHT`: The value changes by `STEP_DELTA` + every `STEP_HEIGHT` millimeters. The formula used is: + `value = start + step_delta * floor(z_height / step_height)`. + You can simply count bands or read tuning tower labels to determine + the optimum value. + +### [virtual_sdcard] + +Klipper supports the following standard G-Code commands if the [virtual_sdcard config section](Config_Reference.md#virtual_sdcard) is enabled: - List SD card: `M20` @@ -63,805 +1098,23 @@ enabled: - Set SD position: `M26 S` - Report SD print status: `M27` -In addition, the following extended commands are availble when the +In addition, the following extended commands are available when the "virtual_sdcard" config section is enabled. -- Load a file and start SD print: `SDCARD_PRINT_FILE FILENAME=` -- Unload file and clear SD state: `SDCARD_RESET_FILE` -### G-Code arcs +#### SDCARD_PRINT_FILE +`SDCARD_PRINT_FILE FILENAME=`: Load a file and start SD +print. -The following standard G-Code commands are available if a -[gcode_arcs config section](Config_Reference.md#gcode_arcs) is -enabled: -- Controlled Arc Move (G2 or G3): `G2 [X] [Y] [Z] - [E] [F] I J` +#### SDCARD_RESET_FILE +`SDCARD_RESET_FILE`: Unload file and clear SD state. -### G-Code firmware retraction - -The following standard G-Code commands are available if a -[firmware_retraction config section](Config_Reference.md#firmware_retraction) -is enabled: -- Retract: `G10` -- Unretract: `G11` - -### G-Code display commands - -The following standard G-Code commands are available if a -[display config section](Config_Reference.md#display) is enabled: -- Display Message: `M117 ` -- Set build percentage: `M73 P` - -### Other available G-Code commands - -The following standard G-Code commands are currently available, but -using them is not recommended: -- Get Endstop Status: `M119` (Use QUERY_ENDSTOPS instead.) - -## Extended G-Code Commands - -Klipper uses "extended" G-Code commands for general configuration and -status. These extended commands all follow a similar format - they -start with a command name and may be followed by one or more -parameters. For example: `SET_SERVO SERVO=myservo ANGLE=5.3`. In this -document, the commands and parameters are shown in uppercase, however -they are not case sensitive. (So, "SET_SERVO" and "set_servo" both run -the same command.) - -The following standard commands are supported: -- `QUERY_ENDSTOPS`: Probe the axis endstops and report if they are - "triggered" or in an "open" state. This command is typically used to - verify that an endstop is working correctly. -- `QUERY_ADC [NAME=] [PULLUP=]`: Report the last - analog value received for a configured analog pin. If NAME is not - provided, the list of available adc names are reported. If PULLUP is - provided (as a value in Ohms), the raw analog value along with the - equivalent resistance given that pullup is reported. -- `GET_POSITION`: Return information on the current location of the - toolhead. -- `SET_GCODE_OFFSET [X=|X_ADJUST=] - [Y=|Y_ADJUST=] [Z=|Z_ADJUST=] - [MOVE=1 [MOVE_SPEED=]]`: Set a positional offset to apply to - future G-Code commands. This is commonly used to virtually change - the Z bed offset or to set nozzle XY offsets when switching - extruders. For example, if "SET_GCODE_OFFSET Z=0.2" is sent, then - future G-Code moves will have 0.2mm added to their Z height. If the - X_ADJUST style parameters are used, then the adjustment will be - added to any existing offset (eg, "SET_GCODE_OFFSET Z=-0.2" followed - by "SET_GCODE_OFFSET Z_ADJUST=0.3" would result in a total Z offset - of 0.1). If "MOVE=1" is specified then a toolhead move will be - issued to apply the given offset (otherwise the offset will take - effect on the next absolute G-Code move that specifies the given - axis). If "MOVE_SPEED" is specified then the toolhead move will be - performed with the given speed (in mm/s); otherwise the toolhead - move will use the last specified G-Code speed. -- `SAVE_GCODE_STATE [NAME=]`: Save the current - g-code coordinate parsing state. Saving and restoring the g-code - state is useful in scripts and macros. This command saves the - current g-code absolute coordinate mode (G90/G91), absolute extrude - mode (M82/M83), origin (G92), offset (SET_GCODE_OFFSET), speed - override (M220), extruder override (M221), move speed, current XYZ - position, and relative extruder "E" position. If NAME is provided it - allows one to name the saved state to the given string. If NAME is - not provided it defaults to "default". -- `RESTORE_GCODE_STATE [NAME=] - [MOVE=1 [MOVE_SPEED=]]`: Restore a state previously saved via - SAVE_GCODE_STATE. If "MOVE=1" is specified then a toolhead move will - be issued to move back to the previous XYZ position. If "MOVE_SPEED" - is specified then the toolhead move will be performed with the given - speed (in mm/s); otherwise the toolhead move will use the restored - g-code speed. -- `PID_CALIBRATE HEATER= TARGET= - [WRITE_FILE=1]`: Perform a PID calibration test. The specified - heater will be enabled until the specified target temperature is - reached, and then the heater will be turned off and on for several - cycles. If the WRITE_FILE parameter is enabled, then the file - /tmp/heattest.txt will be created with a log of all temperature - samples taken during the test. -- `TURN_OFF_HEATERS`: Turn off all heaters. -- `TEMPERATURE_WAIT SENSOR= [MINIMUM=] [MAXIMUM=]`: - Wait until the given temperature sensor is at or above the supplied - MINIMUM and/or at or below the supplied MAXIMUM. -- `SET_VELOCITY_LIMIT [VELOCITY=] [ACCEL=] - [ACCEL_TO_DECEL=] [SQUARE_CORNER_VELOCITY=]`: Modify - the printer's velocity limits. -- `SET_HEATER_TEMPERATURE HEATER= [TARGET=]`: - Sets the target temperature for a heater. If a target temperature is - not supplied, the target is 0. -- `ACTIVATE_EXTRUDER EXTRUDER=`: In a printer with - multiple extruders this command is used to change the active - extruder. -- `SET_PRESSURE_ADVANCE [EXTRUDER=] [ADVANCE=] - [SMOOTH_TIME=]`: Set pressure advance - parameters. If EXTRUDER is not specified, it defaults to the active - extruder. -- `SET_EXTRUDER_STEP_DISTANCE [EXTRUDER=] - [DISTANCE=]`: Set a new value for the provided extruder's - "step distance". The "step distance" is - `rotation_distance/(full_steps_per_rotation*microsteps)`. Value is - not retained on Klipper reset. Use with caution, small changes can - result in excessive pressure between extruder and hot end. Do proper - calibration steps with filament before use. If 'DISTANCE' value is - not included command will return current step distance. -- `SYNC_STEPPER_TO_EXTRUDER STEPPER= [EXTRUDER=]`: This - command will cause the given extruder STEPPER (as specified in an - [extruder](Config_Reference#extruder) or - [extruder stepper](Config_Reference#extruder_stepper) config - section) to become synchronized to the given EXTRUDER. If EXTRUDER - is an empty string then the stepper will not be synchronized to an - extruder. -- `SET_STEPPER_ENABLE STEPPER= ENABLE=[0|1]`: Enable or - disable only the given stepper. This is a diagnostic and debugging - tool and must be used with care. Disabling an axis motor does not - reset the homing information. Manually moving a disabled stepper may - cause the machine to operate the motor outside of safe limits. This - can lead to damage to axis components, hot ends, and print surface. -- `STEPPER_BUZZ STEPPER=`: Move the given stepper forward - one mm and then backward one mm, repeated 10 times. This is a - diagnostic tool to help verify stepper connectivity. -- `MANUAL_PROBE [SPEED=]`: Run a helper script useful for - measuring the height of the nozzle at a given location. If SPEED is - specified, it sets the speed of TESTZ commands (the default is - 5mm/s). During a manual probe, the following additional commands are - available: - - `ACCEPT`: This command accepts the current Z position and - concludes the manual probing tool. - - `ABORT`: This command terminates the manual probing tool. - - `TESTZ Z=`: This command moves the nozzle up or down by the - amount specified in "value". For example, `TESTZ Z=-.1` would move - the nozzle down .1mm while `TESTZ Z=.1` would move the nozzle up - .1mm. The value may also be `+`, `-`, `++`, or `--` to move the - nozzle up or down an amount relative to previous attempts. -- `Z_ENDSTOP_CALIBRATE [SPEED=]`: Run a helper script useful - for calibrating a Z position_endstop config setting. See the - MANUAL_PROBE command for details on the parameters and the - additional commands available while the tool is active. -- `Z_OFFSET_APPLY_ENDSTOP`: Take the current Z Gcode offset (aka, - babystepping), and subtract it from the stepper_z endstop_position. - This acts to take a frequently used babystepping value, and "make - it permanent". Requires a `SAVE_CONFIG` to take effect. -- `TUNING_TOWER COMMAND= PARAMETER= START= [SKIP=] - [FACTOR= [BAND=]] | [STEP_DELTA= STEP_HEIGHT=]`: - A tool for tuning a parameter on each Z height during a print. - The tool will run the given `COMMAND` with the given `PARAMETER` - assigned to a value that varies with `Z` according to a formula. Use `FACTOR` - if you will use a ruler or calipers to measure the Z height of the optimum - value, or `STEP_DELTA` and `STEP_HEIGHT` if the tuning tower model has bands - of discrete values as is common with temperature towers. If `SKIP=` - is specified, the tuning process doesn't begin until Z height `` is - reached, and below that the value will be set to `START`; in this case, the - `z_height` used in the formulas below is actually `max(z - skip, 0)`. - There are three possible combinations of options: - - `FACTOR`: The value changes at a rate of `factor` per millimeter. - The formula used is - `value = start + factor * z_height`. - You can plug the optimum Z height directly into the formula to - determine the optimum parameter value. - - `FACTOR` and `BAND`: The value changes at an average rate of `factor` per - millimeter, but in discrete bands where the adjustment will only be made - every `BAND` millimeters of Z height. - The formula used is - `value = start + factor * ((floor(z_height / band) + .5) * band)`. - - `STEP_DELTA` and `STEP_HEIGHT`: The value changes by `STEP_DELTA` every - `STEP_HEIGHT` millimeters. The formula used is - `value = start + step_delta * floor(z_height / step_height)`. - You can simply count bands or read tuning tower labels to determine the - optimum value. -- `SET_DISPLAY_GROUP [DISPLAY=] GROUP=`: Set the - active display group of an lcd display. This allows to define - multiple display data groups in the config, - e.g. `[display_data ]` and switch between them - using this extended gcode command. If DISPLAY is not specified it - defaults to "display" (the primary display). -- `SET_IDLE_TIMEOUT [TIMEOUT=]`: Allows the user to set the - idle timeout (in seconds). -- `RESTART`: This will cause the host software to reload its config - and perform an internal reset. This command will not clear error - state from the micro-controller (see FIRMWARE_RESTART) nor will it - load new software (see - [the FAQ](FAQ.md#how-do-i-upgrade-to-the-latest-software)). -- `FIRMWARE_RESTART`: This is similar to a RESTART command, but it - also clears any error state from the micro-controller. -- `SAVE_CONFIG`: This command will overwrite the main printer config - file and restart the host software. This command is used in - conjunction with other calibration commands to store the results of - calibration tests. -- `STATUS`: Report the Klipper host software status. -- `HELP`: Report the list of available extended G-Code commands. - -### G-Code Macro Commands - -The following command is available when a -[gcode_macro config section](Config_Reference.md#gcode_macro) is -enabled (also see the -[command templates guide](Command_Templates.md)): -- `SET_GCODE_VARIABLE MACRO= VARIABLE= - VALUE=`: This command allows one to change the value of a - gcode_macro variable at run-time. The provided VALUE is parsed as a - Python literal. - -### Custom Pin Commands - -The following command is available when an -[output_pin config section](Config_Reference.md#output_pin) is -enabled: -- `SET_PIN PIN=config_name VALUE= CYCLE_TIME=` - -Note: Hardware PWM does not currently support the CYCLE_TIME parameter -and will use the cycle time defined in the config. - -### Manually Controlled Fans Commands - -The following command is available when a -[fan_generic config section](Config_Reference.md#fan_generic) is -enabled: -- `SET_FAN_SPEED FAN=config_name SPEED=` This command sets - the speed of a fan. must be between 0.0 and 1.0. - -### Neopixel and Dotstar Commands - -The following command is available when a -[neopixel config section](Config_Reference.md#neopixel) or -[dotstar config section](Config_Reference.md#dotstar) is enabled: -- `SET_LED LED= RED= GREEN= BLUE= - WHITE= [INDEX=] [TRANSMIT=0] [SYNC=1]`: This sets the LED - output. Each color `` must be between 0.0 and 1.0. The WHITE - option is only valid on RGBW LEDs. If multiple LED chips are - daisy-chained then one may specify INDEX to alter the color of just - the given chip (1 for the first chip, 2 for the second, etc.). If - INDEX is not provided then all LEDs in the daisy-chain will be set - to the provided color. If TRANSMIT=0 is specified then the color - change will only be made on the next SET_LED command that does not - specify TRANSMIT=0; this may be useful in combination with the INDEX - parameter to batch multiple updates in a daisy-chain. By default, the - SET_LED command will sync it's changes with other ongoing gcode commands. - This can lead to undesirable behavior if LEDs are being set while the - printer is not printing as it will reset the idle timeout. If careful - timing is not needed, the optional SYNC=0 parameter can be specified to - apply the changes instantly and not reset the idle timeout. - -### Servo Commands - -The following commands are available when a -[servo config section](Config_Reference.md#servo) is enabled: -- `SET_SERVO SERVO=config_name [ANGLE= | WIDTH=]`: - Set the servo position to the given angle (in degrees) or pulse - width (in seconds). Use `WIDTH=0` to disable the servo output. - -### Manual stepper Commands - -The following command is available when a -[manual_stepper config section](Config_Reference.md#manual_stepper) is -enabled: -- `MANUAL_STEPPER STEPPER=config_name [ENABLE=[0|1]] - [SET_POSITION=] [SPEED=] [ACCEL=] - [MOVE= [STOP_ON_ENDSTOP=[1|2|-1|-2]] [SYNC=0]]`: This command - will alter the state of the stepper. Use the ENABLE parameter to - enable/disable the stepper. Use the SET_POSITION parameter to force - the stepper to think it is at the given position. Use the MOVE - parameter to request a movement to the given position. If SPEED - and/or ACCEL is specified then the given values will be used instead - of the defaults specified in the config file. If an ACCEL of zero is - specified then no acceleration will be performed. If - STOP_ON_ENDSTOP=1 is specified then the move will end early should - the endstop report as triggered (use STOP_ON_ENDSTOP=2 to complete - the move without error even if the endstop does not trigger, use -1 - or -2 to stop when the endstop reports not triggered). Normally - future G-Code commands will be scheduled to run after the stepper - move completes, however if a manual stepper move uses SYNC=0 then - future G-Code movement commands may run in parallel with the stepper - movement. - -### Probe - -The following commands are available when a -[probe config section](Config_Reference.md#probe) is enabled (also see -the [probe calibrate guide](Probe_Calibrate.md)): -- `PROBE [PROBE_SPEED=] [LIFT_SPEED=] [SAMPLES=] - [SAMPLE_RETRACT_DIST=] [SAMPLES_TOLERANCE=] - [SAMPLES_TOLERANCE_RETRIES=] - [SAMPLES_RESULT=median|average]`: Move the nozzle downwards until - the probe triggers. If any of the optional parameters are provided - they override their equivalent setting in the - [probe config section](Config_Reference.md#probe). -- `QUERY_PROBE`: Report the current status of the probe ("triggered" - or "open"). -- `PROBE_ACCURACY [PROBE_SPEED=] [SAMPLES=] - [SAMPLE_RETRACT_DIST=]`: Calculate the maximum, minimum, - average, median, and standard deviation of multiple probe - samples. By default, 10 SAMPLES are taken. Otherwise the optional - parameters default to their equivalent setting in the probe config - section. -- `PROBE_CALIBRATE [SPEED=] [=]`: Run a - helper script useful for calibrating the probe's z_offset. See the - PROBE command for details on the optional probe parameters. See - the MANUAL_PROBE command for details on the SPEED parameter and the - additional commands available while the tool is active. Please note, - the PROBE_CALIBRATE command uses the speed variable - to move in XY direction as well as Z. -- `Z_OFFSET_APPLY_PROBE`: Take the current Z Gcode offset (aka, - babystepping), and subtract if from the probe's z_offset. - This acts to take a frequently used babystepping value, and "make - it permanent". Requires a `SAVE_CONFIG` to take effect. - -### BLTouch - -The following command is available when a -[bltouch config section](Config_Reference.md#bltouch) is enabled (also -see the [BL-Touch guide](BLTouch.md)): -- `BLTOUCH_DEBUG COMMAND=`: This sends a command to the - BLTouch. It may be useful for debugging. Available commands are: - `pin_down`, `touch_mode`, `pin_up`, `self_test`, `reset`, - (*1): `set_5V_output_mode`, `set_OD_output_mode`, `output_mode_store` - - *** Note that the commands marked by (*1) are solely supported - by a BL-Touch V3.0 or V3.1(+) - -- `BLTOUCH_STORE MODE=`: This stores an output mode in the - EEPROM of a BLTouch V3.1 Available output_modes are: `5V`, `OD` - -### Delta Calibration +### [z_tilt] The following commands are available when the -[delta_calibrate config section](Config_Reference.md#linear-delta-kinematics) -is enabled (also see the [delta calibrate guide](Delta_Calibrate.md)): -- `DELTA_CALIBRATE [METHOD=manual] [=]`: This - command will probe seven points on the bed and recommend updated - endstop positions, tower angles, and radius. See the PROBE command - for details on the optional probe parameters. If METHOD=manual is - specified then the manual probing tool is activated - see the - MANUAL_PROBE command above for details on the additional commands - available while this tool is active. -- `DELTA_ANALYZE`: This command is used during enhanced delta - calibration. See [Delta Calibrate](Delta_Calibrate.md) for details. +[z_tilt config section](Config_Reference.md#z_tilt) is enabled. -### Bed Tilt - -The following commands are available when the -[bed_tilt config section](Config_Reference.md#bed_tilt) is enabled: -- `BED_TILT_CALIBRATE [METHOD=manual] [=]`: - This command will probe the points specified in the config and then - recommend updated x and y tilt adjustments. See the PROBE command - for details on the optional probe parameters. If METHOD=manual is - specified then the manual probing tool is activated - see the - MANUAL_PROBE command above for details on the additional commands - available while this tool is active. - -### Mesh Bed Leveling - -The following commands are available when the -[bed_mesh config section](Config_Reference.md#bed_mesh) is enabled -(also see the [bed mesh guide](Bed_Mesh.md)): -- `BED_MESH_CALIBRATE [METHOD=manual] [=] - [=]`: - This command probes the bed using generated points specified by the - parameters in the config. After probing, a mesh is generated and - z-movement is adjusted according to the mesh. See the PROBE command - for details on the optional probe parameters. If METHOD=manual is - specified then the manual probing tool is activated - see the - MANUAL_PROBE command above for details on the additional commands - available while this tool is active. -- `BED_MESH_OUTPUT PGP=[<0:1>]`: This command outputs the current probed - z values and current mesh values to the terminal. If PGP=1 is specified - the X, Y coordinates generated by bed_mesh, along with their associated - indices, will be output to the terminal. -- `BED_MESH_MAP`: Like to BED_MESH_OUTPUT, this command prints the current - state of the mesh to the terminal. Instead of printing the values in a - human readable format, the state is serialized in json format. This allows - octoprint plugins to easily capture the data and generate height maps - approximating the bed's surface. -- `BED_MESH_CLEAR`: This command clears the mesh and removes all - z adjustment. It is recommended to put this in your end-gcode. -- `BED_MESH_PROFILE LOAD= SAVE= REMOVE=`: This - command provides profile management for mesh state. LOAD will - restore the mesh state from the profile matching the supplied name. - SAVE will save the current mesh state to a profile matching the - supplied name. Remove will delete the profile matching the - supplied name from persistent memory. Note that after SAVE or - REMOVE operations have been run the SAVE_CONFIG gcode must be run - to make the changes to peristent memory permanent. -- `BED_MESH_OFFSET [X=] [Y=]`: Applies X and/or Y - offsets to the mesh lookup. This is useful for printers with - independent extruders, as an offset is necessary to produce - correct Z adjustment after a tool change. - -### Bed Screws Helper - -The following commands are available when the -[bed_screws config section](Config_Reference.md#bed_screws) is enabled -(also see the -[manual level guide](Manual_Level.md#adjusting-bed-leveling-screws)): -- `BED_SCREWS_ADJUST`: This command will invoke the bed screws - adjustment tool. It will command the nozzle to different locations - (as defined in the config file) and allow one to make adjustments to - the bed screws so that the bed is a constant distance from the - nozzle. - -### Bed Screws Tilt Adjust Helper - -The following commands are available when the -[screws_tilt_adjust config section](Config_Reference.md#screws_tilt_adjust) -is enabled (also see the -[manual level guide](Manual_Level.md#adjusting-bed-leveling-screws-using-the-bed-probe)): -- `SCREWS_TILT_CALCULATE [DIRECTION=CW|CCW] [=]`: - This command will invoke the bed screws adjustment tool. It will command the - nozzle to different locations (as defined in the config file) - probing the z height and calculate the number of knob turns to - adjust the bed level. If DIRECTION is specified, the knob turns will all - be in the same direction, clockwise (CW) or counterclockwise (CCW). - See the PROBE command for details on the optional probe parameters. - IMPORTANT: You MUST always do a G28 before using this command. - -### Z Tilt - -The following commands are available when the -[z_tilt config section](Config_Reference.md#z_tilt) is enabled: -- `Z_TILT_ADJUST [=]`: This command will probe - the points specified in the config and then make independent - adjustments to each Z stepper to compensate for tilt. See the PROBE - command for details on the optional probe parameters. - -### Dual Carriages - -The following command is available when the -[dual_carriage config section](Config_Reference.md#dual_carriage) is -enabled: -- `SET_DUAL_CARRIAGE CARRIAGE=[0|1]`: This command will set the active - carriage. It is typically invoked from the activate_gcode and - deactivate_gcode fields in a multiple extruder configuration. - -### TMC stepper drivers - -The following commands are available when any of the -[tmcXXXX config sections](Config_Reference.md#tmc-stepper-driver-configuration) -are enabled: -- `DUMP_TMC STEPPER=`: This command will read the TMC driver - registers and report their values. -- `INIT_TMC STEPPER=`: This command will intitialize the TMC - registers. Needed to re-enable the driver if power to the chip is - turned off then back on. -- `SET_TMC_CURRENT STEPPER= CURRENT= HOLDCURRENT=`: - This will adjust the run and hold currents of the TMC driver. - (HOLDCURRENT is not applicable to tmc2660 drivers.) -- `SET_TMC_FIELD STEPPER= FIELD= VALUE=`: This - will alter the value of the specified register field of the TMC - driver. This command is intended for low-level diagnostics and - debugging only because changing the fields during run-time can lead - to undesired and potentially dangerous behavior of your printer. - Permanent changes should be made using the printer configuration - file instead. No sanity checks are performed for the given values. - -### Endstop adjustments by stepper phase - -The following commands are available when an -[endstop_phase config section](Config_Reference.md#endstop_phase) is -enabled (also see the [endstop phase guide](Endstop_Phase.md)): -- `ENDSTOP_PHASE_CALIBRATE [STEPPER=]`: If no STEPPER - parameter is provided then this command will reports statistics on - endstop stepper phases during past homing operations. When a STEPPER - parameter is provided it arranges for the given endstop phase - setting to be written to the config file (in conjunction with the - SAVE_CONFIG command). - -### Force movement - -The following commands are available when the -[force_move config section](Config_Reference.md#force_move) is -enabled: -- `FORCE_MOVE STEPPER= DISTANCE= VELOCITY= - [ACCEL=]`: This command will forcibly move the given stepper - the given distance (in mm) at the given constant velocity (in - mm/s). If ACCEL is specified and is greater than zero, then the - given acceleration (in mm/s^2) will be used; otherwise no - acceleration is performed. No boundary checks are performed; no - kinematic updates are made; other parallel steppers on an axis will - not be moved. Use caution as an incorrect command could cause - damage! Using this command will almost certainly place the low-level - kinematics in an incorrect state; issue a G28 afterwards to reset - the kinematics. This command is intended for low-level diagnostics - and debugging. -- `SET_KINEMATIC_POSITION [X=] [Y=] [Z=]`: Force - the low-level kinematic code to believe the toolhead is at the given - cartesian position. This is a diagnostic and debugging command; use - SET_GCODE_OFFSET and/or G92 for regular axis transformations. If an - axis is not specified then it will default to the position that the - head was last commanded to. Setting an incorrect or invalid position - may lead to internal software errors. This command may invalidate - future boundary checks; issue a G28 afterwards to reset the - kinematics. - -### SDcard loop - -When the [sdcard_loop config section](Config_Reference.md#sdcard_loop) -is enabled, the following extended commands are available: -- `SDCARD_LOOP_BEGIN COUNT=`: Begin a looped section in the SD - print. A count of 0 indicates that the section should be looped - indefinately. -- `SDCARD_LOOP_END`: End a looped section in the SD print. -- `SDCARD_LOOP_DESIST`: Complete existing loops without further - iterations. - -### Send message (respond) to host - -The following commands are availabe when the -[respond config section](Config_Reference.md#respond) is enabled. -- `M118 `: echo the message prepended with the configured - default prefix (or `echo: ` if no prefix is configured). -- `RESPOND MSG=""`: echo the message prepended with the - configured default prefix (or `echo: ` if no prefix is configured). -- `RESPOND TYPE=echo MSG=""`: echo the message prepended with - `echo: `. -- `RESPOND TYPE=command MSG=""`: echo the message prepended - with `// `. Octopint can be configured to respond to these messages - (e.g. `RESPOND TYPE=command MSG=action:pause`). -- `RESPOND TYPE=error MSG=""`: echo the message prepended - with `!! `. -- `RESPOND PREFIX= MSG=""`: echo the message - prepended with ``. (The `PREFIX` parameter will take - priority over the `TYPE` parameter) - -### Pause Resume - -The following commands are available when the -[pause_resume config section](Config_Reference.md#pause_resume) is -enabled: -- `PAUSE`: Pauses the current print. The current position is captured - for restoration upon resume. -- `RESUME [VELOCITY=]`: Resumes the print from a pause, first - restoring the previously captured position. The VELOCITY parameter - determines the speed at which the tool should return to the original - captured position. -- `CLEAR_PAUSE`: Clears the current paused state without resuming the - print. This is useful if one decides to cancel a print after a - PAUSE. It is recommended to add this to your start gcode to make - sure the paused state is fresh for each print. -- `CANCEL_PRINT`: Cancels the current print. - -### Filament Sensor - -The following command is available when the -[filament_switch_sensor or filament_motion_sensor config section](Config_Reference.md#filament_switch_sensor) -is enabled. -- `QUERY_FILAMENT_SENSOR SENSOR=`: Queries the current - status of the filament sensor. The data displayed on the terminal - will depend on the sensor type defined in the confguration. -- `SET_FILAMENT_SENSOR SENSOR= ENABLE=[0|1]`: Sets the - filament sensor on/off. If ENABLE is set to 0, the filament sensor - will be disabled, if set to 1 it is enabled. - -### Firmware Retraction - -The following commands are available when the -[firmware_retraction config section](Config_Reference.md#firmware_retraction) -is enabled. These commands allow you to utilise the firmware -retraction feature available in many slicers, to reduce stringing -during non-extrusion moves from one part of the print to another. -Appropriately configuring pressure advance reduces the length of -retraction required. -- `SET_RETRACTION [RETRACT_LENGTH=] [RETRACT_SPEED=] - [UNRETRACT_EXTRA_LENGTH=] [UNRETRACT_SPEED=]`: Adjust the - parameters used by firmware retraction. RETRACT_LENGTH determines - the length of filament to retract and unretract. The speed of - retraction is adjusted via RETRACT_SPEED, and is typically set - relatively high. The speed of unretraction is adjusted via - UNRETRACT_SPEED, and is not particularly critical, although often - lower than RETRACT_SPEED. In some cases it is useful to add a small - amount of additional length on unretraction, and this is set via - UNRETRACT_EXTRA_LENGTH. SET_RETRACTION is commonly set as part of - slicer per-filament configuration, as different filaments require - different parameter settings. -- `GET_RETRACTION`: Queries the current parameters used by firmware - retraction and displays them on the terminal. -- `G10`: Retracts the extruder using the currently configured - parameters. -- `G11`: Unretracts the extruder using the currently configured - parameters. - -### Skew Correction - -The following commands are available when the -[skew_correction config section](Config_Reference.md#skew_correction) -is enabled (also see the [Skew Correction](Skew_Correction.md) guide): -- `SET_SKEW [XY=] [XZ=] - [YZ=] [CLEAR=<0|1>]`: Configures the [skew_correction] - module with measurements (in mm) taken from a calibration print. - One may enter measurements for any combination of planes, planes not - entered will retain their current value. If `CLEAR=1` is entered - then all skew correction will be disabled. -- `GET_CURRENT_SKEW`: Reports the current printer skew for each plane - in both radians and degrees. The skew is calculated based on - parameters provided via the `SET_SKEW` gcode. -- `CALC_MEASURED_SKEW [AC=] [BD=] - [AD=]`: Calculates and reports the skew (in radians and - degrees) based on a measured print. This can be useful for - determining the printer's current skew after correction has been - applied. It may also be useful before correction is applied to - determine if skew correction is necessary. See [Skew Correction](Skew_Correction.md) - for details on skew calibration objects and measurements. -- `SKEW_PROFILE [LOAD=] [SAVE=] [REMOVE=]`: Profile - management for skew_correction. LOAD will restore skew state from - the profile matching the supplied name. SAVE will save the current - skew state to a profile matching the supplied name. Remove will - delete the profile matching the supplied name from persistent - memory. Note that after SAVE or REMOVE operations have been run the - SAVE_CONFIG gcode must be run to make the changes to peristent - memory permanent. - -### Delayed GCode - -The following command is enabled if a -[delayed_gcode config section](Config_Reference.md#delayed_gcode) has -been enabled (also see the -[template guide](Command_Templates.md#delayed-gcodes)): -- `UPDATE_DELAYED_GCODE [ID=] [DURATION=]`: Updates the - delay duration for the identified [delayed_gcode] and starts the timer - for gcode execution. A value of 0 will cancel a pending delayed gcode - from executing. - -### Save Variables - -The following command is enabled if a -[save_variables config section](Config_Reference.md#save_variables) -has been enabled: -- `SAVE_VARIABLE VARIABLE= VALUE=`: Saves the variable to - disk so that it can be used across restarts. All stored variables - are loaded into the `printer.save_variables.variables` dict at - startup and can be used in gcode macros. The provided VALUE is - parsed as a Python literal. - -### Resonance compensation - -The following command is enabled if an -[input_shaper config section](Config_Reference.md#input_shaper) has -been enabled (also see the -[resonance compensation guide](Resonance_Compensation.md)): -- `SET_INPUT_SHAPER [SHAPER_FREQ_X=] - [SHAPER_FREQ_Y=] - [DAMPING_RATIO_X=] - [DAMPING_RATIO_Y=] [SHAPER_TYPE=] - [SHAPER_TYPE_X=] [SHAPER_TYPE_Y=]`: - Modify input shaper parameters. Note that SHAPER_TYPE parameter - resets input shaper for both X and Y axes even if different shaper - types have been configured in [input_shaper] section. SHAPER_TYPE - cannot be used together with either of SHAPER_TYPE_X and - SHAPER_TYPE_Y parameters. See - [config reference](Config_Reference.md#input_shaper) for more - details on each of these parameters. - -### Temperature Fan Commands - -The following command is available when a -[temperature_fan config section](Config_Reference.md#temperature_fan) -is enabled: -- `SET_TEMPERATURE_FAN_TARGET temperature_fan= - [target=] [min_speed=] [max_speed=]`: Sets the target temperature for a - temperature_fan. If a target is not supplied, it is set to the - specified temperature in the config file. If speeds are not supplied, no change is applied. - -### Adxl345 Accelerometer Commands - -The following commands are available when an -[adxl345 config section](Config_Reference.md#adxl345) is enabled: -- `ACCELEROMETER_MEASURE [CHIP=] [NAME=]`: Starts - accelerometer measurements at the requested number of samples per - second. If CHIP is not specified it defaults to "adxl345". The - command works in a start-stop mode: when executed for the first - time, it starts the measurements, next execution stops them. The - results of measurements are written to a file named - `/tmp/adxl345--.csv` where `` is the name of the - accelerometer chip (`my_chip_name` from `[adxl345 my_chip_name]`) - and `` is the optional NAME parameter. If NAME is not - specified it defaults to the current time in "YYYYMMDD_HHMMSS" - format. If the accelerometer does not have a name in its config - section (simply `[adxl345]`) then `` part of the name is not - generated. -- `ACCELEROMETER_QUERY [CHIP=] [RATE=]`: queries - accelerometer for the current value. If CHIP is not specified it - defaults to "adxl345". If RATE is not specified, the default value - is used. This command is useful to test the connection to the - ADXL345 accelerometer: one of the returned values should be a - free-fall acceleration (+/- some noise of the chip). -- `ACCELEROMETER_DEBUG_READ [CHIP=] REG=`: queries - ADXL345 register (e.g. 44 or 0x2C). Can be useful for - debugging purposes. -- `ACCELEROMETER_DEBUG_WRITE [CHIP=] REG= VAL=`: - writes raw into a register . Both and - can be a decimal or a hexadecimal integer. Use with care, - and refer to ADXL345 data sheet for the reference. - -### Resonance Testing Commands - -The following commands are available when a -[resonance_tester config section](Config_Reference.md#resonance_tester) -is enabled (also see the -[measuring resonances guide](Measuring_Resonances.md)): -- `MEASURE_AXES_NOISE`: Measures and outputs the noise for all axes of - all enabled accelerometer chips. -- `TEST_RESONANCES AXIS= OUTPUT= - [NAME=] [FREQ_START=] [FREQ_END=] - [HZ_PER_SEC=] [INPUT_SHAPING=[<0:1>]]`: Runs the resonance - test in all configured probe points for the requested - and measures the acceleration using the accelerometer chips configured - for the respective axis. can either be X or Y, or specify an - arbitrary direction as `AXIS=dx,dy`, where dx and dy are floating point - numbers defining a direction vector (e.g. `AXIS=X`, `AXIS=Y`, or - `AXIS=1,-1` to define a diagonal direction). Note that `AXIS=dx,dy` and - `AXIS=-dx,-dy` is equivalent. If `INPUT_SHAPING=0` or not set (default), - disables input shaping for the resonance testing, because it is not valid - to run the resonance testing with the input shaper enabled. - `OUTPUT` parameter is a comma-separated list of which outputs will be - written. If `raw_data` is requested, then the raw accelerometer data - is written into a file or a series of files - `/tmp/raw_data__[_].csv` with (`_` part of - the name generated only if more than 1 probe point is configured). - If `resonances` is specified, the frequency response is calculated - (across all probe points) and written into - `/tmp/resonances__.csv` file. If unset, OUTPUT defaults - to `resonances`, and NAME defaults to the current time in - "YYYYMMDD_HHMMSS" format. -- `SHAPER_CALIBRATE [AXIS=] [NAME=] - [FREQ_START=] [FREQ_END=] - [HZ_PER_SEC=] [MAX_SMOOTHING=]`: - Similarly to `TEST_RESONANCES`, runs the resonance test as configured, - and tries to find the optimal parameters for the input shaper for the - requested axis (or both X and Y axes if `AXIS` parameter is unset). - If `MAX_SMOOTHING` is unset, its value is taken from `[resonance_tester]` - section, with the default being unset. See the - [Max smoothing](Measuring_Resonances.md#max-smoothing) of the measuring - resonances guide for more information on the use of this feature. - The results of the tuning are printed to the console, and the frequency - responses and the different input shapers values are written to a CSV - file(s) `/tmp/calibration_data__.csv`. Unless specified, NAME - defaults to the current time in "YYYYMMDD_HHMMSS" format. Note that - the suggested input shaper parameters can be persisted in the config - by issuing `SAVE_CONFIG` command. - -### Palette 2 Commands - -The following command is available when the -[palette2 config section](Config_Reference.md#palette2) -is enabled: -- `PALETTE_CONNECT`: This command initializes the connection with - the Palette 2. -- `PALETTE_DISCONNECT`: This command disconnects from the Palette 2. -- `PALETTE_CLEAR`: This command instructs the Palette 2 to clear all of the - input and output paths of filament. -- `PALETTE_CUT`: This command instructs the Palette 2 to cut the filament - currently loaded in the splice core. -- `PALETTE_SMART_LOAD`: This command start the smart load sequence on the - Palette 2. Filament is loaded automatically by extruding it the distance - calibrated on the device for the printer, and instructs the Palette 2 - once the loading has been completed. This command is the same as pressing - **Smart Load** directly on the Palette 2 screen after the filament load - is complete. - -Palette prints work by embedding special OCodes (Omega Codes) -in the GCode file: -- `O1`...`O32`: These codes are read from the GCode stream and processed - by this module and passed to the Palette 2 device. - -### Filament Width Sensor Commands - -The following command is available when the -[tsl1401cl filament width sensor config section](Config_Reference.md#tsl1401cl_filament_width_sensor) -or [hall filament width sensor config section](Config_Reference.md#hall_filament_width_sensor) -is enabled (also see [TSLl401CL Filament Width Sensor](TSL1401CL_Filament_Width_Sensor.md) -and [Hall Filament Width Sensor](Hall_Filament_Width_Sensor.md)): - -- `QUERY_FILAMENT_WIDTH` - Return the current measured filament width -- `RESET_FILAMENT_WIDTH_SENSOR` - Clear all sensor readings. Helpful after - filament change -- `DISABLE_FILAMENT_WIDTH_SENSOR` - Turn off the filament width sensor and - stop using it for flow control -- `ENABLE_FILAMENT_WIDTH_SENSOR` - Turn on the filament width sensor and - start using it for flow control - -### Hall Filament Width Sensor Commands - -The following command is available when the -[hall filament width sensor config section](Config_Reference.md#hall_filament_width_sensor) -is enabled: - -- `QUERY_RAW_FILAMENT_WIDTH` - Return the current ADC channel readings and - RAW sensor value for calibration points -- `ENABLE_FILAMENT_WIDTH_LOG` - Turn on diameter logging -- `DISABLE_FILAMENT_WIDTH_LOG` - Turn off diameter logging +#### Z_TILT_ADJUST +`Z_TILT_ADJUST [=]`: This command will probe +the points specified in the config and then make independent +adjustments to each Z stepper to compensate for tilt. See the PROBE +command for details on the optional probe parameters. diff --git a/docs/Hall_Filament_Width_Sensor.md b/docs/Hall_Filament_Width_Sensor.md index 978d6450..680a1a4f 100644 --- a/docs/Hall_Filament_Width_Sensor.md +++ b/docs/Hall_Filament_Width_Sensor.md @@ -11,7 +11,7 @@ an assembly video is also available on [Youtube](https://www.youtube.com/watch?v To use Hall filament width sensor, read [Config Reference](Config_Reference.md#hall_filament_width_sensor) and -[G-Code documentation](G-Codes.md#Hall_Filament_Width_Sensor_Commands). +[G-Code documentation](G-Codes.md#hall_filament_width_sensor). ## How does it work? diff --git a/docs/Measuring_Resonances.md b/docs/Measuring_Resonances.md index 6be076b7..655a6494 100644 --- a/docs/Measuring_Resonances.md +++ b/docs/Measuring_Resonances.md @@ -473,10 +473,11 @@ ignoring any errors for `SET_INPUT_SHAPER` command. For `TEST_RESONANCES` command, specify the desired test axis. The raw data will be written into `/tmp` directory on the RPi. -The raw data can also be obtained by running the command `ACCELEROMETER_MEASURE` -command twice during some normal printer activity - first to start the -measurements, and then to stop them and write the output file. Refer to -[G-Codes](G-Codes.md#adxl345-accelerometer-commands) for more details. +The raw data can also be obtained by running the command +`ACCELEROMETER_MEASURE` command twice during some normal printer +activity - first to start the measurements, and then to stop them and +write the output file. Refer to [G-Codes](G-Codes.md#adxl345) for more +details. The data can be processed later by the following scripts: `scripts/graph_accelerometer.py` and `scripts/calibrate_shaper.py`. Both diff --git a/docs/Probe_Calibrate.md b/docs/Probe_Calibrate.md index 9bede889..ed3964e6 100644 --- a/docs/Probe_Calibrate.md +++ b/docs/Probe_Calibrate.md @@ -129,12 +129,12 @@ typical bed leveling procedures. It may be possible to tune the probe speed and/or probe start height to improve the repeatability of the probe. The `PROBE_ACCURACY` command allows one to run tests with different parameters to see their impact - see the -[G-Codes document](G-Codes.md) for further details. If the probe -generally obtains repeatable results but has an occasional outlier, -then it may be possible to account for that by using multiple samples -on each probe - read the description of the probe `samples` config -parameters in the [config reference](Config_Reference.md#probe) for -more details. +[G-Codes document](G-Codes.md#probe_accuracy) for further details. If +the probe generally obtains repeatable results but has an occasional +outlier, then it may be possible to account for that by using multiple +samples on each probe - read the description of the probe `samples` +config parameters in the [config reference](Config_Reference.md#probe) +for more details. If new probe speed, samples count, or other settings are needed, then update the printer.cfg file and issue a `RESTART` command. If so, it diff --git a/docs/TMC_Drivers.md b/docs/TMC_Drivers.md index 581fe2b2..8f85af53 100644 --- a/docs/TMC_Drivers.md +++ b/docs/TMC_Drivers.md @@ -45,7 +45,7 @@ leave a stepper idle sufficiently long. If one wishes to reduce current to motors during print start routines, then consider issuing -[SET_TMC_CURRENT](G-Codes.md#tmc-stepper-drivers) commands in a +[SET_TMC_CURRENT](G-Codes.md#set_tmc_current) commands in a [START_PRINT macro](Slicers.md#klipper-gcode_macro) to adjust the current before and after normal printing moves. @@ -410,10 +410,10 @@ restrictions: ## Querying and diagnosing driver settings -The `[DUMP_TMC command](G-Codes.md#tmc-stepper-drivers) is a useful -tool when configuring and diagnosing the drivers. It will report all -fields configured by Klipper as well as all fields that can be queried -from the driver. +The `[DUMP_TMC command](G-Codes.md#dump_tmc) is a useful tool when +configuring and diagnosing the drivers. It will report all fields +configured by Klipper as well as all fields that can be queried from +the driver. All of the reported fields are defined in the Trinamic datasheet for each driver. These datasheets can be found on the @@ -429,7 +429,7 @@ Klipper supports configuring many low-level driver fields using has the full list of fields available for each type of driver. In addition, almost all fields can be modified at run-time using the -[SET_TMC_FIELD command](G-Codes.md#tmc-stepper-drivers). +[SET_TMC_FIELD command](G-Codes.md#set_tmc_field). Each of these fields is defined in the Trinamic datasheet for each driver. These datasheets can be found on the diff --git a/docs/TSL1401CL_Filament_Width_Sensor.md b/docs/TSL1401CL_Filament_Width_Sensor.md index a0dccb92..a788069f 100644 --- a/docs/TSL1401CL_Filament_Width_Sensor.md +++ b/docs/TSL1401CL_Filament_Width_Sensor.md @@ -7,7 +7,7 @@ designs at [Thingiverse](https://www.thingiverse.com/search?q=filament%20width%2 To use a sensor array as a filament width sensor, read [Config Reference](Config_Reference.md#tsl1401cl_filament_width_sensor) and -[G-Code documentation](G-Codes.md#Filament_Width_Sensor_Commands). +[G-Code documentation](G-Codes.md#hall_filament_width_sensor). ## How does it work?