DEV2: Bed leveling grid area wrong?

Hi,
yesterday I grabbed the version from github to restart working with my printer.
- I use EEPROM
- I use Repetier Server

In my configuration.h it is written:
#define LEVELING_METHOD 1
#define L_P1_X 15
#define L_P1_Y 280
#define L_P2_X 15
#define L_P2_Y 15
#define L_P3_X 280
#define L_P3_Y 15
#define GRID_SIZE 4
#define ENABLE_BUMP_CORRECTION 1          // CPU intensive, so only activate if required
#define BUMP_CORRECTION_START_DEGRADE 0.5 // Until this height we correct 100%
#define BUMP_CORRECTION_END_HEIGHT 2      // From this height on we do no correction
#define BUMP_LIMIT_TO 1.5                   // Maximum allowed correction up/down, <= 0 off.

My bed is 300x300mm² large.
I cannot find zje L_P1_X ... values in the EEPROM.



I switch on my printer and enter G32 S2 by Repetier Server.

What I observe:

- Homing z,y,x as I wish.
- It moves down to the height where it should start the bed levelling
- It moves in x/y by the distances given in EEPROM "Z-probe X offset [mm]=-108" and "Z-probe Y offset [mm]=-10"
(everything as expected)
- It moves to the first point where it should measure the height of the bed.

Here it moves to (1|1) instead of (15|280). There might be a reason for starting in the liwer left edge, but this would be in my case (15|15). I cannot find any EEPROM setting which could override the setting from the config. Is that correct? The upper right point is (191|291) as I can read from the display during levelling.

- It moves along the different point of a 4x4 grid, but in fact it is not symmetric as expected. Total x-distance is smaller than total y-distance (where y is correct)
- After finishing it seems to home
- It moves to the y-center, but a bit left of the x-center (some cm).
- It looks like it's moving by "Z-probe X/Y offset" landing RIGHT of the x-center
- It probes
- It it is moving back by "Z-probe X/Y offset"

Bold ist what I do not understand.

It looks for me like there is somewhere an override position/area for the grid - or it is simply not defined by the L_P... points. Where can I find the correct definition? The only other reasonable point would be
LC_P... in the configuration.h, but they are totally different.

(1|1) and (191|291) may come from
#define Z_PROBE_BORDER 1  
with a bed of the 190x290 mm², but than the upper right point is calculated wrong.

In LevelingMethod.cpp I can find getBedRectangle xMin, xMax, yMin, YMax, which lets me assume, that it does not use the points mentioned above, but the bed dimensions.
In my EEPROM I have set:
Printer Bed X Min [mm] = 0
Printer Bed Y Min [mm] = 0
Printer Bed X Max [mm] = 280
Printer Bed Y Max [mm] = 280

If this is used, I would expect lower left: (1|1) upper right (279|279), which does not fit to the values (191|291).

1. Which settings are used for the grid area?
2. Why is it not connected to the bed area?
3. What am I doing wrong?

best regards
karl.ranseier






Comments

  • edited March 2021
    After thinking about it, I realized, that it makes sence to not probe the maximum height in the center (after measuring the grid), but at a given point in the grid. Because I do have a 4x4 grid this is not in the center.
    So the open question is why it is not using an area between (1|1) and (279|279).

    A question related to it: in which file can I find the relation between the parameters in the configuration.h an the EEPROM?
  • edited March 2021
    And some more information:
    I switched to a 3x3 grid to see the positions clearer.
    So after measuring the grid it moves to the most right position, if I see that correctly. That should be okay, but I have in mind from another discussion, that it should be in the center. That may have changed.

    Another problem which I observe here is that both times it homes z, it is moving up at the to the end of the homing. It moves to a non-valid point, so many steps are lost. The only parameter I see which is related to it is "z axis endstop distance after homing", which is set to 0 in my case. Maybe it is moving somehow the distance "z probe min nozzle distance" or "z probe trigger height" at the wrong time?

    At the end of the G32 procedure z axis is flashing ????.?? / 9.69, like it is not calibrated.
  • edited March 2021
    The problem of the z-homing was due to a wrong value in max z height. That was set to 121.12 or so, but it must be 160.
  • #define L_P1_X 15
    #define L_P1_Y 280
    #define L_P2_X 15
    #define L_P2_Y 15
    #define L_P3_X 280
    #define L_P3_Y 15

    is not used for grid leveling. Grid leveling uses bed size reduced by Z_PROBE_BORDER. That area is further reduced by the z probe x/y offsets so it is guaranteed that all points in measured area are reachable with active z-probe.

    For z max homing this function tests the z max length:
    void __attribute__((weak)) GCode_32(GCode* com) {
    bool ok = Leveling::execute_G32(com);
    if (ok && Motion1::homeDir[Z_AXIS] > 0 && ZProbe != nullptr && !Printer::breakLongCommand) {
    bool oldDistortion = Leveling::isDistortionEnabled();
    Leveling::setDistortionEnabled(false);

    // we need to measure top as well to get correct height after homing
    // Solution is simple and robust. We just home Z go to middle and measure
    // and measure z distance with probe. Difference between z and measured z is z max error.
    Motion1::homeAxes(axisBits[Z_AXIS]);
    float zTheroetical = ZProbeHandler::optimumProbingHeight(), zMeasured = 0;
    Motion1::setTmpPositionXYZ((Motion1::minPosOff[X_AXIS] + Motion1::maxPosOff[X_AXIS]) * 0.5,
    (Motion1::minPosOff[Y_AXIS] + Motion1::maxPosOff[Y_AXIS]) * 0.5, zTheroetical);
    ok = Motion1::moveByOfficial(Motion1::tmpPosition, Motion1::moveFeedrate[X_AXIS], false);
    if (ok) {
    ok &= ZProbeHandler::activate();
    }
    if (ok) {
    zMeasured = ZProbeHandler::runProbe();
    ZProbeHandler::deactivate();
    ok = zMeasured != ILLEGAL_Z_PROBE;
    }
    if (ok) {
    Motion1::maxPos[Z_AXIS] += zMeasured - zTheroetical + (Leveling::isDistortionEnabled() ? Leveling::distortionAt(Motion1::currentPositionTransformed[X_AXIS], Motion1::currentPositionTransformed[Y_AXIS]) : 0);
    EEPROM::markChanged();
    Motion1::updateRotMinMax();
    Motion1::currentPosition[Z_AXIS] = zMeasured;
    Motion1::updatePositionsFromCurrent();
    Motion2::setMotorPositionFromTransformed();
    }
    Leveling::setDistortionEnabled(oldDistortion);
    }
    if (!ok) {
    GCode::fatalError(PSTR("Leveling failed!"));
    }
    }

  • About the area:
    okay, that explains the changed area. But why is it reduced by the z probe x/y offsets ? I do have a maximum area of movement (x: -65...475) and an area of the heted bed (x: 0..300). Why reduce the measured area by the offset if it fits within the maximum reachable area?

    In my opinion it should look like:
    grid max x = minimum(max bed area x | x axis max position + z probe x offset)
    grid min x = maximum(min bed area x | x axis min position - z probe x offset)
  • In LevelingMethod.cpp

    // calc min and max coordinates defining the area reachable by ZProbe
        xMin = RMath::max(xMin - tOffMaxX + ZProbeHandler::xOffset(), xMin);
        xMax = RMath::min(xMax - tOffMinX + ZProbeHandler::xOffset(), xMax);
        yMin = RMath::max(yMin - tOffMaxY + ZProbeHandler::yOffset(), yMin);
        yMax = RMath::min(yMax - tOffMinY + ZProbeHandler::yOffset(), yMax);

    Should be
    // calc min and max coordinates defining the area reachable by ZProbe
        xMin = RMath::max(BED_X_MIN - tOffMaxX + ZProbeHandler::xOffset(), xMin);
        xMax = RMath::min(BED_X_MAX - tOffMinX + ZProbeHandler::xOffset(), xMax);
        yMin = RMath::max(BED_Y_MIN - tOffMaxY + ZProbeHandler::yOffset(), yMin);
        yMax = RMath::min(BED_Y_MAX - tOffMinY + ZProbeHandler::yOffset(), yMax);

    As you may see, I have no idea about the variables and how to call the correct value. I have no idea what ZProbeHandler::xOffset() is doing, I will simply ignore it.




  • edited March 2021
    in Gcodes.cpp I can find:
    Motion1::setTmpPositionXYZ((Motion1::minPosOff[X_AXIS] + Motion1::maxPosOff[X_AXIS]) * 0.5,
                                       (Motion1::minPosOff[Y_AXIS] + Motion1::maxPosOff[Y_AXIS]) * 0.5, zTheroetical);

    The bold parts should be replaced by xMin, xMax and yMin, yMax as above. If you do have a bed very offcentered of your machine, this may give big trouble. the original version is not the center of the bed, but the center of the machine.
    In my opinion it would even be better to land exactly on a point of the grid, otherwise there might be a bump which makes everthing wrong. Soemething like:

    x = xMin+ dx * integer(curGridSize/2)
    y = yMin + dy * integer(curGridSize/2)

    Where integer should be a function to cut of 0.5 if the gridsize is an odd number.

    The lines in my upper comment could eventually be:
    // calc min and max coordinates defining the area reachable by ZProbe
        xMin = RMath::max(Motion1::minPosOff[0] + ZProbeHandler::xOffset(), xMin);
        xMax = RMath::min(Motion1::maxPosOff[0] + ZProbeHandler::xOffset(), xMax);
        yMin = RMath::max(Motion1::minPosOff[1] + ZProbeHandler::yOffset(), yMin);
        yMax = RMath::min(Motion1::maxPosOff[1] + ZProbeHandler::yOffset(), yMax);


    A reminder: after that procedure the z-position seems to be uncalibrated, which is indicated by the flashing ????.?? at z: on the display.
  • BED_X_MIN etc are defines while value smight be changed dynamically. Therefore we call
    PrinterType::getBedRectangle(xMin, xMax, yMin, yMax);
    which sets xyMinMax to the values of the bed depending on the printer type active. For deltas it is e.g. taken from radius.
    ZProbeHandler::xOffset()  is just fetching the x offset value for z probe so it can be used to calculate reachable bed area.
    So that part looks fine so far. Check probe offsets and what the printer type returns if it does not match expectations.
    M360 returns bed position btw, so it is easy to check where that would be and it can be changed in eeprom.

    Using bed center is in deed better also it must be a real difference to make it not work this way.
    I saw that a test if distortion should be corrected is wrong since it would always be off where it gets added.

    Would this version:

    void __attribute__((weak)) GCode_32(GCode* com) {
    bool ok = Leveling::execute_G32(com);
    if (ok && Motion1::homeDir[Z_AXIS] > 0 && ZProbe != nullptr && !Printer::breakLongCommand) {
    bool oldDistortion = Leveling::isDistortionEnabled();
    Leveling::setDistortionEnabled(false);

    // we need to measure top as well to get correct height after homing
    // Solution is simple and robust. We just home Z go to middle and measure
    // and measure z distance with probe. Difference between z and measured z is z max error.
    Motion1::homeAxes(axisBits[Z_AXIS]);
    float zTheroetical = ZProbeHandler::optimumProbingHeight(), zMeasured = 0;
    float xMin, xMax, yMin, yMax, xCenter, yCenter;
    PrinterType::getBedRectangle(xMin, xMax, yMin, yMax);
    xCenter = 0.5 * (xMin + xMax);
    yCenter = 0.5 * (yMin + yMax);
    Motion1::setTmpPositionXYZ(xCenter, yCenter, zTheroetical);
    ok = Motion1::moveByOfficial(Motion1::tmpPosition, Motion1::moveFeedrate[X_AXIS], false);
    if (ok) {
    ok &= ZProbeHandler::activate();
    }
    if (ok) {
    zMeasured = ZProbeHandler::runProbe();
    ZProbeHandler::deactivate();
    ok = zMeasured != ILLEGAL_Z_PROBE;
    }
    if (ok) {
    Motion1::maxPos[Z_AXIS] += zMeasured - zTheroetical + (oldDistortion ? Leveling::distortionAt(xCenter, yCenter) : 0);
    EEPROM::markChanged();
    Motion1::updateRotMinMax();
    Motion1::currentPosition[Z_AXIS] = zMeasured;
    Motion1::updatePositionsFromCurrent();
    Motion2::setMotorPositionFromTransformed();
    }
    Leveling::setDistortionEnabled(oldDistortion);
    }
    if (!ok) {
    GCode::fatalError(PSTR("Leveling failed!"));
    }
    }


    work better? It will not use grid align test because grid is only one leveling method. Others work differently so there is no rule to get the point. But normally it should be neglectible now that the distortion is added in height computation. Before it was not considered at all so much bigger.

    If that works I will push it to github.

  • edited March 2021
    Yes, with yours and mine changes it looks correct, but I did not do any test for a test point out of the reachable area.

    The last problem is that z is not realized as correct value. Still z position on the display is changing between the position and ????.??

    Here is the logfile:
    Send:20:26:52.029: N23 G32 S2
    Send:20:26:52.029: N24 M114
    Recv:20:26:52.030: minPosOff: -65.07 -100.07 -0.07
    Recv:20:26:52.030: maxPosOff: 475.01 400.01 161.62
    Recv:20:26:52.030: rotMin: -0.07 -0.07 -0.07
    Recv:20:26:52.030: rotMax: 0.01 0.01 0.33
    Recv:20:26:52.031: transform: 1.00000 0.00000 0.00035 -0.00000 1.00000 0.00038 -0.00035 -0.00038 1.00000
    Recv:20:26:52.031: Info:Autoleveling disabled
    Recv:20:26:52.031: X:149.94 Y:149.94 Z:161.397 E:0.0000 (2)
    Recv:20:26:52.081: Move CX:149.94 CY:149.94 CZ:161.40 OX:0.00 l:5.00 f:40.00
    Recv:20:26:52.081: Move DX:0.00 DE:0.00 DY:0.00 DZ:-5.00
    Recv:20:26:52.484: Move CX:149.94 CY:149.94 CZ:156.40 OX:0.00 l:7.50 f:8.00
    Recv:20:26:52.484: Move DX:0.00 DE:0.00 DY:0.00 DZ:7.50
    Recv:20:26:53.327: Move CX:149.94 CY:149.94 CZ:163.90 OX:0.00 l:0.40 f:40.00
    Recv:20:26:53.327: Move DX:0.00 DE:0.00 DY:0.00 DZ:-0.40
    Recv:20:26:53.626: Move CX:149.94 CY:149.94 CZ:161.29 OX:0.00 l:1.29 f:45.00
    Recv:20:26:53.626: Move DX:0.00 DE:0.00 DY:0.00 DZ:-1.29
    Recv:20:26:53.919: Move CX:149.94 CY:149.94 CZ:160.00 OX:0.00 l:750.12 f:65.00
    Recv:20:26:53.919: Move DX:0.00 DE:0.00 DY:750.12 DZ:0.00
    Recv:20:26:58.056: Move CX:149.94 CY:900.06 CZ:160.00 OX:0.00 l:5.00 f:65.00
    Recv:20:26:58.056: Move DX:0.00 DE:0.00 DY:-5.00 DZ:0.00
    Recv:20:26:58.522: Move CX:149.94 CY:895.06 CZ:160.00 OX:0.00 l:7.50 f:13.00
    Recv:20:26:58.522: Move DX:0.00 DE:0.00 DY:7.50 DZ:0.00
    Recv:20:26:58.994: Move CX:149.94 CY:902.56 CZ:160.00 OX:0.00 l:0.01 f:65.00
    Recv:20:26:58.994: Move DX:0.00 DE:0.00 DY:-0.01 DZ:0.00
    Recv:20:26:59.221: Move CX:149.94 CY:400.00 CZ:160.00 OX:0.00 l:810.12 f:65.00
    Recv:20:26:59.221: Move DX:-810.12 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:02.816: Move CX:-660.17 CY:400.00 CZ:160.00 OX:0.00 l:5.00 f:65.00
    Recv:20:27:02.816: Move DX:5.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:03.186: Move CX:-655.17 CY:400.00 CZ:160.00 OX:0.00 l:7.50 f:13.00
    Recv:20:27:03.186: Move DX:-7.50 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:03.625: Move CX:-662.67 CY:400.00 CZ:160.00 OX:0.00 l:0.07 f:65.00
    Recv:20:27:03.625: Move DX:0.07 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:03.818: X:-65.00 Y:400.00 Z:160.000 E:0.0000
    Recv:20:27:03.818: Move CX:-65.00 CY:400.00 CZ:160.00 OX:0.00 l:0.40 f:40.00
    Recv:20:27:03.818: Move DX:0.00 DE:0.00 DY:0.00 DZ:0.40
    Recv:20:27:04.123: Move CX:-65.00 CY:400.00 CZ:160.00 OX:0.00 l:1.29 f:100.00
    Recv:20:27:04.124: Move DX:0.00 DE:0.00 DY:0.00 DZ:1.29
    Recv:20:27:04.124: SelectTool:0
    Recv:20:27:04.416: X:-65.00 Y:400.00 Z:161.286 E:0.0000
    Recv:20:27:04.416: Move CX:-65.00 CY:400.00 CZ:161.29 OX:0.00 l:136.29 f:40.00
    Recv:20:27:04.416: Move DX:0.00 DE:0.00 DY:0.00 DZ:-136.29
    Recv:20:27:04.416: Move CX:-65.00 CY:400.00 CZ:25.00 OX:0.00 l:15.00 f:100.00
    Recv:20:27:04.416: Move DX:0.00 DE:0.00 DY:-15.00 DZ:0.00
    Recv:20:27:04.416: Move CX:-65.00 CY:385.00 CZ:25.00 OX:0.00 l:108.46 f:100.00
    Recv:20:27:04.416: Move DX:108.00 DE:0.00 DY:10.00 DZ:0.00
    Recv:20:27:09.700: Autoleveling with 9 grid points...
    Recv:20:27:09.700: Move CX:43.00 CY:395.00 CZ:25.00 OX:108.00 l:386.39 f:100.00
    Recv:20:27:09.700: Move DX:70.00 DE:0.00 DY:-380.00 DZ:0.00
    Recv:20:27:09.701: X:5.00 Y:5.00 Z:25.000 E:0.0000
    Recv:20:27:13.927: Move CX:113.00 CY:15.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:13.927: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:15.447: Move CX:113.00 CY:15.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:15.447: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:15.821: Move CX:113.00 CY:15.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:15.821: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:16.875: X:5.00 Y:5.00 Z:25.000 E:0.0000
    Recv:20:27:16.876: Z-probe:25.138 X:5.00 Y:5.00
    Recv:20:27:16.876: Move CX:113.00 CY:15.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:16.876: Move DX:145.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:16.876: X:150.00 Y:5.00 Z:25.000 E:0.0000
    Recv:20:27:18.690: Move CX:258.00 CY:15.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:18.690: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:20.200: Move CX:258.00 CY:15.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:20.200: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:20.617: Move CX:258.00 CY:15.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:20.617: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:21.672: X:150.00 Y:5.00 Z:25.000 E:0.0000
    Recv:20:27:21.672: Z-probe:25.051 X:150.00 Y:5.00
    Recv:20:27:21.673: Move CX:258.00 CY:15.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:21.673: Move DX:145.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:21.673: X:295.00 Y:5.00 Z:25.000 E:0.0000
    Recv:20:27:23.486: Move CX:403.00 CY:15.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:23.486: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:24.987: Move CX:403.00 CY:15.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:24.987: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:25.416: Move CX:403.00 CY:15.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:25.416: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:26.468: X:295.00 Y:5.00 Z:25.000 E:0.0000
    Recv:20:27:26.468: Z-probe:24.983 X:295.00 Y:5.00
    Recv:20:27:26.468: Move CX:403.00 CY:15.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:26.469: Move DX:0.00 DE:0.00 DY:145.00 DZ:0.00
    Recv:20:27:26.469: X:295.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:27:28.286: Move CX:403.00 CY:160.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:28.286: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:29.806: Move CX:403.00 CY:160.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:29.806: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:30.215: Move CX:403.00 CY:160.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:30.215: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:31.272: X:295.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:27:31.272: Z-probe:25.129 X:295.00 Y:150.00
    Recv:20:27:31.272: Move CX:403.00 CY:160.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:31.272: Move DX:-145.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:31.274: X:150.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:27:33.086: Move CX:258.00 CY:160.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:33.086: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:34.615: Move CX:258.00 CY:160.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:34.615: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:35.014: Move CX:258.00 CY:160.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:35.014: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:36.072: X:150.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:27:36.072: Z-probe:25.204 X:150.00 Y:150.00
    Recv:20:27:36.072: Move CX:258.00 CY:160.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:36.072: Move DX:-145.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:36.072: X:5.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:27:37.886: Move CX:113.00 CY:160.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:37.886: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:39.414: Move CX:113.00 CY:160.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:39.414: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:39.814: Move CX:113.00 CY:160.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:39.814: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:40.870: X:5.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:27:40.870: Z-probe:25.190 X:5.00 Y:150.00
    Recv:20:27:40.870: Move CX:113.00 CY:160.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:40.870: Move DX:0.00 DE:0.00 DY:145.00 DZ:0.00
    Recv:20:27:40.870: X:5.00 Y:295.00 Z:25.000 E:0.0000
    Recv:20:27:42.687: Move CX:113.00 CY:305.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:42.687: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:44.187: Move CX:113.00 CY:305.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:44.187: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:44.611: Move CX:113.00 CY:305.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:44.611: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:45.664: X:5.00 Y:295.00 Z:25.000 E:0.0000
    Recv:20:27:45.664: Z-probe:24.970 X:5.00 Y:295.00
    Recv:20:27:45.664: Move CX:113.00 CY:305.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:45.664: Move DX:145.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:45.664: X:150.00 Y:295.00 Z:25.000 E:0.0000
    Recv:20:27:47.478: Move CX:258.00 CY:305.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:47.478: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:48.979: Move CX:258.00 CY:305.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:48.979: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:49.300: Move CX:258.00 CY:305.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:49.300: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:50.351: X:150.00 Y:295.00 Z:25.000 E:0.0000
    Recv:20:27:50.351: Z-probe:24.978 X:150.00 Y:295.00
    Recv:20:27:50.351: Move CX:258.00 CY:305.00 CZ:25.00 OX:108.00 l:145.00 f:100.00
    Recv:20:27:50.351: Move DX:145.00 DE:0.00 DY:0.00 DZ:0.00
    Recv:20:27:50.351: X:295.00 Y:295.00 Z:25.000 E:0.0000
    Recv:20:27:52.165: Move CX:403.00 CY:305.00 CZ:25.00 OX:108.00 l:37.50 f:8.00
    Recv:20:27:52.165: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:27:53.657: Move CX:403.00 CY:305.00 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:27:53.657: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:27:53.978: Move CX:403.00 CY:305.00 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:27:53.978: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:27:55.029: X:295.00 Y:295.00 Z:25.000 E:0.0000
    Recv:20:27:55.029: Z-probe:24.901 X:295.00 Y:295.00
    Recv:20:27:55.029: Move CX:403.00 CY:305.00 CZ:25.00 OX:108.00 l:108.46 f:100.00
    Recv:20:27:55.030: Move DX:-108.00 DE:0.00 DY:-10.00 DZ:0.00
    Recv:20:27:56.479: plane: a = -0.0003 b = -0.0004 c = 25.1650
    Recv:20:27:56.479: z = a * x + y * b + c
    Recv:20:27:56.479: minPosOff: -65.06 -100.07 -0.07
    Recv:20:27:56.479: maxPosOff: 475.01 400.01 161.60
    Recv:20:27:56.479: rotMin: -0.06 -0.07 -0.07
    Recv:20:27:56.479: rotMax: 0.01 0.01 0.31
    Recv:20:27:56.479: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:27:56.480: Transformation matrix: 1.000000 0.000000 0.000326 -0.000000 1.000000 0.000370 -0.000326 -0.000370 1.000000
    Recv:20:27:56.480: minPosOff: -65.06 -100.07 -0.07
    Recv:20:27:56.480: maxPosOff: 475.01 400.01 161.60
    Recv:20:27:56.481: rotMin: -0.06 -0.07 -0.07
    Recv:20:27:56.481: rotMax: 0.01 0.01 0.31
    Recv:20:27:56.482: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:27:56.482: Info:Autoleveling enabled
    Recv:20:27:56.482: X:295.01 Y:295.01 Z:24.754 E:0.0000
    Recv:20:27:56.609: Z bump correction enabled
    Recv:20:27:56.609: G33 X min:5.00 X max:295.00 Y min:5.00 Y max:295.00 Grid Size:3x3 Bed Temp:0.0
    Recv:20:27:56.609: X:295.01 Y:295.01 Z:24.754 E:0.0000
    Recv:20:27:56.609: minPosOff: -65.06 -100.07 -0.07
    Recv:20:27:56.609: maxPosOff: 475.01 400.01 161.60
    Recv:20:27:56.610: rotMin: -0.06 -0.07 -0.07
    Recv:20:27:56.610: rotMax: 0.01 0.01 0.31
    Recv:20:27:56.610: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:27:56.611: X:295.00 Y:295.00 Z:24.959 E:0.0000
    Recv:20:27:56.612: Move CX:295.00 CY:295.00 CZ:24.96 OX:0.00 l:242.50 f:40.00
    Recv:20:27:56.612: Move DX:0.00 DE:0.00 DY:0.00 DZ:242.50
    Recv:20:27:57.499: Storing data to eeprom
    Recv:20:28:00.297: Move CX:295.00 CY:295.00 CZ:267.46 OX:0.00 l:5.00 f:40.00
    Recv:20:28:00.297: Move DX:0.00 DE:0.00 DY:0.00 DZ:-5.00
    Recv:20:28:00.698: Move CX:295.00 CY:295.00 CZ:262.46 OX:0.00 l:7.50 f:8.00
    Recv:20:28:00.698: Move DX:0.00 DE:0.00 DY:0.00 DZ:7.50
    Recv:20:28:01.537: Move CX:295.00 CY:295.00 CZ:269.96 OX:0.00 l:0.38 f:40.00
    Recv:20:28:01.537: Move DX:0.00 DE:0.00 DY:0.00 DZ:-0.38
    Recv:20:28:01.776: Move CX:295.00 CY:295.00 CZ:161.29 OX:0.00 l:1.29 f:45.00
    Recv:20:28:01.776: Move DX:0.00 DE:0.00 DY:0.00 DZ:-1.29
    Recv:20:28:01.776: minPosOff: -65.06 -100.07 -0.07
    Recv:20:28:01.776: maxPosOff: 475.01 400.01 161.60
    Recv:20:28:01.776: rotMin: -0.06 -0.07 -0.07
    Recv:20:28:01.776: rotMax: 0.01 0.01 0.31
    Recv:20:28:01.777: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:28:01.777: X:295.05 Y:295.06 Z:159.795 E:0.0000
    Recv:20:28:02.069: Move CX:295.00 CY:295.00 CZ:160.00 OX:0.00 l:0.18 f:40.00
    Recv:20:28:02.069: Move DX:0.00 DE:0.00 DY:0.00 DZ:0.18
    Recv:20:28:02.288: Move CX:295.00 CY:295.00 CZ:160.00 OX:0.00 l:1.49 f:100.00
    Recv:20:28:02.288: Move DX:-0.04 DE:0.00 DY:-0.05 DZ:1.49
    Recv:20:28:02.288: SelectTool:0
    Recv:20:28:02.613: EEPROM data updated
    Recv:20:28:02.613: X:295.01 Y:295.01 Z:161.286 E:0.0000
    Recv:20:28:02.613: Move CX:294.96 CY:294.95 CZ:161.49 OX:0.00 l:246.23 f:100.00
    Recv:20:28:02.613: Move DX:-144.96 DE:0.00 DY:-144.96 DZ:-136.39
    Recv:20:28:02.614: Move CX:149.99 CY:149.99 CZ:25.10 OX:0.00 l:108.46 f:100.00
    Recv:20:28:02.614: Move DX:108.00 DE:0.00 DY:10.00 DZ:0.04
    Recv:20:28:07.200: minPosOff: -65.06 -100.07 -0.07
    Recv:20:28:07.201: maxPosOff: 475.01 400.01 161.60
    Recv:20:28:07.201: rotMin: -0.06 -0.07 -0.07
    Recv:20:28:07.201: rotMax: 0.01 0.01 0.31
    Recv:20:28:07.202: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:28:07.202: X:149.99 Y:149.99 Z:25.143 E:0.0000
    Recv:20:28:07.202: Move CX:257.99 CY:159.99 CZ:25.14 OX:108.00 l:37.50 f:8.00
    Recv:20:28:07.202: Move DX:0.00 DE:0.00 DY:0.00 DZ:-37.50
    Recv:20:28:08.726: Move CX:257.99 CY:159.99 CZ:0.00 OX:108.00 l:2.00 f:150.00
    Recv:20:28:08.726: Move DX:0.00 DE:0.00 DY:0.00 DZ:2.00
    Recv:20:28:09.047: Move CX:257.99 CY:159.99 CZ:2.00 OX:108.00 l:3.00 f:8.00
    Recv:20:28:09.047: Move DX:0.00 DE:0.00 DY:0.00 DZ:-3.00
    Recv:20:28:10.104: minPosOff: -65.06 -100.07 -0.07
    Recv:20:28:10.104: maxPosOff: 475.01 400.01 161.60
    Recv:20:28:10.104: rotMin: -0.06 -0.07 -0.07
    Recv:20:28:10.104: rotMax: 0.01 0.01 0.31
    Recv:20:28:10.105: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:28:10.105: X:150.00 Y:150.00 Z:25.000 E:0.0000
    Recv:20:28:10.106: Z-probe:25.158 X:150.00 Y:150.00
    Recv:20:28:10.106: Move CX:257.99 CY:159.99 CZ:25.14 OX:108.00 l:108.46 f:100.00
    Recv:20:28:10.106: Move DX:-108.00 DE:0.00 DY:-10.00 DZ:-0.04
    Recv:20:28:11.555: minPosOff: -65.06 -100.07 -0.07
    Recv:20:28:11.555: maxPosOff: 475.01 400.01 161.61
    Recv:20:28:11.555: rotMin: -0.06 -0.07 -0.07
    Recv:20:28:11.555: rotMax: 0.01 0.01 0.31
    Recv:20:28:11.555: transform: 1.00000 0.00000 0.00033 -0.00000 1.00000 0.00037 -0.00033 -0.00037 1.00000
    Recv:20:28:11.555: Echo:N23 G32 S2
    Recv:20:28:11.556: X:150.00 Y:150.00 Z:25.158 E:0.0000
    Recv:20:28:11.556: Echo:N24 M114
    Recv:20:28:12.495: Storing data to eeprom
    Recv:20:28:12.495: EEPROM data updated

  • Please ignore the blinking z axis. It comes from probing as it seems. Running manually G30 also causes this. Not sure why this happens but it is in 
    void Motion2::endstopTriggered(Motion3Buffer* act, fast8_t axis, bool dir) {

    I think. Need to find out why or fix it after z probing. 
  • I recognized that before the last z-height-probing it already says "auto level complete". Maybe there it says "correct z-value" and after that it messes up. I agree, that this is not urgent, but I hate to ignore warnings.

    By the way, does the last probing really make sense?
    Here is an example how it may look like:
    https://drive.google.com/file/d/12JL6I2AVE99le32W5GiJB2pm8FJXthvj/view?usp=sharing

    This is again the same discussion like probing exactly on the grid.

    If i understand the procedure correctly it would make more sense to probe the highest point in the grid than a centered point. Just a thought. I know that my print area is 161 mm high and my slicer is set to a maximum value of 159 mm. If the firmware is not doing it exactly, I think one can even skip the last probing.
  • The autolevel complete comes from the leveling implementation as end message.

    In the special case of z max homing there is the extra code which we are more or less discussing about. What it does is to ensure that after homing z=0 is where you expect it. So it homes, goes down and measures the distance to bed vs. expected distance and corrects z max height with the difference. So yes it makes sense to do this, only question is if it is the best solution we can think of and if the error remaining is negligible.
    We disable distortion correction before homing but autoleveling is active. Then we measure height that includes distortion. For correction we assume

    Motion1::maxPos[Z_AXIS] += zMeasured - zTheroetical + (oldDistortion ? Leveling::distortionAt(xCenter, yCenter) : 0);
    so if we previously had distortion correction active it would correct that also as good as possible. The big slope in your example is already fixed by rotation so only the small distortion error gets fixed. Maximum error is max. difference between real bed and interpolated distortion values. Of course least at the grid measure points but negligible because printing also works. If it would not work you would increase grid count to reduce the error during print and then it also gets reduced here.
  • Ok, thanks for the explanation. I will not bother you anymore on that ;-)

    And thank you again for all of this support. I hope that my testing helps you, too, so both sides have a benefit.

    Because I think "clapping hands" does not help enough, I just bought the Pro Version of Repetier-Server (even if the regular version is definetly enough for me).


  • I already made some changes locally and will surely come back when I have a bit time to fix the homing issues and blinking z axis. It is always good if someone checks critically what is going on. 
  • edited April 2021
    It looks like these changes are not included in the latest version, is that intended?

    levelinmethod.cpp
      // calc min and max coordinates defining the area reachable by ZProbe
        //xMin = RMath::max(xMin - tOffMaxX + ZProbeHandler::xOffset(), xMin);
        //xMax = RMath::min(xMax - tOffMinX + ZProbeHandler::xOffset(), xMax);
       // yMin = RMath::max(yMin - tOffMaxY + ZProbeHandler::yOffset(), yMin);
        //yMax = RMath::min(yMax - tOffMinY + ZProbeHandler::yOffset(), yMax);
    //New:
    xMin = RMath::max(Motion1::minPosOff[0] + ZProbeHandler::xOffset(), xMin);
        xMax = RMath::min(Motion1::maxPosOff[0] + ZProbeHandler::xOffset(), xMax);
        yMin = RMath::max(Motion1::minPosOff[1] + ZProbeHandler::yOffset(), yMin);
        yMax = RMath::min(Motion1::maxPosOff[1] + ZProbeHandler::yOffset(), yMax);


    (edit: copied the wrong part)

  • Ok, must have lost track of the thread and problem. Rechecking I think it is wrong. I think correct solution is

    xMin = RMath::max(Motion1::minPosOff[0], xMin);
    xMax = RMath::min(Motion1::maxPosOff[0], xMax);
    yMin = RMath::max(Motion1::minPosOff[1], yMin);
    yMax = RMath::min(Motion1::maxPosOff[1], yMax);

    xMin = RMath::max(Motion1::minPos[0] + rotMin[0] + ZProbeHandler::xOffset(), xMin);
    xMax = RMath::min(Motion1::maxPos[0] + rotMax[0] + ZProbeHandler::xOffset(), xMax);
    yMin = RMath::max(Motion1::minPos[1] + rotMin[1] + ZProbeHandler::yOffset(), yMin);
    yMax = RMath::min(Motion1::maxPos[1] + rotMax[1] + ZProbeHandler::yOffset(), yMax);


    minPosOff contains tool offsets and it makes no sense to add zprobe offset to that. It is either tool offset or z probe offset that is active and this must be measured from printer limits.

    I'm still not 100% sure with the complete transformation. I have to redo offset handling since I think it adjust in the wrong coordinate system, also difference is normally quite low.
  • I cannot compile with your solution:

    Compiling .pio\build\RUMBA32\src\motion\LevelingMethod.cpp.o
    src\motion\LevelingMethod.cpp: In static member function 'static bool Leveling::measure(GCode*)':
    src\motion\LevelingMethod.cpp:280:44: error: 'rotMin' was not declared in this scope
      280 |     xMin = RMath::max(Motion1::minPos[0] + rotMin[0] + ZProbeHandler::xOffset(), xMin);
          |                                            ^~~~~~
    src\motion\LevelingMethod.cpp:281:44: error: 'rotMax' was not declared in this scope
      281 |     xMax = RMath::min(Motion1::maxPos[0] + rotMax[0] + ZProbeHandler::xOffset(), xMax);
          |                                            ^~~~~~
    *** [.pio\build\RUMBA32\src\motion\LevelingMethod.cpp.o] Error 1

    when hovering on
    rotMin[0]
    it says
    "der Bezeichner rotMin ist nicht defniert" C/C++ (20)"




  • ok da muss noch ein Motion1:: vor rotMin/Max - copy paste. Hatte noch keine Zeit das ganze selber zu testen daher auch nicht veröffentlicht.
  • Mit der Korrektur misst es an den von mir erwarteten Stellen! Danke!
Sign In or Register to comment.