( Simple Edge find - Tomas CNC version)
( Parameter #40 is axis )
( Parameter #50 is maximum distanse )
( Parameter #7075 - the ball diameter )

( Working cube values are situated in Parameters - )
( 5421 ... 5428 - Minimum point )
( 5431 ... 5438 - Maximum point )
( 5401 ... 5409 - Current Tool Offset )
( 5471 ... 5479 - Tool Length Sensor position )
( 5403 - Current Tool Z Offset )
( Position of Tool Sensor is situated in Parameters 5471 ... 5478 )

#10=10 (Sensor number)

#100=500 (Speed)

M88 L1 P#10
G91 G0 X#50 F#100
G04 P0.5
M89 L0 P#10
G91 G0 X[0-#50] F30
G04 P0.5

if [ #50 lt 0 ] 200
( Positive direction )
G90 G10 L70 P1 X[0-#7075/2]
JUMP 300


N200
( Negative direction )
G90 G10 L70 P1 X[#7075/2]

N300




