At the start, #502 should be set the the first Z in the probe table in the gcode file which should be close to 0 anyway.
Here is an example taken from the start of a file I have...
Code: Select all
(Set variables #500, #501, #502 to X Y and Z to be used by o100)
#500 = 0.0
#501 = 0.0
#502 = 0.00250
(Set Z before milling starts...)
M98 P100
M98 P200
As you can see #502 is set to 0.00250 which is the same as the Z of probe point 1 in the table of the same gcode file...
Code: Select all
(80 | 79 | 78 | 77 | 76 | 75 | 74 | 73 | 72 | 71)
(61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70)
(60 | 59 | 58 | 57 | 56 | 55 | 54 | 53 | 52 | 51)
(41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50)
(40 | 39 | 38 | 37 | 36 | 35 | 34 | 33 | 32 | 31)
(21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30)
(20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11)
(1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10)
(Match the "point order" with the XYZ position here)
(1 | X = 0.000000 Y = 0.000000 Z = 0.002500)
(2 | X = 53.447500 Y = 0.000000 Z = -0.062500)
(3 | X = 106.895000 Y = 0.000000 Z = -0.115000)
(4 | X = 160.342500 Y = 0.000000 Z = -0.205000)
(5 | X = 213.790000 Y = 0.000000 Z = -0.300000)
(6 | X = 267.237500 Y = 0.000000 Z = -0.390000)
(7 | X = 320.685000 Y = 0.000000 Z = -0.437500)
(8 | X = 374.132500 Y = 0.000000 Z = -0.480000)
(9 | X = 427.580000 Y = 0.000000 Z = -0.632500)
(10 | X = 481.027500 Y = 0.000000 Z = -0.775000)
(11 | X = 481.027500 Y = 54.432500 Z = -0.800000)
(12 | X = 427.580000 Y = 54.432500 Z = -0.710000)
(13 | X = 374.132500 Y = 54.432500 Z = -0.577500)
(14 | X = 320.685000 Y = 54.432500 Z = -0.550000)
(15 | X = 267.237500 Y = 54.432500 Z = -0.505000)
...
For your code, what is #502 set to? Can you paste the starting block where the subs are called here?
The retraction should be the probe clearance value you set in AL. By default this is 2mm.