Initial implementation of PID Autotune Menu Items

Adds the parameter U to M303. If U1 is included , it will use the
PID-values from the auto-tune.
This commit is contained in:
WPBack
2016-03-20 14:56:11 +01:00
committed by Scott Lahteine
parent da9d4c4caf
commit 3b3e8a02b5
5 changed files with 42 additions and 11 deletions

View File

@@ -1176,11 +1176,11 @@ static void lcd_control_temperature_menu() {
#endif
//
// PID-P, PID-I, PID-D, PID-C
// PID-P E1, PID-I E1, PID-D E1, PID-C E1
// PID-P E2, PID-I E2, PID-D E2, PID-C E2
// PID-P E3, PID-I E3, PID-D E3, PID-C E3
// PID-P E4, PID-I E4, PID-D E4, PID-C E4
// PID-P, PID-I, PID-D, PID-C, PID Autotune
// PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1
// PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2
// PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3
// PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4
//
#if ENABLED(PIDTEMP)
@@ -1189,8 +1189,20 @@ static void lcd_control_temperature_menu() {
raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \
MENU_ITEM_EDIT(float52, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex); \
if (eindex == 0) { \
MENU_ITEM(gcode, MSG_PID_AUTOTUNE ELABEL, PSTR("M303 U1")); \
} \
else if (eindex == 1) { \
MENU_ITEM(gcode, MSG_PID_AUTOTUNE ELABEL, PSTR("M303 U1 E1")); \
} \
else if (eindex == 2) { \
MENU_ITEM(gcode, MSG_PID_AUTOTUNE ELABEL, PSTR("M303 U1 E2")); \
} \
else { \
MENU_ITEM(gcode, MSG_PID_AUTOTUNE ELABEL, PSTR("M303 U1 E3")); \
}
#if ENABLED(PID_ADD_EXTRUSION_RATE)
#define PID_MENU_ITEMS(ELABEL, eindex) \
_PID_MENU_ITEMS(ELABEL, eindex); \