|
@@ -6948,6 +6948,9 @@ inline void gcode_M503() {
|
6948
|
6948
|
stepper.synchronize();
|
6949
|
6949
|
if (code_seen('S')) dual_x_carriage_mode = (DualXMode)code_value_byte();
|
6950
|
6950
|
switch (dual_x_carriage_mode) {
|
|
6951
|
+ case DXC_FULL_CONTROL_MODE:
|
|
6952
|
+ case DXC_AUTO_PARK_MODE:
|
|
6953
|
+ break;
|
6951
|
6954
|
case DXC_DUPLICATION_MODE:
|
6952
|
6955
|
if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_axis_units(X_AXIS), X2_MIN_POS - x_home_pos(0));
|
6953
|
6956
|
if (code_seen('R')) duplicate_extruder_temp_offset = code_value_temp_diff();
|
|
@@ -6962,9 +6965,6 @@ inline void gcode_M503() {
|
6962
|
6965
|
SERIAL_CHAR(',');
|
6963
|
6966
|
SERIAL_ECHOLN(hotend_offset[Y_AXIS][1]);
|
6964
|
6967
|
break;
|
6965
|
|
- case DXC_FULL_CONTROL_MODE:
|
6966
|
|
- case DXC_AUTO_PARK_MODE:
|
6967
|
|
- break;
|
6968
|
6968
|
default:
|
6969
|
6969
|
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
6970
|
6970
|
break;
|
|
@@ -7254,9 +7254,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
7254
|
7254
|
if (DEBUGGING(LEVELING)) {
|
7255
|
7255
|
SERIAL_ECHOPGM("Dual X Carriage Mode ");
|
7256
|
7256
|
switch (dual_x_carriage_mode) {
|
7257
|
|
- case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break;
|
7258
|
|
- case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break;
|
7259
|
7257
|
case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break;
|
|
7258
|
+ case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break;
|
|
7259
|
+ case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break;
|
7260
|
7260
|
}
|
7261
|
7261
|
}
|
7262
|
7262
|
#endif
|
|
@@ -8974,39 +8974,45 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
8974
|
8974
|
*/
|
8975
|
8975
|
inline bool prepare_move_to_destination_dualx() {
|
8976
|
8976
|
if (active_extruder_parked) {
|
8977
|
|
- if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
|
8978
|
|
- // move duplicate extruder into correct duplication position.
|
8979
|
|
- planner.set_position_mm(
|
8980
|
|
- LOGICAL_X_POSITION(inactive_extruder_x_pos),
|
8981
|
|
- current_position[Y_AXIS],
|
8982
|
|
- current_position[Z_AXIS],
|
8983
|
|
- current_position[E_AXIS]
|
8984
|
|
- );
|
8985
|
|
- planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
|
8986
|
|
- current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1);
|
8987
|
|
- SYNC_PLAN_POSITION_KINEMATIC();
|
8988
|
|
- stepper.synchronize();
|
8989
|
|
- extruder_duplication_enabled = true;
|
8990
|
|
- active_extruder_parked = false;
|
8991
|
|
- }
|
8992
|
|
- else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) { // handle unparking of head
|
8993
|
|
- if (current_position[E_AXIS] == destination[E_AXIS]) {
|
8994
|
|
- // This is a travel move (with no extrusion)
|
8995
|
|
- // Skip it, but keep track of the current position
|
8996
|
|
- // (so it can be used as the start of the next non-travel move)
|
8997
|
|
- if (delayed_move_time != 0xFFFFFFFFUL) {
|
8998
|
|
- set_current_to_destination();
|
8999
|
|
- NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
|
9000
|
|
- delayed_move_time = millis();
|
9001
|
|
- return false;
|
|
8977
|
+ switch (dual_x_carriage_mode) {
|
|
8978
|
+ case DXC_FULL_CONTROL_MODE:
|
|
8979
|
+ break;
|
|
8980
|
+ case DXC_DUPLICATION_MODE:
|
|
8981
|
+ if (active_extruder == 0) {
|
|
8982
|
+ // move duplicate extruder into correct duplication position.
|
|
8983
|
+ planner.set_position_mm(
|
|
8984
|
+ LOGICAL_X_POSITION(inactive_extruder_x_pos),
|
|
8985
|
+ current_position[Y_AXIS],
|
|
8986
|
+ current_position[Z_AXIS],
|
|
8987
|
+ current_position[E_AXIS]
|
|
8988
|
+ );
|
|
8989
|
+ planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
|
|
8990
|
+ current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1);
|
|
8991
|
+ SYNC_PLAN_POSITION_KINEMATIC();
|
|
8992
|
+ stepper.synchronize();
|
|
8993
|
+ extruder_duplication_enabled = true;
|
|
8994
|
+ active_extruder_parked = false;
|
9002
|
8995
|
}
|
9003
|
|
- }
|
9004
|
|
- delayed_move_time = 0;
|
9005
|
|
- // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
|
9006
|
|
- planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
9007
|
|
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder);
|
9008
|
|
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
9009
|
|
- active_extruder_parked = false;
|
|
8996
|
+ break;
|
|
8997
|
+ case DXC_AUTO_PARK_MODE:
|
|
8998
|
+ if (current_position[E_AXIS] == destination[E_AXIS]) {
|
|
8999
|
+ // This is a travel move (with no extrusion)
|
|
9000
|
+ // Skip it, but keep track of the current position
|
|
9001
|
+ // (so it can be used as the start of the next non-travel move)
|
|
9002
|
+ if (delayed_move_time != 0xFFFFFFFFUL) {
|
|
9003
|
+ set_current_to_destination();
|
|
9004
|
+ NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
|
|
9005
|
+ delayed_move_time = millis();
|
|
9006
|
+ return false;
|
|
9007
|
+ }
|
|
9008
|
+ }
|
|
9009
|
+ delayed_move_time = 0;
|
|
9010
|
+ // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
|
|
9011
|
+ planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
|
9012
|
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder);
|
|
9013
|
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
|
|
9014
|
+ active_extruder_parked = false;
|
|
9015
|
+ break;
|
9010
|
9016
|
}
|
9011
|
9017
|
}
|
9012
|
9018
|
return true;
|