Main_en - ghzserg/zmod GitHub Wiki
A macro is a small program written in Klipper/Gcode language.
It can be called from:
- A GCODE file
- The Fluidd/Mainsail console (press the English letter
C
in Fluidd)
Note
The value in parentheses is the default value
🔷 Core Macros 🔷 |
|||
---|---|---|---|
START_PRINT | END_PRINT | CLOSE_DIALOGS | FAST_CLOSE_DIALOGS |
LED | LED_OFF | LED_ON | PLAY_MIDI |
CLEAR_NOZZLE | NEW_SAVE_CONFIG | LEVELING_PRINT_FILE | CANCEL |
PAUSE | RESUME | REBOOT | SHUTDOWN |
Replaces the default start G-code.
For printers with a native screen, add M140
/M190 S[bed_temp]
and M109
/M104 S[nozzle_temp]
.
Parameters:
-
EXTRUDER_TEMP
— extruder temperature (default:245
) -
BED_TEMP
— bed temperature (default:80
) -
MESH
— bed mesh profile name (empty = no mesh loaded/created) -
FORCE_LEVELING
— force bed leveling (default:False
) -
SKIP_LEVELING
— skip bed leveling entirely (overridesFORCE_KAMP
/FORCE_LEVELING
, default:False
) -
FORCE_KAMP
— build an adaptive bed mesh (KAMP, default:False
). Recommended to addSAVE_ZMOD_DATA CLEAR=LINE_PURGE
to use purge areas for KAMP. -
Z_OFFSET
— set Z offset (default:0.0
) -
SKIP_ZOFFSET
— skip Z offset adjustment (default:True
for native screen,False
otherwise) -
INTERNAL
— For PRO version without native screen:0
= external air intake,1
= internal air circulation (default:1
)
Notes:
- Any calibration (e.g.,
FORCE_KAMP
/FORCE_LEVELING
) triggers CLEAR_NOZZLE. -
[ZSSH_RELOAD](https://github.com/ghzserg/zmod/wiki/Zmod_en#zssh_reload)
is called duringSTART_PRINT
to restore SSH if needed.
Example for Orca with native screen: Replace the start G-code with:
START_PRINT EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single]
M190 S[bed_temperature_initial_layer_single]
M104 S[nozzle_temperature_initial_layer]
Example for Orca without native screen:
START_PRINT EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single]
Layer tracking in Fluidd: Add to start G-code:
SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count]
Add to layer change G-code:
SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num + 1}
Global flags (set via SAVE_ZMOD_DATA
):
-
PRECLEAR
— pre-nozzle cleaning inCLEAR_NOZZLE
:0
= disable,1
= enable (default:0
). -
CLEAR
— nozzle cleaning method (LINE_PURGE
). -
PRINT_LEVELING
— enable bed leveling for every print:0
= disable,1
= enable (default:0
). -
USE_KAMP
— use adaptive bed mesh (KAMP) where possible:0
= disable,1
= enable (default:0
). -
DISABLE_PRIMING
— disable nozzle priming:0
= enable,1
= disable (default:0
). -
FORCE_MD5
— verify file MD5 hashes (default:1
). UseaddMD5.bat
oraddMD5.sh
in post-processing scripts. -
DISABLE_SKEW_CORRECT
— disable skew correction:1
= disable,0
= loadskew_profile
(default:1
). -
AUTO_REBOOT
— auto-reboot after print:0
= disable,1
= enable,2
= firmware restart (default:0
). -
CLOSE_DIALOGS
— auto-close dialogs:0
= disable,1
= slow,2
= fast (requires enabling "Local Network Only" on the printer screen). -
STOP_MOTOR
— disable motors after print:0
= disable,1
= enable (default:1
). -
MIDI_START
— MIDI file to play on print start (e.g.,"start.mid"
). -
MIDI_END
— MIDI file to play on print end.
- Load mesh from
MESH
if specified. - Skip leveling if
SKIP_LEVELING = True
. - Build KAMP mesh if
FORCE_KAMP = True
. - Build full mesh if no mesh is loaded or
FORCE_LEVELING = True
.
Replaces the default end G-code.
Global flags (set via SAVE_ZMOD_DATA
):
-
AUTO_REBOOT
— auto-reboot after print (same as above). -
CLOSE_DIALOGS
— auto-close dialogs (same as above). -
STOP_MOTOR
— disable motors after print (same as above). -
MIDI_END
— MIDI file to play on print end.
Cancel the current print.
Nozzle cleaning (as in stock firmware). Parameters:
-
EXTRUDER_TEMP
— extruder temperature (default:230
) -
BED_TEMP
— bed temperature (default:80
)
PRECLEAR
(set via SAVE_ZMOD_DATA PRECLEAR=1
) enables pre-cleaning. Learn more.
Turn on LED lighting.
Turn off LED lighting.
Set LED brightness.
-
S
— brightness percentage (default:50
).
Pause the print.
Resume the print after pausing.
Play a MIDI file.
-
FILE
— filename (default:For_Elise.mid
). Files are stored inmod_data/midi/
.
Reboot the printer.
Close dialogs on the native screen (slow method).
May cause printer freezes.
Controlled by the CLOSE_DIALOGS
global parameter.
Close dialogs quickly (recommended).
Enable "Local Network Only" in printer settings: Settings → WiFi icon → Network Mode → Toggle "Local Network Only".
Controlled by the CLOSE_DIALOGS
global parameter.
Trigger SAVE_CONFIG
without freezing the native screen.
May take ~1 minute and occasionally cause screen glitches.
Print a file with bed leveling from the native screen.
-
FILENAME
— name of the file to print.
Requires enabling "Local Network Only" in printer settings. Bed leveling options
Power off the printer.