Skip to content
Draft
Show file tree
Hide file tree
Changes from 137 commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
8dcb75d
Mesh/Beacon: better handling of compensation meshes and reference pos
miklschmidt Jan 23, 2025
5f236ff
Mesh/Beacon: minor improvements to mesh error handling and logging
miklschmidt Feb 27, 2025
112349e
Mesh/Beacon: mark meshes invalid if parameters are missing
miklschmidt Feb 27, 2025
2717930
Mesh/Beacon: fix profile loading when applying compensation
miklschmidt Feb 27, 2025
c9e7b54
Mesh/Beacon: instantiate offset mesh when applying scan comp
miklschmidt Feb 27, 2025
caff3a2
Mesh/Beacon: properly check for mesh params when applying scan comp
miklschmidt Feb 27, 2025
365ac5e
Macros/Mesh: set zero reference position on loaded mesh in start_print
miklschmidt Mar 14, 2025
bd0a74e
Macros/Mesh: when setting zero reference position, copy the probed po…
tg73 Apr 7, 2025
b835a6c
Macros/Mesh: Move to safe Z home in CREATE_BEACON_COMPENSATION_MESH
tg73 Apr 14, 2025
5f93c7a
Macros/Mesh: don't require a mesh to be pre-loaded when calling CREAT…
tg73 Apr 14, 2025
eaf021f
Macros/Beacon: Add early checks in START_PRINT for beacon model and s…
tg73 Apr 18, 2025
4c456b6
Macros/Beacon: Before BED_MESH_CALIBRATE, check beacon model temp is …
tg73 Apr 18, 2025
feea5bf
Macros/Beacon: Consistently use "Beacon Scan Compensation" as the def…
tg73 Apr 18, 2025
bd5ae1d
Mesh/Beacon: In create_compensation_mesh, use existing or fresh beaco…
tg73 Apr 18, 2025
959a0dd
Macros: Add missing _LED_START_PRINTING_ERROR in START_PRINT
tg73 Apr 18, 2025
96ddb5b
Macros/Mesh: Quote bed mesh profile name gcode arguments so that spac…
tg73 Apr 18, 2025
3862fe1
Beacon/Mesh: Improve logging/debug in SET_ZERO_REFERENCE_POSITION
tg73 Apr 18, 2025
c049d29
Mesh/Beacon: Remove SAVE_PROFILE option from SET_ZERO_REFERENCE_POSIT…
tg73 Apr 18, 2025
b8558b1
Macros: error handling utility improvements
tg73 Apr 22, 2025
aba1eca
Macros: _CHECK_BED_MESH_PROFILE_EXISTS now sets a last check result s…
tg73 Apr 22, 2025
5e76248
Beacon/Mesh: Substantial rework and improve extended metadata and rel…
tg73 Apr 22, 2025
c9e808e
Mesh/Beacon: remove runtime multiplier, add runtime offset
miklschmidt Mar 14, 2025
25ef320
Beacon: remove obsolete comment
miklschmidt Mar 14, 2025
4f0df53
Macros/Beacon: properly apply/subtract runtime/expansion offsets
miklschmidt Mar 14, 2025
4d6623e
Macros/Beacon: fix saving of runtime z offset (babystepping):
tg73 Apr 24, 2025
0465a29
Macros/Beacon: update hotend expansion offset when print temperature …
miklschmidt Mar 16, 2025
77c72aa
Beacon: minor code cleanup
tg73 Apr 25, 2025
2920963
Macros: ensure TEMPERATURE_WAIT override does not swallow error condi…
tg73 Apr 25, 2025
1abb257
Macros/Beacon: update hotend expansion offset in all relevant scenarios
tg73 Apr 25, 2025
dbe11da
Macros/Beacon: improve variable naming and debug logging
tg73 Apr 26, 2025
14e51e0
Macros/Toolheads: improve debug logging
tg73 Apr 26, 2025
5317358
Extras: add _DEBUG_ECHO_STACK_TRACE
tg73 Apr 26, 2025
df9da6f
Macros: Don't call _BEACON_SET_NOZZLE_TEMP_OFFSET from TEMPERATURE_WAIT
tg73 Apr 27, 2025
16a981b
Mesh/Beacon: adjust default config to avoid aliasing during rapid scans
tg73 Apr 28, 2025
e79c74c
Mesh/Beacon: code for testing purposes
tg73 Apr 28, 2025
4a48590
Mesh/Beacon: add optional 'notes' extended mesh parameter
tg73 Apr 30, 2025
5a2da79
Mesh/Beacon: code for testing purposes
tg73 Apr 30, 2025
53666b3
Mesh/Beacon: move scipy calculation to external process and elsewhere…
tg73 May 2, 2025
810d67d
Mesh/Beacon: testing edge-enhanced filtering
tg73 May 8, 2025
85f6510
Extras: testing - add partial MULTI_POINT_PROBE implementation for da…
tg73 May 9, 2025
23c5268
Extras/Ratos: remove TEST_PROCESS_GCODE_FILE
tg73 May 12, 2025
ee02eb8
Extras/z-offset: Add ratos_z_offset extension
tg73 May 13, 2025
5034dff
Extras/Ratos: code for testing purposes
tg73 May 14, 2025
300c3b0
Extras/Beacon: added beacon_true_zero_correction module
tg73 May 21, 2025
d88f000
Mesh/Beacon: use local low filter for compensation mesh, and general …
tg73 May 24, 2025
1605c59
Mesh/Beacon: change beacon_scan_compensation_resolution to 8 to suit …
tg73 May 24, 2025
c15ada3
Mesh/Beacon: add warnings to sanity check
tg73 May 24, 2025
d6744fd
Macros/Beacon: add [beacon_true_zero_correction]
tg73 May 25, 2025
007640c
Moonraker: use tg73 fork of Klipper with required bed_mesh fixes.
tg73 May 26, 2025
0ae402e
Moonraker: remove bogus fields from [update_manager klipper]
tg73 May 26, 2025
d76bf0a
Beacon/Mesh: fix missing argument
tg73 May 26, 2025
23b8bdc
Mesh/Beacon: by default don't log mesh points during BED_MESH_CALIBRATE
tg73 May 26, 2025
9affdfd
Configuration: default [bed_mesh] split_z_delta to 0.01 in base.cfg t…
tg73 May 26, 2025
a3cb126
Beacon/TrueZero: allow [beacon_true_zero_correction] to be disabled b…
tg73 May 28, 2025
4ca15ca
Printers: don't enable mesh fade for all v-core-4 variants
tg73 May 30, 2025
6a0360d
Beacon/TrueZero: support 3 levels of probing strategy via config for …
tg73 May 30, 2025
d6c8272
Extras/Ratos: add helper method
tg73 Jun 2, 2025
8c312b3
Beacon/TrueZero: add _BEACON_TRUE_ZERO_CORRECTION_DIAGNOSTICS
tg73 Jun 2, 2025
937ec91
Extras: code clean up
tg73 Jun 2, 2025
1748989
Beacon/TrueZero: _BEACON_TRUE_ZERO_CORRECTION_DIAGNOSTICS now adds he…
tg73 Jun 2, 2025
9f1cbfb
Install: add libopenblas-base to package list
tg73 Jun 2, 2025
d8aae17
Extras/Ratos: remove multi-point probing test code
tg73 Jun 4, 2025
4221329
Beacon/Mesh: support KEEP_TEMP_MESHES parameter in BEACON_CREATE_SCAN…
tg73 Jun 5, 2025
3d559c5
Beacon/AdaptiveHeatSoak: add beacon_adaptive_heat_soak module - work …
tg73 Jun 5, 2025
b82a7b8
Beacon/AdaptiveHeatSoak: cleanup and initial candidate implementation…
tg73 Jun 8, 2025
1b09866
Macros/Beacon: update variable comments with new recommendations
tg73 Jun 8, 2025
526c7b5
Macros/Beacon: remove unused code
tg73 Jun 8, 2025
46a513c
Macros/Beacon: integrate BEACON_WAIT_FOR_PRINTER_HEAT_SOAK wherever b…
tg73 Jun 10, 2025
58101fe
Macros/Beacon: add config section for beacon_adaptive_heat_soak
tg73 Jun 10, 2025
6a2b64c
Macros/Beacon: fix typo
tg73 Jun 10, 2025
29e449c
Beacon/AdaptiveHeatSoak: fix mistake
tg73 Jun 10, 2025
d37156f
Beacon/AdaptiveHeatSoak: rework, different sampling strategy, add tre…
tg73 Jun 15, 2025
79724ef
Beacon/AdaptiveHeatSoak: improve time formatting
tg73 Jun 15, 2025
483fce6
Beacon/AdaptiveHeatSoak: stop waiting if the printer shuts down
tg73 Jun 15, 2025
6f5ce41
Beacon/AdaptiveHeatSoak: add minimum wait parameter
tg73 Jun 16, 2025
5eb8437
Macros: move calculation of safe home position to ratos.py, expose vi…
tg73 Jun 16, 2025
878a3ee
Homing/Beacon: rationalize beacon homing and true zero behaviour
tg73 Jun 16, 2025
832b127
Mesh/Beacon/TrueZero: support fuzzy true zero position, and ensure th…
tg73 Jun 18, 2025
9c3cfc1
Beacon/Mesh: when creating a compensation mesh, store chamber temp an…
tg73 Jun 18, 2025
4e75568
Beacon/AdaptiveHeatSoak: accommodate noisier z rates that are sometim…
tg73 Jun 20, 2025
17059c3
Beacon/AdaptiveHeatSoak: fix reporting of minimum wait time
tg73 Jun 23, 2025
833a73b
Beacon/AdaptiveHeatSoak: fix spelling of adaptive
tg73 Jun 23, 2025
8fd0a3e
Beacon/AdaptiveHeatSoak: increase moving average window
tg73 Jun 24, 2025
733f09a
Macros/Beacon: fix pre-soak routine in BEACON_CREATE_SCAN_COMPENSATIO…
tg73 Jun 24, 2025
c994f90
Macros/Beacon: use z=2.5 as heat soaking height to allow for more gan…
tg73 Jun 24, 2025
94c81fd
Macros/Beacon: fix passing of chamber_temp argument
tg73 Jun 24, 2025
336a85e
Macros/Beacon: fix misleading comment
tg73 Jun 24, 2025
1330081
Macros: add initconfigfile module
tg73 Jun 26, 2025
76be52f
Macros: use printer.initconfigfile instead of printer.configfile
tg73 Jun 26, 2025
7bd1641
feat(extras): add dynamic_governor
tg73 Jun 29, 2025
cd72303
refactor(extras): rename initconfigfile to fastconfig
tg73 Jun 30, 2025
954a86c
refactor(extras): move [fastconfig] and [dynamic_governor] to base.cfg
tg73 Jun 30, 2025
b13703d
docs: add copyright headers
tg73 Jun 23, 2025
cf1196d
refactor(beacon-mesh): remove test code
tg73 Jun 23, 2025
1c37d87
refactor(beacon): move variable to internal section to discourage use…
tg73 Jun 23, 2025
5ca569e
refactor(beacon-mesh): make dependency on scipy.ndimage lazy, it's on…
tg73 Jun 23, 2025
7a6bd7e
feat(beacon): support basic automatic selection of compensation mesh
tg73 Jul 9, 2025
b8783f5
feat(beacon-heatsoak): add ThresholdPredictor
tg73 Jul 13, 2025
dd8eb8d
refactor(beacon-heatsoak): beacon adaptive heatsoak now uses layer qu…
tg73 Jul 14, 2025
94ef0ac
feat(beacon-heatsoak): user-friendly progress updates
tg73 Jul 15, 2025
7c7d28e
fix(beacon-mesh): reinstate accidental deletion of macro line
tg73 Jul 17, 2025
d36aba9
fix(dynamic-governor): add a delay before switching to the idle governor
tg73 Jul 18, 2025
2328e16
refactor(beacon-macros): update fully-auto calibration routine BEACON…
tg73 Jul 21, 2025
5c3f56a
feat(extras-ratos): show in display status (like M117) python-side er…
tg73 Jul 21, 2025
4e3a5c1
feat(bed-mesh): raise an error if BED_MESH_CALIBRATE is called with u…
tg73 Jul 21, 2025
8c995b2
refactor(beacon-heatsoak): enable adaptive heatsoak by default only f…
tg73 Jul 21, 2025
960fe6a
refactor(bed-mesh): make the error-if-abl-not-applied behaviour opt-i…
tg73 Jul 22, 2025
f6127d6
fix(vaoc): _VAOC_PROBE_NOZZLE_TEMP_OFFSET now respects the configured…
tg73 Jul 22, 2025
ef6d515
refactor(extras-ratos): improve handling and logging of out-of-range …
tg73 Jul 24, 2025
0c97db6
fix(macros): avoid potential init delayed gcode race condition
tg73 Jul 24, 2025
5988787
feat(bed-mesh): before BED_MESH_CALIBRATE, automatically apply ABL an…
tg73 Jul 24, 2025
cf41593
feat(fastconfig): add defensive initialization check
tg73 Jul 24, 2025
fb23421
chore(postprocessor): support PrusaSlicer 2.9.1 and 2.9.2
tg73 Jul 24, 2025
7a05aae
chore(beacon-macros): remove unused macro variable
tg73 Jul 24, 2025
7df7c1a
fix(idex-beacon): only apply nozzle expansion z offset when applicable
tg73 Jul 26, 2025
5623a21
fix(idex): ensure that the `standby` flag for each toolhead is set co…
tg73 Jul 26, 2025
f446ed8
fix(beacon-mesh): improve reactor yielding to avoid timer too close e…
tg73 Aug 5, 2025
7cd304d
feat(beacon-heatsoak): additionally store z value in diagnostic csv f…
tg73 Aug 12, 2025
fa70765
fix(beacon-heatsoak): improve robustness of soak completion detection
tg73 Aug 12, 2025
5256bdb
fix(beacon-heatsoak): increase minimum threshold from 10 to 12.5
tg73 Aug 23, 2025
bcf19ab
fix(beacon-heatsoak): add retry when preparing for sampling as a spec…
tg73 Aug 26, 2025
de1e847
refactor(ratos): move BackgroundDisplayStatusProgressHandler class to…
tg73 Aug 27, 2025
3b02044
feature(beacon-mesh): cotemporal compensation mesh creation
tg73 Jul 30, 2025
5595c59
fix(configuration): skip pointless home/calibrate after creating a co…
tg73 Aug 27, 2025
adfca62
fix(configuration): set split_delta_z to 1um for V-Core 4 variants
tg73 Aug 28, 2025
77ea6c6
feature(beacon-mesh): support faulty regions in cotemporal compensati…
tg73 Aug 28, 2025
44a4174
revert(extras): remove dynamic_governor
tg73 Sep 21, 2025
4472eb5
refactor(extras): extract common logic into a helper function
tg73 Dec 2, 2025
81571c9
chore(cleanup): fix minor niggles
tg73 Dec 2, 2025
7be6853
fix(extras): move lookup to after validation
tg73 Dec 2, 2025
62b6f6f
fix(extras): log correct value and use strict `is True` check
tg73 Dec 2, 2025
660efe3
fix(extras): don't access non-existent class member, and add belt and…
tg73 Dec 2, 2025
856c534
chore(beacon-heatsoak): clean up self.reactor initialization
tg73 Dec 3, 2025
dc55753
chore(cleanup): fix comment typo
tg73 Dec 3, 2025
8d5981a
fix(beacon-mesh): preserve traceback when raising exceptions
tg73 Dec 3, 2025
500e2ad
fix(macros): fix unbalanced brace typo
tg73 Dec 3, 2025
84276ee
chore(spelling): fix spelling in comment
tg73 Dec 3, 2025
a49b49c
chore(spelling): fix typo
tg73 Dec 3, 2025
afc89da
fix(beacon-true-zero): avoid hard-coded path
tg73 Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 31 additions & 57 deletions configuration/homing.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ variable_safe_home_x: "middle" # float|middle = z-homing x locat
variable_safe_home_y: "middle" # float|middle = z-homing y location
variable_driver_type_x: "tmc2209" # tmc2209|tmc2130|tmc5160 = stepper driver type for sensorless homing
variable_driver_type_y: "tmc2209" # tmc2209|tmc2130|tmc5160 = stepper driver type for sensorless homing
variable_stowable_probe_stop_on_error: False # internal use only. Do not touch!

variable_stowable_probe_stop_on_error: False # internal use only. Do not touch!

[ratos_homing]
axes: xyz
Expand Down Expand Up @@ -79,10 +78,7 @@ gcode:
{% set homing_x = homing_x if homing_x else homing %}
{% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %}
{% set printable_x_max = printer["gcode_macro RatOS"].printable_x_max|float %}
{% set safe_home_x = printer["gcode_macro RatOS"].safe_home_x %}
{% if safe_home_x is not defined or safe_home_x|lower == 'middle' %}
{% set safe_home_x = printable_x_max / 2 %}
{% endif %}
{% set safe_home_x, safe_home_y = printer.ratos.safe_home_position %}

# parameter
{% set X = true if params.X|lower == 'true' else false %}
Expand Down Expand Up @@ -125,10 +121,7 @@ gcode:
{% set homing_y = homing_y if homing_y else homing %}
{% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %}
{% set printable_y_max = printer["gcode_macro RatOS"].printable_y_max|float %}
{% set safe_home_y = printer["gcode_macro RatOS"].safe_home_y %}
{% if safe_home_y is not defined or safe_home_y|lower == 'middle' %}
{% set safe_home_y = printable_y_max / 2 %}
{% endif %}
{% set safe_home_x, safe_home_y = printer.ratos.safe_home_position %}

# parameter
{% set X = true if params.X|lower == 'true' else false %}
Expand Down Expand Up @@ -159,6 +152,8 @@ gcode:

# beacon contact config
{% set beacon_contact_z_homing = true if printer["gcode_macro RatOS"].beacon_contact_z_homing|default(false)|lower == 'true' else false %}
{% set beacon_contact_start_print_true_zero = true if printer["gcode_macro RatOS"].beacon_contact_start_print_true_zero|default(false)|lower == 'true' else false %}
{% set beacon_z_home_position_fuzzing_radius = printer["gcode_macro RatOS"].beacon_z_home_position_fuzzing_radius|default(0)|float %}

# parameter
{% set X = true if params.X|lower == 'true' else false %}
Expand All @@ -175,24 +170,23 @@ gcode:
{% else %}
{% if z_probe == "stowable" %}
DEPLOY_PROBE
_MOVE_TO_SAFE_Z_HOME
{% if printer.configfile.settings.beacon is defined and beacon_contact_z_homing %}
BEACON_AUTO_CALIBRATE SKIP_MODEL_CREATION=1
_MOVE_TO_SAFE_Z_HOME Z_HOP=True
{% endif %}
_MOVE_TO_SAFE_Z_HOME
{% if printer.fastconfig.settings.beacon is defined and beacon_contact_z_homing %}
{% if beacon_contact_start_print_true_zero %}
# The critical zero probing happens during start print after heat soaking, not here.
BEACON_AUTO_CALIBRATE SKIP_MODEL_CREATION=1 SKIP_MULTIPOINT_PROBING=1
{% else %}
G28 Z
{% endif %}
_Z_HOP
STOW_PROBE
{% else %}
_MOVE_TO_SAFE_Z_HOME
{% if printer.configfile.settings.beacon is defined and beacon_contact_z_homing %}
# The critical zero probing happens here.
BEACON_AUTO_CALIBRATE SKIP_MODEL_CREATION=1
_MOVE_TO_SAFE_Z_HOME Z_HOP=True
{% else %}
G28 Z
{% endif %}
_Z_HOP
_MOVE_TO_SAFE_Z_HOME Z_HOP=True
{% else %}
G28 Z
{% endif %}
_Z_HOP
{% if z_probe == "stowable" %}
STOW_PROBE
{% endif %}
{% endif %}
{% endif %}
Expand Down Expand Up @@ -239,22 +233,22 @@ gcode:
{% for axis in printer["gcode_macro RatOS"].x_axes %}
{% set stepper = "stepper_" ~ axis|lower %}
{% set stepper_driver = printer["gcode_macro RatOS"].x_driver_types[loop.index0] ~ " " ~ stepper %}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.configfile.config[stepper_driver].run_current}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.fastconfig.config[stepper_driver].run_current}
{% endfor %}
{% else %}
{% set x_driver = printer["gcode_macro RatOS"].driver_type_x|lower ~ " stepper_x" %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={printer.configfile.config[x_driver].run_current}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={printer.fastconfig.config[x_driver].run_current}
{% endif %}

{% if printer["gcode_macro RatOS"].y_axes is defined %}
{% for axis in printer["gcode_macro RatOS"].y_axes %}
{% set stepper = "stepper_" ~ axis|lower %}
{% set stepper_driver = printer["gcode_macro RatOS"].y_driver_types[loop.index0] ~ " " ~ stepper %}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.configfile.config[stepper_driver].run_current}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.fastconfig.config[stepper_driver].run_current}
{% endfor %}
{% else %}
{% set y_driver = printer["gcode_macro RatOS"].driver_type_y|lower ~ " stepper_y" %}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={printer.configfile.config[y_driver].run_current}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={printer.fastconfig.config[y_driver].run_current}
{% endif %}

# Wait for currents to settle
Expand Down Expand Up @@ -305,22 +299,22 @@ gcode:
{% for axis in printer["gcode_macro RatOS"].x_axes %}
{% set stepper = "stepper_" ~ axis|lower %}
{% set stepper_driver = printer["gcode_macro RatOS"].x_driver_types[loop.index0] ~ " " ~ stepper %}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.configfile.config[stepper_driver].run_current}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.fastconfig.config[stepper_driver].run_current}
{% endfor %}
{% else %}
{% set x_driver = printer["gcode_macro RatOS"].driver_type_x|lower ~ " stepper_x" %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={printer.configfile.config[x_driver].run_current}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={printer.fastconfig.config[x_driver].run_current}
{% endif %}

{% if printer["gcode_macro RatOS"].y_axes is defined %}
{% for axis in printer["gcode_macro RatOS"].y_axes %}
{% set stepper = "stepper_" ~ axis|lower %}
{% set stepper_driver = printer["gcode_macro RatOS"].y_driver_types[loop.index0] ~ " " ~ stepper %}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.configfile.config[stepper_driver].run_current}
SET_TMC_CURRENT STEPPER={stepper} CURRENT={printer.fastconfig.config[stepper_driver].run_current}
{% endfor %}
{% else %}
{% set y_driver = printer["gcode_macro RatOS"].driver_type_y|lower ~ " stepper_y" %}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={printer.configfile.config[y_driver].run_current}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={printer.fastconfig.config[y_driver].run_current}
{% endif %}

# Wait for currents to settle
Expand All @@ -332,34 +326,14 @@ gcode:
[gcode_macro _Z_HOP]
description: Move Z axis up by Z_HOP distance at Z_HOP_SPEED. In relative mode it will move Z axis up by Z_HOP distance. In absolute mode it will move Z axis to Z_HOP distance.
gcode:
{% set z_hop = printer.configfile.config.ratos_homing.z_hop|float %}
{% set z_hop_speed = printer.configfile.config.ratos_homing.z_hop_speed|float * 60 %}
{% set z_hop = printer.fastconfig.config.ratos_homing.z_hop|float %}
{% set z_hop_speed = printer.fastconfig.config.ratos_homing.z_hop_speed|float * 60 %}

G0 Z{z_hop} F{z_hop_speed}

[gcode_macro _MOVE_TO_SAFE_Z_HOME]
description: Move to safe home position with optional Z_HOP (pass Z_HOP=True as parameter)
[gcode_macro __MOVE_TO_SAFE_Z_HOME_ECHO_DEBUG]
gcode:
{% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %}
{% set printable_x_max = printer["gcode_macro RatOS"].printable_x_max|float %}
{% set printable_y_max = printer["gcode_macro RatOS"].printable_y_max|float %}
{% set safe_home_x = printer["gcode_macro RatOS"].safe_home_x %}
{% if safe_home_x is not defined or safe_home_x|lower == 'middle' %}
{% set safe_home_x = printable_x_max / 2 %}
{% endif %}
{% set safe_home_y = printer["gcode_macro RatOS"].safe_home_y %}
{% if safe_home_y is not defined or safe_home_y|lower == 'middle' %}
{% set safe_home_y = printable_y_max / 2 %}
{% endif %}

{% if params.Z_HOP is defined %}
_Z_HOP
{% endif %}

DEBUG_ECHO PREFIX="_MOVE_TO_SAFE_Z_HOME" MSG="axis_maximum.x: {printer.toolhead.axis_maximum.x}, axis_maximum.y: {printer.toolhead.axis_maximum.y}, bed_margin_x: {printer['gcode_macro RatOS'].bed_margin_x}, bed_margin_y: {printer['gcode_macro RatOS'].bed_margin_y}, safe_home_x: {safe_home_x}, safe_home_y: {safe_home_y}, printable_x_max: {printable_x_max}, printable_y_max: {printable_y_max}"

# Go to safe home
G0 X{safe_home_x} Y{safe_home_y} F{speed}
DEBUG_ECHO PREFIX="_MOVE_TO_SAFE_Z_HOME" MSG="x: {params.X}, y: {params.Y}, z_hop: {params.Z_HOP}, fuzzy_radius: {params.FUZZY_RADIUS}, axis_maximum.x: {printer.toolhead.axis_maximum.x}, axis_maximum.y: {printer.toolhead.axis_maximum.y}, bed_margin_x: {printer['gcode_macro RatOS'].bed_margin_x}, bed_margin_y: {printer['gcode_macro RatOS'].bed_margin_y}, printable_x_max: {printer['gcode_macro RatOS'].printable_x_max}, printable_y_max: {printer['gcode_macro RatOS'].printable_y_max}"

[gcode_macro MAYBE_HOME]
description: Only home unhomed axis
Expand Down
Loading