Ver código fonte

Enable hotend / bed PID separately in ExtUI (#16827)

proferabg 5 anos atrás
pai
commit
3f87f912c5
Nenhuma conta vinculada ao e-mail do autor do commit

+ 21
- 12
Marlin/src/lcd/extensible_ui/ui_api.cpp Ver arquivo

894
 
894
 
895
   float getFeedrate_percent() { return feedrate_percentage; }
895
   float getFeedrate_percent() { return feedrate_percentage; }
896
 
896
 
897
-  #if HAS_PID_HEATING
897
+  #if ENABLED(PIDTEMP)
898
     float getPIDValues_Kp(const extruder_t tool) {
898
     float getPIDValues_Kp(const extruder_t tool) {
899
       return PID_PARAM(Kp, tool);
899
       return PID_PARAM(Kp, tool);
900
     }
900
     }
901
+    
901
     float getPIDValues_Ki(const extruder_t tool) {
902
     float getPIDValues_Ki(const extruder_t tool) {
902
       return unscalePID_i(PID_PARAM(Ki, tool));
903
       return unscalePID_i(PID_PARAM(Ki, tool));
903
     }
904
     }
905
+    
904
     float getPIDValues_Kd(const extruder_t tool) {
906
     float getPIDValues_Kd(const extruder_t tool) {
905
       return unscalePID_d(PID_PARAM(Kd, tool));
907
       return unscalePID_d(PID_PARAM(Kd, tool));
906
     }
908
     }
909
+
910
+    void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
911
+      thermalManager.temp_hotend[tool].pid.Kp = p;
912
+      thermalManager.temp_hotend[tool].pid.Ki = scalePID_i(i);
913
+      thermalManager.temp_hotend[tool].pid.Kd = scalePID_d(d);
914
+      thermalManager.updatePID();
915
+    }
916
+
917
+    void startPIDTune(const float temp, extruder_t tool){
918
+      thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
919
+    }
920
+  #endif
921
+  
922
+  #if ENABLED(PIDTEMPBED)
907
     float getBedPIDValues_Kp() {
923
     float getBedPIDValues_Kp() {
908
       return thermalManager.temp_bed.pid.Kp;
924
       return thermalManager.temp_bed.pid.Kp;
909
     }
925
     }
926
+    
910
     float getBedPIDValues_Ki() {
927
     float getBedPIDValues_Ki() {
911
       return unscalePID_i(thermalManager.temp_bed.pid.Ki);
928
       return unscalePID_i(thermalManager.temp_bed.pid.Ki);
912
     }
929
     }
930
+    
913
     float getBedPIDValues_Kd() {
931
     float getBedPIDValues_Kd() {
914
       return unscalePID_d(thermalManager.temp_bed.pid.Kd);
932
       return unscalePID_d(thermalManager.temp_bed.pid.Kd);
915
     }
933
     }
916
-
917
-    void setPIDValues(const float p, const float i, const float d, extruder_t tool) {
918
-      thermalManager.temp_hotend[tool].pid.Kp = p;
919
-      thermalManager.temp_hotend[tool].pid.Ki = scalePID_i(i);
920
-      thermalManager.temp_hotend[tool].pid.Kd = scalePID_d(d);
921
-      thermalManager.updatePID();
922
-    }
934
+    
923
     void setBedPIDValues(const float p, const float i, const float d) {
935
     void setBedPIDValues(const float p, const float i, const float d) {
924
       thermalManager.temp_bed.pid.Kp = p;
936
       thermalManager.temp_bed.pid.Kp = p;
925
       thermalManager.temp_bed.pid.Ki = scalePID_i(i);
937
       thermalManager.temp_bed.pid.Ki = scalePID_i(i);
926
       thermalManager.temp_bed.pid.Kd = scalePID_d(d);
938
       thermalManager.temp_bed.pid.Kd = scalePID_d(d);
927
       thermalManager.updatePID();
939
       thermalManager.updatePID();
928
     }
940
     }
929
-
930
-    void startPIDTune(const float temp, extruder_t tool){
931
-      thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
932
-    }
941
+    
933
     void startBedPIDTune(const float temp) {
942
     void startBedPIDTune(const float temp) {
934
       thermalManager.PID_autotune(temp, H_BED, 4, true);
943
       thermalManager.PID_autotune(temp, H_BED, 4, true);
935
     }
944
     }

+ 6
- 3
Marlin/src/lcd/extensible_ui/ui_api.h Ver arquivo

249
     #endif
249
     #endif
250
   #endif
250
   #endif
251
 
251
 
252
-  #if HAS_PID_HEATING
252
+  #if ENABLED(PIDTEMP)
253
     float getPIDValues_Kp(const extruder_t);
253
     float getPIDValues_Kp(const extruder_t);
254
     float getPIDValues_Ki(const extruder_t);
254
     float getPIDValues_Ki(const extruder_t);
255
     float getPIDValues_Kd(const extruder_t);
255
     float getPIDValues_Kd(const extruder_t);
256
+    void setPIDValues(const float, const float, const float, extruder_t);
257
+    void startPIDTune(const float, extruder_t);
258
+  #endif
259
+  
260
+  #if ENABLED(PIDTEMPBED)
256
     float getBedPIDValues_Kp();
261
     float getBedPIDValues_Kp();
257
     float getBedPIDValues_Ki();
262
     float getBedPIDValues_Ki();
258
     float getBedPIDValues_Kd();
263
     float getBedPIDValues_Kd();
259
-    void setPIDValues(const float, const float, const float, extruder_t);
260
     void setBedPIDValues(const float, const float, const float);
264
     void setBedPIDValues(const float, const float, const float);
261
-    void startPIDTune(const float, extruder_t);
262
     void startBedPIDTune(const float);
265
     void startBedPIDTune(const float);
263
   #endif
266
   #endif
264
 
267
 

Carregando…
Cancelar
Salvar