G92 Z#ProbeSize/2 should be G92 Z#0 if you're measuring the over all length of the touch probe and not removing half the size of the ball.
dunno if flashcut is still alive but anyway, i made some gcode to find XYZ stock origin using a touchprobe #ProbeSize should be set in the variables menu to the diameter of the probe tip
bring the probe tip to within .5/.5/.5 of the edges to check for, set program to zero, run this gcode. it'll end up at 0,0,.2 , setting the tool length of the probe makes it effective 0, i thought about adding a tool change at the top to a preset tool for the probe in the library.
I7 is the probe line, change for your setup. i ran it about 30 times in a row and i was getting around .0001 or better repeat-ability, also i did notice that the FlashCut Relative XYZ DRO has a math error, if you reset it to 0,0,0 and then keep running and resetting the program original it'll drift over by around .0001 each run) strange stuff.
It searches Z down, X - to X+ then Y+ to Y-
(Switch to imperial)
G20
(Go to Program Z0)
G01Z0F5
(Go to Program X0Y0)
G01Y0X0F5
(search z for .5" at feed rate of 1) input line 7
G31 Z-.5 I7 S1 E0 F1
(Program.Z is ?)
(set Program Z to 0, with compensation)
G92 Z#ProbeSize/2
(Dwell .5 second)
G04 P.5
(Move to Program.Z.1 above part)
G01Z.1F5
(Move to Program.X-.3)
G01X-.3F5
(Move to Program.Z-.03 below part , maybe use ball size?)
G01Z-.03F1
(search X for .5" at feed rate of 1) input line 7
G31 X.5 I7 S1 E0 F1
(set Program X to 0, with compensation)
G92 X-#ProbeSize/2
(Dwell .5 second)
G04 P.5
(move away from part in X)
G01 X-.2F5
(Move to Program.Y.4, still below part in Z)
G01 Y.4F5
(move into part on X, z is below top)
G01 X.1F5
(search Y for -1" at feed rate of 1) input line 7
G31 Y-1 I7 S1 E0 F1
(set Program Y to 0, with compensation)
G92 Y#ProbeSize/2
(Dwell .5 second)
G04 P.5
(move above part)
G01Z.2F5
(move over corner)
G01X0Y0F5
Similar Threads:
G92 Z#ProbeSize/2 should be G92 Z#0 if you're measuring the over all length of the touch probe and not removing half the size of the ball.
I was just wondering if anyone had done this for FC, thanks.
A lazy man does it twice.
i did a corner finding one, center of a hole and a few others i'll post when i get home.
Code:N100 GLOBAL REAL #XC #YC #ZC N102 GLOBAL REAL #PX #PY #PX1 #PY1 #PX2 #PY2 #CX #CY #RAD #STEP N103 GLOBAL REAL #DXDY N103 GLOBAL REAL #DXDY1 N104 (Switch to imperial) N106 G20 N108 (switch to the touch probe, set your tool as needed) N110 M06 T100 N112 (Go to Program X0Y0) N114 G01Y0X0F5 N116 G31 X-1 I7 S1 E0 F1 N118 G01 X#Program.X/2 Y0 F5 N122 (search Y axis to -1 at feed rate of 1 input line 7) N124 G31 Y-1 I7 S1 E0 F1 N126 (First point is Program.X.Program.Y) N128 #PX = #Program.X N130 #PY = #Program.Y (N131 M00 #PX & " " & #PY N132 (Step back slightly to take probe off surface) N133 G01 X#Program.X/3 Y#Program.Y/2 F5 N138 (search Y axis to 2 at feed rate of 1 input line 7) N140 G31 Y.5 I7 S1 E0 F1 N142 (Second point is Program.X.Program.Y) N144 #PX1 = #Program.X N146 #PY1 = #Program.Y (N147 M00 #PX1 & " " & #PY1 N149 G01 X#PX/3 Y#Program.Y/3 F5 N154 (search X axis to 2 at feed rate of 1 input line 7) N156 G31 X2 I7 S1 E0 F1 N158 (Third point is Program.X.Program.Y) N160 #PX2 = #Program.X N162 #PY2 = #Program.Y (N163 M00 #PX2 & " " & #PY2 N164 (Go to Program X0Y0) N166 G01Y0X0F5 IF [#PX1 - #PX] = 0 THEN #PX1 = #PX1 + 0.0001 ENDIF IF [#PX2 - #PX1] = 0 THEN #PX2 = #PX2 + 0.0001 ENDIF IF [#PY1 - #PY] = 0 THEN #PY1 = #PY1 + 0.0001 ENDIF IF [#PY2 - #PY1] = 0 THEN #PY2 = #PY2 + 0.0001 ENDIF #DXDY = [#PY1 - #PY] / [#PX1 - #PX] N174 #DXDY1=[[#PY2]-[#PY1]]/[[#PX2]-[#PX1]] (M00 #DXDY & " " & #DXDY1 IF [#DXDY1 + #DXDY] = 0 THEN M00 "Either lines are on same coord or too small area" ENDIF N176 #CX=[[[#DXDY]*[#DXDY1]]*[[#PY]-[#PY2]]+[[#DXDY1]*[[#PX]+[#PX1]]]-[[#DXDY]*[[#PX1]+[#PX2]]]]/[[2.]*[[#DXDY1]-[#DXDY]]] N178 #CY=[[-1.]/[#DXDY]]*[[#CX]-[[#PX]+[#PX1]]/[2.]]+[[#PY]+[#PY1]]/[2.] (N180 #RAD=[SQRT[[[[#PX1]-[#CX]]*[[#PX1]-[#CX]]]+[[[#PY1]-[#CY]]*[[#PY1]-[#CY]]]]]*[2.] N182 M00 #CX & " " & " " & #CY & " " & #RAD N183 M00 #PX & " " & #PY & "; " & #PX1 & " " & #PY1 & "; " & #PX2 & " " & #PY2 N184 M00
Code:(Probe Left/Back set as program zero, move to Right/Front, set program zero to half/current position) GLOBAL REAL #XWidth GLOBAL REAL #YWidth GLOBAL REAL #XCenter GLOBAL REAL #YCenter GLOBAL STRING #Message #XWidth = 0 #YWidth = 0 #XCenter = 0 #YCenter = 0 (Switch to imperial) G20 M06 T100 (Go to Program Z0) G01Z0F5 (Go to Program X0Y0) G01Y0X0F12 (search z for .5" at feed rate of 1) input line 7 G31 Z-.5 I7 S1 E0 F1 (Program.Z is ?) (set Program Z to 0, no compensation since its the bottom of the probe, not the middle) G92 Z0 (Dwell .1 second) G04 P.1 (Move to Program.Z.1 above part) G01Z.1F20 (Move to Program.X-.3, since origin is rough) G01X-.3F20 (Move to Program.Z-.03 below part , maybe use ball size + ?) G01Z-.07F20 (fast search X for .5" at feed rate of 6) input line 7 G31 X.5 I7 S1 E0 F5 (quickly step back a tad) G01 X#Program.X - .1F20 (slow search X for .5" at feed rate of 1) input line 7 G31 X.15 I7 S1 E0 F1 (set Program X to 0, with compensation) G92 X-#Probe1SizeL/2 (move away from part in X) G01 X-.2F20 (Move to Program.Y, still below part in Z) G01 Y.2F20 (move into part on X, z is below top) G01 X.1F20 (fast search Y for -1" at feed rate of 6 input line 7 ) G31 Y-1 I7 S1 E0 F6 (move back away from part) G01 Y#Program.Y + .1 F12 (slow search Y for .15" at feed rate of 1 input line 7 ) G31 Y-.15 I7 S1 E0 F1 (set Program Y to 0, with probe ball compensation) G92 Y#Probe1SizeL/2 (move back away from part) G01 Y#Program.Y + .1 F12 (move above part) G01Z.2F20 (move over RoughX,RoughY guessed size of box at F5) G01 X#RoughX Y-#RoughY/2 F40 (move down to below edge of part) G01Z-.07F20 (fast search for X2, search for -1 in X) G31 X-1 I7 S1 E0 F6 (move out a tad) G01 X#Program.X + .1 F12 (slow search) G31 X-.2 I7 S1 E0 F1 ( size of object in X , these fail when not in simulator mode) #XWidth = #Program.X - #Probe1SizeL/2 #XCenter = #XWidth/2 (move away from x in positive direction) G01 X#Program.X + .2 F12 ( this moves XY and Z for some reason in simulator? ) G01Z.2F20 (Move to Program.Y-.4, still below part in Z) G01 X#RoughX/2 Y-#RoughY F40 (move into part on X, z is below top) G01Z-.07F12 (search Y for 1" at feed rate of 6 input line 7) G31 Y.1 I7 S1 E0 F6 G01 Y#Program.Y-.1 F12 (search Y for 1" at feed rate of 1 input line 7) G31 Y.1 I7 S1 E0 F1 ( size of object in Y - #Probe1SizeL/2) #YWidth = #Program.Y + #Probe1SizeL/2 (away from part) G01 Y#Program.Y - .1F12 #YCenter = #YWidth/2 (move z above part) G01Z.2F12 G01 X#XCenter Y#YCenter F40 (update screen) #XWidth1 = #XWidth #YWidth1 = #YWidth
rectangle center
i remoted in and pulled them off the cnc machine, but i'll add notes when i can
Code:GLOBAL REAL #PX #PY #PX1 #PY1 GLOBAL REAL #CX #CY (Switch to imperial) G20 (switch to the touch probe, set your tool as needed) M06 T100 (Go to Program X0Y0) G01Y0X0F5 G31 X-1 I7 S1 E0 F1 #PX = #Program.X G01 X#Program.X+0.08 F1 G31 Y-1 I7 S1 E0 F1 #PY = #Program.Y G01 Y#Program.Y+0.08 F1 G31 Y.5 I7 S1 E0 F1 #PY1 = #Program.Y G01 Y#Program.Y-0.08 F1 G31 X2 I7 S1 E0 F1 #PX1 = #Program.X G01Z.2F5 M00 #PX & " " & #PY & #PX1 & " " & #PX1 #CX = #PX1 - #PX #CY = #PY1 - #PY #CX = #CX /2 #CY = #CY /2 #CX = #PX + #CX #CY = #PY + #CY G01 X#CX Y#CY M00 #CX & " " & #CY
Below is what I use for center finding... note that I have one on the machine that runs this twice in a row for holes. Doing it twice gave me more assurance and accuracy. Also note, you need to install the #ProbeSize reference and Probe Diameter in the Variables Table.
------------------------------------
(Probe Hole Center - Tested)
(X-Y Center Hole Probe Routine)
(Start program in center area of opening, .050 Down Z into Hole)
(Seek travel distance is 2" in each axis - adjustable in G31 lines below)
(#ProbeSize is set in Variables)
G90
G20
G01 X0 Y0 Z0 F8
(Find X Center)
G31 X-2 I1 S1 E0 F8
G92 X0.0
G01 X#ProbeSize / 2 F8
/G04 P.2
G31 X2 I1 S1 E0 F8
#x1 = #Program.X
#xc1 = #x1 / 2
/G04 P.2
G1 X#xc1 F8
G92 X0.0
(Find Y Center)
G31 Y-2 I1 S1 E0 F8
G92 Y0.0
G01 Y#ProbeSize / 2 F8
/G04 P.2
G31 Y2 I1 S1 E0 F8
#y1 = #Program.Y
#yc1 = #y1 / 2
/G04 P.2
G1 Y#yc1 F8
G92 Y0.0
G01 Z0.200
G92 Z0
M00 "Remember to set Z Zero for tooling"
M99
-------------------------------------------------------------------
Chris L
Though it could definitely be user error. I get an error in FC before even starting with this code. I did edit it to be the correct input line. The probe diameter is set in my touch probe settings. Is there something else I am missing? I am having some luck with charliex's
A lazy man does it twice.
Btw, Thank You both. I am going to be enjoying this machine soon.
A lazy man does it twice.
not sure what you mean, so i'll assume and make eli5 notes,ProbeSize is the size of the ball of the touch probe itself, so typically what you want in 3d probing is the center of the ball not the outside edge,s o half the width is the center.
in flashcut if you define the variable ProbeSize to the width of the ball , then the existing code will set the offset to the probed position with the half the width of the ball, so again the center of the ball, if set to 0 then it wont compensate for the size of the probe ball, and when it touches the object, the point where the probe contacts the surface will become the actual program Z offset, same for any axis using the probe.
Typically you'd want to predefine ProbeSize in the flashcut variables screen to the measured width of the probe tip. i'll post a screenshot of my setup when i get home if it helps, or if misunderstood what you were asking let me know!
cheers
My probes physical tip is .1570" in diameter. The tool length offset is 3.3999". I have the tip size entered for tool 10 in my case.
Any pictures will help.
A lazy man does it twice.
First, Thank you so much for answering and the quickness was unexpected. I am assuming the first 4 values in the user variables applies to this conversation. There are 4 you have listed and not knowing the diameter of your probe it is ignorant to assume. What are the 4 different variables?
I see
#ProbeSize
#ProbeSizeL
#ProbeSize1
#ProbeSize1L
I am at a loss for the 4 different boxes.
I do understand where to enter them ;-) Just not why or what they represent.
#
A lazy man does it twice.
CharlieX, Thanks again.
Ended up using only the #ProbeSize, selected Real and added the probes tip diameter .1570. It seems to be working well.
Copied a few of the macros off of this thread and get mixed results. Mostly the probe is either probing an incorrect direction or sequence than I need.
I will look into modifying them for my use or understanding.
Funny that FC has program sensing but wont allow different settings on each axis simultaneously.
At least I did realize I could select X & Y and positive direction of travel to probe at the same time ;-)
A lazy man does it twice.
I spoke too soon. Though I have a much better work around than I did. I still dont understand the user variables well enough.
A lazy man does it twice.
i have two touch probes, and they have different attachments for the end ball, one small, one large ball. so there are two sets of variables for each of the probes, you only need the first one
i assume the setup of our machines is similar for axis direction