zooc.run.model_z_offset
Z-offset model based on measurements.
- class zooc.run.model_z_offset.ModelZOffset
Bases:
ABCBase class for the Z-offset model based on measurements.
- static log_data(filter_model)
Convert to TOML formatted string.
Format:
z_samples=[[x0,y0], [x1,y1], [...]]
- Parameters:
filter_model (FilterMath | None) – Filter model.
- Returns:
Input data in TOML format.
- Return type:
- calc_offset(sample, max_delta)
Calculate the final Z-offset based on the previous and the latest measurements.
- abstractmethod create_filter(data)
Create a filter model based on the collected data.
- Parameters:
- Returns:
Filter model if converged, None if not converged.
- Return type:
- describe()
Describe the internal state of the model.
- filter_model: FilterMath | None = None
Filter model based on the latest valid measurement.
- class zooc.run.model_z_offset.ModelZOffsetExp(*, require_success=2, tau_min_th=30.0, tau_max_th=600.0, noise_rel_range_th=0.02, noise_abs_range_th=0.01)
Bases:
ModelZOffsetModeling the settling of Z-offset due to heat expansion over time.
The model provides the estimated Z-offset value based on the data collected.
- Parameters:
require_success (int) – How many consecutive measurements should yield valid offset.
tau_min_th (float) – Minimum time constant for the exp filter. Time constant should be reasonable, at least some seconds [s].
tau_max_th (float) – Maximum time constant for the exp filter. Large printers may have time constant of many minutes [s].
noise_rel_range_th (float) – Allowed relative noise range for the monotonicity. Allow 2% full range noise (or noise_abs_range_th which ever is larger) [%].
noise_abs_range_th (float) – Allowed absolute noise range for the monotonicity.
- static log_data(filter_model)
Convert to TOML formatted string.
Format:
z_samples=[[x0,y0], [x1,y1], [...]]
- Parameters:
filter_model (FilterMath | None) – Filter model.
- Returns:
Input data in TOML format.
- Return type:
- calc_offset(sample, max_delta)
Calculate the final Z-offset based on the previous and the latest measurements.
- create_filter(data)
Create a filter model based on the collected data.
- Parameters:
- Returns:
Filter model if converged, None if not converged.
- Return type:
- describe()
Describe the internal state of the model.
- filter_model: FilterMath | None = None
Filter model based on the latest valid measurement.
- class zooc.run.model_z_offset.ModelZOffsetStable(*, t_end, t_forecast, mean_samples=7, max_abs_input_range=0.1)
Bases:
ModelZOffsetZ-offset model for stable state where the offset is not changing.
- Parameters:
- static log_data(filter_model)
Convert to TOML formatted string.
Format:
z_samples=[[x0,y0], [x1,y1], [...]]
- Parameters:
filter_model (FilterMath | None) – Filter model.
- Returns:
Input data in TOML format.
- Return type:
- calc_offset(sample, max_delta)
Calculate the final Z-offset based on the previous and the latest measurements.
- create_filter(data)
Create a filter model based on the collected data.
- Parameters:
- Returns:
Filter model if converged, None if not converged.
- Return type:
- describe()
Describe the internal state of the model.
- filter_model: FilterMath | None = None
Filter model based on the latest valid measurement.