// 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
#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
//===========================================================================
}
//======================================================================================
-#define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
#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)
{
Serial.begin(BAUDRATE);
SERIAL_ECHO_START;
- SERIAL_ECHOPGM("Marlin ");
SERIAL_ECHOLN(version_string);
SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START;
}
else
{
- LCD_MESSAGEPGM("Free move.");
st_synchronize();
+ LCD_MESSAGEPGM("Free move.");
disable_x();
disable_y();
disable_z();
// The current position of the tool in absolute steps\r
long position[4]; //rescaled from extern when axis_steps_per_unit are changed by gcode\r
\r
+#ifdef AUTOTEMP\r
+float high_e_speed=0;\r
+#endif\r
+\r
\r
//===========================================================================\r
//=============================private variables ============================\r
return(block);\r
}\r
\r
+#ifdef AUTOTEMP\r
+void getHighESpeed()\r
+{\r
+ if(degTargetHotend0()+2<AUTOTEMP_MIN) //probably temperature set to zero.\r
+ return; //do nothing\r
+ float high=0;\r
+ char block_index = block_buffer_tail;\r
+ \r
+ while(block_index != block_buffer_head) {\r
+ float se=block_buffer[block_index].speed_e;\r
+ if(se>high)\r
+ {\r
+ high=se;\r
+ }\r
+ block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);\r
+ }\r
+ high_e_speed=high*axis_steps_per_unit[E_AXIS]/(1000000.0); //so it is independent of the esteps/mm. before \r
+ \r
+ float g=AUTOTEMP_MIN+high_e_speed*AUTOTEMP_FACTOR;\r
+ float t=constrain(AUTOTEMP_MIN,g,AUTOTEMP_MAX);\r
+ setTargetHotend0(t);\r
+ SERIAL_ECHO_START;\r
+ SERIAL_ECHOPAIR("highe",high_e_speed);\r
+ SERIAL_ECHOPAIR(" t",t);\r
+ SERIAL_ECHOLN("");\r
+}\r
+#endif\r
+\r
void check_axes_activity() {\r
unsigned char x_active = 0;\r
unsigned char y_active = 0; \r
memcpy(position, target, sizeof(target)); // position[] = target[]\r
\r
planner_recalculate();\r
+ #ifdef AUTOTEMP\r
+ getHighESpeed();\r
+ #endif\r
st_wake_up();\r
}\r
\r
extern float max_z_jerk;\r
extern float mintravelfeedrate;\r
extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];\r
-\r
+#ifdef AUTOTEMP\r
+extern float high_e_speed;\r
+#endif\r
#endif\r
{\r
char ch=pgm_read_byte(message);\r
char *target=messagetext;\r
- while(ch)\r
+ uint8_t cnt=0;\r
+ while(ch &&cnt<LCD_WIDTH)\r
{\r
*target=ch;\r
target++;\r
+ cnt++;\r
ch=pgm_read_byte(++message);\r
}\r
}\r