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

This commit is contained in:
Erik van der Zalm 2011-11-19 17:23:47 +01:00
commit e02af3e66a
3 changed files with 22 additions and 11 deletions

View file

@ -297,11 +297,10 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
//automatic temperature: just for testing, this is very dangerous, keep disabled! //automatic temperature: just for testing, this is very dangerous, keep disabled!
// not working yet. // not working yet.
//Erik: the settings currently depend dramatically on skeinforge39 or 41.
//#define AUTOTEMP //#define AUTOTEMP
#define AUTOTEMP_MIN 190 #ifdef AUTOTEMP
#define AUTOTEMP_MAX 260 #define AUTOTEMP_OLDWEIGHT 0.98
#define AUTOTEMP_FACTOR 1000. //current target temperature= min+largest buffered espeeds)*FACTOR #endif
const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement

View file

@ -695,7 +695,9 @@ inline void process_commands()
case 109: case 109:
{// M109 - Wait for extruder heater to reach target. {// M109 - Wait for extruder heater to reach target.
LCD_MESSAGEPGM("Heating..."); LCD_MESSAGEPGM("Heating...");
#ifdef AUTOTEMP
autotemp_enabled=false; autotemp_enabled=false;
#endif
if (code_seen('S')) setTargetHotend0(code_value()); if (code_seen('S')) setTargetHotend0(code_value());
#ifdef AUTOTEMP #ifdef AUTOTEMP
if (code_seen('S')) autotemp_min=code_value(); if (code_seen('S')) autotemp_min=code_value();

View file

@ -382,6 +382,7 @@ block_t *plan_get_current_block() {
#ifdef AUTOTEMP #ifdef AUTOTEMP
void getHighESpeed() void getHighESpeed()
{ {
static float oldt=0;
if(!autotemp_enabled) if(!autotemp_enabled)
return; return;
if(degTargetHotend0()+2<autotemp_min) //probably temperature set to zero. if(degTargetHotend0()+2<autotemp_min) //probably temperature set to zero.
@ -401,12 +402,21 @@ void getHighESpeed()
} }
float g=autotemp_min+high*autotemp_factor; 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); setTargetHotend0(t);
SERIAL_ECHO_START; // SERIAL_ECHO_START;
SERIAL_ECHOPAIR("highe",high); // SERIAL_ECHOPAIR("highe",high);
SERIAL_ECHOPAIR(" t",t); // SERIAL_ECHOPAIR(" t",t);
SERIAL_ECHOLN(""); // SERIAL_ECHOLN("");
} }
#endif #endif