Browse Source

autotemp working, default=disabled.

Bernhard Kubicek 13 years ago
parent
commit
f52e1a9571
2 changed files with 18 additions and 9 deletions
  1. 3
    4
      Marlin/Configuration.h
  2. 15
    5
      Marlin/planner.cpp

+ 3
- 4
Marlin/Configuration.h View File

297
 
297
 
298
 //automatic temperature: just for testing, this is very dangerous, keep disabled!
298
 //automatic temperature: just for testing, this is very dangerous, keep disabled!
299
 // not working yet.
299
 // not working yet.
300
-//Erik: the settings currently depend dramatically on skeinforge39 or 41.
301
 //#define AUTOTEMP
300
 //#define AUTOTEMP
302
-#define AUTOTEMP_MIN 190
303
-#define AUTOTEMP_MAX 260
304
-#define AUTOTEMP_FACTOR 1000.  //current target temperature= min+largest buffered espeeds)*FACTOR
301
+#ifdef AUTOTEMP
302
+  #define AUTOTEMP_OLDWEIGHT 0.98
303
+#endif
305
 
304
 
306
 
305
 
307
 const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
306
 const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement

+ 15
- 5
Marlin/planner.cpp View File

382
 #ifdef AUTOTEMP
382
 #ifdef AUTOTEMP
383
 void getHighESpeed()
383
 void getHighESpeed()
384
 {
384
 {
385
+  static float oldt=0;
385
   if(!autotemp_enabled)
386
   if(!autotemp_enabled)
386
     return;
387
     return;
387
   if(degTargetHotend0()+2<autotemp_min)  //probably temperature set to zero.
388
   if(degTargetHotend0()+2<autotemp_min)  //probably temperature set to zero.
401
   }
402
   }
402
    
403
    
403
   float g=autotemp_min+high*autotemp_factor;
404
   float g=autotemp_min+high*autotemp_factor;
404
-  float t=constrain(autotemp_min,g,autotemp_max);
405
+  float t=g;
406
+  if(t<autotemp_min)
407
+    t=autotemp_min;
408
+  if(t>autotemp_max)
409
+    t=autotemp_max;
410
+  if(oldt>t)
411
+  {
412
+    t=AUTOTEMP_OLDWEIGHT*oldt+(1-AUTOTEMP_OLDWEIGHT)*t;
413
+  }
414
+  oldt=t;
405
   setTargetHotend0(t);
415
   setTargetHotend0(t);
406
-  SERIAL_ECHO_START;
407
-  SERIAL_ECHOPAIR("highe",high);
408
-  SERIAL_ECHOPAIR(" t",t);
409
-  SERIAL_ECHOLN("");
416
+//   SERIAL_ECHO_START;
417
+//   SERIAL_ECHOPAIR("highe",high);
418
+//   SERIAL_ECHOPAIR(" t",t);
419
+//   SERIAL_ECHOLN("");
410
 }
420
 }
411
 #endif
421
 #endif
412
 
422
 

Loading…
Cancel
Save