G33 eccentric probe fixes (#6850)

* excentric probe config fix

* undo last commit

* eccentric probe fix

* oops

* !stow after each probe

* deploy/stow fix

* E parameter + bit of cleanup

* comment

* LCD menu fix
This commit is contained in:
Luc Van Daele 2017-06-12 08:07:19 +02:00 committed by Scott Lahteine
parent e47029199e
commit 896dfa0577
2 changed files with 29 additions and 31 deletions

View file

@ -5080,6 +5080,8 @@ void home_all_axes() { gcode_G28(true); }
* V0 Dry-run mode. Report settings and probe results. No calibration.
* V1 Report settings
* V2 Report settings and probe results
*
* E Engage the probe for each point
*/
inline void gcode_G33() {
@ -5102,6 +5104,7 @@ void home_all_axes() { gcode_G28(true); }
}
const bool towers_set = !parser.seen('T'),
stow_after_each = parser.seen('E'),
_1p_calibration = probe_points == 1,
_4p_calibration = probe_points == 2,
_4p_towers_points = _4p_calibration && towers_set,
@ -5120,30 +5123,17 @@ void home_all_axes() { gcode_G28(true); }
_7p_double_circle ? 0.5 : 0),
radius = (1 + circles * 0.1) * delta_calibration_radius;
for (uint8_t axis = 1; axis < 13; ++axis) {
if (!position_is_reachable_by_probe_xy(cos(RADIANS(180 + 30 * axis)) * radius, sin(RADIANS(180 + 30 * axis)) * radius)) {
if (!position_is_reachable_xy(cos(RADIANS(180 + 30 * axis)) * radius, sin(RADIANS(180 + 30 * axis)) * radius)) {
SERIAL_PROTOCOLLNPGM("?(M665 B)ed radius is implausible.");
return;
}
}
}
SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");
stepper.synchronize();
#if HAS_LEVELING
reset_bed_level(); // After calibration bed-level data is no longer valid
#endif
#if HOTENDS > 1
const uint8_t old_tool_index = active_extruder;
tool_change(0, 0, true);
#endif
setup_for_endstop_or_probe_move();
endstops.enable(true);
home_delta();
endstops.not_homing();
const static char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
const float dx = (X_PROBE_OFFSET_FROM_EXTRUDER),
dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
int8_t iterations = 0;
float test_precision,
zero_std_dev = (verbose_level ? 999.0 : 0.0), // 0.0 in dry-run mode : forced end
zero_std_dev_old = zero_std_dev,
@ -5157,6 +5147,22 @@ void home_all_axes() { gcode_G28(true); }
alpha_old = delta_tower_angle_trim[A_AXIS],
beta_old = delta_tower_angle_trim[B_AXIS];
SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");
stepper.synchronize();
#if HAS_LEVELING
reset_bed_level(); // After calibration bed-level data is no longer valid
#endif
#if HOTENDS > 1
const uint8_t old_tool_index = active_extruder;
tool_change(0, 0, true);
#endif
setup_for_endstop_or_probe_move();
DEPLOY_PROBE();
endstops.enable(true);
home_delta();
endstops.not_homing();
// print settings
SERIAL_PROTOCOLPGM("Checking... AC");
@ -5189,13 +5195,7 @@ void home_all_axes() { gcode_G28(true); }
SERIAL_EOL();
}
#if ENABLED(Z_PROBE_SLED)
DEPLOY_PROBE();
#endif
int8_t iterations = 0;
home_offset[Z_AXIS] -= probe_pt(0.0, 0.0 , true, 1); // 1st probe to set height
home_offset[Z_AXIS] -= probe_pt(dx, dy, stow_after_each, 1); // 1st probe to set height
do_probe_raise(Z_CLEARANCE_BETWEEN_PROBES);
do {
@ -5210,12 +5210,12 @@ void home_all_axes() { gcode_G28(true); }
// Probe the points
if (!_7p_half_circle && !_7p_triple_circle) { // probe the center
z_at_pt[0] += probe_pt(0.0, 0.0 , true, 1);
z_at_pt[0] += probe_pt(dx, dy, stow_after_each, 1);
}
if (_7p_calibration) { // probe extra center points
for (int8_t axis = _7p_multi_circle ? 11 : 9; axis > 0; axis -= _7p_multi_circle ? 2 : 4) {
const float a = RADIANS(180 + 30 * axis), r = delta_calibration_radius * 0.1;
z_at_pt[0] += probe_pt(cos(a) * r, sin(a) * r, true, 1); // TODO: Needs error handling
z_at_pt[0] += probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1);
}
z_at_pt[0] /= float(_7p_double_circle ? 7 : probe_points);
}
@ -5230,7 +5230,7 @@ void home_all_axes() { gcode_G28(true); }
for (float circles = -offset_circles ; circles <= offset_circles; circles++) {
const float a = RADIANS(180 + 30 * axis),
r = delta_calibration_radius * (1 + circles * (zig_zag ? 0.1 : -0.1));
z_at_pt[axis] += probe_pt(cos(a) * r, sin(a) * r, true, 1); // TODO: Needs error handling
z_at_pt[axis] += probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1);
}
zig_zag = !zig_zag;
z_at_pt[axis] /= (2 * offset_circles + 1);
@ -5452,13 +5452,11 @@ void home_all_axes() { gcode_G28(true); }
#if ENABLED(DELTA_HOME_TO_SAFE_ZONE)
do_blocking_move_to_z(delta_clip_start_height);
#endif
STOW_PROBE();
clean_up_after_endstop_or_probe_move();
#if HOTENDS > 1
tool_change(old_tool_index, 0, true);
#endif
#if ENABLED(Z_PROBE_SLED)
RETRACT_PROBE();
#endif
}
#endif // DELTA_AUTO_CALIBRATION

View file

@ -2323,7 +2323,7 @@ void kill_screen(const char* lcd_msg) {
MENU_BACK(MSG_MAIN);
#if ENABLED(DELTA_AUTO_CALIBRATION)
MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1 A"));
MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1"));
#endif
MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
if (axis_homed[Z_AXIS]) {