Model UV as power-invariant, so that scaling P doesn't change the
intercept location (that is, the zero point remains at the same
temperature even for more powerful heaters).
NOTE: It's not clear to me whether this is generally true (couldn't
find a datasheet from the same heater in diffent power variants
showing the efficiency loss)
- Expose TEMP_MODEL_fS and TEMP_MODEL_LAG as D and L respectively,
initializing the default values based on the previous hard-coded
values.
- Always round L to the effective sample lag to future-proof model
upgrades or changes (the stored value _is_ the effective value).
- Introduce UV as a new linear term for PTC heaters, defaulting
to an identity for model backward-compatibility.
Running `M310 A` should set the TM calibration bit status if the
autotune procedure was successful.
Partially addresses #3891 and #3890, since running `M310 A F0` should
*still* count as valid calibration data and is not something that can be
replicated by using the LCD (which enforces self-test).
Disabling the model during a warn/error condition will also stop
updating the warning/error flag, keeping the printer in an error state.
Clear all flags as well when changing model settings.
Set a menu block for fatal thermal errors instead of abusing
lcd_return_to_status() to kick the user out of the menus.
This now allows a thermal model error to be recoverable through menu
access.
Ensure that fan checks are reset and use the new speed at each step of
the calibration.
This also gives extra time to the fan to ramp-up from a cold start,
when a fancheck could previously start right *after* the speed change.
Should fix#3791
- Ensures repeated autotune attempts with self-check can't succeed due
to different starting conditions.
- Allows for a simpler workflow during selftest and wizard if autotune
fails.
Provide average calibrated values for all fan levels for MK3/MK3S
variants and enable the model by default.
This ensures the calibration step is not skipped unless explicitly
disabled.
Force-clear fan values during autotune to restore the previous
calibration behavior, as fan resistance levels can be too big and
prevent the autotune-with-selfcheck to fail.
Consume any pending LCD click after the temperature model calibration.
Since we're already in the status menu, the usual consume action is not
done automatically here.
Allow running the model checking during autotuning, with the only
exception being the parameter estimation stage where we alter the same
value which is used by the checker (done to conserve memory/code).
With previous changes the model checker will disable/enable itself when
passing through an unavailable R vector entry, allowing to start the
calibration by checking only the stages where the part fan is disabled.
The C/R0 values should be stable enough to provide a fail-safe mechanism
for printers of the same variant right from the factory.
Instead of assuming the model state is always valid, allow NAN values to
pass-through the various check/estimation stages.
This allows running the model checker with incomplete parameters (for
example, missing entries in the R vector) and resume automatically.
We already disable the heaters upon entering, and the new temperature
isr doesn't perform any direct movement until we return to the main
loop.
This allows us to remove direct control of the soft_pwm interrupt from
the header, which is dangerous.
Call this variable menu_block_mask instead. We don't need to know the
exact reason of why we're locking the menu.
We will be able to reuse this to prevent menu entry during more
activities in a cleaner way than testing for each condition as it's
currently done for both menu entry and longpress.
This allows us to use "M310 B0 W0.01" as a way to report the current
error continuosly on the serial without 1) more code and 2) without
preventing regular usage.