aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/G-Codes.md18
-rw-r--r--klippy/extras/tuning_tower.py3
2 files changed, 14 insertions, 7 deletions
diff --git a/docs/G-Codes.md b/docs/G-Codes.md
index dbc176ac..70e3abe2 100644
--- a/docs/G-Codes.md
+++ b/docs/G-Codes.md
@@ -213,13 +213,17 @@ The following standard commands are supported:
This acts to take a frequently used babystepping value, and "make
it permanent". Requires a `SAVE_CONFIG` to take effect.
- `TUNING_TOWER COMMAND=<command> PARAMETER=<name> START=<value>
- FACTOR=<value> [BAND=<value>]`: A tool for tuning a parameter on
- each Z height during a print. The tool will run the given COMMAND
- with the given PARAMETER assigned to the value using the formula
- `value = start + factor * z_height`. If BAND is provided then the
- adjustment will only be made every BAND millimeters of z height - in
- that case the formula used is `value = start + factor *
- ((floor(z_height / band) + .5) * band)`.
+ FACTOR=<value> [BAND=<value>] [SKIP=<value>]`: A tool for tuning
+ a parameter on each Z height during a print. The tool will run
+ the given COMMAND with the given PARAMETER assigned to the value
+ using the formula `value = start + factor * z_height`. If BAND is
+ provided then the adjustment will only be made every BAND
+ millimeters of z height - in that case the formula used is
+ `value = start + factor * ((floor(z_height / band) + .5) * band)`.
+ If `SKIP=<value>` is specified, the tuning process doesn't begin
+ until Z height `<value>` is reached, and below that the value will
+ be set to `START`; in this case, the `z_height` used in the
+ formulas above is actually `max(z - skip, 0)`.
- `SET_DISPLAY_GROUP [DISPLAY=<display>] GROUP=<group>`: Set the
active display group of an lcd display. This allows to define
multiple display data groups in the config,
diff --git a/klippy/extras/tuning_tower.py b/klippy/extras/tuning_tower.py
index fa1ea536..0bcfc4db 100644
--- a/klippy/extras/tuning_tower.py
+++ b/klippy/extras/tuning_tower.py
@@ -30,6 +30,7 @@ class TuningTower:
self.start = gcmd.get_float('START', 0.)
self.factor = gcmd.get_float('FACTOR')
self.band = gcmd.get_float('BAND', 0., minval=0.)
+ self.skip = gcmd.get_float('SKIP', 0., minval=0.)
# Enable test mode
if self.gcode.is_traditional_gcode(command):
self.command_fmt = "%s %s%%.9f" % (command, parameter)
@@ -47,6 +48,8 @@ class TuningTower:
self.last_position = list(pos)
return pos
def calc_value(self, z):
+ if self.skip:
+ z = max(0., z - self.skip)
if self.band:
z = (math.floor(z / self.band) + .5) * self.band
return self.start + z * self.factor