Skip to content

Commit a0aec41

Browse files
authored
fix shared PID issue, chamber temp + add touch screen calibration (#130)
1 parent f26e51e commit a0aec41

File tree

16 files changed

+331
-271
lines changed

16 files changed

+331
-271
lines changed

Marlin/Marlin/Configuration_adv.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
* and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set
287287
* below 2.
288288
*/
289-
#define WATCH_TEMP_PERIOD 20 // Seconds
289+
#define WATCH_TEMP_PERIOD 40 // Seconds
290290
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
291291
#endif
292292

@@ -3852,7 +3852,7 @@
38523852
*
38533853
* Execute certain G-code commands immediately after power-on.
38543854
*/
3855-
#define STARTUP_COMMANDS "M141 S45"
3855+
#define STARTUP_COMMANDS ""
38563856

38573857
/**
38583858
* G-code Macros
@@ -3888,8 +3888,11 @@
38883888
#define MAIN_MENU_ITEM_2_GCODE "M141 S0"
38893889
//#define MAIN_MENU_ITEM_2_CONFIRM // Show a confirmation dialog before this action
38903890

3891-
#define MAIN_MENU_ITEM_3_DESC "Bed leveling (3-point)"
3891+
#define MAIN_MENU_ITEM_3_DESC "Bed leveling (3-point)"
38923892
#include "BedLevelingScript.h"
3893+
3894+
#define MAIN_MENU_ITEM_4_DESC "Calibrate Touch Screen"
3895+
#define MAIN_MENU_ITEM_4_GCODE "M995"
38933896
#endif
38943897

38953898
// Custom Menu: Configuration Menu

Marlin/Marlin/src/gcode/config/M301.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,18 @@ void GcodeSuite::M301() {
5757

5858
if (e < HOTENDS) { // catch bad input value
5959

60-
if (parser.seenval('P')) PID_PARAM(Kp, e) = parser.value_float();
61-
if (parser.seenval('I')) PID_PARAM(Ki, e) = scalePID_i(parser.value_float());
62-
if (parser.seenval('D')) PID_PARAM(Kd, e) = scalePID_d(parser.value_float());
60+
if (parser.seenval('P')) SET_HOTEND_PID(Kp, e, parser.value_float());
61+
if (parser.seenval('I')) SET_HOTEND_PID(Ki, e, parser.value_float());
62+
if (parser.seenval('D')) SET_HOTEND_PID(Kd, e, parser.value_float());
6363

6464
#if ENABLED(PID_EXTRUSION_SCALING)
65-
if (parser.seenval('C')) PID_PARAM(Kc, e) = parser.value_float();
65+
if (parser.seenval('C')) SET_HOTEND_PID(Kc, e, parser.value_float());
6666
if (parser.seenval('L')) thermalManager.lpq_len = parser.value_int();
67-
NOMORE(thermalManager.lpq_len, LPQ_MAX_LEN);
68-
NOLESS(thermalManager.lpq_len, 0);
67+
LIMIT(thermalManager.lpq_len, 0, LPQ_MAX_LEN);
6968
#endif
7069

7170
#if ENABLED(PID_FAN_SCALING)
72-
if (parser.seenval('F')) PID_PARAM(Kf, e) = parser.value_float();
71+
if (parser.seenval('F')) SET_HOTEND_PID(Kf, e, parser.value_float());
7372
#endif
7473

7574
thermalManager.updatePID();
@@ -83,23 +82,22 @@ void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t
8382
IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1);
8483
HOTEND_LOOP() {
8584
if (e == eindex || eindex == -1) {
85+
const hotend_pid_t &pid = thermalManager.temp_hotend[e].pid;
8686
report_echo_start(forReplay);
8787
SERIAL_ECHOPGM_P(
8888
#if ENABLED(PID_PARAMS_PER_HOTEND)
8989
PSTR(" M301 E"), e, SP_P_STR
9090
#else
9191
PSTR(" M301 P")
9292
#endif
93-
, PID_PARAM(Kp, e)
94-
, PSTR(" I"), unscalePID_i(PID_PARAM(Ki, e))
95-
, PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e))
93+
, pid.p(), PSTR(" I"), pid.i(), PSTR(" D"), pid.d()
9694
);
9795
#if ENABLED(PID_EXTRUSION_SCALING)
98-
SERIAL_ECHOPGM_P(SP_C_STR, PID_PARAM(Kc, e));
96+
SERIAL_ECHOPGM_P(SP_C_STR, pid.c());
9997
if (e == 0) SERIAL_ECHOPGM(" L", thermalManager.lpq_len);
10098
#endif
10199
#if ENABLED(PID_FAN_SCALING)
102-
SERIAL_ECHOPGM(" F", PID_PARAM(Kf, e));
100+
SERIAL_ECHOPGM(" F", pid.f());
103101
#endif
104102
SERIAL_EOL();
105103
}

Marlin/Marlin/src/gcode/config/M304.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
*/
3737
void GcodeSuite::M304() {
3838
if (!parser.seen("PID")) return M304_report();
39-
if (parser.seenval('P')) thermalManager.temp_bed.pid.Kp = parser.value_float();
40-
if (parser.seenval('I')) thermalManager.temp_bed.pid.Ki = scalePID_i(parser.value_float());
41-
if (parser.seenval('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float());
39+
if (parser.seenval('P')) thermalManager.temp_bed.pid.set_Kp(parser.value_float());
40+
if (parser.seenval('I')) thermalManager.temp_bed.pid.set_Ki(parser.value_float());
41+
if (parser.seenval('D')) thermalManager.temp_bed.pid.set_Kd(parser.value_float());
4242
}
4343

4444
void GcodeSuite::M304_report(const bool forReplay/*=true*/) {
4545
report_heading_etc(forReplay, F(STR_BED_PID));
46-
SERIAL_ECHOLNPGM(
47-
" M304 P", thermalManager.temp_bed.pid.Kp
48-
, " I", unscalePID_i(thermalManager.temp_bed.pid.Ki)
49-
, " D", unscalePID_d(thermalManager.temp_bed.pid.Kd)
46+
SERIAL_ECHOLNPGM(" M304"
47+
" P", thermalManager.temp_bed.pid.p()
48+
, " I", thermalManager.temp_bed.pid.i()
49+
, " D", thermalManager.temp_bed.pid.d()
5050
);
5151
}
5252

Marlin/Marlin/src/gcode/config/M309.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
*/
3737
void GcodeSuite::M309() {
3838
if (!parser.seen("PID")) return M309_report();
39-
if (parser.seen('P')) thermalManager.temp_chamber.pid.Kp = parser.value_float();
40-
if (parser.seen('I')) thermalManager.temp_chamber.pid.Ki = scalePID_i(parser.value_float());
41-
if (parser.seen('D')) thermalManager.temp_chamber.pid.Kd = scalePID_d(parser.value_float());
39+
if (parser.seenval('P')) thermalManager.temp_chamber.pid.set_Kp(parser.value_float());
40+
if (parser.seenval('I')) thermalManager.temp_chamber.pid.set_Ki(parser.value_float());
41+
if (parser.seenval('D')) thermalManager.temp_chamber.pid.set_Kd(parser.value_float());
4242
}
4343

4444
void GcodeSuite::M309_report(const bool forReplay/*=true*/) {
4545
report_heading_etc(forReplay, F(STR_CHAMBER_PID));
46-
SERIAL_ECHOLNPGM(
47-
" M309 P", thermalManager.temp_chamber.pid.Kp
48-
, " I", unscalePID_i(thermalManager.temp_chamber.pid.Ki)
49-
, " D", unscalePID_d(thermalManager.temp_chamber.pid.Kd)
46+
SERIAL_ECHOLNPGM(" M309"
47+
" P", thermalManager.temp_chamber.pid.p()
48+
, " I", thermalManager.temp_chamber.pid.i()
49+
, " D", thermalManager.temp_chamber.pid.d()
5050
);
5151
}
5252

Marlin/Marlin/src/lcd/e3v2/jyersui/dwin.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,23 +2136,23 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
21362136
case HOTENDPID_KP:
21372137
if (draw) {
21382138
Draw_Menu_Item(row, ICON_Version, F("Kp Value"));
2139-
Draw_Float(thermalManager.temp_hotend[0].pid.Kp, row, false, 100);
2139+
Draw_Float(thermalManager.temp_hotend[0].pid.p(), row, false, 100);
21402140
}
21412141
else
21422142
Modify_Value(thermalManager.temp_hotend[0].pid.Kp, 0, 5000, 100, thermalManager.updatePID);
21432143
break;
21442144
case HOTENDPID_KI:
21452145
if (draw) {
21462146
Draw_Menu_Item(row, ICON_Version, F("Ki Value"));
2147-
Draw_Float(unscalePID_i(thermalManager.temp_hotend[0].pid.Ki), row, false, 100);
2147+
Draw_Float(thermalManager.temp_hotend[0].pid.i(), row, false, 100);
21482148
}
21492149
else
21502150
Modify_Value(thermalManager.temp_hotend[0].pid.Ki, 0, 5000, 100, thermalManager.updatePID);
21512151
break;
21522152
case HOTENDPID_KD:
21532153
if (draw) {
21542154
Draw_Menu_Item(row, ICON_Version, F("Kd Value"));
2155-
Draw_Float(unscalePID_d(thermalManager.temp_hotend[0].pid.Kd), row, false, 100);
2155+
Draw_Float(thermalManager.temp_hotend[0].pid.d(), row, false, 100);
21562156
}
21572157
else
21582158
Modify_Value(thermalManager.temp_hotend[0].pid.Kd, 0, 5000, 100, thermalManager.updatePID);
@@ -2203,7 +2203,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
22032203
case BEDPID_KP:
22042204
if (draw) {
22052205
Draw_Menu_Item(row, ICON_Version, F("Kp Value"));
2206-
Draw_Float(thermalManager.temp_bed.pid.Kp, row, false, 100);
2206+
Draw_Float(thermalManager.temp_bed.pid.p(), row, false, 100);
22072207
}
22082208
else {
22092209
Modify_Value(thermalManager.temp_bed.pid.Kp, 0, 5000, 100, thermalManager.updatePID);
@@ -2212,15 +2212,15 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
22122212
case BEDPID_KI:
22132213
if (draw) {
22142214
Draw_Menu_Item(row, ICON_Version, F("Ki Value"));
2215-
Draw_Float(unscalePID_i(thermalManager.temp_bed.pid.Ki), row, false, 100);
2215+
Draw_Float(thermalManager.temp_bed.pid.i(), row, false, 100);
22162216
}
22172217
else
22182218
Modify_Value(thermalManager.temp_bed.pid.Ki, 0, 5000, 100, thermalManager.updatePID);
22192219
break;
22202220
case BEDPID_KD:
22212221
if (draw) {
22222222
Draw_Menu_Item(row, ICON_Version, F("Kd Value"));
2223-
Draw_Float(unscalePID_d(thermalManager.temp_bed.pid.Kd), row, false, 100);
2223+
Draw_Float(thermalManager.temp_bed.pid.d(), row, false, 100);
22242224
}
22252225
else
22262226
Modify_Value(thermalManager.temp_bed.pid.Kd, 0, 5000, 100, thermalManager.updatePID);

Marlin/Marlin/src/lcd/e3v2/proui/dwin.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,13 +2591,15 @@ void SetStepsY() { HMI_value.axis = Y_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP
25912591
void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP, UNITFDIGITS); }
25922592
#if HAS_HOTEND
25932593
void SetStepsE() { HMI_value.axis = E_AXIS; SetPFloatOnClick( MIN_STEP, MAX_STEP, UNITFDIGITS); }
2594-
void SetHotendPidT() { SetPIntOnClick(MIN_ETEMP, MAX_ETEMP); }
2594+
#if ENABLED(PIDTEMP)
2595+
void SetHotendPidT() { SetPIntOnClick(MIN_ETEMP, MAX_ETEMP); }
2596+
#endif
25952597
#endif
2596-
#if HAS_HEATED_BED
2598+
#if ENABLED(PIDTEMPBED)
25972599
void SetBedPidT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); }
25982600
#endif
25992601

2600-
#if HAS_HOTEND || HAS_HEATED_BED
2602+
#if EITHER(PIDTEMP, PIDTEMPBED)
26012603
void SetPidCycles() { SetPIntOnClick(3, 50); }
26022604
void SetKp() { SetPFloatOnClick(0, 1000, 2); }
26032605
void ApplyPIDi() {
@@ -3149,10 +3151,10 @@ void Draw_AdvancedSettings_Menu() {
31493151
#if HAS_HOME_OFFSET
31503152
MENU_ITEM_F(ICON_HomeOffset, MSG_SET_HOME_OFFSETS, onDrawSubMenu, Draw_HomeOffset_Menu);
31513153
#endif
3152-
#if HAS_HOTEND
3154+
#if ENABLED(PIDTEMP)
31533155
MENU_ITEM(ICON_PIDNozzle, F(STR_HOTEND_PID " Settings"), onDrawSubMenu, Draw_HotendPID_Menu);
31543156
#endif
3155-
#if HAS_HEATED_BED
3157+
#if ENABLED(PIDTEMPBED)
31563158
MENU_ITEM(ICON_PIDbed, F(STR_BED_PID " Settings"), onDrawSubMenu, Draw_BedPID_Menu);
31573159
#endif
31583160
MENU_ITEM_F(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, Draw_FilSet_Menu);
@@ -3577,10 +3579,10 @@ void Draw_Steps_Menu() {
35773579
CurrentMenu->draw();
35783580
}
35793581

3580-
#if HAS_HOTEND
3582+
#if ENABLED(PIDTEMP)
35813583
void Draw_HotendPID_Menu() {
35823584
checkkey = Menu;
3583-
if (SetMenu(HotendPIDMenu, F(STR_HOTEND_PID " Settings"),8)) {
3585+
if (SetMenu(HotendPIDMenu, F(STR_HOTEND_PID " Settings"), 8)) {
35843586
BACK_ITEM(Draw_AdvancedSettings_Menu);
35853587
MENU_ITEM(ICON_PIDNozzle, F(STR_HOTEND_PID), onDrawMenuItem, HotendPID);
35863588
EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp);
@@ -3596,10 +3598,10 @@ void Draw_Steps_Menu() {
35963598
}
35973599
#endif
35983600

3599-
#if HAS_HEATED_BED
3601+
#if ENABLED(PIDTEMPBED)
36003602
void Draw_BedPID_Menu() {
36013603
checkkey = Menu;
3602-
if (SetMenu(BedPIDMenu, F(STR_BED_PID " Settings"),8)) {
3604+
if (SetMenu(BedPIDMenu, F(STR_BED_PID " Settings"), 8)) {
36033605
BACK_ITEM(Draw_AdvancedSettings_Menu);
36043606
MENU_ITEM(ICON_PIDNozzle, F(STR_BED_PID), onDrawMenuItem,BedPID);
36053607
EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp);

Marlin/Marlin/src/lcd/e3v2/proui/dwin.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ void Draw_Motion_Menu();
265265
void Draw_Preheat1_Menu();
266266
void Draw_Preheat2_Menu();
267267
void Draw_Preheat3_Menu();
268-
void Draw_HotendPID_Menu();
268+
#if ENABLED(PIDTEMP)
269+
void Draw_HotendPID_Menu();
270+
#endif
269271
#endif
270272
void Draw_Temperature_Menu();
271273
void Draw_MaxSpeed_Menu();
@@ -274,7 +276,7 @@ void Draw_MaxAccel_Menu();
274276
void Draw_MaxJerk_Menu();
275277
#endif
276278
void Draw_Steps_Menu();
277-
#if HAS_HEATED_BED
279+
#if ENABLED(PIDTEMPBED)
278280
void Draw_BedPID_Menu();
279281
#endif
280282
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)

Marlin/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,16 @@ void DGUSTxHandler::PIDKp(DGUS_VP &vp) {
421421
default: return;
422422
#if ENABLED(PIDTEMPBED)
423423
case DGUS_Data::Heater::BED:
424-
value = ExtUI::getBedPIDValues_Kp();
424+
value = ExtUI::getBedPID_Kp();
425425
break;
426426
#endif
427427
#if ENABLED(PIDTEMP)
428428
case DGUS_Data::Heater::H0:
429-
value = ExtUI::getPIDValues_Kp(ExtUI::E0);
429+
value = ExtUI::getPID_Kp(ExtUI::E0);
430430
break;
431431
#if HAS_MULTI_HOTEND
432432
case DGUS_Data::Heater::H1:
433-
value = ExtUI::getPIDValues_Kp(ExtUI::E1);
433+
value = ExtUI::getPID_Kp(ExtUI::E1);
434434
break;
435435
#endif
436436
#endif
@@ -447,16 +447,16 @@ void DGUSTxHandler::PIDKi(DGUS_VP &vp) {
447447
default: return;
448448
#if ENABLED(PIDTEMPBED)
449449
case DGUS_Data::Heater::BED:
450-
value = ExtUI::getBedPIDValues_Ki();
450+
value = ExtUI::getBedPID_Ki();
451451
break;
452452
#endif
453453
#if ENABLED(PIDTEMP)
454454
case DGUS_Data::Heater::H0:
455-
value = ExtUI::getPIDValues_Ki(ExtUI::E0);
455+
value = ExtUI::getPID_Ki(ExtUI::E0);
456456
break;
457457
#if HAS_MULTI_HOTEND
458458
case DGUS_Data::Heater::H1:
459-
value = ExtUI::getPIDValues_Ki(ExtUI::E1);
459+
value = ExtUI::getPID_Ki(ExtUI::E1);
460460
break;
461461
#endif
462462
#endif
@@ -473,16 +473,16 @@ void DGUSTxHandler::PIDKd(DGUS_VP &vp) {
473473
default: return;
474474
#if ENABLED(PIDTEMPBED)
475475
case DGUS_Data::Heater::BED:
476-
value = ExtUI::getBedPIDValues_Kd();
476+
value = ExtUI::getBedPID_Kd();
477477
break;
478478
#endif
479479
#if ENABLED(PIDTEMP)
480480
case DGUS_Data::Heater::H0:
481-
value = ExtUI::getPIDValues_Kd(ExtUI::E0);
481+
value = ExtUI::getPID_Kd(ExtUI::E0);
482482
break;
483483
#if HAS_MULTI_HOTEND
484484
case DGUS_Data::Heater::H1:
485-
value = ExtUI::getPIDValues_Kd(ExtUI::E1);
485+
value = ExtUI::getPID_Kd(ExtUI::E1);
486486
break;
487487
#endif
488488
#endif

Marlin/Marlin/src/lcd/extui/nextion/nextion_tft.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,17 @@ void NextionTFT::PanelInfo(uint8_t req) {
459459

460460
case 37: // PID
461461
#if ENABLED(PIDTEMP)
462-
#define SEND_PID_INFO_0(A, B) SEND_VALasTXT(A, getPIDValues_K##B(E0))
462+
#define SEND_PID_INFO_0(A, B) SEND_VALasTXT(A, getPID_K##B(E0))
463463
#else
464464
#define SEND_PID_INFO_0(A, B) SEND_NA(A)
465465
#endif
466466
#if BOTH(PIDTEMP, HAS_MULTI_EXTRUDER)
467-
#define SEND_PID_INFO_1(A, B) SEND_VALasTXT(A, getPIDValues_K##B(E1))
467+
#define SEND_PID_INFO_1(A, B) SEND_VALasTXT(A, getPID_K##B(E1))
468468
#else
469469
#define SEND_PID_INFO_1(A, B) SEND_NA(A)
470470
#endif
471471
#if ENABLED(PIDTEMPBED)
472-
#define SEND_PID_INFO_BED(A, B) SEND_VALasTXT(A, getBedPIDValues_K##B())
472+
#define SEND_PID_INFO_BED(A, B) SEND_VALasTXT(A, getBedPID_K##B())
473473
#else
474474
#define SEND_PID_INFO_BED(A, B) SEND_NA(A)
475475
#endif

Marlin/Marlin/src/lcd/extui/ui_api.cpp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -946,32 +946,26 @@ namespace ExtUI {
946946
float getFeedrate_percent() { return feedrate_percentage; }
947947

948948
#if ENABLED(PIDTEMP)
949-
float getPIDValues_Kp(const extruder_t tool) { return PID_PARAM(Kp, tool); }
950-
float getPIDValues_Ki(const extruder_t tool) { return unscalePID_i(PID_PARAM(Ki, tool)); }
951-
float getPIDValues_Kd(const extruder_t tool) { return unscalePID_d(PID_PARAM(Kd, tool)); }
952-
953-
void setPIDValues(const_float_t p, const_float_t i, const_float_t d, extruder_t tool) {
954-
thermalManager.temp_hotend[tool].pid.Kp = p;
955-
thermalManager.temp_hotend[tool].pid.Ki = scalePID_i(i);
956-
thermalManager.temp_hotend[tool].pid.Kd = scalePID_d(d);
957-
thermalManager.updatePID();
949+
float getPID_Kp(const extruder_t tool) { return thermalManager.temp_hotend[tool].pid.p(); }
950+
float getPID_Ki(const extruder_t tool) { return thermalManager.temp_hotend[tool].pid.i(); }
951+
float getPID_Kd(const extruder_t tool) { return thermalManager.temp_hotend[tool].pid.d(); }
952+
953+
void setPID(const_float_t p, const_float_t i, const_float_t d, extruder_t tool) {
954+
thermalManager.setPID(uint8_t(tool), p, i, d);
958955
}
959956

960957
void startPIDTune(const celsius_t temp, extruder_t tool) {
961-
thermalManager.PID_autotune(temp, (heater_id_t)tool, 8, true);
958+
thermalManager.PID_autotune(temp, heater_id_t(tool), 8, true);
962959
}
963960
#endif
964961

965962
#if ENABLED(PIDTEMPBED)
966-
float getBedPIDValues_Kp() { return thermalManager.temp_bed.pid.Kp; }
967-
float getBedPIDValues_Ki() { return unscalePID_i(thermalManager.temp_bed.pid.Ki); }
968-
float getBedPIDValues_Kd() { return unscalePID_d(thermalManager.temp_bed.pid.Kd); }
969-
970-
void setBedPIDValues(const_float_t p, const_float_t i, const_float_t d) {
971-
thermalManager.temp_bed.pid.Kp = p;
972-
thermalManager.temp_bed.pid.Ki = scalePID_i(i);
973-
thermalManager.temp_bed.pid.Kd = scalePID_d(d);
974-
thermalManager.updatePID();
963+
float getBedPID_Kp() { return thermalManager.temp_bed.pid.p(); }
964+
float getBedPID_Ki() { return thermalManager.temp_bed.pid.i(); }
965+
float getBedPID_Kd() { return thermalManager.temp_bed.pid.d(); }
966+
967+
void setBedPID(const_float_t p, const_float_t i, const_float_t d) {
968+
thermalManager.temp_bed.pid.set(p, i, d);
975969
}
976970

977971
void startBedPIDTune(const celsius_t temp) {

0 commit comments

Comments
 (0)