@ -285,6 +285,25 @@ void GcodeSuite::M906() {
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(I)
|
||||
case I_AXIS: L6470_SET_KVAL_HOLD(I); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
case J_AXIS: L6470_SET_KVAL_HOLD(J); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
case K_AXIS: L6470_SET_KVAL_HOLD(K); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(U)
|
||||
case U_AXIS: L6470_SET_KVAL_HOLD(U); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(V)
|
||||
case V_AXIS: L6470_SET_KVAL_HOLD(V); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(W)
|
||||
case W_AXIS: L6470_SET_KVAL_HOLD(W); break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7)
|
||||
case E_AXIS: {
|
||||
const int8_t eindex = get_target_e_stepper_from_command(-2);
|
||||
@ -346,6 +365,24 @@ void GcodeSuite::M906() {
|
||||
#if AXIS_IS_L64XX(Z4)
|
||||
L64XX_REPORT_CURRENT(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(I)
|
||||
L64XX_REPORT_CURRENT(I);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
L64XX_REPORT_CURRENT(J);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
L64XX_REPORT_CURRENT(K);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(U)
|
||||
L64XX_REPORT_CURRENT(U);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(V)
|
||||
L64XX_REPORT_CURRENT(V);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(W)
|
||||
L64XX_REPORT_CURRENT(W);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
L64XX_REPORT_CURRENT(E0);
|
||||
#endif
|
||||
|
@ -39,7 +39,7 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M907: Set digital trimpot motor current using axis codes X [Y] [Z] [E]
|
||||
* M907: Set digital trimpot motor current using axis codes X [Y] [Z] [I] [J] [K] [U] [V] [W] [E]
|
||||
* B<current> - Special case for 4th (E) axis
|
||||
* S<current> - Special case to set first 3 axes
|
||||
*/
|
||||
@ -49,15 +49,15 @@ void GcodeSuite::M907() {
|
||||
if (!parser.seen("BS" LOGICAL_AXES_STRING))
|
||||
return M907_report();
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.set_digipot_current(i, parser.value_int());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(IAXIS_CHAR(i))) stepper.set_digipot_current(i, parser.value_int());
|
||||
if (parser.seenval('B')) stepper.set_digipot_current(4, parser.value_int());
|
||||
if (parser.seenval('S')) LOOP_LE_N(i, 4) stepper.set_digipot_current(i, parser.value_int());
|
||||
|
||||
#elif HAS_MOTOR_CURRENT_PWM
|
||||
|
||||
if (!parser.seen(
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY)
|
||||
"XY"
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K, MOTOR_CURRENT_PWM_U, MOTOR_CURRENT_PWM_V, MOTOR_CURRENT_PWM_W)
|
||||
"XY" SECONDARY_AXIS_GANG("I", "J", "K", "U", "V", "W")
|
||||
#endif
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
|
||||
"Z"
|
||||
@ -67,8 +67,12 @@ void GcodeSuite::M907() {
|
||||
#endif
|
||||
)) return M907_report();
|
||||
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY)
|
||||
if (parser.seenval('X') || parser.seenval('Y')) stepper.set_digipot_current(0, parser.value_int());
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K, MOTOR_CURRENT_PWM_U, MOTOR_CURRENT_PWM_V, MOTOR_CURRENT_PWM_W)
|
||||
if (NUM_AXIS_GANG(
|
||||
parser.seenval('X'), || parser.seenval('Y'), || false,
|
||||
|| parser.seenval('I'), || parser.seenval('J'), || parser.seenval('K'),
|
||||
|| parser.seenval('U'), || parser.seenval('V'), || parser.seenval('W')
|
||||
)) stepper.set_digipot_current(0, parser.value_int());
|
||||
#endif
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
|
||||
if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int());
|
||||
@ -81,7 +85,7 @@ void GcodeSuite::M907() {
|
||||
|
||||
#if HAS_MOTOR_CURRENT_I2C
|
||||
// this one uses actual amps in floating point
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) digipot_i2c.set_current(i, parser.value_float());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(IAXIS_CHAR(i))) digipot_i2c.set_current(i, parser.value_float());
|
||||
// Additional extruders use B,C,D for channels 4,5,6.
|
||||
// TODO: Change these parameters because 'E' is used. B<index>?
|
||||
#if HAS_EXTRUDERS
|
||||
@ -95,7 +99,7 @@ void GcodeSuite::M907() {
|
||||
const float dac_percent = parser.value_float();
|
||||
LOOP_LE_N(i, 4) stepper_dac.set_current_percent(i, dac_percent);
|
||||
}
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper_dac.set_current_percent(i, parser.value_float());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(IAXIS_CHAR(i))) stepper_dac.set_current_percent(i, parser.value_float());
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -104,15 +108,15 @@ void GcodeSuite::M907() {
|
||||
void GcodeSuite::M907_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS));
|
||||
#if HAS_MOTOR_CURRENT_PWM
|
||||
SERIAL_ECHOLNPGM_P( // PWM-based has 3 values:
|
||||
PSTR(" M907 X"), stepper.motor_current_setting[0] // X and Y
|
||||
SERIAL_ECHOLNPGM_P( // PWM-based has 3 values:
|
||||
PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W)
|
||||
, SP_Z_STR, stepper.motor_current_setting[1] // Z
|
||||
, SP_E_STR, stepper.motor_current_setting[2] // E
|
||||
);
|
||||
#elif HAS_MOTOR_CURRENT_SPI
|
||||
SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values:
|
||||
LOOP_LOGICAL_AXES(q) { // X Y Z (I J K) E (map to X Y Z (I J K) E0 by default)
|
||||
SERIAL_CHAR(' ', axis_codes[q]);
|
||||
LOOP_LOGICAL_AXES(q) { // X Y Z (I J K U V W) E (map to X Y Z (I J K U V W) E0 by default)
|
||||
SERIAL_CHAR(' ', IAXIS_CHAR(q));
|
||||
SERIAL_ECHO(stepper.motor_current_setting[q]);
|
||||
}
|
||||
SERIAL_CHAR(' ', 'B'); // B (maps to E1 by default)
|
||||
|
@ -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_ECHOLNPGM_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_X_LBL, pos.x, SP_Y_LBL, pos.y, SP_Z_LBL, pos.z,
|
||||
SP_I_LBL, pos.i, SP_J_LBL, pos.j, SP_K_LBL, pos.k,
|
||||
SP_U_LBL, pos.u, SP_V_LBL, pos.v, SP_W_LBL, pos.w
|
||||
)
|
||||
#if HAS_EXTRUDERS
|
||||
, SP_E_LBL, 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
|
||||
|
@ -85,6 +85,15 @@ static void set_stealth_status(const bool enable, const int8_t eindex) {
|
||||
#if K_HAS_STEALTHCHOP
|
||||
case K_AXIS: TMC_SET_STEALTH(K); break;
|
||||
#endif
|
||||
#if U_HAS_STEALTHCHOP
|
||||
case U_AXIS: TMC_SET_STEALTH(U); break;
|
||||
#endif
|
||||
#if V_HAS_STEALTHCHOP
|
||||
case V_AXIS: TMC_SET_STEALTH(V); break;
|
||||
#endif
|
||||
#if W_HAS_STEALTHCHOP
|
||||
case W_AXIS: TMC_SET_STEALTH(W); break;
|
||||
#endif
|
||||
|
||||
#if E_STEPPERS
|
||||
case E_AXIS: {
|
||||
@ -115,6 +124,9 @@ static void say_stealth_status() {
|
||||
OPTCODE( I_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(I))
|
||||
OPTCODE( J_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(J))
|
||||
OPTCODE( K_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(K))
|
||||
OPTCODE( U_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(U))
|
||||
OPTCODE( V_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(V))
|
||||
OPTCODE( W_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(W))
|
||||
OPTCODE(E0_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E0))
|
||||
OPTCODE(E1_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E1))
|
||||
OPTCODE(E2_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E2))
|
||||
@ -157,17 +169,23 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
|
||||
chop_z = TERN0(Z_HAS_STEALTHCHOP, stepperZ.get_stored_stealthChop()),
|
||||
chop_i = TERN0(I_HAS_STEALTHCHOP, stepperI.get_stored_stealthChop()),
|
||||
chop_j = TERN0(J_HAS_STEALTHCHOP, stepperJ.get_stored_stealthChop()),
|
||||
chop_k = TERN0(K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop());
|
||||
chop_k = TERN0(K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop()),
|
||||
chop_u = TERN0(U_HAS_STEALTHCHOP, stepperU.get_stored_stealthChop()),
|
||||
chop_v = TERN0(V_HAS_STEALTHCHOP, stepperV.get_stored_stealthChop()),
|
||||
chop_w = TERN0(W_HAS_STEALTHCHOP, stepperW.get_stored_stealthChop());
|
||||
|
||||
if (chop_x || chop_y || chop_z || chop_i || chop_j || chop_k) {
|
||||
if (chop_x || chop_y || chop_z || chop_i || chop_j || chop_k || chop_u || chop_v || chop_w) {
|
||||
say_M569(forReplay);
|
||||
LINEAR_AXIS_CODE(
|
||||
NUM_AXIS_CODE(
|
||||
if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR),
|
||||
if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR),
|
||||
if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR),
|
||||
if (chop_i) SERIAL_ECHOPGM_P(SP_I_STR),
|
||||
if (chop_j) SERIAL_ECHOPGM_P(SP_J_STR),
|
||||
if (chop_k) SERIAL_ECHOPGM_P(SP_K_STR)
|
||||
if (chop_k) SERIAL_ECHOPGM_P(SP_K_STR),
|
||||
if (chop_u) SERIAL_ECHOPGM_P(SP_U_STR),
|
||||
if (chop_v) SERIAL_ECHOPGM_P(SP_V_STR),
|
||||
if (chop_w) SERIAL_ECHOPGM_P(SP_W_STR)
|
||||
);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
@ -190,6 +208,9 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
|
||||
if (TERN0( I_HAS_STEALTHCHOP, stepperI.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_I_STR), true); }
|
||||
if (TERN0( J_HAS_STEALTHCHOP, stepperJ.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_J_STR), true); }
|
||||
if (TERN0( K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_K_STR), true); }
|
||||
if (TERN0( U_HAS_STEALTHCHOP, stepperU.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_U_STR), true); }
|
||||
if (TERN0( V_HAS_STEALTHCHOP, stepperV.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_V_STR), true); }
|
||||
if (TERN0( W_HAS_STEALTHCHOP, stepperW.get_stored_stealthChop())) { say_M569(forReplay, FPSTR(SP_W_STR), true); }
|
||||
|
||||
if (TERN0(E0_HAS_STEALTHCHOP, stepperE0.get_stored_stealthChop())) { say_M569(forReplay, F("T0 E"), true); }
|
||||
if (TERN0(E1_HAS_STEALTHCHOP, stepperE1.get_stored_stealthChop())) { say_M569(forReplay, F("T1 E"), true); }
|
||||
|
@ -44,6 +44,9 @@ static void tmc_print_current(TMC &st) {
|
||||
* A[current] - Set mA current for A driver(s) (Requires AXIS*_NAME 'A')
|
||||
* B[current] - Set mA current for B driver(s) (Requires AXIS*_NAME 'B')
|
||||
* C[current] - Set mA current for C driver(s) (Requires AXIS*_NAME 'C')
|
||||
* U[current] - Set mA current for U driver(s) (Requires AXIS*_NAME 'U')
|
||||
* V[current] - Set mA current for V driver(s) (Requires AXIS*_NAME 'V')
|
||||
* W[current] - Set mA current for W driver(s) (Requires AXIS*_NAME 'W')
|
||||
* E[current] - Set mA current for E driver(s)
|
||||
*
|
||||
* I[index] - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3; 3 for Z4.)
|
||||
@ -114,6 +117,15 @@ void GcodeSuite::M906() {
|
||||
#if AXIS_IS_TMC(K)
|
||||
case K_AXIS: TMC_SET_CURRENT(K); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(U)
|
||||
case U_AXIS: TMC_SET_CURRENT(U); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(V)
|
||||
case V_AXIS: TMC_SET_CURRENT(V); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(W)
|
||||
case W_AXIS: TMC_SET_CURRENT(W); break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0) || AXIS_IS_TMC(E1) || AXIS_IS_TMC(E2) || AXIS_IS_TMC(E3) || AXIS_IS_TMC(E4) || AXIS_IS_TMC(E5) || AXIS_IS_TMC(E6) || AXIS_IS_TMC(E7)
|
||||
case E_AXIS: {
|
||||
@ -181,6 +193,16 @@ void GcodeSuite::M906() {
|
||||
#if AXIS_IS_TMC(K)
|
||||
TMC_SAY_CURRENT(K);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(U)
|
||||
TMC_SAY_CURRENT(U);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(V)
|
||||
TMC_SAY_CURRENT(V);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(W)
|
||||
TMC_SAY_CURRENT(W);
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
TMC_SAY_CURRENT(E0);
|
||||
#endif
|
||||
@ -217,7 +239,8 @@ void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
|
||||
};
|
||||
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) \
|
||||
|| AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K)
|
||||
|| AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K) \
|
||||
|| AXIS_IS_TMC(U) || AXIS_IS_TMC(V) || AXIS_IS_TMC(W)
|
||||
say_M906(forReplay);
|
||||
#if AXIS_IS_TMC(X)
|
||||
SERIAL_ECHOPGM_P(SP_X_STR, stepperX.getMilliamps());
|
||||
@ -237,6 +260,15 @@ void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
|
||||
#if AXIS_IS_TMC(K)
|
||||
SERIAL_ECHOPGM_P(SP_K_STR, stepperK.getMilliamps());
|
||||
#endif
|
||||
#if AXIS_IS_TMC(U)
|
||||
SERIAL_ECHOPGM_P(SP_U_STR, stepperU.getMilliamps());
|
||||
#endif
|
||||
#if AXIS_IS_TMC(V)
|
||||
SERIAL_ECHOPGM_P(SP_V_STR, stepperV.getMilliamps());
|
||||
#endif
|
||||
#if AXIS_IS_TMC(W)
|
||||
SERIAL_ECHOPGM_P(SP_W_STR, stepperW.getMilliamps());
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
#endif
|
||||
|
||||
|
@ -53,12 +53,21 @@
|
||||
#if HAS_K_AXIS && M91x_USE(K)
|
||||
#define M91x_USE_K 1
|
||||
#endif
|
||||
#if HAS_U_AXIS && M91x_USE(U)
|
||||
#define M91x_USE_U 1
|
||||
#endif
|
||||
#if HAS_V_AXIS && M91x_USE(V)
|
||||
#define M91x_USE_V 1
|
||||
#endif
|
||||
#if HAS_W_AXIS && M91x_USE(W)
|
||||
#define M91x_USE_W 1
|
||||
#endif
|
||||
|
||||
#if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5) || M91x_USE_E(6) || M91x_USE_E(7)
|
||||
#define M91x_SOME_E 1
|
||||
#endif
|
||||
|
||||
#if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_USE_I && !M91x_USE_J && !M91x_USE_K && !M91x_SOME_E
|
||||
#if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_USE_I && !M91x_USE_J && !M91x_USE_K && !M91x_USE_U && !M91x_USE_V && !M91x_USE_W && !M91x_SOME_E
|
||||
#error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160."
|
||||
#endif
|
||||
|
||||
@ -109,6 +118,9 @@
|
||||
TERN_(M91x_USE_I, tmc_report_otpw(stepperI));
|
||||
TERN_(M91x_USE_J, tmc_report_otpw(stepperJ));
|
||||
TERN_(M91x_USE_K, tmc_report_otpw(stepperK));
|
||||
TERN_(M91x_USE_U, tmc_report_otpw(stepperU));
|
||||
TERN_(M91x_USE_V, tmc_report_otpw(stepperV));
|
||||
TERN_(M91x_USE_W, tmc_report_otpw(stepperW));
|
||||
#if M91x_USE_E(0)
|
||||
tmc_report_otpw(stepperE0);
|
||||
#endif
|
||||
@ -137,7 +149,7 @@
|
||||
|
||||
/**
|
||||
* M912: Clear TMC stepper driver overtemperature pre-warn flag held by the library
|
||||
* Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, Z3, Z4 and E[index].
|
||||
* Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, Z3, Z4, A, B, C, U, V, W, and E[index].
|
||||
* If no axes are given, clear all.
|
||||
*
|
||||
* Examples:
|
||||
@ -154,9 +166,12 @@
|
||||
hasI = TERN0(M91x_USE_I, parser.seen(axis_codes.i)),
|
||||
hasJ = TERN0(M91x_USE_J, parser.seen(axis_codes.j)),
|
||||
hasK = TERN0(M91x_USE_K, parser.seen(axis_codes.k)),
|
||||
hasU = TERN0(M91x_USE_U, parser.seen(axis_codes.u)),
|
||||
hasV = TERN0(M91x_USE_V, parser.seen(axis_codes.v)),
|
||||
hasW = TERN0(M91x_USE_W, parser.seen(axis_codes.w)),
|
||||
hasE = TERN0(M91x_SOME_E, parser.seen(axis_codes.e));
|
||||
|
||||
const bool hasNone = !hasE && !hasX && !hasY && !hasZ && !hasI && !hasJ && !hasK;
|
||||
const bool hasNone = !hasE && !hasX && !hasY && !hasZ && !hasI && !hasJ && !hasK && !hasU && !hasV && !hasW;
|
||||
|
||||
#if M91x_SOME_X
|
||||
const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF));
|
||||
@ -206,6 +221,18 @@
|
||||
const int8_t kval = int8_t(parser.byteval(axis_codes.k, 0xFF));
|
||||
if (hasNone || kval == 1 || (hasK && kval < 0)) tmc_clear_otpw(stepperK);
|
||||
#endif
|
||||
#if M91x_USE_U
|
||||
const int8_t uval = int8_t(parser.byteval(axis_codes.u, 0xFF));
|
||||
if (hasNone || uval == 1 || (hasU && uval < 0)) tmc_clear_otpw(stepperU);
|
||||
#endif
|
||||
#if M91x_USE_V
|
||||
const int8_t vval = int8_t(parser.byteval(axis_codes.v, 0xFF));
|
||||
if (hasNone || vval == 1 || (hasV && vval < 0)) tmc_clear_otpw(stepperV);
|
||||
#endif
|
||||
#if M91x_USE_W
|
||||
const int8_t wval = int8_t(parser.byteval(axis_codes.w, 0xFF));
|
||||
if (hasNone || wval == 1 || (hasW && wval < 0)) tmc_clear_otpw(stepperW);
|
||||
#endif
|
||||
|
||||
#if M91x_SOME_E
|
||||
const int8_t eval = int8_t(parser.byteval(axis_codes.e, 0xFF));
|
||||
@ -296,6 +323,15 @@
|
||||
#if K_HAS_STEALTHCHOP
|
||||
case K_AXIS: TMC_SET_PWMTHRS(K,K); break;
|
||||
#endif
|
||||
#if U_HAS_STEALTHCHOP
|
||||
case U_AXIS: TMC_SET_PWMTHRS(U,U); break;
|
||||
#endif
|
||||
#if V_HAS_STEALTHCHOP
|
||||
case V_AXIS: TMC_SET_PWMTHRS(V,V); break;
|
||||
#endif
|
||||
#if W_HAS_STEALTHCHOP
|
||||
case W_AXIS: TMC_SET_PWMTHRS(W,W); break;
|
||||
#endif
|
||||
|
||||
#if E0_HAS_STEALTHCHOP || E1_HAS_STEALTHCHOP || E2_HAS_STEALTHCHOP || E3_HAS_STEALTHCHOP || E4_HAS_STEALTHCHOP || E5_HAS_STEALTHCHOP || E6_HAS_STEALTHCHOP || E7_HAS_STEALTHCHOP
|
||||
case E_AXIS: {
|
||||
@ -326,6 +362,9 @@
|
||||
TERN_( I_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(I,I));
|
||||
TERN_( J_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(J,J));
|
||||
TERN_( K_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(K,K));
|
||||
TERN_( U_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(U,U));
|
||||
TERN_( V_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(V,V));
|
||||
TERN_( W_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(W,W));
|
||||
|
||||
TERN_(E0_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(1));
|
||||
@ -397,6 +436,18 @@
|
||||
say_M913(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_K_STR, stepperK.get_pwm_thrs());
|
||||
#endif
|
||||
#if U_HAS_STEALTHCHOP
|
||||
say_M913(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_U_STR, stepperU.get_pwm_thrs());
|
||||
#endif
|
||||
#if V_HAS_STEALTHCHOP
|
||||
say_M913(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_V_STR, stepperV.get_pwm_thrs());
|
||||
#endif
|
||||
#if W_HAS_STEALTHCHOP
|
||||
say_M913(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_W_STR, stepperW.get_pwm_thrs());
|
||||
#endif
|
||||
|
||||
#if E0_HAS_STEALTHCHOP
|
||||
say_M913(forReplay);
|
||||
@ -451,7 +502,7 @@
|
||||
|
||||
bool report = true;
|
||||
const uint8_t index = parser.byteval('I');
|
||||
LOOP_LINEAR_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
|
||||
LOOP_NUM_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
|
||||
const int16_t value = parser.value_int();
|
||||
report = false;
|
||||
switch (i) {
|
||||
@ -484,6 +535,15 @@
|
||||
#if K_SENSORLESS
|
||||
case K_AXIS: stepperK.homing_threshold(value); break;
|
||||
#endif
|
||||
#if U_SENSORLESS && AXIS_HAS_STALLGUARD(U)
|
||||
case U_AXIS: stepperU.homing_threshold(value); break;
|
||||
#endif
|
||||
#if V_SENSORLESS && AXIS_HAS_STALLGUARD(V)
|
||||
case V_AXIS: stepperV.homing_threshold(value); break;
|
||||
#endif
|
||||
#if W_SENSORLESS && AXIS_HAS_STALLGUARD(W)
|
||||
case W_AXIS: stepperW.homing_threshold(value); break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -499,6 +559,9 @@
|
||||
TERN_(I_SENSORLESS, tmc_print_sgt(stepperI));
|
||||
TERN_(J_SENSORLESS, tmc_print_sgt(stepperJ));
|
||||
TERN_(K_SENSORLESS, tmc_print_sgt(stepperK));
|
||||
TERN_(U_SENSORLESS, tmc_print_sgt(stepperU));
|
||||
TERN_(V_SENSORLESS, tmc_print_sgt(stepperV));
|
||||
TERN_(W_SENSORLESS, tmc_print_sgt(stepperW));
|
||||
}
|
||||
}
|
||||
|
||||
@ -561,6 +624,18 @@
|
||||
say_M914(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_K_STR, stepperK.homing_threshold());
|
||||
#endif
|
||||
#if U_SENSORLESS
|
||||
say_M914(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_U_STR, stepperU.homing_threshold());
|
||||
#endif
|
||||
#if V_SENSORLESS
|
||||
say_M914(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_V_STR, stepperV.homing_threshold());
|
||||
#endif
|
||||
#if W_SENSORLESS
|
||||
say_M914(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(SP_W_STR, stepperW.homing_threshold());
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // USE_SENSORLESS
|
||||
|
Reference in New Issue
Block a user