Skip to content

make hotend PIDTEMP optional in PID_autotune#28367

Open
ellensp wants to merge 1 commit intoMarlinFirmware:bugfix-2.1.xfrom
ellensp:update-PID_autotune
Open

make hotend PIDTEMP optional in PID_autotune#28367
ellensp wants to merge 1 commit intoMarlinFirmware:bugfix-2.1.xfrom
ellensp:update-PID_autotune

Conversation

@ellensp
Copy link
Copy Markdown
Contributor

@ellensp ellensp commented Mar 20, 2026

Description

Presently void Temperature::PID_autotune(const celsius_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result/*=false*/) assume a hotend exists and has pid values if anything has pid enabled.

If you set the following in Configuration.h

#define TEMP_SENSOR_0 0
#define PIDTEMPBED

PIDTEMP is auto undefined as it should be but PID_autotune assumes otherwise

resulting in errors:

Marlin/src/module/temperature.cpp:822:106: error: 'WATCH_TEMP_PERIOD' was not declared in this scope
       const uint16_t watch_temp_period = PER_WATCH_CBH(WATCH_CHAMBER_TEMP_PERIOD, WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD);

Marlin/src/module/temperature.cpp:823:111: error: 'WATCH_TEMP_INCREASE' was not declared in this scope
       const uint8_t watch_temp_increase = PER_WATCH_CBH(WATCH_CHAMBER_TEMP_INCREASE, WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE);

Marlin/src/module/temperature.cpp:824:108: error: 'TEMP_HYSTERESIS' was not declared in this scope
       const celsius_float_t watch_hysteresis = PER_WATCH_CBH(TEMP_CHAMBER_HYSTERESIS, TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS),

Marlin/src/module/temperature.cpp:835:62: error: 'hotend_max_target' was not declared in this scope
     if (target > PER_CBH(CHAMBER_MAX_TARGET, BED_MAX_TARGET, hotend_max_target(heater_id))) {

Marlin/src/module/temperature.cpp:809:70: error: 'temp_hotend' was not declared in this scope
     #define SET_CBH(F,V) PER_CBH(temp_chamber.F = V, temp_bed.F = V, temp_hotend[heater_id].F = V)

Requirements

#define TEMP_SENSOR_0 0
#define PIDTEMPBED

Benefits

Builds as expceted

@ellensp
Copy link
Copy Markdown
Contributor Author

ellensp commented Mar 20, 2026

Please check thoroughly, It seems correct but it's after midnight and my brain has turned into a pumpkin

@ellensp ellensp changed the title make hotend optional in PID_autotune make hotend PIDTEMP optional in PID_autotune Mar 20, 2026
@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 4 times, most recently from 1bc0732 to 72c7874 Compare March 27, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant