# Hesine M505, Activating z-probe would lead to forbidden xy position

Hello,

I have a Hesine M505 printer (cartesian) with a fixed inductive z-probe.
The sensor was on the left side in 3D printed holder. With time the sensor changed from "normal to the bed" to "a bit skew".
I got the impression, that the autolevelling wasn't reliable anymore.
I built an Aluminium plate with the sensor at the right side of the nozzle.

#define Z_PROBE_X_OFFSET 64
#define Z_PROBE_Y_OFFSET 7

some other settings:

Arduino IDE 1.8.9
Configuration.h This file is optimized for version 1.0.3

Bed Size = 220 x 220 mm
usable Bed Size = 200 x 200 mm

#define X_MIN_POS -32
#define Y_MIN_POS -3

#define X_MAX_LENGTH 242
#define Y_MAX_LENGTH 218

#define ZHOME_X_POS 112
#define ZHOME_Y_POS 108

Nozzle as Point of measurement
(Nozzle within bed with 10mm margin)
P1 = 10/10
P2 = 210/10
P3 = 10/210
With G30 I get: Error:Activating z-probe would lead to forbidden xy position: -96.000000, -10.00
Idea:
-96 = -(-X_MIN_POS + Z_PROBE_X_OFFSET)
-10 = -(-Y_MIN_POS + Z_PROBE_Y_OFFSET)

Sensor as Point of measurement
(as Sensor is within bed at X_MIN_POS and only need slight correction for Y margin)
P1 = 0/13
P2 = 148/13
P3 = 0/200
With G30 I get: Error:Activating z-probe would lead to forbidden xy position: -64.000000, -7.00
Idea:
-64 = -(Z_PROBE_X_OFFSET)
-7 = -(Z_PROBE_Y_OFFSET)

What is the mathematical construction of P1, P2, P3 with the given values?
I haven't find it in the net.

Thanks a lot
Peter

• Try  margin +probe offset -Xmin
so  p1 x=    (10+64-32) =42

And p1 y = (10+7-3) = 14

So
P1 42 14
P2 210 14
P3 42 310
• Hello Martin,

I entered your values and controled with M205
EPR:3 816 42.000 Z-probe X1 [mm]
EPR:3 820 14.000 Z-probe Y1 [mm]
EPR:3 824 210.000 Z-probe X2 [mm]
EPR:3 828 14.000 Z-probe Y2 [mm]
EPR:3 832 42.000 Z-probe X3 [mm]
EPR:3 836 310.000 Z-probe Y3 [mm]

then G28 X0 Y0

G30
SENDING:G30
ok 0
on Terminal:
Error:Activating z-probe would lead to forbidden xy position: -96.000000, -10.00
fatal:G30 probing failed! - Printer stopped and heaters disabled due to this error. Fix error and restart with M999.

M999
G28 X0 Y0
tried with G33
Nozzle, then Sensor moved to ZHOME_X_POS 112 / ZHOME_Y_POS 108 - Z_PROBE_Y_OFFSET 7
on Terminal:
X:-32.00 Y:-3.00 Z:0.000 E:0.0000

on Terminal:
Z correction disabled / Reference Z for measurement:20.000

moved again
on Terminal:
Z-probe:22.683 X:32.00 Y:220.00
Error:Stopping distortion measurement due to errors.
fatal:G33 failed! - Printer stopped and heaters disabled due to this error. Fix error and restart with M999.

What now?

Thanks, Peter

• Hello,
to be honest, I am far away to be a code writer.
To find the reason, I searched with the error code.
In BedLeveling.ccp I found code who might be the reason of my problem.

bool Printer::startProbing(bool runScript, bool enforceStartHeight) {
float cx, cy, cz;
realPosition(cx, cy, cz);
// Fix position to be inside print area when probe is enabled
...
if((ZPOffsetX > 0 && Printer::currentPosition[X_AXIS] - ZPOffsetX < Printer::xMin) ||
(ZPOffsetY > 0 && Printer::currentPosition[Y_AXIS] - ZPOffsetY < Printer::yMin) ||
(ZPOffsetX < 0 && Printer::currentPosition[X_AXIS] - ZPOffsetX > Printer::xMin + Printer::xLength) ||
(ZPOffsetY < 0 && Printer::currentPosition[Y_AXIS] - ZPOffsetY > Printer::yMin + Printer::yLength))
...
I expect this is Java Code.
&& is logical AND, || is logical OR.
In the if section we have in
- line 1: (ZPOffsetX > 0 && ...
- line 2: (ZPOffsetY > 0 && ...
- line 3: (ZPOffsetX < 0 && ...
- line 4: (ZPOffsetY < 0 && ...
If line 1 is True, then line 3 must be False.
If line 2 is True, then line 4 must be False.
line 1 OR line 2 OR line 3 OR line 4 is always True > Error

As I wrote, I am not a code writer. What do I oversee?

Thanks, Peter

• It is C++ and you oversee the paranthesis where the and (&&) condition is in. So any of the 4 rules can trigger invalid positions.

Error:Activating z-probe would lead to forbidden xy position: -96.000000, -10.00

You need to add 96 mm to x and 10 to y position for measuring to prevent that error. Make sure to change it in eeprom as well.
• sorry, slight typo, P3 should be 42 210

maybe that will fix it ?

• No problem is the left front point. Please also note that G33 doe snot use the points from autoleveling. It has it's own coordinates which you can only set in configuration.h. Not sure where you now get errors from.
• Hello,
thanks Repetier and Matin ... as I wrote "I am far away to be a code writer"

next Test with Martins (corrected) values and Repetiers corrections for P1:
P1 42 14
P2 210 14
P3 42 210
M206 T3 P816 X138    (42+96)
M206 T3 P820 X24      (14+10)
M206 T3 P824 X210
M206 T3 P828 X14
M206 T3 P832 X42
M206 T3 P836 X210

M500
M501
M205

SENDING:G30
ok 0
Error:Activating z-probe would lead to forbidden xy position: -96.000000, -10.00

next Test with corrections for P1, P2, P3

M206 T3 P816 X138    (42+96)
M206 T3 P820 X24      (14+10)
M206 T3 P824 X306    (210+96)
M206 T3 P828 X24      (14+10)
M206 T3 P832 X138    (42+96)
M206 T3 P836 X306    (210+96)

M500
M501
M205

SENDING:G30
ok 0
Error:Activating z-probe would lead to forbidden xy position: -64.000000, -7.00

Why are the values negative, as the sensor values are positiv?

Repetier: you wrote "problem is the left front point"

What is the Formula to calculate P1x/y with the values in Configuration.h or another place?
#define Z_PROBE_X_OFFSET 64
#define Z_PROBE_Y_OFFSET 7
#define X_MIN_POS -32
#define Y_MIN_POS -3
#define X_MAX_LENGTH 242
#define Y_MAX_LENGTH 218
#define ZHOME_X_POS 112
#define ZHOME_Y_POS 108

I my case, P1 can be 0/10, as the sensor is already 32mm within bed:
#define X_MIN_POS -32 + #define Z_PROBE_X_OFFSET 64

Thanks, Peter

• G30 is the wrong command. G30 does a z probe where you are. So if you are currently at a wrong position that gives the coordinate error, reagardless of the point you enter for G32.
Send G1 X100 Y100
and then test. Also run G32 from there to be sure deploying probe at start works.
• Hello,
I homed X and Y and started G32.
First it moved to the middle of the bed, X ok, Y -5mm, to take the initial distance to the bed.
The next two measurements had been right of the middle and to far in the Y direction, so the third run into the "wall".

It's midnight now and I have to shut down the computer and the 3D Printer for two weeks to help my son working with bricks and plaster.
Comming back, I start again geting my 3D Printer running.
Thanks for helping me
Peter
• I my case, P1 can be 0/10, as the sensor is already 32mm within bed:
No, because it will try to move the sensor to X0 which will put the nopzzle at -64