tuning_tower: compensate z-offset (#2881)
Signed-off-by: Rubens Panfili <rubens.panfili@gmail.com>
This commit is contained in:
parent
492cd3d99f
commit
9530373ccb
|
@ -45,6 +45,10 @@ class TuningTower:
|
||||||
self.last_position = list(pos)
|
self.last_position = list(pos)
|
||||||
return pos
|
return pos
|
||||||
def calc_value(self, z):
|
def calc_value(self, z):
|
||||||
|
# Compensate Z-Offset
|
||||||
|
gcode = self.printer.lookup_object("gcode")
|
||||||
|
z_offset = gcode.get_status(None)['base_zpos']
|
||||||
|
z = max(0, z - z_offset)
|
||||||
if self.band:
|
if self.band:
|
||||||
z = (math.floor(z / self.band) + .5) * self.band
|
z = (math.floor(z / self.band) + .5) * self.band
|
||||||
return self.start + z * self.factor
|
return self.start + z * self.factor
|
||||||
|
|
Loading…
Reference in New Issue