G30 mistery

edited January 2016 in General
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


  • edited January 2016
    another test this morning, repeater the last test, at the end homing then g30 p0; it report proper zlenght + 0.1.
    Is possible that this 0.1 come out from this line of code:
     float maxStartHeight = EEPROM::zProbeBedDistance() + (EEPROM::zProbeHeight() > 0 ? EEPROM::zProbeHeight() : 0) + 0.1;
    Tried also autolevel routine, voluntary create an missallignment of the bed in front of column A (pushed a bit down) seems the calculated transformation matrix compensate to much the error and after apply it the nozzle touch the bed in front of column A and is too high on opposite side of the bed.

    After autolevel I've 441.641 in eprom, if I home with g28 repetier host show the correct zheight but on the display show 441.59, why?
  • First you seem to like to measure from top. That is quite risky depending on target position. In any case you should set

    #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.

  • edited February 2016
    thank you so much for the explanation, now it's clear.
    I've try over the weekend to understand why I can't autolevel (manually I can calibrate the printer with dial whithin +-002mm).
    After many test I've discovered that if I put the probe in the same positiion of the extruder everything work as aspected.
    Seems if I've the probe whith any offset from extruder the calculated matrix not work.
    Any suggestion where to investigate about the problem?
  • Sorry, but could not follow your matrix problem. What matrix are you talking about? Rotation matrix or displacement? What did you send, what did you expect and what did happen?
  • sorry, I mean rotation matrix
    if I've the probe installed in place of extruder = rotation matrix perfect
    if I've the probe offsetted from extruder, with proper declaration in firmware = rotation matrix wrong

  • If you have probe offsetted, you enter probe offset  whcih I guess you mean with " with proper declaration in firmware"

    One problem many user face is that G32 fails to activate probe position because extrude is from homing in a corner and would hit endstops. So to be sure do G1 X100 Y100 and then G32. Also make sure all probe points can be reached with activated probe without hitting endstops or resulting matrix would in deed be wrong.

    Delta printers can still fail with offset z-probe if the head is slightly tilted from imperfection. Then it really differs where you measure as the rotation will change over xy-plane.
  • Yes the probe offset is declared in the eeprom.
    No end stop hitting in any movement

    YOU ARE RIGHT the extruder plate tilting! 
    The printer is squared but tollerance of the diagonal rod+tollerance of steel ball fixture make the plate tilt of +-0.1

    Now I will try to use extruder as zprobe.
  • with alluminium bed using the nozzle as probe everything is perfect!
Sign In or Register to comment.