| 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)) { |
no test coverage detected