From 10c524fdb3c8c8e0e10a05b62af835c83117f86d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Tue, 30 Aug 2022 12:54:47 +0200 Subject: [PATCH] TM: Add M310 [F] parameter to enable autotune self-test --- Firmware/Marlin_main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c55a3d5a..4baa8e61 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7520,7 +7520,7 @@ Sigma_Exit: #### Usage M310 ; report values - M310 [ A ] ; autotune + M310 [ A ] [ F ] ; autotune M310 [ S ] ; set 0=disable 1=enable M310 [ I ] [ R ] ; set resistance at index M310 [ P | C ] ; set power, capacitance @@ -7538,12 +7538,13 @@ Sigma_Exit: - `W` - warning threshold (K/s; default in variant) - `T` - ambient temperature correction (K; default in variant) - `A` - autotune C+R values + - `F` - force model self-test state (0=off 1=on) during autotune using current values */ case 310: { // parse all parameters float P = NAN, C = NAN, R = NAN, E = NAN, W = NAN, T = NAN; - int8_t I = -1, S = -1, B = -1, A = -1; + int8_t I = -1, S = -1, B = -1, A = -1, F = -1; if(code_seen('C')) C = code_value(); if(code_seen('P')) P = code_value(); if(code_seen('I')) I = code_value_short(); @@ -7554,6 +7555,7 @@ Sigma_Exit: if(code_seen('W')) W = code_value(); if(code_seen('T')) T = code_value(); if(code_seen('A')) A = code_value_short(); + if(code_seen('F')) F = code_value_short(); // report values if nothing has been requested if(isnan(C) && isnan(P) && isnan(R) && isnan(E) && isnan(W) && isnan(T) && I < 0 && S < 0 && B < 0 && A < 0) { @@ -7570,7 +7572,7 @@ Sigma_Exit: if(S >= 0) temp_model_set_enabled(S); // run autotune - if(A >= 0) temp_model_autotune(A); + if(A >= 0) temp_model_autotune(A, F > 0); } break; #endif