use just short movement for unloading filament

This commit is contained in:
PavelSindler 2018-12-17 21:25:07 +01:00
parent cb1f6d2a0e
commit 27c8612360
2 changed files with 7 additions and 8 deletions
Firmware

View file

@ -377,13 +377,6 @@ void mmu_load_step() {
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMU_LOAD_FEEDRATE, active_extruder);
st_synchronize();
}
void mmu_unload_step() {
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * 0.1;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMU_LOAD_FEEDRATE, active_extruder);
st_synchronize();
}
bool mmu_get_response(uint8_t move)
{
printf_P(PSTR("mmu_get_response - begin move:%d\n"), move);
@ -406,7 +399,11 @@ bool mmu_get_response(uint8_t move)
mmu_load_step();
break;
case MMU_UNLOAD_MOVE:
mmu_unload_step();
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMU_LOAD_FEEDRATE, active_extruder);
st_synchronize();
disable_e0(); //turn off E-stepper to prevent overheating and alow filament pull-out if necessary
move = MMU_NO_MOVE;
break;
case MMU_TCODE_MOVE: //first do unload and then continue with infinite loading
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME;
@ -414,6 +411,7 @@ bool mmu_get_response(uint8_t move)
st_synchronize();
move = MMU_LOAD_MOVE;
break;
case MMU_NO_MOVE:
default:
delay_keep_alive(100);
break;

View file

@ -17,6 +17,7 @@ extern int16_t mmu_buildnr;
#define MMU_FILAMENT_UNKNOWN 255
#define MMU_NO_MOVE 0
#define MMU_UNLOAD_MOVE 1
#define MMU_LOAD_MOVE 2
#define MMU_TCODE_MOVE 3