Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use stepper_z's rotation distance #5

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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:
Loading