stop print during auto home and mesh bed leveling improved

This commit is contained in:
3d-gussner 2017-05-19 19:09:59 +02:00
parent 1fe5976daa
commit 67872b1027
3 changed files with 33 additions and 16 deletions

View File

@ -1892,7 +1892,6 @@ void trace() {
noTone(BEEPER); noTone(BEEPER);
delay(20); delay(20);
} }
/* /*
void ramming() { void ramming() {
// float tmp[4] = DEFAULT_MAX_FEEDRATE; // float tmp[4] = DEFAULT_MAX_FEEDRATE;
@ -1949,9 +1948,9 @@ void ramming() {
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3000 / 60, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3000 / 60, active_extruder);
st_synchronize(); st_synchronize();
//current_position[X_AXIS] += 23; //delay //current_position[X_AXIS] += 23; //delay
//plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], //current_position[E_AXIS], 600/60, active_extruder); //delay //plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600/60, active_extruder); //delay
//current_position[X_AXIS] -= 23; //delay //current_position[X_AXIS] -= 23; //delay
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600/60, active_extruder); //delay //plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600/60, active_extruder); //delay
delay(4700); delay(4700);
max_feedrate[E_AXIS] = 80; max_feedrate[E_AXIS] = 80;
current_position[E_AXIS] -= 92; current_position[E_AXIS] -= 92;
@ -2875,6 +2874,7 @@ void process_commands()
lcd_update(2); lcd_update(2);
} }
break; break;
@ -2938,20 +2938,33 @@ void process_commands()
// We don't know where we are! HOME! // We don't know where we are! HOME!
// Push the commands to the front of the message queue in the reverse order! // Push the commands to the front of the message queue in the reverse order!
// There shall be always enough space reserved for these commands. // There shall be always enough space reserved for these commands.
repeatcommand_front(); // repeat G80 with all its parameters if (lcd_commands_type != LCD_COMMAND_STOP_PRINT) {
enquecommand_front_P((PSTR("G28 W0"))); repeatcommand_front(); // repeat G80 with all its parameters
enquecommand_front_P((PSTR("G28 W0")));
}
else {
mesh_bed_leveling_flag = false;
}
break; break;
} }
if (run == false && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) { if (run == false && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) {
temp_compensation_start(); if (lcd_commands_type != LCD_COMMAND_STOP_PRINT) {
run = true; temp_compensation_start();
repeatcommand_front(); // repeat G80 with all its parameters run = true;
enquecommand_front_P((PSTR("G28 W0"))); repeatcommand_front(); // repeat G80 with all its parameters
enquecommand_front_P((PSTR("G28 W0")));
}
else {
mesh_bed_leveling_flag = false;
}
break; break;
} }
run = false; run = false;
if (lcd_commands_type == LCD_COMMAND_STOP_PRINT) {
mesh_bed_leveling_flag = false;
break;
}
// Save custom message state, set a new custom message state to display: Calibrating point 9. // Save custom message state, set a new custom message state to display: Calibrating point 9.
bool custom_message_old = custom_message; bool custom_message_old = custom_message;
unsigned int custom_message_type_old = custom_message_type; unsigned int custom_message_type_old = custom_message_type;

View File

@ -662,7 +662,7 @@ void lcd_commands()
cancel_heatup = true; cancel_heatup = true;
setTargetBed(0); setTargetBed(0);
#ifndef SNMM #ifndef SNMM
setTargetHotend(0, 0); //to heating when changing filament for multicolor setTargetHotend(0, 0); //heating when changing filament for multicolor
setTargetHotend(0, 1); setTargetHotend(0, 1);
setTargetHotend(0, 2); setTargetHotend(0, 2);
#endif #endif
@ -3807,18 +3807,21 @@ void lcd_sdcard_stop()
} }
if ((int32_t)encoderPosition == 2) if ((int32_t)encoderPosition == 2)
{ {
cancel_heatup = true; cancel_heatup = true;
#ifdef MESH_BED_LEVELING #ifdef MESH_BED_LEVELING
mbl.active = false; mbl.active = false;
#endif #endif
// Stop the stoppers, update the position from the stoppers. // Stop the stoppers, update the position from the stoppers.
planner_abort_hard(); if (mesh_bed_leveling_flag == false && homing_flag == false) {
// Because the planner_abort_hard() initialized current_position[Z] from the stepper, planner_abort_hard();
// Z baystep is no more applied. Reset it. // Because the planner_abort_hard() initialized current_position[Z] from the stepper,
babystep_reset(); // Z baystep is no more applied. Reset it.
babystep_reset();
}
// Clean the input command queue. // Clean the input command queue.
cmdqueue_reset(); cmdqueue_reset();
lcd_setstatuspgm(MSG_PRINT_ABORTED); lcd_setstatuspgm(MSG_PRINT_ABORTED);
lcd_update(2);
card.sdprinting = false; card.sdprinting = false;
card.closefile(); card.closefile();

View File

@ -978,6 +978,7 @@ static void lcd_implementation_status_screen()
lcd_printPGM(PSTR(": ")); lcd_printPGM(PSTR(": "));
lcd.print(custom_message_state); //seconds lcd.print(custom_message_state); //seconds
lcd.print(' '); lcd.print(' ');
} }
} }