-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPROBEZ
More file actions
executable file
·71 lines (55 loc) · 2.13 KB
/
PROBEZ
File metadata and controls
executable file
·71 lines (55 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//Copyright 2024 Toolpath Labs Inc., Justin Gray, and Josh Smith
//PROBEZ
//Description: Probe in Z from the above stock
//Initial Coding: Justin Gray
//Modified 1/14/2024: Joshua Smith
//Simplified WCS extended number math, added probe error checking, added probe distance argument,removed air blast
//Argument A -> #1 is the work coordinate system to store offsets in. The format for extended G54 offsets would be a period followed by the offset G54.5
//Argument B -> #2 is the desired probing distance and should be negative
//Argument I -> #9 print results enabled by fusion360
//load probe config
G65 "PROBECONFIG"
M19 // ORIENT SPINDLE
//important local variables
#111 = @104 //FAST PROBE SPEED PROVIDED BY PROBECONFIG MACRO
#112 = @105 //SLOW PROBE SPEED PROVIDED BY PROBECONFIG MACRO
#105 = @107 //TOOL LENGTH PROVIDED BY PROBECONFIG MACRO
#108 = @108 //PROBE BACKOFF DISTANCE PROVIDED BY PROBECONFIG MACRO
//CALCULATE EXTENDED WCS NUMBER
//FIX removes any decimal value
#114 = ROUND[[#1 - FIX[#1]] * 10]
//Check that the probe distance is negative
IF[#2<0]
//Probe z the desired distance and at fast feed
G31 G91 P2 Z[#2] F#111
//Check that the probe has triggered
IF[R_SKIP[0,1] == 1]
G91 G01 Z+[#108] //back off 1/4 the probing distance
FIX_CUT_OR_ON
G31 G91 P2 Z[#2] F#112 //Probe X the desired distance at slow feed
FIX_CUT_OR_OFF
#104=R_SKIP[0,203] //GET MACHINE Z COORDINATE
G91 G01 Z+[#108] //back off 1/4 the probing distance
#106 = [#104-#105] //current position - probe length
@996 = #106
//safety check for inspection variable
IF[#9 == #0]
#9 = 0
END_IF
//STORE Z OFFSET FOR WCS ZERO
IF [#1 < 53 || #1 == #0 || #9 > 0]
//DO NOT SET ANYTHING INTO WCS
ELSEIF [#114 < 1]
W_G53G59_COOR[0,#1,3,#106]
ELSE
W_G54EXP_COOR[0,#114,3,#106]
END_IF
ELSE
ALARM["ERROR: FAILED TO PROBE PART WITHIN SPECIFIED DISTANCE"]
END_IF
ELSE
ALARM["ERROR: PROBE DISTANCE MUST BE NEGATIVE"]
END_IF
M20 // UNLOCK SPINDLE ORIENTATION FOR SAFETY
G90
M99