AUTOTEMP default proportions (#17560)

This commit is contained in:
studiodyne 2020-04-17 02:03:53 +02:00 committed by GitHub
parent fd4c025e98
commit 9110f756ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 13 deletions

View File

@ -206,7 +206,7 @@
// A well-chosen Kc value should add just enough power to melt the increased material volume.
//#define PID_EXTRUSION_SCALING
#if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define DEFAULT_Kc (100) // heating power = Kc * e_speed
#define LPQ_MAX_LEN 50
#endif
@ -262,18 +262,28 @@
#endif
/**
* Automatic Temperature:
* The hotend target temperature is calculated by all the buffered lines of gcode.
* The maximum buffered steps/sec of the extruder motor is called "se".
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
* mintemp and maxtemp. Turn this off by executing M109 without F*
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
* Automatic Temperature Mode
*
* Dynamically adjust the hotend target temperature based on planned E moves.
*
* (Contrast with PID_EXTRUSION_SCALING, which tracks E movement and adjusts PID
* behavior using an additional kC value.)
*
* Autotemp is calculated by (mintemp + factor * mm_per_sec), capped to maxtemp.
*
* Enable Autotemp Mode with M104/M109 F<factor> S<mintemp> B<maxtemp>.
* Disable by sending M104/M109 with no F parameter (or F0 with AUTOTEMP_PROPORTIONAL).
*/
#define AUTOTEMP
#if ENABLED(AUTOTEMP)
#define AUTOTEMP_OLDWEIGHT 0.98
// Turn on AUTOTEMP on M104/M109 by default using proportions set here
//#define AUTOTEMP_PROPORTIONAL
#if ENABLED(AUTOTEMP_PROPORTIONAL)
#define AUTOTEMP_MIN_P 0 // (°C) Added to the target temperature
#define AUTOTEMP_MAX_P 5 // (°C) Added to the target temperature
#define AUTOTEMP_FACTOR_P 1 // Apply this F parameter by default (overridden by M104/M109 F)
#endif
#endif
// Extra options for the M114 "Current Position" report

View File

@ -2973,9 +2973,18 @@ void Planner::set_max_jerk(const AxisEnum axis, float targetValue) {
#if ENABLED(AUTOTEMP)
void Planner::autotemp_M104_M109() {
if ((autotemp_enabled = parser.seen('F'))) autotemp_factor = parser.value_float();
if (parser.seen('S')) autotemp_min = parser.value_celsius();
if (parser.seen('B')) autotemp_max = parser.value_celsius();
#if ENABLED(AUTOTEMP_PROPORTIONAL)
const int16_t target = thermalManager.degTargetHotend(active_extruder);
autotemp_min = target + AUTOTEMP_MIN_P;
autotemp_max = target + AUTOTEMP_MAX_P;
autotemp_factor = AUTOTEMP_FACTOR_P;
#endif
if (parser.seenval('S')) autotemp_min = parser.value_celsius();
if (parser.seenval('B')) autotemp_max = parser.value_celsius();
if (parser.seenval('F')) autotemp_factor = parser.value_float();
if (!autotemp_factor) autotemp_enabled = false; // F0 will disable autotemp
}
#endif