Bläddra i källkod

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

Erik van der Zalm 13 år sedan
förälder
incheckning
e02af3e66a
3 ändrade filer med 22 tillägg och 11 borttagningar
  1. 3
    4
      Marlin/Configuration.h
  2. 4
    2
      Marlin/Marlin.pde
  3. 15
    5
      Marlin/planner.cpp

+ 3
- 4
Marlin/Configuration.h Visa fil

@@ -297,11 +297,10 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
297 297
 
298 298
 //automatic temperature: just for testing, this is very dangerous, keep disabled!
299 299
 // not working yet.
300
-//Erik: the settings currently depend dramatically on skeinforge39 or 41.
301 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 306
 const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement

+ 4
- 2
Marlin/Marlin.pde Visa fil

@@ -694,8 +694,10 @@ inline void process_commands()
694 694
       break;
695 695
     case 109: 
696 696
     {// M109 - Wait for extruder heater to reach target.
697
-        LCD_MESSAGEPGM("Heating...");
698
-        autotemp_enabled=false;
697
+        LCD_MESSAGEPGM("Heating...");   
698
+        #ifdef AUTOTEMP
699
+          autotemp_enabled=false;
700
+        #endif
699 701
         if (code_seen('S')) setTargetHotend0(code_value());
700 702
         #ifdef AUTOTEMP
701 703
           if (code_seen('S')) autotemp_min=code_value();

+ 15
- 5
Marlin/planner.cpp Visa fil

@@ -382,6 +382,7 @@ block_t *plan_get_current_block() {
382 382
 #ifdef AUTOTEMP
383 383
 void getHighESpeed()
384 384
 {
385
+  static float oldt=0;
385 386
   if(!autotemp_enabled)
386 387
     return;
387 388
   if(degTargetHotend0()+2<autotemp_min)  //probably temperature set to zero.
@@ -401,12 +402,21 @@ void getHighESpeed()
401 402
   }
402 403
    
403 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 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 421
 #endif
412 422
 

Laddar…
Avbryt
Spara