Skip to content

G33 minor change #6558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0aaee91
Merge remote-tracking branch 'refs/remotes/MarlinFirmware/RCBugFix' i…
LVD-AC May 3, 2017
4937266
Merge remote-tracking branch 'refs/remotes/MarlinFirmware/RCBugFix' i…
LVD-AC May 3, 2017
f3de3d1
Minor change to G33
LVD-AC May 3, 2017
fd8af32
thinkyhead remarks
LVD-AC May 4, 2017
c095ee9
Readme Version 1.1.0
thinkyhead May 4, 2017
3cd9af2
bugfix-1.1.x ReadMe, Version, helper scripts
thinkyhead May 4, 2017
058787d
Thinkyhead comments
LVD-AC May 4, 2017
ae7c602
fix error in M105 output -- use SERIAL_PROTOCOL for ints instead of S…
bgort May 4, 2017
267f3a0
Fixed USE_CONTROLLER_FAN #define usage
May 4, 2017
2e4abf3
correction
LVD-AC May 5, 2017
0cc4b08
Merge pull request #6587 from zlowred/bugfix-1.1.x
thinkyhead May 5, 2017
c07c169
Merge remote-tracking branch 'refs/remotes/MarlinFirmware/bugfix-1.1.…
LVD-AC May 5, 2017
f0f2073
Merge remote-tracking branch 'refs/remotes/MarlinFirmware/bugfix-1.1.…
LVD-AC May 5, 2017
f878e59
credit
LVD-AC May 5, 2017
e4d1af6
Thinkyhead comments amendment
LVD-AC May 5, 2017
3bcd034
Preventing premature end
LVD-AC May 5, 2017
7fcb5c1
Minor fix in K8200 readme
thinkyhead May 5, 2017
6876e79
Tweak command index increment
thinkyhead May 5, 2017
d14b068
Tweak git helper scripts
thinkyhead May 5, 2017
77769e2
Edit configuration comments
thinkyhead May 5, 2017
66bedc1
Merge pull request #6600 from thinkyhead/bugfix_first_fixes
thinkyhead May 5, 2017
bef9791
Fix mfrb and mfpub
thinkyhead May 5, 2017
e8b87ca
Merge remote-tracking branch 'refs/remotes/MarlinFirmware/bugfix-1.1.…
LVD-AC May 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 38 additions & 36 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5060,20 +5060,16 @@ void home_all_axes() { gcode_G28(); }
*
* Parameters:
*
* P Number of probe points:
* Pn Number of probe points:
*
* P1 Probe center and set height only.
* P2 Probe center and towers. Set height, endstops, and delta radius.
* P3 Probe all positions: center, towers and opposite towers. Set all.
* P4-P7 Probe all positions at different locations and average them.
*
* A Abort delta height calibration after 1 probe (only P1)
* T0 Don't calibrate tower angle corrections
*
* O Use opposite tower points instead of tower points (only P2)
*
* T Don't calibrate tower angle corrections (P3-P7)
*
* V Verbose level:
* Vn Verbose level:
*
* V0 Dry-run mode. Report settings and probe results. No calibration.
* V1 Report settings
Expand Down Expand Up @@ -5103,16 +5099,19 @@ void home_all_axes() { gcode_G28(); }
point_averaging = probe_points >= 4,
probe_center_plus_6 = probe_points >= 5;

const char negating_parameter = do_height_only ? 'A' : do_center_and_towers ? 'O' : 'T';
int8_t probe_mode = code_seen(negating_parameter) && code_value_bool() ? -probe_points : probe_points;
bool towers_set = (code_seen('T') ? code_value_bool() : true);

SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");

stepper.synchronize();
#if HAS_LEVELING
set_bed_leveling_enabled(false);
reset_bed_level(); //after calibration bed-level will no longer be valid
#endif

home_all_axes();
#if HOTENDS > 1
tool_change(0, 0, true);
#endif
endstops.enable(true);
home_delta();

const static char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
float test_precision,
Expand Down Expand Up @@ -5148,7 +5147,7 @@ void home_all_axes() { gcode_G28(); }
SERIAL_PROTOCOLPAIR(" Radius:", delta_radius);
}
SERIAL_EOL;
if (probe_mode > 2) { // negative disables tower angles
if (probe_center_plus_3 && towers_set) {
SERIAL_PROTOCOLPGM(".Tower angle : Tx:");
if (delta_tower_angle_trim[A_AXIS] >= 0) SERIAL_CHAR('+');
SERIAL_PROTOCOL_F(delta_tower_angle_trim[A_AXIS], 2);
Expand Down Expand Up @@ -5194,7 +5193,7 @@ void home_all_axes() { gcode_G28(); }
}
if (!do_height_only) { // probe the radius
bool zig_zag = true;
for (uint8_t axis = (probe_mode == -2 ? 3 : 1); axis < 13;
for (uint8_t axis = (do_center_and_towers && !towers_set ? 3 : 1); axis < 13;
axis += (do_center_and_towers ? 4 : do_all_positions ? 2 : 1)) {
float offset_circles = (do_circle_x4 ? (zig_zag ? 1.5 : 1.0) :
do_circle_x3 ? (zig_zag ? 1.0 : 0.5) :
Expand All @@ -5220,7 +5219,7 @@ void home_all_axes() { gcode_G28(); }
S2 += sq(z_at_pt[0]);
N++;
if (!do_height_only) // std dev from zero plane
for (uint8_t axis = (probe_mode == -2 ? 3 : 1); axis < 13; axis += (do_center_and_towers ? 4 : 2)) {
for (uint8_t axis = (do_center_and_towers && !towers_set ? 3 : 1); axis < 13; axis += (do_center_and_towers ? 4 : 2)) {
S1 += z_at_pt[axis];
S2 += sq(z_at_pt[axis]);
N++;
Expand Down Expand Up @@ -5255,25 +5254,25 @@ void home_all_axes() { gcode_G28(); }
#define Z0444(I) ZP(a_factor * 4.0 / 9.0, I)
#define Z0888(I) ZP(a_factor * 8.0 / 9.0, I)

switch (probe_mode) {
case -1:
test_precision = 0.00;
switch (probe_points) {
case 1:
test_precision = 0.00;
LOOP_XYZ(i) e_delta[i] = Z1000(0);
break;

case 2:
e_delta[X_AXIS] = Z1050(0) + Z0700(1) - Z0350(5) - Z0350(9);
e_delta[Y_AXIS] = Z1050(0) - Z0350(1) + Z0700(5) - Z0350(9);
e_delta[Z_AXIS] = Z1050(0) - Z0350(1) - Z0350(5) + Z0700(9);
r_delta = Z2250(0) - Z0750(1) - Z0750(5) - Z0750(9);
break;

case -2:
e_delta[X_AXIS] = Z1050(0) - Z0700(7) + Z0350(11) + Z0350(3);
e_delta[Y_AXIS] = Z1050(0) + Z0350(7) - Z0700(11) + Z0350(3);
e_delta[Z_AXIS] = Z1050(0) + Z0350(7) + Z0350(11) - Z0700(3);
r_delta = Z2250(0) - Z0750(7) - Z0750(11) - Z0750(3);
if (towers_set) {
e_delta[X_AXIS] = Z1050(0) + Z0700(1) - Z0350(5) - Z0350(9);
e_delta[Y_AXIS] = Z1050(0) - Z0350(1) + Z0700(5) - Z0350(9);
e_delta[Z_AXIS] = Z1050(0) - Z0350(1) - Z0350(5) + Z0700(9);
r_delta = Z2250(0) - Z0750(1) - Z0750(5) - Z0750(9);
}
else {
e_delta[X_AXIS] = Z1050(0) - Z0700(7) + Z0350(11) + Z0350(3);
e_delta[Y_AXIS] = Z1050(0) + Z0350(7) - Z0700(11) + Z0350(3);
e_delta[Z_AXIS] = Z1050(0) + Z0350(7) + Z0350(11) - Z0700(3);
r_delta = Z2250(0) - Z0750(7) - Z0750(11) - Z0750(3);
}
break;

default:
Expand All @@ -5282,7 +5281,7 @@ void home_all_axes() { gcode_G28(); }
e_delta[Z_AXIS] = Z1050(0) - Z0175(1) - Z0175(5) + Z0350(9) + Z0175(7) + Z0175(11) - Z0350(3);
r_delta = Z2250(0) - Z0375(1) - Z0375(5) - Z0375(9) - Z0375(7) - Z0375(11) - Z0375(3);

if (probe_mode > 0) { // negative disables tower angles
if (towers_set) {
t_alpha = + Z0444(1) - Z0888(5) + Z0444(9) + Z0444(7) - Z0888(11) + Z0444(3);
t_beta = - Z0888(1) + Z0444(5) + Z0444(9) - Z0888(7) + Z0444(11) + Z0444(3);
}
Expand Down Expand Up @@ -5317,7 +5316,7 @@ void home_all_axes() { gcode_G28(); }
SERIAL_PROTOCOLPGM(". c:");
if (z_at_pt[0] > 0) SERIAL_CHAR('+');
SERIAL_PROTOCOL_F(z_at_pt[0], 2);
if (probe_mode == 2 || probe_center_plus_3) {
if ((do_center_and_towers && towers_set) || probe_center_plus_3) {
SERIAL_PROTOCOLPGM(" x:");
if (z_at_pt[1] >= 0) SERIAL_CHAR('+');
SERIAL_PROTOCOL_F(z_at_pt[1], 2);
Expand All @@ -5328,8 +5327,8 @@ void home_all_axes() { gcode_G28(); }
if (z_at_pt[9] >= 0) SERIAL_CHAR('+');
SERIAL_PROTOCOL_F(z_at_pt[9], 2);
}
if (probe_mode != -2) SERIAL_EOL;
if (probe_mode == -2 || probe_center_plus_3) {
if (!do_center_and_towers || towers_set) SERIAL_EOL;
if ((do_center_and_towers && !towers_set) || probe_center_plus_3) {
if (probe_center_plus_3) {
SERIAL_CHAR('.');
SERIAL_PROTOCOL_SP(13);
Expand Down Expand Up @@ -5379,7 +5378,7 @@ void home_all_axes() { gcode_G28(); }
SERIAL_PROTOCOLPAIR(" Radius:", delta_radius);
}
SERIAL_EOL;
if (probe_mode > 2) { // negative disables tower angles
if (probe_center_plus_3 && towers_set) {
SERIAL_PROTOCOLPGM(".Tower angle : Tx:");
if (delta_tower_angle_trim[A_AXIS] >= 0) SERIAL_CHAR('+');
SERIAL_PROTOCOL_F(delta_tower_angle_trim[A_AXIS], 2);
Expand Down Expand Up @@ -5412,11 +5411,14 @@ void home_all_axes() { gcode_G28(); }
}

stepper.synchronize();

home_all_axes();
endstops.enable(true);
Copy link
Member

@thinkyhead thinkyhead May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup_for_endstop_or_probe_move perhaps here? And after homing, clean_up_after_endstop_or_probe_move… possibly… See if these functions do the right thing for this situation.

Copy link
Member

@thinkyhead thinkyhead May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, after enabling endstops to do something, when done the method to call is endstops.not_homing() which will set them back to their global non-homing state.

home_delta();

} while (zero_std_dev < test_precision && iterations < 31);

#if ENABLED(DELTA_HOME_TO_SAFE_ZONE)
do_blocking_move_to_z(delta_clip_start_height);
#endif
#if ENABLED(Z_PROBE_SLED)
RETRACT_PROBE();
#endif
Expand Down