Macros are an essential tool for configuring and managing Klipper. A number of macros are pre-defined in the example configurations but a lot more is possible.
Klipper macros are always in the following format:
Important: The tab / spaces before the gcode is required.
There is a Klipper Macros Beginner’s Guide in the How-To section.
To see examples of the macros themselves, look at the standard printer.cfg for the printer.
By default, all printers are setup with a
[homing_override] configuration section that includes a gcode macro for the home process. This macro is updating during the setup process to define the Z endstop location. However the homing override method always homes X and Y before homing Z.
[safe_z_home] configuration allows for a Z homing process without requiring a repeat home of X and Y. To enable safe z homing disable homing override and provide a X,Y coordinate of your Z endstop pin. Be aware that enabling safe Z home will likely require a change in other processes / macros.
The G32 macro is included with the stock configuration for most printers. This is typically used as a “full home” process that will home and perform leveling / tilt adjustments.
The PRINT_START macro is called at the start of every print by slicers that are configured to be aware of it.
The PRINT_END macro is called at the end of every print by slicers that are configured to be aware of it.
|CG28, G32, G141, PURGE_BUCKET, TEST_SPEED_FAST
|_SET_CASE_LEDS, _CASELIGHT_ON, _CASELIGHT_OFF, CASELIGHT, _CLEAR_DISPLAY
|set_led_length, Update_idle_timeout, delay
Contributors - please make sure your macros are well documented!