🏗️ Support for up to 6 linear axes (#19112)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
committed by
Scott Lahteine
parent
d3c56a76e7
commit
c1fca91103
@ -33,12 +33,15 @@
|
||||
* M17: Enable stepper motors
|
||||
*/
|
||||
void GcodeSuite::M17() {
|
||||
if (parser.seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z"))) {
|
||||
if (parser.seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR))) {
|
||||
LOGICAL_AXIS_CODE(
|
||||
if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) enable_e_steppers(),
|
||||
if (parser.seen_test('X')) ENABLE_AXIS_X(),
|
||||
if (parser.seen_test('Y')) ENABLE_AXIS_Y(),
|
||||
if (parser.seen_test('Z')) ENABLE_AXIS_Z()
|
||||
if (parser.seen_test('Z')) ENABLE_AXIS_Z(),
|
||||
if (parser.seen_test(AXIS4_NAME)) ENABLE_AXIS_I(),
|
||||
if (parser.seen_test(AXIS5_NAME)) ENABLE_AXIS_J(),
|
||||
if (parser.seen_test(AXIS6_NAME)) ENABLE_AXIS_K()
|
||||
);
|
||||
}
|
||||
else {
|
||||
@ -56,13 +59,16 @@ void GcodeSuite::M18_M84() {
|
||||
stepper_inactive_time = parser.value_millis_from_seconds();
|
||||
}
|
||||
else {
|
||||
if (parser.seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z"))) {
|
||||
if (parser.seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR))) {
|
||||
planner.synchronize();
|
||||
LOGICAL_AXIS_CODE(
|
||||
if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) disable_e_steppers(),
|
||||
if (parser.seen_test('X')) DISABLE_AXIS_X(),
|
||||
if (parser.seen_test('Y')) DISABLE_AXIS_Y(),
|
||||
if (parser.seen_test('Z')) DISABLE_AXIS_Z()
|
||||
if (parser.seen_test('Z')) DISABLE_AXIS_Z(),
|
||||
if (parser.seen_test(AXIS4_NAME)) DISABLE_AXIS_I(),
|
||||
if (parser.seen_test(AXIS5_NAME)) DISABLE_AXIS_J(),
|
||||
if (parser.seen_test(AXIS6_NAME)) DISABLE_AXIS_K()
|
||||
);
|
||||
}
|
||||
else
|
||||
|
@ -70,26 +70,12 @@
|
||||
dual_x_carriage_mode = (DualXMode)parser.value_byte();
|
||||
idex_set_mirrored_mode(false);
|
||||
|
||||
if (dual_x_carriage_mode == DXC_MIRRORED_MODE) {
|
||||
if (previous_mode != DXC_DUPLICATION_MODE) {
|
||||
SERIAL_ECHOLNPGM("Printer must be in DXC_DUPLICATION_MODE prior to ");
|
||||
SERIAL_ECHOLNPGM("specifying DXC_MIRRORED_MODE.");
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
return;
|
||||
}
|
||||
idex_set_mirrored_mode(true);
|
||||
float x_jog = current_position.x - .1;
|
||||
for (uint8_t i = 2; --i;) {
|
||||
planner.buffer_line(x_jog, current_position.y, current_position.z, current_position.e, feedrate_mm_s, 0);
|
||||
x_jog += .1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch (dual_x_carriage_mode) {
|
||||
|
||||
case DXC_FULL_CONTROL_MODE:
|
||||
case DXC_AUTO_PARK_MODE:
|
||||
break;
|
||||
|
||||
case DXC_DUPLICATION_MODE:
|
||||
// Set the X offset, but no less than the safety gap
|
||||
if (parser.seen('X')) duplicate_extruder_x_offset = _MAX(parser.value_linear_units(), (X2_MIN_POS) - (X1_MIN_POS));
|
||||
@ -97,10 +83,29 @@
|
||||
// Always switch back to tool 0
|
||||
if (active_extruder != 0) tool_change(0);
|
||||
break;
|
||||
|
||||
case DXC_MIRRORED_MODE: {
|
||||
if (previous_mode != DXC_DUPLICATION_MODE) {
|
||||
SERIAL_ECHOLNPGM("Printer must be in DXC_DUPLICATION_MODE prior to ");
|
||||
SERIAL_ECHOLNPGM("specifying DXC_MIRRORED_MODE.");
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
return;
|
||||
}
|
||||
idex_set_mirrored_mode(true);
|
||||
|
||||
// Do a small 'jog' motion in the X axis
|
||||
xyze_pos_t dest = current_position; dest.x -= 0.1f;
|
||||
for (uint8_t i = 2; --i;) {
|
||||
planner.buffer_line(dest, feedrate_mm_s, 0);
|
||||
dest.x += 0.1f;
|
||||
}
|
||||
} return;
|
||||
|
||||
default:
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
break;
|
||||
}
|
||||
|
||||
idex_set_parked(false);
|
||||
set_duplication_enabled(false);
|
||||
|
||||
|
Reference in New Issue
Block a user