Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay Z-Axis on Autoload #4280

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3576,7 +3576,7 @@ static void gcode_M600(const bool automatic, const float x_position, const float
custom_message_type = CustomMsg::Status;
}

void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex){
void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){
FSensorBlockRunout fsBlockRunout;

prusa_statistics(22);
Expand All @@ -3592,6 +3592,10 @@ void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex){
current_position[E_AXIS] += fastLoadLength;
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence

if (raise_z_axis) { // backwards compatibility for 3.12 and older FW
raise_z_above(MIN_Z_FOR_LOAD);
gudnimg marked this conversation as resolved.
Show resolved Hide resolved
}

load_filament_final_feed(); // slow sequence
st_synchronize();

Expand Down Expand Up @@ -8769,13 +8773,12 @@ SERIAL_PROTOCOLPGM("\n\n");

// Z lift. For safety only allow positive values
if (code_seen('Z')) z_target = fabs(code_value());
else raise_z_above(MIN_Z_FOR_LOAD); // backwards compatibility for 3.12 and older FW


// Raise the Z axis
float delta = raise_z(z_target);

// Load filament
gcode_M701(fastLoadLength, mmuSlotIndex);
gcode_M701(fastLoadLength, mmuSlotIndex, !code_seen('Z')); // if no z -> trigger MIN_Z_FOR_LOAD for backwards compatibility on 3.12 and older FW

// Restore Z axis
raise_z(-delta);
Expand Down
3 changes: 0 additions & 3 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,6 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
// modified elsewhere and needs to be redrawn in full.

// reset bFilamentWaitingFlag immediately to avoid re-entry from raise_z_above()!
bool once = !bFilamentWaitingFlag;
bFilamentWaitingFlag = true;

// also force-enable lcd_draw_update (might be 0 when called from outside a menu)
Expand All @@ -2005,12 +2004,10 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
case FilamentAction::MmuLoad:
case FilamentAction::MmuLoadingTest:
lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD));
if (once) raise_z_above(MIN_Z_FOR_LOAD);
break;
case FilamentAction::UnLoad:
case FilamentAction::MmuUnLoad:
lcd_puts_P(_T(MSG_PREHEATING_TO_UNLOAD));
if (once) raise_z_above(MIN_Z_FOR_UNLOAD);
break;
case FilamentAction::MmuEject:
lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT));
Expand Down
Loading