diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index f44c858b9a81e3e6f191e150a761355ba6948680..8661ae438e78afd285434d87752b0b730f3fb0a5 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -119,7 +119,7 @@
   // if Kc is choosen well, the additional required power due to increased melting should be compensated.
   #define PID_ADD_EXTRUSION_RATE  
   #ifdef PID_ADD_EXTRUSION_RATE
-    #define  DEFAULT_Kc (5) //heatingpower=Kc*(e_speed)
+    #define  DEFAULT_Kc (3) //heatingpower=Kc*(e_speed)
   #endif
 #endif // PIDTEMP
 
@@ -275,6 +275,16 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
 #define N_ARC_CORRECTION 25
 
 
+//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
+
+
+
 const int dropsegments=0; //everything with less than this number of steps  will be ignored as move and joined with the next movement
 
 //===========================================================================
diff --git a/Marlin/EEPROMwrite.h b/Marlin/EEPROMwrite.h
index fcb3d8d3914cc3fa41cb31ac4ba9b9bc27173062..3d8a0b2b9eb2a9e4ef0712f460ac0ee59d5d7ee4 100644
--- a/Marlin/EEPROMwrite.h
+++ b/Marlin/EEPROMwrite.h
@@ -25,7 +25,6 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
 }
 //======================================================================================
 
-#define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
 
 
 
diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
index 1e36b61e88d1e8c7b027d628e0523aaafd9110b2..e14471264f24a01b3845089301d8030158e12e8c 100644
--- a/Marlin/Marlin.h
+++ b/Marlin/Marlin.h
@@ -35,6 +35,9 @@ const char echomagic[] PROGMEM ="echo:";
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
 #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
 
+#define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
+
+
 //things to write to serial from Programmemory. saves 400 to 2k of RAM.
 #define SerialprintPGM(x) serialprintPGM(PSTR(x))
 inline void serialprintPGM(const char *str)
diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde
index dee095d84fd9dbbf5553d00d7e079f7b1460457d..672591a72d1aa0ea81b982eb7363f117663f50d5 100644
--- a/Marlin/Marlin.pde
+++ b/Marlin/Marlin.pde
@@ -211,7 +211,6 @@ void setup()
 { 
   Serial.begin(BAUDRATE);
   SERIAL_ECHO_START;
-  SERIAL_ECHOPGM("Marlin ");
   SERIAL_ECHOLN(version_string);
   SERIAL_PROTOCOLLNPGM("start");
   SERIAL_ECHO_START;
@@ -785,8 +784,8 @@ inline void process_commands()
       }
       else
       { 
-        LCD_MESSAGEPGM("Free move.");
         st_synchronize(); 
+        LCD_MESSAGEPGM("Free move.");
         disable_x(); 
         disable_y(); 
         disable_z(); 
diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp
index 34e29ff53561c41ff4fbb0477fb7378ec8e93f68..863b116a5bc5fbf5e4d742663486dc5791702260 100644
--- a/Marlin/planner.cpp
+++ b/Marlin/planner.cpp
@@ -84,6 +84,10 @@ unsigned long axis_steps_per_sqr_second[NUM_AXIS];
 // The current position of the tool in absolute steps
 long position[4];   //rescaled from extern when axis_steps_per_unit are changed by gcode
 
+#ifdef AUTOTEMP
+float high_e_speed=0;
+#endif
+
 
 //===========================================================================
 //=============================private variables ============================
@@ -363,6 +367,34 @@ block_t *plan_get_current_block() {
   return(block);
 }
 
+#ifdef AUTOTEMP
+void getHighESpeed()
+{
+  if(degTargetHotend0()+2<AUTOTEMP_MIN)  //probably temperature set to zero.
+    return; //do nothing
+  float high=0;
+  char block_index = block_buffer_tail;
+  
+  while(block_index != block_buffer_head) {
+    float se=block_buffer[block_index].speed_e;
+    if(se>high)
+    {
+      high=se;
+    }
+    block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);
+  }
+  high_e_speed=high*axis_steps_per_unit[E_AXIS]/(1000000.0);  //so it is independent of the esteps/mm. before 
+   
+  float g=AUTOTEMP_MIN+high_e_speed*AUTOTEMP_FACTOR;
+  float t=constrain(AUTOTEMP_MIN,g,AUTOTEMP_MAX);
+  setTargetHotend0(t);
+  SERIAL_ECHO_START;
+  SERIAL_ECHOPAIR("highe",high_e_speed);
+  SERIAL_ECHOPAIR(" t",t);
+  SERIAL_ECHOLN("");
+}
+#endif
+
 void check_axes_activity() {
   unsigned char x_active = 0;
   unsigned char y_active = 0;  
@@ -581,6 +613,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
   memcpy(position, target, sizeof(target)); // position[] = target[]
 
   planner_recalculate();
+  #ifdef AUTOTEMP
+    getHighESpeed();
+  #endif
   st_wake_up();
 }
 
diff --git a/Marlin/planner.h b/Marlin/planner.h
index 79f54d879f8d2b874dfa315be5ffbd77c52cda9d..c5bc5b8aaf456d8f7bc90ad6d2e01bc33037a19c 100644
--- a/Marlin/planner.h
+++ b/Marlin/planner.h
@@ -89,5 +89,7 @@ extern float max_xy_jerk; //speed than can be stopped at once, if i understand c
 extern float max_z_jerk;
 extern float mintravelfeedrate;
 extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];
-
+#ifdef AUTOTEMP
+extern float high_e_speed;
+#endif
 #endif
diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde
index 59edb34702cd0c0cb739d90f133c07e4075aa470..d95167166d43c1f902ad9c14291f29c7138b1a09 100644
--- a/Marlin/ultralcd.pde
+++ b/Marlin/ultralcd.pde
@@ -71,10 +71,12 @@ void lcd_statuspgm(const char* message)
 {
   char ch=pgm_read_byte(message);
   char *target=messagetext;
-  while(ch)
+  uint8_t cnt=0;
+  while(ch &&cnt<LCD_WIDTH)
   {
     *target=ch;
     target++;
+    cnt++;
     ch=pgm_read_byte(++message);
   }
 }