Skip to content
Permalink
Browse files

Fixed quickstoop and acounted for retract at end of gcode

EM-1593

Signed-off-by: Robin den Hertog <r.denhertog@ultimaker.com>
  • Loading branch information...
robinmdh authored and daid committed May 29, 2017
1 parent 03132a7 commit aa89f34a056a5192923e06842e4919ceedc933fd
Showing with 19 additions and 13 deletions.
  1. +13 −13 Marlin/UltiLCD2_menu_print.cpp
  2. +6 −0 Marlin/stepper.cpp
@@ -59,7 +59,7 @@ static void abortPrint()
char buffer[32];
if (card.sdprinting)
{
// we're not printing any more
// we're not printing any more
card.sdprinting = false;
}
//If we where paused, make sure we abort that pause. Else strange things happen: https://github.com/Ultimaker/Ultimaker2Marlin/issues/32
@@ -71,8 +71,11 @@ static void abortPrint()
if (primed)
{
// set up the end of print retraction
sprintf_P(buffer, PSTR("G92 E%i"), int(((float)END_OF_PRINT_RETRACTION) / volume_to_filament_length[active_extruder]));
sprintf_P(buffer, PSTR("G92 E%i"), int( ((float)END_OF_PRINT_RETRACTION) / volume_to_filament_length[active_extruder]) - (retracted ? retract_length : 0) );
enquecommand(buffer);
// since we have just parked the filament accounting for the retracted length, forget about any G10/G11 retractions that happened at end of this print.
retracted = false;

// perform the retraction at the standard retract speed
sprintf_P(buffer, PSTR("G1 F%i E0"), int(retract_feedrate));
enquecommand(buffer);
@@ -119,22 +122,19 @@ static void checkPrintFinished()

static void doStartPrint()
{
// zero the extruder position
current_position[E_AXIS] = 0.0;
plan_set_e_position(0);
primed = false;
position_error = false;

// since we are going to prime the nozzle, forget about any G10/G11 retractions that happened at end of previous print
retracted = false;
// zero the extruder position
current_position[E_AXIS] = 0.0;
plan_set_e_position(0);
primed = false;
position_error = false;

for(uint8_t e = 0; e<EXTRUDERS; e++)
{
if (!LCD_DETAIL_CACHE_MATERIAL(e))
{
// don't prime the extruder if it isn't used in the (Ulti)gcode
// traditional gcode files typically won't have the Material lines at start, so we won't prime for those
// Also, on dual/multi extrusion files, only prime the extruders that are used in the gcode-file.
// don't prime the extruder if it isn't used in the (Ulti)gcode
// traditional gcode files typically won't have the Material lines at start, so we won't prime for those
// Also, on dual/multi extrusion files, only prime the extruders that are used in the gcode-file.
continue;
}
active_extruder = e;
@@ -929,6 +929,12 @@ void quickStop()
plan_discard_current_block();
current_block = NULL;
ENABLE_STEPPER_DRIVER_INTERRUPT();
// NOT corrected for extruder offset as it works the wrong way in this version of marlin.
current_position[X_AXIS] = float(st_get_position(X_AXIS)) / axis_steps_per_unit[X_AXIS];
current_position[Y_AXIS] = float(st_get_position(Y_AXIS)) / axis_steps_per_unit[Y_AXIS];
current_position[Z_AXIS] = float(st_get_position(Z_AXIS)) / axis_steps_per_unit[Z_AXIS];
current_position[E_AXIS] = float(st_get_position(E_AXIS)) / axis_steps_per_unit[E_AXIS];
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
}

void digitalPotWrite(int address, int value) // From Arduino DigitalPotControl example

3 comments on commit aa89f34

@TinkerGnome

This comment has been minimized.

Copy link
Contributor

TinkerGnome replied Aug 3, 2017

in quickstop() shouldn't the current filament diameter taken into account for the e-position? Something along these lines:
current_position[E_AXIS] = (float(st_get_position(E_AXIS))/axis_steps_per_unit[E_AXIS])/volume_to_filament_length[active_extruder];

@ckielstra

This comment has been minimized.

Copy link
Contributor

ckielstra replied Aug 7, 2017

An oversight indeed. Reported the bug in our internal bug logging system as EM-1793.

@Ghostkeeper

This comment has been minimized.

Copy link
Member

Ghostkeeper replied Mar 15, 2018

The oversight has been fixed by TinkerGnome's pull request.

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.