//automatic temperature: just for testing, this is very dangerous, keep disabled!
// not working yet.
-//Erik: the settings currently depend dramatically on skeinforge39 or 41.
//#define AUTOTEMP
-#define AUTOTEMP_MIN 190
-#define AUTOTEMP_MAX 260
-#define AUTOTEMP_FACTOR 1000. //current target temperature= min+largest buffered espeeds)*FACTOR
+#ifdef AUTOTEMP
+ #define AUTOTEMP_OLDWEIGHT 0.98
+#endif
const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
#ifdef AUTOTEMP
void getHighESpeed()
{
+ static float oldt=0;
if(!autotemp_enabled)
return;
if(degTargetHotend0()+2<autotemp_min) //probably temperature set to zero.
}
float g=autotemp_min+high*autotemp_factor;
- float t=constrain(autotemp_min,g,autotemp_max);
+ float t=g;
+ if(t<autotemp_min)
+ t=autotemp_min;
+ if(t>autotemp_max)
+ t=autotemp_max;
+ if(oldt>t)
+ {
+ t=AUTOTEMP_OLDWEIGHT*oldt+(1-AUTOTEMP_OLDWEIGHT)*t;
+ }
+ oldt=t;
setTargetHotend0(t);
- SERIAL_ECHO_START;
- SERIAL_ECHOPAIR("highe",high);
- SERIAL_ECHOPAIR(" t",t);
- SERIAL_ECHOLN("");
+// SERIAL_ECHO_START;
+// SERIAL_ECHOPAIR("highe",high);
+// SERIAL_ECHOPAIR(" t",t);
+// SERIAL_ECHOLN("");
}
#endif