|
|
@ -384,54 +384,4 @@ |
|
|
|
} |
|
|
|
#endif // USE_SENSORLESS
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TMC Z axis calibration routine |
|
|
|
*/ |
|
|
|
#if ENABLED(TMC_Z_CALIBRATION) |
|
|
|
void GcodeSuite::M915() { |
|
|
|
const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT, |
|
|
|
_z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT; |
|
|
|
|
|
|
|
if (!TEST(axis_known_position, Z_AXIS)) { |
|
|
|
SERIAL_ECHOLNPGM("\nPlease home Z axis first"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
#if AXIS_IS_TMC(Z) |
|
|
|
const uint16_t Z_current_1 = stepperZ.getMilliamps(); |
|
|
|
stepperZ.rms_current(_rms); |
|
|
|
#endif |
|
|
|
#if AXIS_IS_TMC(Z2) |
|
|
|
const uint16_t Z2_current_1 = stepperZ2.getMilliamps(); |
|
|
|
stepperZ2.rms_current(_rms); |
|
|
|
#endif |
|
|
|
#if AXIS_IS_TMC(Z3) |
|
|
|
const uint16_t Z3_current_1 = stepperZ3.getMilliamps(); |
|
|
|
stepperZ3.rms_current(_rms); |
|
|
|
#endif |
|
|
|
|
|
|
|
SERIAL_ECHOPAIR("\nCalibration current: Z", _rms); |
|
|
|
|
|
|
|
soft_endstops_enabled = false; |
|
|
|
|
|
|
|
do_blocking_move_to_z(Z_MAX_POS+_z); |
|
|
|
|
|
|
|
#if AXIS_IS_TMC(Z) |
|
|
|
stepperZ.rms_current(Z_current_1); |
|
|
|
#endif |
|
|
|
#if AXIS_IS_TMC(Z2) |
|
|
|
stepperZ2.rms_current(Z2_current_1); |
|
|
|
#endif |
|
|
|
#if AXIS_IS_TMC(Z3) |
|
|
|
stepperZ3.rms_current(Z3_current_1); |
|
|
|
#endif |
|
|
|
|
|
|
|
do_blocking_move_to_z(Z_MAX_POS); |
|
|
|
soft_endstops_enabled = true; |
|
|
|
|
|
|
|
SERIAL_ECHOLNPGM("\nHoming Z because we lost steps"); |
|
|
|
enqueue_and_echo_commands_P(PSTR("G28 Z")); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_TRINAMIC
|