Skip to content

Commit

Permalink
feat: use stepper_z's rotation distance (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jomik authored Jul 12, 2024
1 parent c2824a1 commit 0b9d3d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
5 changes: 1 addition & 4 deletions macros/z_tramming.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ gcode:
{% if config is undefined %}
{action_raise_error("Missing _Z_TRAMMING_SETTINGS macro")}
{% endif %}
{% if config.screw_lead is undefined %}
{action_raise_error("Missing screw_lead in _Z_TRAMMING_SETTINGS macro")}
{% endif %}

{% set speed = config.speed | default(printer.configfile.settings.bed_mesh.speed) * 60 %}

Expand Down Expand Up @@ -61,7 +58,7 @@ gcode:
{% set config = printer["gcode_macro _Z_TRAMMING_SETTINGS"] %}
{% set probe = printer.configfile.settings.probe %}
{% set tolerance = config.tolerance | default(probe.samples_tolerance * 2)%}
{% set screw_lead = config.screw_lead %}
{% set screw_lead = printer.configfile.settings.stepper_z.rotation_distance | float %}
{% set lift_direction = config.lift_direction | default("CW") | upper %}

{% if not lift_direction in ["CW", "CCW"] %}
Expand Down
10 changes: 0 additions & 10 deletions macros/z_tramming_settings.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This macro contains the configuration variables for the Z Tramming macro
[gcode_macro _Z_TRAMMING_SETTINGS]
# variable_screw_lead: 4 # Required! The lead of Z lead screws in mm. This is the distance the Z axis moves for one full rotation of the lead screw. It is calculated by measuring the pitch and counting the number of starts/threads.
# variable_tolerance: 0.04 # Defaults to double the probe.samples_tolerance
# variable_y_position: 51 # Defaults to probe at the center of bed
# variable_left: 0 # Defaults to minmum position accounting for probe offset
Expand All @@ -9,12 +8,3 @@
# variable_lift_direction: 'CW' # The direction to turn a lead screw to lift the bed. Defaults to CW. Either CW or CCW
gcode:

# This is an example for a Sovol SV06
# [gcode_macro _Z_TRAMMING_SETTINGS]
# variable_screw_lead: 4
# gcode:

# This is an example for a Sovol SV06 Plus
# [gcode_macro _Z_TRAMMING_SETTINGS]
# variable_screw_lead: 4
# gcode:

0 comments on commit 0b9d3d7

Please sign in to comment.