Klipper Supported G-Code

Klipper Supported G-Code

Klipper is a firmware for 3D printers that utilizes a single-board computer like a Raspberry Pi to offload the more intensive calculations from the printer's microcontroller. Klipper supports a wide range of G-code commands that enable a user to customize their printer's settings and behavior.

References:


Here is a list of some of the most common G-code commands supported by Klipper, along with an explanation of what each command does.

  • G0/G1: This command moves the print head to a specified location. G0 moves the print head at maximum speed, while G1 moves the print head at a specified speed.
  • G2/G3: These commands create arcs by specifying the center of the arc and the end point. G2 creates a clockwise arc, while G3 creates a counterclockwise arc.
  • G4: This command introduces a pause in the print for a specified amount of time, allowing for things like filament change or post-processing.
  • G10/G11: These commands allow for the setting and resetting of the printer's offset values. G10 sets the values, while G11 resets them.
  • G20/G21: These commands set the units of measurement used by the printer. G20 sets inches, while G21 sets millimeters.
  • G28: This command homes the print head to the origin of the printer's coordinate system.
  • G29: This command initiates the printer's auto bed leveling process, allowing for more accurate printing.
  • G32: This command initiates a probe-based calibration of the printer's bed.
  • G90/G91: These commands set the printer's positioning mode. G90 sets absolute positioning, while G91 sets relative positioning.
  • G92: This command allows for the manual setting of the printer's position.
  • M18: This command disables the printer's motors, allowing for manual manipulation of the printer's components.
  • M20: This command lists the files stored on the printer's SD card.
  • M82/M83: These commands set the extruder's positioning mode. M82 sets absolute positioning, while M83 sets relative positioning.
  • M84: This command disables the printer's motors after a specified amount of inactivity.
  • M104/M109: These commands set the extruder's temperature. M104 sets the temperature, while M109 waits until the temperature is reached before proceeding.
  • M140/M190: These commands set the bed's temperature. M140 sets the temperature, while M190 waits until the temperature is reached before proceeding.
  • M220: This command sets the printer's overall speed percentage.
  • M221: This command sets the printer's flow percentage.

These are just a few of the many G-code commands supported by Klipper. By utilizing these commands, a user can customize their printer's behavior and achieve more precise and accurate prints.

Extended G-Code

In addition to the standard G-code commands, Klipper also supports extended commands that allow for more advanced customization of printer behavior. These commands often start with the prefix "SET_" followed by a specific parameter and value. Here are some of the most common extended commands:

  • SET_SERVO: This command allows for the control of servos on the printer. The parameters include SERVO (the name of the servo to control) and ANGLE (the angle to set the servo to).
  • SET_GCODE_OFFSET: This command sets a g-code offset that is added to each g-code command sent to the printer. This can be useful for fine-tuning the printer's position.
  • SET_GCODE_VARIABLE: This command sets a variable that can be used in g-code commands. For example, you could set a variable named "temp" to a specific value, then use that variable in subsequent g-code commands to set the temperature.
  • SET_MESH_RADIUS: This command sets the radius of the mesh used for bed leveling.
  • SET_MAX_EXTRUDER_TEMP: This command sets the maximum temperature allowed for the printer's extruder.
  • SET_MAX_BED_TEMP: This command sets the maximum temperature allowed for the printer's bed.
  • SET_MIN_PRINT_SPEED: This command sets the minimum speed for printing. Any movement slower than this speed will be slowed down to match.
  • SET_MIN_SEGMENT_TIME: This command sets the minimum time for a segment of g-code to execute. This can help prevent the printer from moving too quickly and potentially skipping steps.
  • SET_MIN_PRINT_SPEED: This command sets the minimum speed for printing. Any movement slower than this speed will be slowed down to match.
  • SET_PRESSURE_ADVANCE: This command sets the pressure advance value for the printer. Pressure advance helps compensate for the lag time between extruder movement and actual filament flow.
  • SET_STEPPER_CURRENT: This command sets the current for the printer's stepper motors.
  • SET_WATCHDOG: This command enables or disables the printer's watchdog timer, which resets the printer if it detects a problem.

These extended commands can be used to fine-tune the printer's behavior and achieve better prints. However, it's important to note that they should be used with caution, as improper use of these commands can potentially damage the printer. Always consult the Klipper documentation and forums before using extended commands, and make sure to test any changes on a small print before attempting a larger one.