✨ Support for up to 9 axes (linear, rotary) (#23112)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@@ -48,10 +48,14 @@ void GcodeSuite::G60() {
|
||||
|
||||
#if ENABLED(SAVED_POSITIONS_DEBUG)
|
||||
{
|
||||
DEBUG_ECHOPGM(STR_SAVED_POS " S", slot);
|
||||
const xyze_pos_t &pos = stored_position[slot];
|
||||
DEBUG_ECHOPGM(STR_SAVED_POS " S", slot, " :");
|
||||
DEBUG_ECHOLNPAIR_F_P(
|
||||
LIST_N(DOUBLE(LINEAR_AXES), PSTR(" : X"), pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z, SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k)
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
SP_Y_STR, pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z,
|
||||
SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k,
|
||||
SP_U_STR, pos.u, SP_V_STR, pos.v, SP_W_STR, pos.w
|
||||
)
|
||||
#if HAS_EXTRUDERS
|
||||
, SP_E_STR, pos.e
|
||||
#endif
|
||||
|
||||
@@ -68,9 +68,9 @@ void GcodeSuite::G61() {
|
||||
SYNC_E(stored_position[slot].e);
|
||||
}
|
||||
else {
|
||||
if (parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K))) {
|
||||
if (parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W))) {
|
||||
DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot);
|
||||
LOOP_LINEAR_AXES(i) {
|
||||
LOOP_NUM_AXES(i) {
|
||||
destination[i] = parser.seen(AXIS_CHAR(i))
|
||||
? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i)
|
||||
: current_position[i];
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
* A<pos> = Override park position A (requires AXIS*_NAME 'A')
|
||||
* B<pos> = Override park position B (requires AXIS*_NAME 'B')
|
||||
* C<pos> = Override park position C (requires AXIS*_NAME 'C')
|
||||
* U<pos> = Override park position U (requires AXIS*_NAME 'U')
|
||||
* V<pos> = Override park position V (requires AXIS*_NAME 'V')
|
||||
* W<pos> = Override park position W (requires AXIS*_NAME 'W')
|
||||
* Z<linear> = Override Z raise
|
||||
*
|
||||
* With an LCD menu:
|
||||
@@ -64,17 +67,22 @@ void GcodeSuite::M125() {
|
||||
xyz_pos_t park_point = NOZZLE_PARK_POINT;
|
||||
|
||||
// Move to filament change position or given position
|
||||
LINEAR_AXIS_CODE(
|
||||
NUM_AXIS_CODE(
|
||||
if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')),
|
||||
if (parser.seenval('Y')) park_point.y = RAW_Y_POSITION(parser.linearval('Y')),
|
||||
NOOP,
|
||||
if (parser.seenval(AXIS4_NAME)) park_point.i = RAW_I_POSITION(parser.linearval(AXIS4_NAME)),
|
||||
if (parser.seenval(AXIS5_NAME)) park_point.j = RAW_J_POSITION(parser.linearval(AXIS5_NAME)),
|
||||
if (parser.seenval(AXIS6_NAME)) park_point.k = RAW_K_POSITION(parser.linearval(AXIS6_NAME))
|
||||
if (parser.seenval(AXIS4_NAME)) park_point.i = RAW_X_POSITION(parser.linearval(AXIS4_NAME)),
|
||||
if (parser.seenval(AXIS5_NAME)) park_point.j = RAW_X_POSITION(parser.linearval(AXIS5_NAME)),
|
||||
if (parser.seenval(AXIS6_NAME)) park_point.k = RAW_X_POSITION(parser.linearval(AXIS6_NAME)),
|
||||
if (parser.seenval(AXIS7_NAME)) park_point.u = RAW_X_POSITION(parser.linearval(AXIS7_NAME)),
|
||||
if (parser.seenval(AXIS8_NAME)) park_point.v = RAW_X_POSITION(parser.linearval(AXIS8_NAME)),
|
||||
if (parser.seenval(AXIS9_NAME)) park_point.w = RAW_X_POSITION(parser.linearval(AXIS9_NAME))
|
||||
);
|
||||
|
||||
// Lift Z axis
|
||||
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
|
||||
#if HAS_Z_AXIS
|
||||
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
|
||||
park_point += hotend_offset[active_extruder];
|
||||
|
||||
@@ -54,8 +54,14 @@
|
||||
*
|
||||
* E[distance] - Retract the filament this far
|
||||
* Z[distance] - Move the Z axis by this distance
|
||||
* X[position] - Move to this X position, with Y
|
||||
* Y[position] - Move to this Y position, with X
|
||||
* X[position] - Move to this X position (instead of NOZZLE_PARK_POINT.x)
|
||||
* Y[position] - Move to this Y position (instead of NOZZLE_PARK_POINT.y)
|
||||
* I[position] - Move to this I position (instead of NOZZLE_PARK_POINT.i)
|
||||
* J[position] - Move to this J position (instead of NOZZLE_PARK_POINT.j)
|
||||
* K[position] - Move to this K position (instead of NOZZLE_PARK_POINT.k)
|
||||
* C[position] - Move to this U position (instead of NOZZLE_PARK_POINT.u)
|
||||
* H[position] - Move to this V position (instead of NOZZLE_PARK_POINT.v)
|
||||
* O[position] - Move to this W position (instead of NOZZLE_PARK_POINT.w)
|
||||
* U[distance] - Retract distance for removal (manual reload)
|
||||
* L[distance] - Extrude distance for insertion (manual reload)
|
||||
* B[count] - Number of times to beep, -1 for indefinite (if equipped with a buzzer)
|
||||
@@ -117,26 +123,25 @@ void GcodeSuite::M600() {
|
||||
xyz_pos_t park_point NOZZLE_PARK_POINT;
|
||||
|
||||
// Move XY axes to filament change position or given position
|
||||
LINEAR_AXIS_CODE(
|
||||
NUM_AXIS_CODE(
|
||||
if (parser.seenval('X')) park_point.x = parser.linearval('X'),
|
||||
if (parser.seenval('Y')) park_point.y = parser.linearval('Y'),
|
||||
if (parser.seenval('Z')) park_point.z = parser.linearval('Z'), // Lift Z axis
|
||||
if (parser.seenval(AXIS4_NAME)) park_point.i = parser.linearval(AXIS4_NAME),
|
||||
if (parser.seenval(AXIS5_NAME)) park_point.j = parser.linearval(AXIS5_NAME),
|
||||
if (parser.seenval(AXIS6_NAME)) park_point.k = parser.linearval(AXIS6_NAME)
|
||||
if (parser.seenval('I')) park_point.i = parser.linearval('I'),
|
||||
if (parser.seenval('J')) park_point.j = parser.linearval('J'),
|
||||
if (parser.seenval('K')) park_point.k = parser.linearval('K'),
|
||||
if (parser.seenval('C')) park_point.u = parser.linearval('C'), // U axis
|
||||
if (parser.seenval('H')) park_point.v = parser.linearval('H'), // V axis
|
||||
if (parser.seenval('O')) park_point.w = parser.linearval('O') // W axis
|
||||
);
|
||||
|
||||
#if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
|
||||
park_point += hotend_offset[active_extruder];
|
||||
#endif
|
||||
|
||||
#if ENABLED(MMU2_MENUS)
|
||||
// For MMU2, when enabled, reset retract value so it doesn't mess with MMU filament handling
|
||||
const float unload_length = standardM600 ? -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length)) : 0.5f;
|
||||
#else
|
||||
// Unload filament
|
||||
const float unload_length = -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length));
|
||||
#endif
|
||||
// Unload filament
|
||||
// For MMU2, when enabled, reset retract value so it doesn't mess with MMU filament handling
|
||||
const float unload_length = standardM600 ? -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length)) : 0.5f;
|
||||
|
||||
const int beep_count = parser.intval('B', -1
|
||||
#ifdef FILAMENT_CHANGE_ALERT_BEEPS
|
||||
|
||||
Reference in New Issue
Block a user