I'm running with 2130s on my 2560/Marlin/RAMPs 1.4 home made rig and using sensorless homing for X & Y. I stumbled across this GCODE today and the code for it is listed below. What the heck is this actually accomplishing?
I was super excited at first, thinking it would solve all my manual paper calibrations by automatically probing and detecting the extruder tip touching the bed.
By subtracting the missed steps it could automatically determine the distance between the IR Z sensor and where the tip actually is. I can't see what value this is actually providing, though.
Any thoughts?
inline void gcode_M915() {
uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT;
uint16_t _z = parser.seenval('Z') ? parser.value_int() : CALIBRATION_EXTRA_HEIGHT;
if (!axis_known_position[Z_AXIS]) {
SERIAL_ECHOLNPGM("\nPlease home Z axis first");
return;
}
uint16_t Z_current_1 = stepperZ.getCurrent();
uint16_t Z2_current_1 = stepperZ.getCurrent();
stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
SERIAL_ECHOPAIR("\nCalibration current: Z", _rms);
soft_endstops_enabled = false;
do_blocking_move_to_z(Z_MAX_POS+_z);
stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER);
stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER);
do_blocking_move_to_z(Z_MAX_POS);
soft_endstops_enabled = true;
SERIAL_ECHOLNPGM("\nHoming Z because we lost steps");
home_z_safely();
}