Main_en - ghzserg/zmod GitHub Wiki

Main

Прочитать на русском языке

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

START_PRINT

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 (overrides FORCE_KAMP/FORCE_LEVELING, default: False)
  • FORCE_KAMP — build an adaptive bed mesh (KAMP, default: False). Recommended to add SAVE_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 during START_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}

Bed leveling options


Global flags (set via SAVE_ZMOD_DATA):

  • PRECLEAR — pre-nozzle cleaning in CLEAR_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). Use addMD5.bat or addMD5.sh in post-processing scripts.
  • DISABLE_SKEW_CORRECT — disable skew correction: 1 = disable, 0 = load skew_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.

Bed leveling logic:

  1. Load mesh from MESH if specified.
  2. Skip leveling if SKIP_LEVELING = True.
  3. Build KAMP mesh if FORCE_KAMP = True.
  4. Build full mesh if no mesh is loaded or FORCE_LEVELING = True.

Top


END_PRINT

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.

Top


CANCEL

Cancel the current print.

Top


CLEAR_NOZZLE

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.

Top


LED_ON

Turn on LED lighting.

Top


LED_OFF

Turn off LED lighting.

Top


LED

Set LED brightness.

  • S — brightness percentage (default: 50).

Top


PAUSE

Pause the print.

Top


RESUME

Resume the print after pausing.

Top


PLAY_MIDI

Play a MIDI file.

  • FILE — filename (default: For_Elise.mid). Files are stored in mod_data/midi/.

Top


REBOOT

Reboot the printer.

Top


CLOSE_DIALOGS

Close dialogs on the native screen (slow method). May cause printer freezes. Controlled by the CLOSE_DIALOGS global parameter.

Top


FAST_CLOSE_DIALOGS

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.

Top


NEW_SAVE_CONFIG

Trigger SAVE_CONFIG without freezing the native screen. May take ~1 minute and occasionally cause screen glitches.

Top


LEVELING_PRINT_FILE

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

Top


SHUTDOWN

Power off the printer.


Back Top Forward

⚠️ **GitHub.com Fallback** ⚠️