Merge pull request #1672 from thinkyhead/fix_probeaction

Fix mangled probe_pt calls
master
Scott Lahteine 9 years ago
commit f65f61fa72

@ -417,12 +417,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -1370,12 +1370,11 @@ static void retract_z_probe() {
} }
enum ProbeAction enum ProbeAction {
{ ProbeStay = 0,
ProbeStay = 0, ProbeEngage = BIT(0),
ProbeEngage = (1 << 0), ProbeRetract = BIT(1),
ProbeRetract = (1 << 1), ProbeEngageAndRetract = (ProbeEngage | ProbeRetract)
ProbeEngageAndRetract = (ProbeEngage | ProbeRetract),
}; };
/// Probe bed height at position (x,y), returns the measured z value /// Probe bed height at position (x,y), returns the measured z value
@ -2178,7 +2177,7 @@ inline void gcode_G28() {
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
#ifndef DELTA #ifndef DELTA
bool topo_flag = verbose_level > 2 || code_seen('T') || code_seen('t'); bool do_topography_map = verbose_level > 2 || code_seen('T') || code_seen('t');
#endif #endif
if (verbose_level > 0) if (verbose_level > 0)
@ -2239,9 +2238,10 @@ inline void gcode_G28() {
st_synchronize(); st_synchronize();
#ifdef DELTA #ifdef DELTA
reset_bed_level(); reset_bed_level();
#else #else
// make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
//vector_3 corrected_position = plan_get_position_mm(); //vector_3 corrected_position = plan_get_position_mm();
//corrected_position.debug("position before G29"); //corrected_position.debug("position before G29");
@ -2282,42 +2282,36 @@ inline void gcode_G28() {
delta_grid_spacing[1] = yGridSpacing; delta_grid_spacing[1] = yGridSpacing;
float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER; float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER;
if (code_seen(axis_codes[Z_AXIS])) { if (code_seen(axis_codes[Z_AXIS])) z_offset += code_value();
z_offset += code_value();
}
#endif #endif
int probePointCounter = 0; int probePointCounter = 0;
bool zig = true; bool zig = true;
for (int yCount=0; yCount < auto_bed_leveling_grid_points; yCount++) for (int yCount = 0; yCount < auto_bed_leveling_grid_points; yCount++) {
{
double yProbe = front_probe_bed_position + yGridSpacing * yCount; double yProbe = front_probe_bed_position + yGridSpacing * yCount;
int xStart, xStop, xInc; int xStart, xStop, xInc;
if (zig) if (zig) {
{
xStart = 0; xStart = 0;
xStop = auto_bed_leveling_grid_points; xStop = auto_bed_leveling_grid_points;
xInc = 1; xInc = 1;
zig = false; zig = false;
} }
else else {
{
xStart = auto_bed_leveling_grid_points - 1; xStart = auto_bed_leveling_grid_points - 1;
xStop = -1; xStop = -1;
xInc = -1; xInc = -1;
zig = true; zig = true;
} }
#ifndef DELTA #ifndef DELTA
// If topo_flag is set then don't zig-zag. Just scan in one direction. // If do_topography_map is set then don't zig-zag. Just scan in one direction.
// This gets the probe points in more readable order. // This gets the probe points in more readable order.
if (!topo_flag) zig = !zig; if (!do_topography_map) zig = !zig;
#endif #endif
for (int xCount=xStart; xCount != xStop; xCount += xInc) for (int xCount = xStart; xCount != xStop; xCount += xInc) {
{
double xProbe = left_probe_bed_position + xGridSpacing * xCount; double xProbe = left_probe_bed_position + xGridSpacing * xCount;
// raise extruder // raise extruder
@ -2384,49 +2378,31 @@ inline void gcode_G28() {
} }
} }
if (topo_flag) { // Show the Topography map if enabled
if (do_topography_map) {
int xx, yy;
SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n"); SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n");
#if TOPO_ORIGIN == OriginFrontLeft SERIAL_PROTOCOLPGM("+-----------+\n");
SERIAL_PROTOCOLPGM("+-----------+\n"); SERIAL_PROTOCOLPGM("|...Back....|\n");
SERIAL_PROTOCOLPGM("|...Back....|\n"); SERIAL_PROTOCOLPGM("|Left..Right|\n");
SERIAL_PROTOCOLPGM("|Left..Right|\n"); SERIAL_PROTOCOLPGM("|...Front...|\n");
SERIAL_PROTOCOLPGM("|...Front...|\n"); SERIAL_PROTOCOLPGM("+-----------+\n");
SERIAL_PROTOCOLPGM("+-----------+\n");
for (yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
#else for (int xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--) {
for (yy = 0; yy < auto_bed_leveling_grid_points; yy++) int ind = yy * auto_bed_leveling_grid_points + xx;
#endif float diff = eqnBVector[ind] - mean;
{ if (diff >= 0.0)
#if TOPO_ORIGIN == OriginBackRight SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment
for (xx = 0; xx < auto_bed_leveling_grid_points; xx++) else
#else SERIAL_PROTOCOLPGM(" ");
for (xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--) SERIAL_PROTOCOL_F(diff, 5);
#endif } // xx
{
int ind =
#if TOPO_ORIGIN == OriginBackRight || TOPO_ORIGIN == OriginFrontLeft
yy * auto_bed_leveling_grid_points + xx
#elif TOPO_ORIGIN == OriginBackLeft
xx * auto_bed_leveling_grid_points + yy
#elif TOPO_ORIGIN == OriginFrontRight
abl2 - xx * auto_bed_leveling_grid_points - yy - 1
#endif
;
float diff = eqnBVector[ind] - mean;
if (diff >= 0.0)
SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment
else
SERIAL_PROTOCOLPGM(" ");
SERIAL_PROTOCOL_F(diff, 5);
} // xx
SERIAL_EOL;
} // yy
SERIAL_EOL; SERIAL_EOL;
} // yy
SERIAL_EOL;
} //topo_flag } //do_topography_map
set_bed_level_equation_lsq(plane_equation_coefficients); set_bed_level_equation_lsq(plane_equation_coefficients);
@ -2448,9 +2424,9 @@ inline void gcode_G28() {
z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeRetract, verbose_level); z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeRetract, verbose_level);
} }
else { else {
z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, verbose_level=verbose_level); z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, ProbeEngageAndRetract, verbose_level);
z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level=verbose_level); z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level);
z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level=verbose_level); z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level);
} }
clean_up_after_endstop_move(); clean_up_after_endstop_move();
set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);

@ -440,12 +440,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -386,12 +386,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Note: this feature occupies 10'206 byte // Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin home_offset // set the rectangle in which to probe
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180 #define BACK_PROBE_BED_POSITION 180

@ -386,12 +386,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Note: this feature occupies 10'206 byte // Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin home_offset // set the rectangle in which to probe
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180 #define BACK_PROBE_BED_POSITION 180

@ -410,12 +410,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -415,12 +415,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -439,12 +439,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -409,12 +409,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -407,12 +407,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

@ -409,12 +409,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
// The edges of the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170 #define RIGHT_PROBE_BED_POSITION 170
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20

Loading…
Cancel
Save