Skip to content

Commit

Permalink
fix: config is not required (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jomik authored Jul 12, 2024
1 parent 0b9d3d7 commit be96fbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ EOF

## How to configure it?

Open `z_tramming_settings.cfg` and uncomment the line with `variable_screw_lead`,
set the number to your lead. The lead is the distance the screw moves in one rotation.
It is calculated by multiplying the pitch with the number of starts of the screw.
So a 2mm pitch, 4 start screw has a lead of 8mm.
You can look at the examples in the file for some known values.
Open `z_tramming_settings.cfg`.
There is an example of what values can be configured together with their defaults.

## Alternatives

Expand Down
8 changes: 2 additions & 6 deletions macros/z_tramming.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ gcode:
{action_raise_error("Missing probe settings")}
{% endif %}

# Verify that required configurations are present
{% set config = printer["gcode_macro _Z_TRAMMING_SETTINGS"] %}
{% if config is undefined %}
{action_raise_error("Missing _Z_TRAMMING_SETTINGS macro")}
{% endif %}
{% set config = printer["gcode_macro _Z_TRAMMING_SETTINGS"] | default({}) %}

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

Expand Down Expand Up @@ -55,7 +51,7 @@ gcode:
variable_left: 0
variable_right: 0
gcode:
{% set config = printer["gcode_macro _Z_TRAMMING_SETTINGS"] %}
{% set config = printer["gcode_macro _Z_TRAMMING_SETTINGS"] | default({}) %}
{% set probe = printer.configfile.settings.probe %}
{% set tolerance = config.tolerance | default(probe.samples_tolerance * 2)%}
{% set screw_lead = printer.configfile.settings.stepper_z.rotation_distance | float %}
Expand Down

0 comments on commit be96fbf

Please sign in to comment.