Chnage how PID values are defined and called

This commit is contained in:
Brandon Kamphake 2022-01-17 17:01:44 -06:00
parent 156130e1af
commit f7259c68f8
2 changed files with 111 additions and 64 deletions

View File

@ -15,7 +15,7 @@
//#define TOOLHEAD_HS_HSPLUS
//#define TOOLHEAD_H175
//#define TOOLHEAD_M175
//#define TOOLHEAD_SK175
// #define TOOLHEAD_SK175
//#define TOOLHEAD_SK285
//#define TOOLHEAD_Quiver_DualExtruder // TAZ Pro Dual Extruder
//#define TOOLHEAD_Albatross_Flexystruder // TAZ Legacy Flexystruder
@ -843,60 +843,107 @@
// Set/get with gcode: M301 E[extruder number, 0-2]
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
#if ENABLED(LULZBOT_UNIVERSAL_TOOLHEAD)
#if ANY(Sidekick_289, Sidekick_747)
// SK Tool heads (30W)
#define LULZBOT_DEFAULT_Kp 26.90
#define LULZBOT_DEFAULT_Ki 2.41
#define LULZBOT_DEFAULT_Kd 75.19
#elif ENABLED(TAZ6)
//TAZ 6 Single Extruder
#define LULZBOT_DEFAULT_Kp 28.79
#define LULZBOT_DEFAULT_Ki 1.91
#define LULZBOT_DEFAULT_Kd 108.51
#else
// E3D Titan Aero with LulzBot V6 block
#define LULZBOT_DEFAULT_Kp 21.0
#define LULZBOT_DEFAULT_Ki 1.78
#define LULZBOT_DEFAULT_Kd 61.93
#endif
#endif
#if ANY(TOOLHEAD_SL_SE_HE, LULZBOT_E3D_Titan_Aero_V6) // Used when LCD is not installed
#define LULZBOT_DEFAULT_Kp 21.0
#define LULZBOT_DEFAULT_Ki 1.78
#define LULZBOT_DEFAULT_Kd 61.93
#elif ENABLED(TOOLHEAD_SK175)
#define LULZBOT_DEFAULT_Kp 26.47
#define LULZBOT_DEFAULT_Ki 2.32
#define LULZBOT_DEFAULT_Kd 75.56
#elif ENABLED(TOOLHEAD_SK285)
#define LULZBOT_DEFAULT_Kp 26.90
#define LULZBOT_DEFAULT_Ki 2.41
#define LULZBOT_DEFAULT_Kd 75.19
#elif ENABLED(TOOLHEAD_H175)
#define LULZBOT_DEFAULT_Kp 27.58
#define LULZBOT_DEFAULT_Ki 3.22
#define LULZBOT_DEFAULT_Kd 65.66
#elif ENABLED(TOOLHEAD_M175)
#define LULZBOT_DEFAULT_Kp 24.54
#define LULZBOT_DEFAULT_Ki 2.52
#define LULZBOT_DEFAULT_Kd 61.75
#elif ANY(TOOLHEAD_HS_HSPLUS)
#define LULZBOT_DEFAULT_Kp 37.55
#define LULZBOT_DEFAULT_Ki 5.39
#define LULZBOT_DEFAULT_Kd 65.36
#endif
//TAZ 6 Single Extruder (W)
#define TAZ6_STD_DEFAULT_Kp 28.79
#define TAZ6_STD_DEFAULT_Ki 1.91
#define TAZ6_STD_DEFAULT_Kd 108.51
#define charTAZ6_STD_DEFAULT_Kp "28.79"
#define charTAZ6_STD_DEFAULT_Ki "1.91"
#define charTAZ6_STD_DEFAULT_Kd "108.51"
// E3D Titan Aero with LulzBot V6 block (40W)
#define SLSEHE_DEFAULT_Kp 21.0
#define SLSEHE_DEFAULT_Ki 1.78
#define SLSEHE_DEFAULT_Kd 61.93
#define charSLSEHE_DEFAULT_Kp "21.0"
#define charSLSEHE_DEFAULT_Ki "1.78"
#define charSLSEHE_DEFAULT_Kd "61.93"
// SK175 Tool head (30W)
#define SK175_DEFAULT_Kp 26.47
#define SK175_DEFAULT_Ki 2.32
#define SK175_DEFAULT_Kd 75.56
#define charSK175_DEFAULT_Kp "26.47"
#define charSK175_DEFAULT_Ki "2.32"
#define charSK175_DEFAULT_Kd "75.56"
// SK285 Tool head (30W)
#define SK285_DEFAULT_Kp 26.90
#define SK285_DEFAULT_Ki 2.41
#define SK285_DEFAULT_Kd 75.19
#define charSK285_DEFAULT_Kp "26.90"
#define charSK285_DEFAULT_Ki "2.41"
#define charSK285_DEFAULT_Kd "75.19"
// H175 Tool head (40W)
#define H175_DEFAULT_Kp 27.58
#define H175_DEFAULT_Ki 3.22
#define H175_DEFAULT_Kd 65.66
#define charH175_DEFAULT_Kp "27.58"
#define charH175_DEFAULT_Ki "3.22"
#define charH175_DEFAULT_Kd "65.66"
// M175 Tool head (50W)
#define M175_DEFAULT_Kp 24.54
#define M175_DEFAULT_Ki 2.52
#define M175_DEFAULT_Kd 61.75
#define charM175_DEFAULT_Kp "24.54"
#define charM175_DEFAULT_Ki "2.52"
#define charM175_DEFAULT_Kd "61.75"
// HS & HSPLUS Tool heads
#define HSHSPLUS_DEFAULT_Kp 37.55
#define HSHSPLUS_DEFAULT_Ki 5.39
#define HSHSPLUS_DEFAULT_Kd 65.36
#define charHSHSPLUS_DEFAULT_Kp "37.55"
#define charHSHSPLUS_DEFAULT_Ki "5.39"
#define charHSHSPLUS_DEFAULT_Kd "65.36"
#if ENABLED(PID_PARAMS_PER_HOTEND)
// Specify between 1 and HOTENDS values per array.
// If fewer than EXTRUDER values are provided, the last element will be repeated.
#define DEFAULT_Kp_LIST { 22.20, 22.20 }
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
#else
#define DEFAULT_Kp LULZBOT_DEFAULT_Kp
#define DEFAULT_Ki LULZBOT_DEFAULT_Ki
#define DEFAULT_Kd LULZBOT_DEFAULT_Kd
// Sets default PID based on which printer/toolhead is selected
#if ENABLED(TAZ6) // Taz 6 Standard toolhead
#define DEFAULT_Kp TAZ6_STD_DEFAULT_Kp
#define DEFAULT_Ki TAZ6_STD_DEFAULT_Ki
#define DEFAULT_Kd TAZ6_STD_DEFAULT_Kd
#elif ANY(TOOLHEAD_SL_SE_HE, LULZBOT_E3D_Titan_Aero_V6, LULZBOT_UNIVERSAL_TOOLHEAD)
#define DEFAULT_Kp SLSEHE_DEFAULT_Kp
#define DEFAULT_Ki SLSEHE_DEFAULT_Ki
#define DEFAULT_Kd SLSEHE_DEFAULT_Kd
#elif ENABLED(TOOLHEAD_SK175)
#define DEFAULT_Kp SK175_DEFAULT_Kp
#define DEFAULT_Ki SK175_DEFAULT_Ki
#define DEFAULT_Kd SK175_DEFAULT_Kd
#elif ENABLED(TOOLHEAD_SK285)
#define DEFAULT_Kp SK285_DEFAULT_Kp
#define DEFAULT_Ki SK285_DEFAULT_Ki
#define DEFAULT_Kd SK285_DEFAULT_Kd
#elif ENABLED(TOOLHEAD_H175)
#define DEFAULT_Kp H175_DEFAULT_Kp
#define DEFAULT_Ki H175_DEFAULT_Ki
#define DEFAULT_Kd H175_DEFAULT_Kd
#elif ENABLED(TOOLHEAD_M175)
#define DEFAULT_Kp M175_DEFAULT_Kp
#define DEFAULT_Ki M175_DEFAULT_Ki
#define DEFAULT_Kd M175_DEFAULT_Kd
#elif ANY(TOOLHEAD_HS_HSPLUS)
#define DEFAULT_Kp HSHSPLUS_DEFAULT_Kp
#define DEFAULT_Ki HSHSPLUS_DEFAULT_Ki
#define DEFAULT_Kd HSHSPLUS_DEFAULT_Kd
#endif
#endif
#endif // PIDTEMP

View File

@ -3837,58 +3837,58 @@
#if ANY(Sidekick_289, Sidekick_747)
#define MAIN_MENU_ITEM_1_DESC "SK175|0.50mm|BRASS"
#define MAIN_MENU_ITEM_1_GCODE "M92E420\nM301P26.29I2.57D72.59\nM906E" E_CURRENT_Aero "\nM500\nM117 SK175|0.50mm|BRASS"
#define MAIN_MENU_ITEM_1_GCODE "M92E420\nM301P" charSK175_DEFAULT_Kp "I" charSK175_DEFAULT_Ki "D" charSK175_DEFAULT_Kd"\nM906E" E_CURRENT_Aero "\nM500\nM117 SK175|0.50mm|BRASS"
#define MAIN_MENU_ITEM_2_DESC "SK285|0.50mm|BRASS"
#define MAIN_MENU_ITEM_2_GCODE "M92E420\nM301" SK_DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 SK285|0.50mm|BRASS"
#define MAIN_MENU_ITEM_2_GCODE "M92E420\nM301P" charSK285_DEFAULT_Kp "I" charSK285_DEFAULT_Ki "D" charSK285_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 SK285|0.50mm|BRASS"
#endif
#if DISABLED(TAZ6, Workhorse)
#define MAIN_MENU_ITEM_3_DESC "M175v2|0.50mm|CRB CU"
#define MAIN_MENU_ITEM_3_GCODE "M92E415\nM301P24.54I2.52D61.75\nM906E" E_CURRENT_BMG "\nM500\nM117 M175v2|0.50mm|CRB CU"
#define MAIN_MENU_ITEM_3_GCODE "M92E415\nM301P" charM175_DEFAULT_Kp "I" charM175_DEFAULT_Ki "D" charM175_DEFAULT_Kd "\nM906E" E_CURRENT_BMG "\nM500\nM117 M175v2|0.50mm|CRB CU"
#define MAIN_MENU_ITEM_4_DESC "SL|0.25mm|NKL-PL CU"
#define MAIN_MENU_ITEM_4_GCODE "M92E420\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 SL|0.25mm|NKL-PL CU"
#define MAIN_MENU_ITEM_4_GCODE "M92E420\nM301P" charSLSEHE_DEFAULT_Kp "I" charSLSEHE_DEFAULT_Ki "D" charSLSEHE_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 SL|0.25mm|NKL-PL CU"
#define MAIN_MENU_ITEM_5_DESC "SE|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_5_GCODE "M92E420\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 SE|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_5_GCODE "M92E420\nM301P" charSLSEHE_DEFAULT_Kp "I" charSLSEHE_DEFAULT_Ki "D" charSLSEHE_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 SE|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_6_DESC "HE|0.50mm|HRD STEEL"
#define MAIN_MENU_ITEM_6_GCODE "M92E420\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 HE|0.50mm|HRD STEEL"
#define MAIN_MENU_ITEM_6_GCODE "M92E420\nM301P" charSLSEHE_DEFAULT_Kp "I" charSLSEHE_DEFAULT_Ki "D" charSLSEHE_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 HE|0.50mm|HRD STEEL"
#define MAIN_MENU_ITEM_7_DESC "HS|0.80mm|HRD STEEL"
#define MAIN_MENU_ITEM_7_GCODE "M92E420\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 HS|0.80mm|HRD STEEL"
#define MAIN_MENU_ITEM_7_GCODE "M92E420\nM301P" charHSHSPLUS_DEFAULT_Kp "I" charHSHSPLUS_DEFAULT_Ki "D" charHSHSPLUS_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 HS|0.80mm|HRD STEEL"
#define MAIN_MENU_ITEM_8_DESC "HS+|1.20mm|HRD STEEL"
#define MAIN_MENU_ITEM_8_GCODE "M92E420\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 HS+|1.20mm|HRD STEEL"
#define MAIN_MENU_ITEM_8_GCODE "M92E420\nM301P" charHSHSPLUS_DEFAULT_Kp "I" charHSHSPLUS_DEFAULT_Ki "D" charHSHSPLUS_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 HS+|1.20mm|HRD STEEL"
#define MAIN_MENU_ITEM_9_DESC "H175|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_9_GCODE "M92E409\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 H175|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_9_GCODE "M92E409\nM301P" charH175_DEFAULT_Kp "I" charH175_DEFAULT_Ki "D" charH175_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 H175|0.50mm|NKL-PL CU"
#else
#define MAIN_MENU_ITEM_3_DESC "M175v2|0.50mm|CRB CU"
#define MAIN_MENU_ITEM_3_GCODE "M92E415\nM206Y0\nM301P24.54I2.52D61.75\nM907E" E_CURRENT_BMG "\nM500\nM117 M175v2|0.50mm|CRB CU"
#define MAIN_MENU_ITEM_3_GCODE "M92E415\nM206Y0\nM301P" charM175_DEFAULT_Kp "I" charM175_DEFAULT_Ki "D" charM175_DEFAULT_Kd "\nM907E" E_CURRENT_BMG "\nM500\nM117 M175v2|0.50mm|CRB CU"
#define MAIN_MENU_ITEM_4_DESC "SL|0.25mm|NKL-PL CU"
#define MAIN_MENU_ITEM_4_GCODE "M92E420\nM206Y0\nM301" DEFAULT_PID "\nM907E" E_CURRENT_Aero "\nM500\nM117 SL|0.25mm|NKL-PL CU"
#define MAIN_MENU_ITEM_4_GCODE "M92E420\nM206Y0\nM301P" charSLSEHE_DEFAULT_Kp "I" charSLSEHE_DEFAULT_Ki "D" charSLSEHE_DEFAULT_Kd "\nM907E" E_CURRENT_Aero "\nM500\nM117 SL|0.25mm|NKL-PL CU"
#define MAIN_MENU_ITEM_5_DESC "SE|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_5_GCODE "M92E420\nM206Y0\nM301" DEFAULT_PID "\nM907E" E_CURRENT_Aero "\nM500\nM117 SE|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_5_GCODE "M92E420\nM206Y0\nM301P" charSLSEHE_DEFAULT_Kp "I" charSLSEHE_DEFAULT_Ki "D" charSLSEHE_DEFAULT_Kd "\nM907E" E_CURRENT_Aero "\nM500\nM117 SE|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_6_DESC "HE|0.50mm|HRD STEEL"
#define MAIN_MENU_ITEM_6_GCODE "M92E420\nM206Y0\nM301" DEFAULT_PID "\nM907E" E_CURRENT_Aero "\nM500\nM117 HE|0.50mm|HRD STEEL"
#define MAIN_MENU_ITEM_6_GCODE "M92E420\nM206Y0\nM301P" charSLSEHE_DEFAULT_Kp "I" charSLSEHE_DEFAULT_Ki "D" charSLSEHE_DEFAULT_Kd "\nM907E" E_CURRENT_Aero "\nM500\nM117 HE|0.50mm|HRD STEEL"
#define MAIN_MENU_ITEM_7_DESC "HS|0.80mm|HRD STEEL"
#define MAIN_MENU_ITEM_7_GCODE "M92E420\nM206Y0\nM301" DEFAULT_PID "\nM907E" E_CURRENT_Aero "\nM500\nM117 HS|0.80mm|HRD STEEL"
#define MAIN_MENU_ITEM_7_GCODE "M92E420\nM206Y0\nM301P" charHSHSPLUS_DEFAULT_Kp "I" charHSHSPLUS_DEFAULT_Ki "D" charHSHSPLUS_DEFAULT_Kd "\nM907E" E_CURRENT_Aero "\nM500\nM117 HS|0.80mm|HRD STEEL"
#define MAIN_MENU_ITEM_8_DESC "HS+|1.20mm|HRD STEEL"
#define MAIN_MENU_ITEM_8_GCODE "M92E420\nM206Y0\nM301" DEFAULT_PID "\nM907E" E_CURRENT_Aero "\nM500\nM117 HS+|1.20mm|HRD STEEL"
#define MAIN_MENU_ITEM_8_GCODE "M92E420\nM206Y0\nM301P" charHSHSPLUS_DEFAULT_Kp "I" charHSHSPLUS_DEFAULT_Ki "D" charHSHSPLUS_DEFAULT_Kd "\nM907E" E_CURRENT_Aero "\nM500\nM117 HS+|1.20mm|HRD STEEL"
#define MAIN_MENU_ITEM_9_DESC "H175|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_9_GCODE "M92E409\nM206Y0\nM301" DEFAULT_PID "\nM906E" E_CURRENT_Aero "\nM500\nM117 H175|0.50mm|NKL-PL CU"
#define MAIN_MENU_ITEM_9_GCODE "M92E409\nM206Y0\nM301P" charH175_DEFAULT_Kp "I" charH175_DEFAULT_Ki "D" charH175_DEFAULT_Kd "\nM906E" E_CURRENT_Aero "\nM500\nM117 H175|0.50mm|NKL-PL CU"
#endif
#if defined(TAZ6)
#define MAIN_MENU_ITEM_1_DESC "Standard|0.5mm"
#define MAIN_MENU_ITEM_1_GCODE "M92E833\nM206Y4\nM301" TAZ6_DEFAULT_PID "\nM907E" E_CURRENT_Std "\nM500\nM117 Standard|0.5mm"
#define MAIN_MENU_ITEM_1_GCODE "M92E833\nM206Y4\nM301P" charTAZ6_STD_DEFAULT_Kp "I" charTAZ6_STD_DEFAULT_Ki "D" charTAZ6_STD_DEFAULT_Kd "\nM907E" E_CURRENT_Std "\nM500\nM117 Standard|0.5mm"
#endif
#endif