|
@@ -790,41 +790,43 @@ static void lcd_control_temperature_menu()
|
790
|
790
|
#ifdef PIDTEMP
|
791
|
791
|
// set up temp variables - undo the default scaling
|
792
|
792
|
pid_current_extruder = 0;
|
793
|
|
- raw_Ki = unscalePID_i(Ki[0]);
|
794
|
|
- raw_Kd = unscalePID_d(Kd[0]);
|
795
|
|
- MENU_ITEM_EDIT(float52, MSG_PID_P, &Kp[0], 1, 9990);
|
|
793
|
+ raw_Ki = unscalePID_i(PID_PARAM(Ki,0));
|
|
794
|
+ raw_Kd = unscalePID_d(PID_PARAM(Kd,0));
|
|
795
|
+ MENU_ITEM_EDIT(float52, MSG_PID_P, &PID_PARAM(Kp,0), 1, 9990);
|
796
|
796
|
// i is typically a small value so allows values below 1
|
797
|
797
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
|
798
|
798
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d);
|
799
|
|
-# ifdef PID_ADD_EXTRUSION_RATE
|
800
|
|
- MENU_ITEM_EDIT(float3, MSG_PID_C, &Kc[0], 1, 9990);
|
801
|
|
-# endif//PID_ADD_EXTRUSION_RATE
|
802
|
|
-#if EXTRUDERS > 1
|
803
|
|
- // set up temp variables - undo the default scaling
|
804
|
|
- pid_current_extruder = 1;
|
805
|
|
- raw_Ki = unscalePID_i(Ki[1]);
|
806
|
|
- raw_Kd = unscalePID_d(Kd[1]);
|
807
|
|
- MENU_ITEM_EDIT(float52, MSG_PID_P1, &Kp[1], 1, 9990);
|
808
|
|
- // i is typically a small value so allows values below 1
|
809
|
|
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I1, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
|
810
|
|
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D1, &raw_Kd, 1, 9990, copy_and_scalePID_d);
|
811
|
|
-# ifdef PID_ADD_EXTRUSION_RATE
|
812
|
|
- MENU_ITEM_EDIT(float3, MSG_PID_C1, &Kc[1], 1, 9990);
|
813
|
|
-# endif//PID_ADD_EXTRUSION_RATE
|
814
|
|
-#endif//EXTRUDERS > 1
|
815
|
|
-#if EXTRUDERS > 2
|
816
|
|
- // set up temp variables - undo the default scaling
|
817
|
|
- pid_current_extruder = 2;
|
818
|
|
- raw_Ki = unscalePID_i(Ki[2]);
|
819
|
|
- raw_Kd = unscalePID_d(Kd[2]);
|
820
|
|
- MENU_ITEM_EDIT(float52, MSG_PID_P2, &Kp[2], 1, 9990);
|
821
|
|
- // i is typically a small value so allows values below 1
|
822
|
|
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I2, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
|
823
|
|
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D2, &raw_Kd, 1, 9990, copy_and_scalePID_d);
|
824
|
|
-# ifdef PID_ADD_EXTRUSION_RATE
|
825
|
|
- MENU_ITEM_EDIT(float3, MSG_PID_C2, &Kc[2], 1, 9990);
|
826
|
|
-# endif//PID_ADD_EXTRUSION_RATE
|
827
|
|
-#endif//EXTRUDERS > 2
|
|
799
|
+ #ifdef PID_ADD_EXTRUSION_RATE
|
|
800
|
+ MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990);
|
|
801
|
+ #endif//PID_ADD_EXTRUSION_RATE
|
|
802
|
+#ifdef PID_PARAMS_PER_EXTRUDER
|
|
803
|
+ #if EXTRUDERS > 1
|
|
804
|
+ // set up temp variables - undo the default scaling
|
|
805
|
+ pid_current_extruder = 0;
|
|
806
|
+ raw_Ki = unscalePID_i(PID_PARAM(Ki,1));
|
|
807
|
+ raw_Kd = unscalePID_d(PID_PARAM(Kd,1));
|
|
808
|
+ MENU_ITEM_EDIT(float52, MSG_PID_P1, &PID_PARAM(Kp,1), 1, 9990);
|
|
809
|
+ // i is typically a small value so allows values below 1
|
|
810
|
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I1, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
|
|
811
|
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D1, &raw_Kd, 1, 9990, copy_and_scalePID_d);
|
|
812
|
+ #ifdef PID_ADD_EXTRUSION_RATE
|
|
813
|
+ MENU_ITEM_EDIT(float3, MSG_PID_C1, &PID_PARAM(Kc,1), 1, 9990);
|
|
814
|
+ #endif//PID_ADD_EXTRUSION_RATE
|
|
815
|
+ #endif//EXTRUDERS > 1
|
|
816
|
+ #if EXTRUDERS > 2
|
|
817
|
+ // set up temp variables - undo the default scaling
|
|
818
|
+ pid_current_extruder = 0;
|
|
819
|
+ raw_Ki = unscalePID_i(PID_PARAM(Ki,2));
|
|
820
|
+ raw_Kd = unscalePID_d(PID_PARAM(Kd,2));
|
|
821
|
+ MENU_ITEM_EDIT(float52, MSG_PID_P2, &PID_PARAM(Kp,2), 1, 9990);
|
|
822
|
+ // i is typically a small value so allows values below 1
|
|
823
|
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I2, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
|
|
824
|
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D2, &raw_Kd, 1, 9990, copy_and_scalePID_d);
|
|
825
|
+ #ifdef PID_ADD_EXTRUSION_RATE
|
|
826
|
+ MENU_ITEM_EDIT(float3, MSG_PID_C2, &PID_PARAM(Kc,2), 1, 9990);
|
|
827
|
+ #endif//PID_ADD_EXTRUSION_RATE
|
|
828
|
+ #endif//EXTRUDERS > 2
|
|
829
|
+#endif // PID_PARAMS_PER_EXTRUDER
|
828
|
830
|
#endif//PIDTEMP
|
829
|
831
|
MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
|
830
|
832
|
MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
|
|
@@ -1731,7 +1733,7 @@ char *ftostr52(const float &x)
|
1731
|
1733
|
void copy_and_scalePID_i()
|
1732
|
1734
|
{
|
1733
|
1735
|
#ifdef PIDTEMP
|
1734
|
|
- Ki[pid_current_extruder] = scalePID_i(raw_Ki);
|
|
1736
|
+ PID_PARAM(Ki, pid_current_extruder) = scalePID_i(raw_Ki);
|
1735
|
1737
|
updatePID();
|
1736
|
1738
|
#endif
|
1737
|
1739
|
}
|
|
@@ -1741,7 +1743,7 @@ void copy_and_scalePID_i()
|
1741
|
1743
|
void copy_and_scalePID_d()
|
1742
|
1744
|
{
|
1743
|
1745
|
#ifdef PIDTEMP
|
1744
|
|
- Kd[pid_current_extruder] = scalePID_d(raw_Kd);
|
|
1746
|
+ PID_PARAM(Kd, pid_current_extruder) = scalePID_d(raw_Kd);
|
1745
|
1747
|
updatePID();
|
1746
|
1748
|
#endif
|
1747
|
1749
|
}
|