|
@@ -297,17 +297,14 @@ float zprobe_zoffset;
|
|
|
|
|
|
// Extruder offset
|
|
// Extruder offset
|
|
#if EXTRUDERS > 1
|
|
#if EXTRUDERS > 1
|
|
-#ifndef DUAL_X_CARRIAGE
|
|
|
|
#define NUM_EXTRUDER_OFFSETS 2 // only in XY plane
|
|
#define NUM_EXTRUDER_OFFSETS 2 // only in XY plane
|
|
-#else
|
|
|
|
- #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane
|
|
|
|
-#endif
|
|
|
|
float extruder_offset[NUM_EXTRUDER_OFFSETS][EXTRUDERS] = {
|
|
float extruder_offset[NUM_EXTRUDER_OFFSETS][EXTRUDERS] = {
|
|
#if defined(EXTRUDER_OFFSET_X) && defined(EXTRUDER_OFFSET_Y)
|
|
#if defined(EXTRUDER_OFFSET_X) && defined(EXTRUDER_OFFSET_Y)
|
|
EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y
|
|
EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y
|
|
#endif
|
|
#endif
|
|
};
|
|
};
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
uint8_t active_extruder = 0;
|
|
uint8_t active_extruder = 0;
|
|
int fanSpeed=0;
|
|
int fanSpeed=0;
|
|
|
|
|
|
@@ -1282,64 +1279,7 @@ XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH);
|
|
XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
|
|
XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
|
|
XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
|
|
XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
|
|
|
|
|
|
-#ifdef DUAL_X_CARRIAGE
|
|
|
|
- #if EXTRUDERS == 1 || defined(COREXY) \
|
|
|
|
- || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
|
|
|
|
- || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
|
|
|
|
- || !defined(X_MAX_PIN) || X_MAX_PIN < 0
|
|
|
|
- #error "Missing or invalid definitions for DUAL_X_CARRIAGE mode."
|
|
|
|
- #endif
|
|
|
|
- #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
|
|
|
|
- #error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
|
|
|
|
- #endif
|
|
|
|
-
|
|
|
|
-#define DXC_FULL_CONTROL_MODE 0
|
|
|
|
-#define DXC_AUTO_PARK_MODE 1
|
|
|
|
-#define DXC_DUPLICATION_MODE 2
|
|
|
|
-static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
|
|
|
-
|
|
|
|
-static float x_home_pos(int extruder) {
|
|
|
|
- if (extruder == 0)
|
|
|
|
- return base_home_pos(X_AXIS) + add_homing[X_AXIS];
|
|
|
|
- else
|
|
|
|
- // In dual carriage mode the extruder offset provides an override of the
|
|
|
|
- // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
|
|
|
|
- // This allow soft recalibration of the second extruder offset position without firmware reflash
|
|
|
|
- // (through the M218 command).
|
|
|
|
- return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int x_home_dir(int extruder) {
|
|
|
|
- return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
|
|
|
|
-static bool active_extruder_parked = false; // used in mode 1 & 2
|
|
|
|
-static float raised_parked_position[NUM_AXIS]; // used in mode 1
|
|
|
|
-static unsigned long delayed_move_time = 0; // used in mode 1
|
|
|
|
-static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
|
|
|
|
-static float duplicate_extruder_temp_offset = 0; // used in mode 2
|
|
|
|
-bool extruder_duplication_enabled = false; // used in mode 2
|
|
|
|
-#endif //DUAL_X_CARRIAGE
|
|
|
|
-
|
|
|
|
static void axis_is_at_home(int axis) {
|
|
static void axis_is_at_home(int axis) {
|
|
-#ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (axis == X_AXIS) {
|
|
|
|
- if (active_extruder != 0) {
|
|
|
|
- current_position[X_AXIS] = x_home_pos(active_extruder);
|
|
|
|
- min_pos[X_AXIS] = X2_MIN_POS;
|
|
|
|
- max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
|
|
|
|
- current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homing[X_AXIS];
|
|
|
|
- min_pos[X_AXIS] = base_min_pos(X_AXIS) + add_homing[X_AXIS];
|
|
|
|
- max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + add_homing[X_AXIS],
|
|
|
|
- max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
current_position[axis] = base_home_pos(axis) + add_homing[axis];
|
|
current_position[axis] = base_home_pos(axis) + add_homing[axis];
|
|
min_pos[axis] = base_min_pos(axis) + add_homing[axis];
|
|
min_pos[axis] = base_min_pos(axis) + add_homing[axis];
|
|
max_pos[axis] = base_max_pos(axis) + add_homing[axis];
|
|
max_pos[axis] = base_max_pos(axis) + add_homing[axis];
|
|
@@ -1511,10 +1451,6 @@ void homeaxis(int axis) {
|
|
axis==Z_AXIS ? HOMEAXIS_DO(Z) :
|
|
axis==Z_AXIS ? HOMEAXIS_DO(Z) :
|
|
0) {
|
|
0) {
|
|
int axis_home_dir = home_dir(axis);
|
|
int axis_home_dir = home_dir(axis);
|
|
-#ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (axis == X_AXIS)
|
|
|
|
- axis_home_dir = x_home_dir(active_extruder);
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
current_position[axis] = 0;
|
|
current_position[axis] = 0;
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
@@ -1938,12 +1874,7 @@ void process_commands()
|
|
{
|
|
{
|
|
current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
|
|
current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
|
|
|
|
|
|
- #ifndef DUAL_X_CARRIAGE
|
|
|
|
int x_axis_home_dir = home_dir(X_AXIS);
|
|
int x_axis_home_dir = home_dir(X_AXIS);
|
|
- #else
|
|
|
|
- int x_axis_home_dir = x_home_dir(active_extruder);
|
|
|
|
- extruder_duplication_enabled = false;
|
|
|
|
- #endif
|
|
|
|
|
|
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
|
destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
|
@@ -1980,40 +1911,16 @@ void process_commands()
|
|
}
|
|
}
|
|
|
|
|
|
if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
|
|
if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
|
|
- {
|
|
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- int tmp_extruder = active_extruder;
|
|
|
|
- extruder_duplication_enabled = false;
|
|
|
|
- active_extruder = !active_extruder;
|
|
|
|
- homeaxis(X_AXIS);
|
|
|
|
- inactive_extruder_x_pos = current_position[X_AXIS];
|
|
|
|
- active_extruder = tmp_extruder;
|
|
|
|
- homeaxis(X_AXIS);
|
|
|
|
- // reset state used by the different modes
|
|
|
|
- memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
|
|
|
|
- delayed_move_time = 0;
|
|
|
|
- active_extruder_parked = true;
|
|
|
|
- #else
|
|
|
|
homeaxis(X_AXIS);
|
|
homeaxis(X_AXIS);
|
|
- #endif
|
|
|
|
- }
|
|
|
|
|
|
|
|
- if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
|
|
|
|
|
|
+ if((home_all_axis) || (code_seen(axis_codes[Y_AXIS])))
|
|
homeaxis(Y_AXIS);
|
|
homeaxis(Y_AXIS);
|
|
- }
|
|
|
|
|
|
|
|
- if(code_seen(axis_codes[X_AXIS]))
|
|
|
|
- {
|
|
|
|
- if(code_value_long() != 0) {
|
|
|
|
- current_position[X_AXIS]=code_value()+add_homing[X_AXIS];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if(code_seen(axis_codes[X_AXIS]) && code_value_long() != 0)
|
|
|
|
+ current_position[X_AXIS]=code_value()+add_homing[X_AXIS];
|
|
|
|
|
|
- if(code_seen(axis_codes[Y_AXIS])) {
|
|
|
|
- if(code_value_long() != 0) {
|
|
|
|
- current_position[Y_AXIS]=code_value()+add_homing[Y_AXIS];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if(code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0)
|
|
|
|
+ current_position[Y_AXIS]=code_value()+add_homing[Y_AXIS];
|
|
|
|
|
|
#if Z_HOME_DIR < 0 // If homing towards BED do Z last
|
|
#if Z_HOME_DIR < 0 // If homing towards BED do Z last
|
|
#ifndef Z_SAFE_HOMING
|
|
#ifndef Z_SAFE_HOMING
|
|
@@ -3189,10 +3096,6 @@ Sigma_Exit:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
|
|
if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
|
|
-#ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
|
|
|
|
- setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
|
|
|
|
-#endif
|
|
|
|
setWatch();
|
|
setWatch();
|
|
break;
|
|
break;
|
|
case 112: // M112 -Emergency Stop
|
|
case 112: // M112 -Emergency Stop
|
|
@@ -3278,17 +3181,9 @@ Sigma_Exit:
|
|
#endif
|
|
#endif
|
|
if (code_seen('S')) {
|
|
if (code_seen('S')) {
|
|
setTargetHotend(code_value(), tmp_extruder);
|
|
setTargetHotend(code_value(), tmp_extruder);
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
|
|
|
|
- setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
|
|
|
|
- #endif
|
|
|
|
CooldownNoWait = true;
|
|
CooldownNoWait = true;
|
|
} else if (code_seen('R')) {
|
|
} else if (code_seen('R')) {
|
|
setTargetHotend(code_value(), tmp_extruder);
|
|
setTargetHotend(code_value(), tmp_extruder);
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
|
|
|
|
- setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
|
|
|
|
- #endif
|
|
|
|
CooldownNoWait = false;
|
|
CooldownNoWait = false;
|
|
}
|
|
}
|
|
#ifdef AUTOTEMP
|
|
#ifdef AUTOTEMP
|
|
@@ -3820,12 +3715,6 @@ Sigma_Exit:
|
|
{
|
|
{
|
|
extruder_offset[Y_AXIS][tmp_extruder] = code_value();
|
|
extruder_offset[Y_AXIS][tmp_extruder] = code_value();
|
|
}
|
|
}
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- if(code_seen('Z'))
|
|
|
|
- {
|
|
|
|
- extruder_offset[Z_AXIS][tmp_extruder] = code_value();
|
|
|
|
- }
|
|
|
|
- #endif
|
|
|
|
SERIAL_ECHO_START;
|
|
SERIAL_ECHO_START;
|
|
SERIAL_ECHORPGM(MSG_HOTEND_OFFSET);
|
|
SERIAL_ECHORPGM(MSG_HOTEND_OFFSET);
|
|
for(tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++)
|
|
for(tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++)
|
|
@@ -3834,10 +3723,6 @@ Sigma_Exit:
|
|
SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]);
|
|
SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]);
|
|
SERIAL_ECHO(",");
|
|
SERIAL_ECHO(",");
|
|
SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]);
|
|
SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]);
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- SERIAL_ECHO(",");
|
|
|
|
- SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
|
|
|
|
- #endif
|
|
|
|
}
|
|
}
|
|
SERIAL_ECHOLN("");
|
|
SERIAL_ECHOLN("");
|
|
}break;
|
|
}break;
|
|
@@ -4453,52 +4338,6 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
#endif //FILAMENTCHANGEENABLE
|
|
#endif //FILAMENTCHANGEENABLE
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- case 605: // Set dual x-carriage movement mode:
|
|
|
|
- // M605 S0: Full control mode. The slicer has full control over x-carriage movement
|
|
|
|
- // M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement
|
|
|
|
- // M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn
|
|
|
|
- // millimeters x-offset and an optional differential hotend temperature of
|
|
|
|
- // mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate
|
|
|
|
- // the first with a spacing of 100mm in the x direction and 2 degrees hotter.
|
|
|
|
- //
|
|
|
|
- // Note: the X axis should be homed after changing dual x-carriage mode.
|
|
|
|
- {
|
|
|
|
- st_synchronize();
|
|
|
|
-
|
|
|
|
- if (code_seen('S'))
|
|
|
|
- dual_x_carriage_mode = code_value();
|
|
|
|
-
|
|
|
|
- if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
|
|
|
|
- {
|
|
|
|
- if (code_seen('X'))
|
|
|
|
- duplicate_extruder_x_offset = max(code_value(),X2_MIN_POS - x_home_pos(0));
|
|
|
|
-
|
|
|
|
- if (code_seen('R'))
|
|
|
|
- duplicate_extruder_temp_offset = code_value();
|
|
|
|
-
|
|
|
|
- SERIAL_ECHO_START;
|
|
|
|
- SERIAL_ECHORPGM(MSG_HOTEND_OFFSET);
|
|
|
|
- SERIAL_ECHO(" ");
|
|
|
|
- SERIAL_ECHO(extruder_offset[X_AXIS][0]);
|
|
|
|
- SERIAL_ECHO(",");
|
|
|
|
- SERIAL_ECHO(extruder_offset[Y_AXIS][0]);
|
|
|
|
- SERIAL_ECHO(" ");
|
|
|
|
- SERIAL_ECHO(duplicate_extruder_x_offset);
|
|
|
|
- SERIAL_ECHO(",");
|
|
|
|
- SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]);
|
|
|
|
- }
|
|
|
|
- else if (dual_x_carriage_mode != DXC_FULL_CONTROL_MODE && dual_x_carriage_mode != DXC_AUTO_PARK_MODE)
|
|
|
|
- {
|
|
|
|
- dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- active_extruder_parked = false;
|
|
|
|
- extruder_duplication_enabled = false;
|
|
|
|
- delayed_move_time = 0;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- #endif //DUAL_X_CARRIAGE
|
|
|
|
|
|
|
|
case 907: // M907 Set digital trimpot motor current using axis codes.
|
|
case 907: // M907 Set digital trimpot motor current using axis codes.
|
|
{
|
|
{
|
|
@@ -4593,57 +4432,6 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
|
if(tmp_extruder != active_extruder) {
|
|
if(tmp_extruder != active_extruder) {
|
|
// Save current position to return to after applying extruder offset
|
|
// Save current position to return to after applying extruder offset
|
|
memcpy(destination, current_position, sizeof(destination));
|
|
memcpy(destination, current_position, sizeof(destination));
|
|
- #ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false &&
|
|
|
|
- (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder)))
|
|
|
|
- {
|
|
|
|
- // Park old head: 1) raise 2) move to park position 3) lower
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
|
|
|
|
- current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
|
|
|
|
- plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
|
|
|
|
- current_position[E_AXIS], max_feedrate[X_AXIS], active_extruder);
|
|
|
|
- plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS],
|
|
|
|
- current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // apply Y & Z extruder offset (x offset is already used in determining home pos)
|
|
|
|
- current_position[Y_AXIS] = current_position[Y_AXIS] -
|
|
|
|
- extruder_offset[Y_AXIS][active_extruder] +
|
|
|
|
- extruder_offset[Y_AXIS][tmp_extruder];
|
|
|
|
- current_position[Z_AXIS] = current_position[Z_AXIS] -
|
|
|
|
- extruder_offset[Z_AXIS][active_extruder] +
|
|
|
|
- extruder_offset[Z_AXIS][tmp_extruder];
|
|
|
|
-
|
|
|
|
- active_extruder = tmp_extruder;
|
|
|
|
-
|
|
|
|
- // This function resets the max/min values - the current position may be overwritten below.
|
|
|
|
- axis_is_at_home(X_AXIS);
|
|
|
|
-
|
|
|
|
- if (dual_x_carriage_mode == DXC_FULL_CONTROL_MODE)
|
|
|
|
- {
|
|
|
|
- current_position[X_AXIS] = inactive_extruder_x_pos;
|
|
|
|
- inactive_extruder_x_pos = destination[X_AXIS];
|
|
|
|
- }
|
|
|
|
- else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
|
|
|
|
- {
|
|
|
|
- active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
|
|
|
|
- if (active_extruder == 0 || active_extruder_parked)
|
|
|
|
- current_position[X_AXIS] = inactive_extruder_x_pos;
|
|
|
|
- else
|
|
|
|
- current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
|
|
|
|
- inactive_extruder_x_pos = destination[X_AXIS];
|
|
|
|
- extruder_duplication_enabled = false;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- // record raised toolhead position for use by unpark
|
|
|
|
- memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
|
|
|
|
- raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
|
|
|
|
- active_extruder_parked = true;
|
|
|
|
- delayed_move_time = 0;
|
|
|
|
- }
|
|
|
|
- #else
|
|
|
|
// Offset extruder (only by XY)
|
|
// Offset extruder (only by XY)
|
|
int i;
|
|
int i;
|
|
for(i = 0; i < 2; i++) {
|
|
for(i = 0; i < 2; i++) {
|
|
@@ -4653,7 +4441,6 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
|
}
|
|
}
|
|
// Set the new active extruder and position
|
|
// Set the new active extruder and position
|
|
active_extruder = tmp_extruder;
|
|
active_extruder = tmp_extruder;
|
|
- #endif //else DUAL_X_CARRIAGE
|
|
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
// Move to the old position if 'F' was in the parameters
|
|
// Move to the old position if 'F' was in the parameters
|
|
if(make_move && Stopped == false) {
|
|
if(make_move && Stopped == false) {
|
|
@@ -4791,47 +4578,6 @@ void prepare_move()
|
|
{
|
|
{
|
|
clamp_to_software_endstops(destination);
|
|
clamp_to_software_endstops(destination);
|
|
previous_millis_cmd = millis();
|
|
previous_millis_cmd = millis();
|
|
-
|
|
|
|
-#ifdef DUAL_X_CARRIAGE
|
|
|
|
- if (active_extruder_parked)
|
|
|
|
- {
|
|
|
|
- if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0)
|
|
|
|
- {
|
|
|
|
- // move duplicate extruder into correct duplication position.
|
|
|
|
- plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
|
- plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
|
|
|
|
- current_position[E_AXIS], max_feedrate[X_AXIS], 1);
|
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
|
- st_synchronize();
|
|
|
|
- extruder_duplication_enabled = true;
|
|
|
|
- active_extruder_parked = false;
|
|
|
|
- }
|
|
|
|
- else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head
|
|
|
|
- {
|
|
|
|
- if (current_position[E_AXIS] == destination[E_AXIS])
|
|
|
|
- {
|
|
|
|
- // this is a travel move - skit it but keep track of current position (so that it can later
|
|
|
|
- // be used as start of first non-travel move)
|
|
|
|
- if (delayed_move_time != 0xFFFFFFFFUL)
|
|
|
|
- {
|
|
|
|
- memcpy(current_position, destination, sizeof(current_position));
|
|
|
|
- if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
|
|
|
|
- raised_parked_position[Z_AXIS] = destination[Z_AXIS];
|
|
|
|
- delayed_move_time = millis();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- delayed_move_time = 0;
|
|
|
|
- // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
|
|
|
|
- plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
|
|
|
|
- current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
|
|
|
|
- current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
|
|
|
|
- active_extruder_parked = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-#endif //DUAL_X_CARRIAGE
|
|
|
|
|
|
|
|
// Do not use feedmultiply for E or Z only moves
|
|
// Do not use feedmultiply for E or Z only moves
|
|
if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
|
|
if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
|
|
@@ -5030,16 +4776,6 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
|
|
WRITE(E0_ENABLE_PIN,oldstatus);
|
|
WRITE(E0_ENABLE_PIN,oldstatus);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
- #if defined(DUAL_X_CARRIAGE)
|
|
|
|
- // handle delayed move timeout
|
|
|
|
- if (delayed_move_time != 0 && (millis() - delayed_move_time) > 1000 && Stopped == false)
|
|
|
|
- {
|
|
|
|
- // travel moves have been received so enact them
|
|
|
|
- delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
|
|
|
|
- memcpy(destination,current_position,sizeof(destination));
|
|
|
|
- prepare_move();
|
|
|
|
- }
|
|
|
|
- #endif
|
|
|
|
#ifdef TEMP_STAT_LEDS
|
|
#ifdef TEMP_STAT_LEDS
|
|
handle_status_leds();
|
|
handle_status_leds();
|
|
#endif
|
|
#endif
|