Nozzle as proble home offset application to probe points

This commit is contained in:
InsanityAutomation
2020-08-23 16:07:15 -04:00
parent d28b66a672
commit 3344d04d83
6 changed files with 33 additions and 19 deletions
+1 -1
View File
@@ -1455,7 +1455,7 @@
* Turn on with the command 'M111 S32'.
* NOTE: Requires a lot of PROGMEM!
*/
//#define DEBUG_LEVELING_FEATURE
#define DEBUG_LEVELING_FEATURE
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL)
// Gradually reduce leveling correction until a set height is reached,
+4 -4
View File
@@ -3320,16 +3320,16 @@
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Aerostruder"
#define USER_GCODE_1 "M92E420\nM907E875\nM500"
#define USER_GCODE_1 "M92E420\nM206X0Y0\nM907E875\nM500"
#define USER_DESC_2 "Moarstruder"
#define USER_GCODE_2 "M92E819\nM907E750\nM500"
#define USER_GCODE_2 "M92E819\nM206X0Y0\nM907E750\nM500"
#define USER_DESC_3 "Standard"
#define USER_GCODE_3 "M92E814\nM907E750\nM500"
#define USER_GCODE_3 "M92E814\nM206X0Y0\nM907E750\nM500"
#define USER_DESC_4 "Mosquito BMG-M"
#define USER_GCODE_4 "M92E814\nM206X5Y15\nM907E750\nM500"
#define USER_GCODE_4 "M92E814\nM206X-5Y-12\nM907E750\nM500"
#endif
/**
+10 -6
View File
@@ -285,8 +285,8 @@ G29_TYPE GcodeSuite::G29() {
G29_RETURN(false);
}
const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
const float rx = (parser.linearval('X', NAN)),
ry = (parser.linearval('Y', NAN));
int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);
if (!isnan(rx) && !isnan(ry)) {
@@ -377,16 +377,20 @@ G29_TYPE GcodeSuite::G29() {
}
else {
probe_position_lf.set(
parser.seenval('L') ? RAW_X_POSITION(parser.value_linear_units()) : x_min,
parser.seenval('F') ? RAW_Y_POSITION(parser.value_linear_units()) : y_min
parser.seenval('L') ? (parser.value_linear_units()) : x_min,
parser.seenval('F') ? (parser.value_linear_units()) : y_min
);
probe_position_rb.set(
parser.seenval('R') ? RAW_X_POSITION(parser.value_linear_units()) : x_max,
parser.seenval('B') ? RAW_Y_POSITION(parser.value_linear_units()) : y_max
parser.seenval('R') ? (parser.value_linear_units()) : x_max,
parser.seenval('B') ? (parser.value_linear_units()) : y_max
);
}
if (!probe.good_bounds(probe_position_lf, probe_position_rb)) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Left : ", probe_position_lf.x);
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Right : ", probe_position_rb.x);
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Front : ", probe_position_lf.y);
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Back : ", probe_position_rb.y);
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds.");
G29_RETURN(false);
}
+6 -4
View File
@@ -125,14 +125,16 @@
* Move the Z probe (or just the nozzle) to the safe homing point
* (Z is already at the right height)
*/
destination.set((xy_float_t){ Z_SAFE_HOMING_X_POINT + home_offset[X_AXIS], Z_SAFE_HOMING_Y_POINT + home_offset[Y_AXIS] }, current_position.z);
//update_workspace_offset(X_AXIS);
//update_workspace_offset(Y_AXIS);
destination.set((xy_float_t){ Z_SAFE_HOMING_X_POINT - home_offset[X_AXIS], Z_SAFE_HOMING_Y_POINT - home_offset[Y_AXIS] }, current_position.z);
//destination.set((xy_float_t){ Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT }, current_position.z);
TERN_(HOMING_Z_WITH_PROBE, destination -= probe.offset_xy);
if (position_is_reachable(destination)) {
if (DEBUGGING(LEVELING)) DEBUG_POS("home_z_safely", destination);
if (DEBUGGING(LEVELING)) DEBUG_POS("home_z_safely", destination);
if (position_is_reachable(destination)) {
// This causes the carriage on Dual X to unpark
TERN_(DUAL_X_CARRIAGE, active_extruder_parked = false);
+12
View File
@@ -153,6 +153,9 @@ public:
#else
_MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x)
#endif
#if ENABLED(NOZZLE_AS_PROBE)
- home_offset[X_AXIS]
#endif
);
}
static inline float max_x() {
@@ -162,6 +165,9 @@ public:
#else
_MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x)
#endif
#if ENABLED(NOZZLE_AS_PROBE)
- home_offset[X_AXIS]
#endif
);
}
static inline float min_y() {
@@ -171,6 +177,9 @@ public:
#else
_MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y)
#endif
#if ENABLED(NOZZLE_AS_PROBE)
- home_offset[Y_AXIS]
#endif
);
}
static inline float max_y() {
@@ -180,6 +189,9 @@ public:
#else
_MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y)
#endif
#if ENABLED(NOZZLE_AS_PROBE)
- home_offset[Y_AXIS]
#endif
);
}
-4
View File
@@ -2104,7 +2104,6 @@ void MarlinSettings::postprocess() {
// Motor Current PWM
//
{
SERIAL_ECHOLN("DIGIPOTS Loading");
#if HAS_DIGIPOTSS
uint32_t motor_current_setting[] = DIGIPOT_MOTOR_CURRENT;
#else
@@ -2116,7 +2115,6 @@ void MarlinSettings::postprocess() {
if (!validating)
COPY(stepper.motor_current_setting, motor_current_setting);
#endif
SERIAL_ECHOLN("DIGIPOTS Loaded");
}
//
@@ -2799,13 +2797,11 @@ void MarlinSettings::reset() {
//
// DIGIPOTS
//
SERIAL_ECHOLN("Writing Digipot");
#if HAS_DIGIPOTSS
static constexpr uint32_t tmp_motor_current_setting[] = DIGIPOT_MOTOR_CURRENT;
LOOP_L_N(q, COUNT(tmp_motor_current_setting))
stepper.digipot_current(q, tmp_motor_current_setting[q]);
#endif
SERIAL_ECHOLN("Digipot Written");
//
// CNC Coordinate System
//