浏览代码

Update temperature.cpp

Rerouter 8 年前
父节点
当前提交
1a2f1d4974
共有 1 个文件被更改,包括 2 次插入20 次删除
  1. 2
    20
      Marlin/temperature.cpp

+ 2
- 20
Marlin/temperature.cpp 查看文件

136
     int Temperature::lpq_ptr = 0;
136
     int Temperature::lpq_ptr = 0;
137
   #endif
137
   #endif
138
 
138
 
139
-  float Temperature::pid_error[HOTENDS],
140
-        Temperature::temp_iState_min[HOTENDS],
141
-        Temperature::temp_iState_max[HOTENDS];
139
+  float Temperature::pid_error[HOTENDS];
142
   bool Temperature::pid_reset[HOTENDS];
140
   bool Temperature::pid_reset[HOTENDS];
143
 #endif
141
 #endif
144
 
142
 
148
         Temperature::pTerm_bed,
146
         Temperature::pTerm_bed,
149
         Temperature::iTerm_bed,
147
         Temperature::iTerm_bed,
150
         Temperature::dTerm_bed,
148
         Temperature::dTerm_bed,
151
-        Temperature::pid_error_bed,
152
-        Temperature::temp_iState_min_bed,
153
-        Temperature::temp_iState_max_bed;
149
+        Temperature::pid_error_bed;
154
 #else
150
 #else
155
   millis_t Temperature::next_bed_check_ms;
151
   millis_t Temperature::next_bed_check_ms;
156
 #endif
152
 #endif
448
     #if ENABLED(PID_EXTRUSION_SCALING)
444
     #if ENABLED(PID_EXTRUSION_SCALING)
449
       last_e_position = 0;
445
       last_e_position = 0;
450
     #endif
446
     #endif
451
-    HOTEND_LOOP() {
452
-      temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
453
-    }
454
-  #endif
455
-  #if ENABLED(PIDTEMPBED)
456
-    temp_iState_max_bed = (PID_BED_INTEGRAL_DRIVE_MAX) / bedKi;
457
   #endif
447
   #endif
458
 }
448
 }
459
 
449
 
564
         }
554
         }
565
         pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX];
555
         pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX];
566
         temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX];
556
         temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX];
567
-        temp_iState[HOTEND_INDEX] = constrain(temp_iState[HOTEND_INDEX], temp_iState_min[HOTEND_INDEX], temp_iState_max[HOTEND_INDEX]);
568
         iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX];
557
         iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX];
569
 
558
 
570
         pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX];
559
         pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX];
627
       pid_error_bed = target_temperature_bed - current_temperature_bed;
616
       pid_error_bed = target_temperature_bed - current_temperature_bed;
628
       pTerm_bed = bedKp * pid_error_bed;
617
       pTerm_bed = bedKp * pid_error_bed;
629
       temp_iState_bed += pid_error_bed;
618
       temp_iState_bed += pid_error_bed;
630
-      temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed);
631
       iTerm_bed = bedKi * temp_iState_bed;
619
       iTerm_bed = bedKi * temp_iState_bed;
632
 
620
 
633
       dTerm_bed = K2 * bedKd * (current_temperature_bed - temp_dState_bed) + K1 * dTerm_bed;
621
       dTerm_bed = K2 * bedKd * (current_temperature_bed - temp_dState_bed) + K1 * dTerm_bed;
955
     // populate with the first value
943
     // populate with the first value
956
     maxttemp[e] = maxttemp[0];
944
     maxttemp[e] = maxttemp[0];
957
     #if ENABLED(PIDTEMP)
945
     #if ENABLED(PIDTEMP)
958
-      temp_iState_min[e] = 0.0;
959
-      temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
960
       #if ENABLED(PID_EXTRUSION_SCALING)
946
       #if ENABLED(PID_EXTRUSION_SCALING)
961
         last_e_position = 0;
947
         last_e_position = 0;
962
       #endif
948
       #endif
963
     #endif //PIDTEMP
949
     #endif //PIDTEMP
964
-    #if ENABLED(PIDTEMPBED)
965
-      temp_iState_min_bed = 0.0;
966
-      temp_iState_max_bed = (PID_BED_INTEGRAL_DRIVE_MAX) / bedKi;
967
-    #endif //PIDTEMPBED
968
   }
950
   }
969
 
951
 
970
   #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING)
952
   #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING)

正在加载...
取消
保存