TM: Set default resistance levels for MK3/MK3S
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.
This commit is contained in:
parent
d84231f2d5
commit
dac73c9582
4 changed files with 14 additions and 4 deletions
|
@ -15,6 +15,7 @@ constexpr uint8_t TEMP_MODEL_LAG_SIZE = (TEMP_MODEL_LAG / TEMP_MGR_INTV + 0.5);
|
|||
|
||||
// resistance values for all fan levels
|
||||
constexpr uint8_t TEMP_MODEL_R_SIZE = (1 << FAN_SOFT_PWM_BITS);
|
||||
static const float TEMP_MODEL_R_DEFAULT[TEMP_MODEL_R_SIZE] PROGMEM = TEMP_MODEL_Rv;
|
||||
|
||||
namespace temp_model {
|
||||
|
||||
|
|
|
@ -2583,14 +2583,13 @@ void temp_model_reset_settings()
|
|||
|
||||
temp_model::data.P = TEMP_MODEL_P;
|
||||
temp_model::data.C = TEMP_MODEL_C;
|
||||
temp_model::data.R[0] = TEMP_MODEL_R;
|
||||
for(uint8_t i = 1; i != TEMP_MODEL_R_SIZE; ++i)
|
||||
temp_model::data.R[i] = NAN;
|
||||
for(uint8_t i = 0; i != TEMP_MODEL_R_SIZE; ++i)
|
||||
temp_model::data.R[i] = pgm_read_float(TEMP_MODEL_R_DEFAULT + i);
|
||||
temp_model::data.Ta_corr = TEMP_MODEL_Ta_corr;
|
||||
temp_model::data.warn = TEMP_MODEL_W;
|
||||
temp_model::data.err = TEMP_MODEL_E;
|
||||
temp_model::warn_beep = true;
|
||||
temp_model::enabled = false;
|
||||
temp_model::enabled = true;
|
||||
temp_model::valid = false;
|
||||
}
|
||||
|
||||
|
@ -2846,6 +2845,10 @@ static bool autotune(int16_t cal_temp)
|
|||
wait(30000);
|
||||
|
||||
for(int8_t i = TEMP_MODEL_R_SIZE - 1; i > 0; i -= TEMP_MODEL_CAL_R_STEP) {
|
||||
// always disable the checker while estimating fan resistance as the difference
|
||||
// (esp with 3rd-party blowers) can be massive
|
||||
temp_model::data.R[i] = NAN;
|
||||
|
||||
uint8_t speed = 256 / TEMP_MODEL_R_SIZE * (i + 1) - 1;
|
||||
set_fan_speed(speed);
|
||||
wait(10000);
|
||||
|
|
|
@ -437,6 +437,9 @@
|
|||
#define TEMP_MODEL_CAL_Th 230 // Default calibration working temperature (C)
|
||||
#define TEMP_MODEL_CAL_Tl 50 // Default calibration cooling temperature (C)
|
||||
|
||||
// fall-back resistance vector (R0-15)
|
||||
#define TEMP_MODEL_Rv {TEMP_MODEL_R, 18.4, 16.7, 15.2, 14.1, 13.3, 12.7, 12.1, 11.7, 11.3, 11., 10.8, 10.6, 10.4, 10.2, 10.1}
|
||||
|
||||
|
||||
/*------------------------------------
|
||||
MOTOR CURRENT SETTINGS
|
||||
|
|
|
@ -441,6 +441,9 @@
|
|||
#define TEMP_MODEL_CAL_Th 230 // Default calibration working temperature (C)
|
||||
#define TEMP_MODEL_CAL_Tl 50 // Default calibration cooling temperature (C)
|
||||
|
||||
// fall-back resistance vector (R0-15)
|
||||
#define TEMP_MODEL_Rv {TEMP_MODEL_R, 18.4, 16.7, 15.2, 14.1, 13.3, 12.7, 12.1, 11.7, 11.3, 11., 10.8, 10.6, 10.4, 10.2, 10.1}
|
||||
|
||||
|
||||
/*------------------------------------
|
||||
MOTOR CURRENT SETTINGS
|
||||
|
|
Loading…
Reference in a new issue