Skip to content

Commit

Permalink
Change SD Card Pause position to Xmin, Ymin
Browse files Browse the repository at this point in the history
Change SD Card Pause position to Xmin, Ymin and save  which extruder is
in use for 2.0 to restore the correct one in case there is some extruder
change like when loading/unloading
  • Loading branch information
Luc committed Feb 17, 2015
1 parent d4ba5db commit 26f38ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/ArduinoDUE/Repetier/Printer.h
Expand Up @@ -101,6 +101,9 @@ class Printer
static int32_t currentPositionSteps[E_AXIS_ARRAY]; ///< Position in steps from origin.
static float currentPosition[Z_AXIS_ARRAY];
static float lastCmdPos[Z_AXIS_ARRAY]; ///< Last coordinates send by gcodes
#if NUM_EXTRUDER>1
static uint lastextruderID;
#endif
static int32_t destinationSteps[E_AXIS_ARRAY]; ///< Target position in steps.
static float extrudeMultiplyError;
#if NONLINEAR_SYSTEM
Expand Down
16 changes: 12 additions & 4 deletions src/ArduinoDUE/Repetier/SDCard.cpp
Expand Up @@ -171,16 +171,21 @@ void SDCard::pausePrint(bool intern)
Printer::moveToReal(IGNORE_COORDINATE, IGNORE_COORDINATE, IGNORE_COORDINATE,
Printer::memoryE - RETRACT_ON_PAUSE,
Printer::maxFeedrate[E_AXIS] / 2);
//save position and extruder ID
#if NUM_EXTRUDER>1
Printer::lastextruderID=Extruder::current->id;
Extruder::selectExtruderById(0);
#endif
Printer::lastCmdPos[X_AXIS] = Printer::currentPosition[X_AXIS];
Printer::lastCmdPos[Y_AXIS] = Printer::currentPosition[Y_AXIS];
Printer::lastCmdPos[Z_AXIS] = Printer::currentPosition[Z_AXIS];
#if DRIVE_SYSTEM == DELTA
Printer::moveToReal(0, 0.9 * EEPROM::deltaMaxRadius(), IGNORE_COORDINATE, IGNORE_COORDINATE, Printer::maxFeedrate[X_AXIS]);
#else
if (Printer::lastCmdPos[Z_AXIS]+10<Printer::zMin+Printer::zLength)
Printer::moveToReal(IGNORE_COORDINATE,IGNORE_COORDINATE,Printer::lastCmdPos[Z_AXIS]+10,IGNORE_COORDINATE,Printer::homingFeedrate[Z_AXIS]);
Printer::moveToReal(Printer::xMin,Printer::yMin + Printer::yLength,IGNORE_COORDINATE,IGNORE_COORDINATE,Printer::homingFeedrate[X_AXIS]);
Printer::moveToReal(Printer::xMin,Printer::yMin,IGNORE_COORDINATE,IGNORE_COORDINATE,Printer::homingFeedrate[X_AXIS]);
#endif
Printer::lastCmdPos[X_AXIS] = Printer::currentPosition[X_AXIS];
Printer::lastCmdPos[Y_AXIS] = Printer::currentPosition[Y_AXIS];
Printer::lastCmdPos[Z_AXIS] = Printer::currentPosition[Z_AXIS];
GCode::executeFString(PSTR(PAUSE_START_COMMANDS));
}
}
Expand All @@ -189,6 +194,9 @@ void SDCard::continuePrint(bool intern)
{
if(!sd.sdactive) return;
if(intern) {
#if NUM_EXTRUDER>1
Extruder::selectExtruderById(Printer::lastextruderID);
#endif
GCode::executeFString(PSTR(PAUSE_END_COMMANDS));
Printer::GoToMemoryPosition(true, true, false, false, Printer::maxFeedrate[X_AXIS]);
Printer::GoToMemoryPosition(false, false, true, false, Printer::maxFeedrate[Z_AXIS] / 2.0f);
Expand Down

2 comments on commit 26f38ef

@Nepenthy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for this Luc! That pause position didnt make sense to me in any condition.

@luc-github
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so many small changes need to be done, just need to find some time to do them compare to big changes, no mention that need to trigger if some repetier changes are applicable or not ...

Please sign in to comment.