瀏覽代碼

Apply minimum C in M303 (#13113)

Apply minimum `C` in `M303`. `PID_autotune()` needs to be called with a 'C'ycles-parameter >2 to give meaningful (different from 0) PID-factors. Therefore silently raise C to 3. Fixing one aspect of #13104
AnHardt 6 年之前
父節點
當前提交
0e37fe8776
共有 2 個檔案被更改,包括 4 行新增2 行删除
  1. 1
    1
      Marlin/src/gcode/temperature/M303.cpp
  2. 3
    1
      Marlin/src/module/temperature.cpp

+ 1
- 1
Marlin/src/gcode/temperature/M303.cpp 查看文件

32
  *
32
  *
33
  *       S<temperature> sets the target temperature. (default 150C / 70C)
33
  *       S<temperature> sets the target temperature. (default 150C / 70C)
34
  *       E<extruder> (-1 for the bed) (default 0)
34
  *       E<extruder> (-1 for the bed) (default 0)
35
- *       C<cycles>
35
+ *       C<cycles> Minimum 3. Default 5.
36
  *       U<bool> with a non-zero value will apply the result to current settings
36
  *       U<bool> with a non-zero value will apply the result to current settings
37
  */
37
  */
38
 void GcodeSuite::M303() {
38
 void GcodeSuite::M303() {

+ 3
- 1
Marlin/src/module/temperature.cpp 查看文件

330
    *
330
    *
331
    * Alternately heat and cool the nozzle, observing its behavior to
331
    * Alternately heat and cool the nozzle, observing its behavior to
332
    * determine the best PID values to achieve a stable temperature.
332
    * determine the best PID values to achieve a stable temperature.
333
+   * Needs sufficient heater power to make some overshoot at target
334
+   * temperature to succeed.
333
    */
335
    */
334
   void Temperature::PID_autotune(const float &target, const int8_t heater, const int8_t ncycles, const bool set_result/*=false*/) {
336
   void Temperature::PID_autotune(const float &target, const int8_t heater, const int8_t ncycles, const bool set_result/*=false*/) {
335
     float current = 0.0;
337
     float current = 0.0;
540
         break;
542
         break;
541
       }
543
       }
542
 
544
 
543
-      if (cycles > ncycles) {
545
+      if (cycles > ncycles && cycles > 2) {
544
         SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED);
546
         SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED);
545
 
547
 
546
         #if HAS_PID_FOR_BOTH
548
         #if HAS_PID_FOR_BOTH

Loading…
取消
儲存