====== gcode ====== {{tag> wip about}} {{:shopping.png?64|}} ...work in progress... See https://www.klipper3d.org/G-Codes.html for the complete set of [[Klipper]] gcode commands. Your slicer takes a CAD model and "slices" it into layers, outputting the instructions, as gcode, necessary to control the printer to print each layer. These gcode instructions specify tool path movements and control all operations. Gcode that is produced by the slicer might look something like this: G28 G1 F1500 G1 X2.0 Y2.0 F3000 G1 X3.0 Y3.0 Klipper's goal is to implement a minimal set of the most common of gcodes required to be effective, and to leverage [[macros]] to build more complex instructions from smaller building blocks, and preferring "extended gcode commands" that are more human readable to traditional Marlin or RepRap gcodes designed when simple parsing simplistic was a necessity during to hardware limitations for the firmware of the time. Klipper supports the following standard G-Code commands: * Move (G0 or G1): G1 [X] [Y] [Z] [E] [F] * Dwell: G4 P * Move to origin: G28 [X] [Y] [Z] * Turn off motors: M18 or M84 * Wait for current moves to finish: M400 * Use absolute/relative distances for extrusion: M82, M83 * Use absolute/relative coordinates: G90, G91 * Set position: G92 [X] [Y] [Z] [E] * Set speed factor override percentage: M220 S * Set extrude factor override percentage: M221 S * Set acceleration: M204 S OR M204 P T * Note: If S is not specified and both P and T are specified, then the acceleration is set to the minimum of P and T. If only one of P or T is specified, the command has no effect. * Get extruder temperature: M105 * Set extruder temperature: M104 [T] [S] * Set extruder temperature and wait: M109 [T] S * Note: M109 always waits for temperature to settle at requested value * Set bed temperature: M140 [S] * Set bed temperature and wait: M190 S * Note: M190 always waits for temperature to settle at requested value * Set fan speed: M106 S * Turn fan off: M107 * Emergency stop: M112 * Get current position: M114 * Get firmware version: M115 Klipper then further implements a set of "extended gcode", a full list of which is available [[https://www.klipper3d.org/G-Codes.html#additional-commands|here]] as part of the Klipper documentation. Common Klipper extended gcode commands include: * RESTART * FIRMWARE_RESTART * GET_POSITION * SET_GCODE_OFFSET * SET_HEATER_TEMPERATURE * TEMPERATURE_WAIT * PAUSE * RESUME * PROBE * SCREWS_TILT_CALCULATE * SDCARD_PRINT_FILE * ... and many more They take meaningfully named parameters which can appear in any order, as opposed to Marlin gcodes that follow strict parameter order and are referenced with preface letters like P, S, T for parameters, second, or tool specifiers which are less human-readable. Gcode itself is case insensitive, except for characters in comments. Comments begin with a semi-colon and end at the end of the line. G28 ; HOME the nozzle SET_HEATER_TEMPERATURE HEATER=extruder TARGET=160 ; set the extruder temperature to 160C