pTerm+=Kc*current_block->speed_e; //additional heating if extrusion speed is high\r
#endif\r
pid_output = constrain(pTerm + iTerm - dTerm, 0, PID_MAX);\r
- HeaterPower=pid_output;\r
+ \r
}\r
#endif //PID_OPENLOOP\r
#ifdef PID_DEBUG\r
//SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm); \r
#endif //PID_DEBUG\r
+ HeaterPower=pid_output;\r
analogWrite(HEATER_0_PIN, pid_output);\r
#endif //PIDTEMP\r
\r
\r
return (1023 * OVERSAMPLENR) - raw;\r
#elif defined BED_USES_AD595\r
- return celsius * (1024.0 / (5.0 * 100.0) ) * OVERSAMPLENR;\r
+ return lround(celsius * (1024.0 * OVERSAMPLENR/ (5.0 * 100.0) ) );\r
#endif\r
}\r
\r