G30 mistery
0.92.8 (jan19) on delta+2560+ramps1.4+IR probe
tested repeteability of the probe +-0.02
declared zheight=441.87 (Measured with 0.05 feeler gauge nozzle/bed)
1st strange thing
with zprobe height=0 G30 report 7.49
with zprobe height=1 G30 report 9.50
it seems to have doubled zheight value, I've looked at the code under float Printer::runZMaxProbe but I don't have enought knowledge on arduino to understand it clearly
2nd in repetier.h: G30 P<0..3> - Single z-probe at current position P = 1 first measurement, P = 2 Last measurement P = 0 or 3 first and last measurement, so I tried (with zprobe height=1 all entry after homing to max with G28):
G30 P0 report 440.16 go from zmax to probe point at probe speed, not apply yoffset declared, return to zmax (not homing)
G30 P1 report 9.52 normal cycle like G30 speed, apply offset, not homig goto zprobe-bed dist
G30 P2 report 440.14 go from zmax to probe point at probe speed, not apply yoffset declared, return to zmax (not homing)
G30 P3 report 9.52 normal cycle like G30 speed, apply offset, not homig goto zprobe-bed dist
mybe I didn't understood the explanation of G30.
other experiment:
if I set zprobe height to 0, I send G30 P0, the measured value is 439,13 so if the measured zheigh is 441.87-439,13=2.74 it's my real probe height? (this value is very near to the measured distance from the bed obtained with feeler gauge 2.65)
But if I put this value as zprobe height the result of a G30 probing is 12.97 like 2.74 has been added two times.
anyone can clarify this situation?
thx leo
Comments
#define ENDSTOP_Z_BACK_ON_HOME 20
or something like that, so you could at least enable z probe without touching endstops or your results get invalid. For real testing always go down near bed. That's also faster and G32 even does it on it's own.
Then you seem to like playing with P parameter. This changes if you measure at nozzle or z probe position. Normally you enable it once (P1) and then then measure everything with P0 and last measurement would disabl it it after measurement with P2. Every other use is just mixing measurement positions.
The function probe runs is float Printer::runZProbe(bool first,bool last,uint8_t repeat,bool runStartScript) { not runZMaxProbe!
Near end you see distance calculation
float distance = static_cast<float>(sum) * invAxisStepsPerMM[Z_AXIS] / static_cast<float>(repeat) + EEPROM::zProbeHeight();
Then some other effects like bending correction/distortion correction and bed coating get added if required. But as you see the probe height is inlcuded only once.
In startProbing which is executed on P1 and P3 you see
float maxStartHeight = EEPROM::zProbeBedDistance() + (EEPROM::zProbeHeight() > 0 ? EEPROM::zProbeHeight() : 0) + 0.1;
if(currentPosition[Z_AXIS] > maxStartHeight) {
moveTo(IGNORE_COORDINATE, IGNORE_COORDINATE, maxStartHeight, IGNORE_COORDINATE, homingFeedrate[Z_AXIS]);
}
So it goes first to probing height and then measures, which is why this returns 9.52. You also see that zProbeHeight is part of starting height so if you change that it also changes starting position. So if you go from 1mm to 2mm you start 1mm heigher and runZProbe adds 2 instead of 1, thus here you have your doubling.