MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / get_pid_output

Method get_pid_output

Marlin/src/module/temperature.cpp:1756–1778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1754 PIDRunner(TT &t) : tempinfo(t) { }
1755
1756 float get_pid_output(const uint8_t extr=0) {
1757 #if ENABLED(PID_OPENLOOP)
1758
1759 return constrain(tempinfo.target, 0, MAX_POW);
1760
1761 #else // !PID_OPENLOOP
1762
1763 float out = tempinfo.pid.get_pid_output(tempinfo.target, tempinfo.celsius);
1764
1765 #if ENABLED(PID_FAN_SCALING)
1766 out += tempinfo.pid.get_fan_scale_output(thermalManager.fan_speed[extr]);
1767 #endif
1768
1769 #if ENABLED(PID_EXTRUSION_SCALING)
1770 out += tempinfo.pid.get_extrusion_scale_output(
1771 extr == active_extruder, stepper.position(E_AXIS), planner.mm_per_step[E_AXIS], thermalManager.lpq_len
1772 );
1773 #endif
1774
1775 return constrain(out, tempinfo.pid.low(), tempinfo.pid.high());
1776
1777 #endif // !PID_OPENLOOP
1778 }
1779
1780 FORCE_INLINE void debug(const_celsius_float_t c, const_float_t pid_out, FSTR_P const name=nullptr, const int8_t index=-1) {
1781 if (TERN0(HAS_PID_DEBUG, thermalManager.pid_debug_flag)) {

Callers 3

get_pid_output_hotendMethod · 0.45
get_pid_output_bedMethod · 0.45

Calls 5

positionMethod · 0.80
get_fan_scale_outputMethod · 0.45
lowMethod · 0.45
highMethod · 0.45

Tested by

no test coverage detected