|
@@ -87,7 +87,10 @@ static float previous_speed[4]; // Speed of previous path line segment
|
87
|
87
|
static float previous_nominal_speed; // Nominal speed of previous path line segment
|
88
|
88
|
|
89
|
89
|
#ifdef AUTOTEMP
|
90
|
|
-float high_e_speed=0;
|
|
90
|
+ float autotemp_max=250;
|
|
91
|
+ float autotemp_min=210;
|
|
92
|
+ float autotemp_factor=1;
|
|
93
|
+ bool autotemp_enabled=false;
|
91
|
94
|
#endif
|
92
|
95
|
|
93
|
96
|
|
|
@@ -379,26 +382,29 @@ block_t *plan_get_current_block() {
|
379
|
382
|
#ifdef AUTOTEMP
|
380
|
383
|
void getHighESpeed()
|
381
|
384
|
{
|
382
|
|
- if(degTargetHotend0()+2<AUTOTEMP_MIN) //probably temperature set to zero.
|
|
385
|
+ if(!autotemp_enabled)
|
|
386
|
+ return;
|
|
387
|
+ if(degTargetHotend0()+2<autotemp_min) //probably temperature set to zero.
|
383
|
388
|
return; //do nothing
|
|
389
|
+
|
384
|
390
|
float high=0;
|
385
|
391
|
char block_index = block_buffer_tail;
|
386
|
392
|
|
387
|
393
|
while(block_index != block_buffer_head) {
|
388
|
|
- float se=block_buffer[block_index].speed_e;
|
|
394
|
+ float se=block_buffer[block_index].steps_e/float(block_buffer[block_index].step_event_count)*block_buffer[block_index].nominal_rate;
|
|
395
|
+ //se; units steps/sec;
|
389
|
396
|
if(se>high)
|
390
|
397
|
{
|
391
|
398
|
high=se;
|
392
|
399
|
}
|
393
|
400
|
block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1);
|
394
|
401
|
}
|
395
|
|
- high_e_speed=high*axis_steps_per_unit[E_AXIS]/(1000000.0); //so it is independent of the esteps/mm. before
|
396
|
402
|
|
397
|
|
- float g=AUTOTEMP_MIN+high_e_speed*AUTOTEMP_FACTOR;
|
398
|
|
- float t=constrain(AUTOTEMP_MIN,g,AUTOTEMP_MAX);
|
|
403
|
+ float g=autotemp_min+high*autotemp_factor;
|
|
404
|
+ float t=constrain(autotemp_min,g,autotemp_max);
|
399
|
405
|
setTargetHotend0(t);
|
400
|
406
|
SERIAL_ECHO_START;
|
401
|
|
- SERIAL_ECHOPAIR("highe",high_e_speed);
|
|
407
|
+ SERIAL_ECHOPAIR("highe",high);
|
402
|
408
|
SERIAL_ECHOPAIR(" t",t);
|
403
|
409
|
SERIAL_ECHOLN("");
|
404
|
410
|
}
|