gcode->stream->printf("initial Bed ht is %f mm\n", bedht);
- // move to start position
- zprobe->home();
- zprobe->coordinated_move(NAN, NAN, -bedht, zprobe->getFastFeedrate(), true); // do a relative move from home to the point above the bed
+ // check probe ht
+ int s;
+ if(!zprobe->doProbeAt(s, 0, 0)) return false;
+ float dz = zprobe->getProbeHeight() - zprobe->zsteps_to_mm(s);
+ gcode->stream->printf("center probe: %1.4f\n", dz);
// get probe points
float t1x, t1y, t2x, t2y, t3x, t3y;
// find bed, run at slow rate so as to not hit bed hard
int s;
if(!zprobe->run_probe(s, false)) return NAN;
+ zprobe->return_probe(s);
+
+ // leave the probe zprobe->getProbeHeight() above bed
+ float dz= zprobe->getProbeHeight() - zprobe->zsteps_to_mm(s);
+ if(dz >= 0) {
+ // probe was not started above bed
+ return NAN;
+ }
+ zprobe->coordinated_move(NAN, NAN, dz, zprobe->getFastFeedrate(), true); // relative move
return zprobe->zsteps_to_mm(s) + deltaz - zprobe->getProbeHeight(); // distance to move from home to 5mm above bed
}
if(isnan(bedht)) return false;
gcode->stream->printf("initial Bed ht is %f mm\n", bedht);
- // move to start position
- zprobe->home();
- zprobe->coordinated_move(NAN, NAN, -bedht, zprobe->getFastFeedrate(), true); // do a relative move from home to the point above the bed
+ // check probe ht
+ int s;
+ if(!zprobe->doProbeAt(s, 0, 0)) return false;
+ float dz = zprobe->getProbeHeight() - zprobe->zsteps_to_mm(s);
+ gcode->stream->printf("center probe: %1.4f\n", dz);
+ if(fabsf(dz) > target) {
+ gcode->stream->printf("Probe was not repeatable to %f mm, (%f)\n", target, dz);
+ return false;
+ }
// get initial probes
// probe the base of the X tower
- int s;
if(!zprobe->doProbeAt(s, t1x, t1y)) return false;
float t1z = zprobe->zsteps_to_mm(s);
gcode->stream->printf("T1-0 Z:%1.4f C:%d\n", t1z, s);
if(isnan(bedht)) return false;
gcode->stream->printf("initial Bed ht is %f mm\n", bedht);
- zprobe->home();
- zprobe->coordinated_move(NAN, NAN, -bedht, zprobe->getFastFeedrate(), true); // do a relative move from home to the point above the bed
+ // check probe ht
+ int s;
+ if(!zprobe->doProbeAt(s, 0, 0)) return false;
+ float dz = zprobe->getProbeHeight() - zprobe->zsteps_to_mm(s);
+ gcode->stream->printf("center probe: %1.4f\n", dz);
+ if(fabsf(dz) > target) {
+ gcode->stream->printf("Probe was not repeatable to %f mm, (%f)\n", target, dz);
+ return false;
+ }
// probe center to get reference point at this Z height
int dc;