Merge remote-tracking branch 'upstream/Marlin_v1' into Marlin_v1

This commit is contained in:
Robert F-C
2013-04-29 22:13:55 +10:00
260 changed files with 227045 additions and 1909 deletions

View File

@ -326,10 +326,10 @@ void manage_heater()
#ifndef PID_OPENLOOP
pid_error[e] = target_temperature[e] - pid_input;
if(pid_error[e] > PID_FUNCTIONAL_RANGE) {
pid_output = PID_MAX;
pid_output = BANG_MAX;
pid_reset[e] = true;
}
else if(pid_error[e] < -PID_FUNCTIONAL_RANGE) {
else if(pid_error[e] < -PID_FUNCTIONAL_RANGE || target_temperature[e] == 0) {
pid_output = 0;
pid_reset[e] = true;
}
@ -1177,3 +1177,31 @@ ISR(TIMER0_COMPB_vect)
#endif
}
}
#ifdef PIDTEMP
// Apply the scale factors to the PID values
float scalePID_i(float i)
{
return i*PID_dT;
}
float unscalePID_i(float i)
{
return i/PID_dT;
}
float scalePID_d(float d)
{
return d/PID_dT;
}
float unscalePID_d(float d)
{
return d*PID_dT;
}
#endif //PIDTEMP