Преглед изворни кода

AUTOTEMP default proportions (#17560)

studiodyne пре 5 година
родитељ
комит
9110f756ad
No account linked to committer's email address
2 измењених фајлова са 32 додато и 13 уклоњено
  1. 20
    10
      Marlin/Configuration_adv.h
  2. 12
    3
      Marlin/src/module/planner.cpp

+ 20
- 10
Marlin/Configuration_adv.h Прегледај датотеку

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

+ 12
- 3
Marlin/src/module/planner.cpp Прегледај датотеку

@@ -2973,9 +2973,18 @@ void Planner::set_max_jerk(const AxisEnum axis, float targetValue) {
2973 2973
 #if ENABLED(AUTOTEMP)
2974 2974
 
2975 2975
   void Planner::autotemp_M104_M109() {
2976
-    if ((autotemp_enabled = parser.seen('F'))) autotemp_factor = parser.value_float();
2977
-    if (parser.seen('S')) autotemp_min = parser.value_celsius();
2978
-    if (parser.seen('B')) autotemp_max = parser.value_celsius();
2976
+
2977
+    #if ENABLED(AUTOTEMP_PROPORTIONAL)
2978
+      const int16_t target = thermalManager.degTargetHotend(active_extruder);
2979
+      autotemp_min = target + AUTOTEMP_MIN_P;
2980
+      autotemp_max = target + AUTOTEMP_MAX_P;
2981
+      autotemp_factor = AUTOTEMP_FACTOR_P;
2982
+    #endif
2983
+
2984
+    if (parser.seenval('S')) autotemp_min = parser.value_celsius();
2985
+    if (parser.seenval('B')) autotemp_max = parser.value_celsius();
2986
+    if (parser.seenval('F')) autotemp_factor = parser.value_float();
2987
+    if (!autotemp_factor) autotemp_enabled = false; // F0 will disable autotemp
2979 2988
   }
2980 2989
 
2981 2990
 #endif

Loading…
Откажи
Сачувај