zooc.run.measure_z

Methods for measuring Z-offset at certain, fixed temperature.

class zooc.run.measure_z.MeasureZ(klipper_module, gcmd, run_config)

Bases: RunCalibrate, ABC

Base class for various methods measuring Z-offset.

Parameters:
abstractmethod measure()

Run the measurement process at current temperatures.

Returns:

Measured Z-offset and auxiliary data.

Raises:

KlipperUtilsError – If the Z-offset didn’t stabilize after the maximum number of tries.

Return type:

tuple[float, dict[str, object]]

class zooc.run.measure_z.MeasureZDelay(klipper_module, gcmd, run_config)

Bases: MeasureZ

Simple measuring with a fixed delay stabilization.

Parameters:
measure()

Run the measurement process at current temperatures.

Returns:

Measured Z-offset and auxiliary data.

Raises:

KlipperUtilsError – If the Z-offset didn’t stabilize after the maximum number of tries.

Return type:

tuple[float, dict[str, object]]

class zooc.run.measure_z.MeasureZDelta(klipper_module, gcmd, run_config)

Bases: MeasureZ

Simple Z-offset measure by measuring until the offset is stable.

Parameters:
measure()

Run the measurement process at current temperatures.

Returns:

Measured Z-offset and auxiliary data.

Raises:

KlipperUtilsError – If the Z-offset didn’t stabilize after the maximum number of tries.

Return type:

tuple[float, dict[str, object]]

class zooc.run.measure_z.MeasureZForecast(klipper_module, gcmd, run_config, *, stable_temp_delta=2.0, max_delta=0.005, t_end_s=300, forecast_duration_s=120)

Bases: MeasureZ

Measure multiple samples over time and estimate the final Z-offset.

If the temperature is stable, use a stable model. Otherwise, use an exponential decay model.

Parameters:
  • klipper_module (KlipperModule) – See parent class: MeasureZ.

  • gcmd (Gcmd) – See parent class: MeasureZ.

  • run_config (RunConfig) – See parent class: MeasureZ.

  • stable_temp_delta (Final[float]) – Stable model: Maximum temperature delta to consider the temperature stable [°C].

  • t_end_s (Final[float]) – Maximum time to measure [s].

  • forecast_duration_s (Final[float]) – Stable model: Time in the future to forecast the Z-offset starting from the last sample [s].

  • max_delta (Final[float]) – Exp model: Maximum allowed deviation between successful measurements.

measure()

Run the measurement process at current temperatures.

Returns:

Measured Z-offset and auxiliary data.

Raises:

KlipperUtilsError – If the Z-offset didn’t stabilize after the maximum number of tries.

Return type:

tuple[float, dict[str, object]]