From 54ddc1d417ed41f98e4430c46c92d8b638cd1173 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Mon, 29 Jun 2015 15:26:09 -0500 Subject: [PATCH] Simplify DRY RUN (PR#2358) Elsewhere DRYRUN turns off the heating elements and ignores constraints on them. Here, whenever motion is entered into the planner, if DRY RUN is set, we instantly act as if the E_AXIS is in the desired final position. --- Marlin/planner.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 35753a7735..d9a52c0bc0 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -502,12 +502,17 @@ float junction_deviation = 0.1; float dx = target[X_AXIS] - position[X_AXIS], dy = target[Y_AXIS] - position[Y_AXIS], - dz = target[Z_AXIS] - position[Z_AXIS], - de = target[E_AXIS] - position[E_AXIS]; + dz = target[Z_AXIS] - position[Z_AXIS]; + + // DRYRUN ignores all temperature constraints and assures that the extruder is instantly satisfied + if (marlin_debug_flags & DEBUG_DRYRUN) + position[E_AXIS] = target[E_AXIS]; + + float de = target[E_AXIS] - position[E_AXIS]; #ifdef PREVENT_DANGEROUS_EXTRUDE if (de) { - if (degHotend(extruder) < extrude_min_temp && !(marlin_debug_flags & DEBUG_DRYRUN)) { + if (degHotend(extruder) < extrude_min_temp) { position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part de = 0; // no difference SERIAL_ECHO_START;