|
|
@ -87,7 +87,10 @@ static float previous_speed[4]; // Speed of previous path line segment
|
|
|
|
static float previous_nominal_speed; // Nominal speed of previous path line segment
|
|
|
|
static float previous_nominal_speed; // Nominal speed of previous path line segment
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef AUTOTEMP
|
|
|
|
#ifdef AUTOTEMP
|
|
|
|
float high_e_speed=0;
|
|
|
|
float autotemp_max=250;
|
|
|
|
|
|
|
|
float autotemp_min=210;
|
|
|
|
|
|
|
|
float autotemp_factor=1;
|
|
|
|
|
|
|
|
bool autotemp_enabled=false;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -379,26 +382,29 @@ block_t *plan_get_current_block() {
|
|
|
|
#ifdef AUTOTEMP
|
|
|
|
#ifdef AUTOTEMP
|
|
|
|
void getHighESpeed()
|
|
|
|
void getHighESpeed()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(degTargetHotend0()+2<AUTOTEMP_MIN) //probably temperature set to zero.
|
|
|
|
if(!autotemp_enabled)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(degTargetHotend0()+2<autotemp_min) //probably temperature set to zero.
|
|
|
|
return; //do nothing
|
|
|
|
return; //do nothing
|
|
|
|
|
|
|
|
|
|
|
|
float high=0;
|
|
|
|
float high=0;
|
|
|
|
char block_index = block_buffer_tail;
|
|
|
|
char block_index = block_buffer_tail;
|
|
|
|
|
|
|
|
|
|
|
|
while(block_index != block_buffer_head) {
|
|
|
|
while(block_index != block_buffer_head) {
|
|
|
|
float se=block_buffer[block_index].speed_e;
|
|
|
|
float se=block_buffer[block_index].steps_e/float(block_buffer[block_index].step_event_count)*block_buffer[block_index].nominal_rate;
|
|
|
|
|
|
|
|
//se; units steps/sec;
|
|
|
|
if(se>high)
|
|
|
|
if(se>high)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
high=se;
|
|
|
|
high=se;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);
|
|
|
|
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 g=autotemp_min+high*autotemp_factor;
|
|
|
|
float t=constrain(AUTOTEMP_MIN,g,AUTOTEMP_MAX);
|
|
|
|
float t=constrain(autotemp_min,g,autotemp_max);
|
|
|
|
setTargetHotend0(t);
|
|
|
|
setTargetHotend0(t);
|
|
|
|
SERIAL_ECHO_START;
|
|
|
|
SERIAL_ECHO_START;
|
|
|
|
SERIAL_ECHOPAIR("highe",high_e_speed);
|
|
|
|
SERIAL_ECHOPAIR("highe",high);
|
|
|
|
SERIAL_ECHOPAIR(" t",t);
|
|
|
|
SERIAL_ECHOPAIR(" t",t);
|
|
|
|
SERIAL_ECHOLN("");
|
|
|
|
SERIAL_ECHOLN("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|