Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Probing Routine - Renishaw/Haas


Bill H
 Share

Recommended Posts

I have a Haas mill and a Renishaw 40-2 wireless probe.

I would like to incorporate code into a program to probe the surface of a part and then modify that value to establish the G54 Z offset.  Specifically, I want the Z plane to be 0.015 below the probed surface.  Can anyone show me how to do this?

Here's the code I use to probe the surface:

T10 M6
G00 G90 G55 X0. Y0. (GETS THE PROBE TO THE CENTER OF THE PART)
G43 H10 Z0.5 (GETS THE PROBE ABOUT 0.5 ABOVE THE PART)
G65 P9359 W54. Z-0.7 (PROBES AND ASSIGNS THE RESULT TO THE G54 Z REGISTER)
G65 P9833 (TURNS OFF THE PROBE)
G53 Z0. (RETRACTS TO THE TOOL CHANGE POSITION)

Thanks!
 

Link to comment
Share on other sites

On a standard Fanuc control, with inspection plus macros, The below macro call will do what you want. However if I recall, Haas does some things a little differently. Go into your program directory and find the number for single surface measurement. That will be the macro number to call. The S value is the work offset to set.  (s1=G54, S2=G55 etc.)

G65 P9811 Z.015 S1.

 

MIke 

  • Like 1
Link to comment
Share on other sites
16 minutes ago, Matthew Hajicek™ - Conventus said:

https://diy.haascnc.com/presentations/use-macro-variables-change-location-work-offset

Looks like all you have to do is add a line at the end:

#5223 = [#5223 -.015]

 

WARNING:

In order to make sure this works "correctly" on a Haas, you should also be forcing the "look ahead" to be turned off, then "back on" after you make the macro change.

Otherwise, what will happen is the Control can "read ahead" and do the "#5223 = [#5223-.015]", before the Probe routine has actually run. So it could accidentally use the "old" value.

This will take care of that:

G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
G65 P9359 W54. Z-0.7 (PROBES AND ASSIGNS THE RESULT TO THE G54 Z REGISTER)
#5223=[#5223-0.015] (SUBTRACT .015 FROM PROBED Z POS)
G65 P9833 (TURNS OFF THE PROBE)
G53 Z0. (RETRACTS TO THE TOOL CHANGE POSITION)
G103 (TURNS LOOK AHEAD BACK ON)

 

  • Thanks 1
Link to comment
Share on other sites
37 minutes ago, Matthew Hajicek™ - Conventus said:

I'm considering using this functionality for fine depth adjustments in tapered threaded holes.  So far I've been reposting when adjustments are needed.

Good plan. That being the case, some food for thought:


#101 = -0.0154
#102 = -0.0231
#103 = 0.0062
#149 = 1.0 (FEED SCALE VALUE)

.

G01 X2.5 Y0. F2.5*[#149]




T40 M06
.
.
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
G65 P9359 W54. Z-0.7 (PROBES AND ASSIGNS THE RESULT TO THE G54 Z REGISTER)
#5223=[#5223-#101] (SUBTRACT #101 FROM PROBED Z POS)
G65 P9833 (TURNS OFF THE PROBE)
G53 Z0. (RETRACTS TO THE TOOL CHANGE POSITION)
G103 (TURNS LOOK AHEAD BACK ON)

.
.
.

T40 M06
.
.
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
G65 P9359 W54. Z-0.7 (PROBES AND ASSIGNS THE RESULT TO THE G54 Z REGISTER)
#5223=[#5223-#102] (SUBTRACT #102 FROM PROBED Z POS)
G65 P9833 (TURNS OFF THE PROBE)
G53 Z0. (RETRACTS TO THE TOOL CHANGE POSITION)
G103 (TURNS LOOK AHEAD BACK ON)
.
.
.

T40 M06
.
.
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
G65 P9359 W54. Z-0.7 (PROBES AND ASSIGNS THE RESULT TO THE G54 Z REGISTER)
#5223=[#5223-#103] (SUBTRACT #103 FROM PROBED Z POS)
G65 P9833 (TURNS OFF THE PROBE)
G53 Z0. (RETRACTS TO THE TOOL CHANGE POSITION)
G103 (TURNS LOOK AHEAD BACK ON)

 

So, the first thing being "multiple variables" for adjusting different "features" independently.

The next suggestion (something I love doing), is a "Feed correction factor".

What I do is change the "Format Assignment Line" inside the Post Processor, to add a "Suffix" string, to the end of all the "Feed" values.

fmt  "F" 15 feed "*[#149]"       #Feedrate

The effect on the machine is to allow you to "globally adjust" all the Feed values that are being used.

Set #149 = 1.0, and all your Feed Values are "as posted". Want to turn down the program by 36%? Set #149 = 0.74.

Want to "dry run" through a section of code? Set #149 = 10., and now you can fly through the code, until you want to change the #149 value back to 0.

This is great for machines that restrict you to only running 200% on the Feed Override values. 200% of F1.0 is still really slow!!!

What I love is the flexibility...

 

 

  • Like 1
Link to comment
Share on other sites

Yeah, that's great!  I have done the feedrate adjustment factor before.  I tweaked my post so I could make it output "F[#101*12.34] for every feedrate so that dynamic paths which had run through the high-feed filter could be manually adjusted.

Here's what I'm thinking.  I'm using the Z values of P1-P14 simply for convenience and so they can be quickly and easily checked on the control.

%
O82222 (8222 A 02 01_10)
(POSTABILITY 5-AXIS HAAS TR160Y TRUNNION)
(MACHINE GROUP-2)
(MASTERCAM - X9)
(MCX FILE  - 8222 A 01_03.MCX-9)
(POST      - MPPOSTABILITY_HAAS_TR160Y.PST)
(PROGRAM   - 8222 A 02 01_03.NC)
(DATE      - 2018.04.27)
(TIME      - 3:01 PM)

#7003 = 0 (HOLE #1 Z SHIFT)
#7023 = 0 (HOLE #2 Z SHIFT)
#7043 = 0 (HOLE #3 Z SHIFT)
#7063 = 0 (HOLE #4 Z SHIFT)
#7083 = 0 (HOLE #5 Z SHIFT)
#7103 = 0 (HOLE #6 Z SHIFT)
#7123 = 0 (HOLE #7 Z SHIFT)
#7143 = 0 (HOLE #8 Z SHIFT)
#7163 = 0 (HOLE #9 Z SHIFT)
#7183 = 0 (HOLE #10 Z SHIFT)
#7203 = 0 (HOLE #11 Z SHIFT)
#7223 = 0 (HOLE #12 Z SHIFT)
#7243 = 0 (HOLE #13 Z SHIFT)
#7263 = 0 (HOLE #14 Z SHIFT)
(#7381 THROUGH #7386, P20, TEMPORARY WORKING OFFSET)
... Tool list...
... Preceding ops ...
(THREAD 14)
T31 M06 (TAPERED THREADMILL S-271427-49337)
T24
(#7381 THROUGH #7386, P20, TEMPORARY WORKING OFFSET)
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
#7381 = #5321 (P20 X = G59 X)
#7382 = #5322 (P20 Y = G59 Y)
#7383 = #5323 + #7263 (P20 Z = G59 Z + P14 Z)
#7384 = #5324 (P20 A = G59 A)
#7385 = #5325 (P20 B = G59 B)
G103 (TURNS LOOK AHEAD BACK ON)
G154 P20 G17 G90
G00 A-96.312 B-73.198
G187 P3 E.002
G01 G94 X-7.4298 Y3.119 S3357 M03 F833.
G43 H31 Z1.3812
M08
Z.8812
Z.2012 F25.
G41 D31 X-7.4294 Y3.1064 F2.
G03 X-7.4132 Y3.1195 I.0031 J.0127
X-7.4304 Y3.1375 Z.2124 I-.0175 J.0005
X-7.4503 Y3.1183 Z.2237 I-.0004 J-.0194
X-7.429 Y3.0965 Z.2349 I.0214 J-.0003
X-7.4126 Y3.1029 Z.2405 I.0004 J.0229
X-7.4053 Y3.1198 Z.2462 I-.0166 J.0173
X-7.4305 Y3.1395 Z.2574 I-.0208 J-.0007
G01 G40 X-7.4298 Y3.119
Z.2012 F25.
G41 D31 X-7.4294 Y3.1064 F2.
G03 X-7.4132 Y3.1195 I.0031 J.0127
X-7.4304 Y3.1375 Z.2124 I-.0175 J.0005
X-7.4503 Y3.1183 Z.2237 I-.0004 J-.0194
X-7.429 Y3.0965 Z.2349 I.0214 J-.0003
X-7.4126 Y3.1029 Z.2405 I.0004 J.0229
X-7.4053 Y3.1198 Z.2462 I-.0166 J.0173
X-7.4305 Y3.1395 Z.2574 I-.0208 J-.0007
G01 G40 X-7.4298 Y3.119
Z.8812 F833.
Z1.3812
G187
(THREAD 13)
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
#7381 = #5321 (P20 X = G59 X)
#7382 = #5322 (P20 Y = G59 Y)
#7383 = #5323 + #7233 (P20 Z = G59 Z + P13 Z)
#7384 = #5324 (P20 A = G59 A)
#7385 = #5325 (P20 B = G59 B)
G103 (TURNS LOOK AHEAD BACK ON)
G154 P20 G17 G90
X-6.9302 Y3.0981 Z1.3822
G187 P3 E.002
Z.8822
Z.2022 F25.
G41 D31 X-6.9298 Y3.0855 F2.
G03 X-6.9136 Y3.0986 I.0031 J.0126
X-6.9308 Y3.1166 Z.2134 I-.0175 J.0005
X-6.9507 Y3.0974 Z.2247 I-.0005 J-.0195
X-6.9295 Y3.0756 Z.2359 I.0214 J-.0003
X-6.9131 Y3.082 Z.2415 I.0004 J.023
X-6.9057 Y3.0989 Z.2472 I-.0166 J.0173
X-6.9309 Y3.1185 Z.2584 I-.0208 J-.0007
G01 G40 X-6.9302 Y3.0981
Z.2022 F25.
G41 D31 X-6.9298 Y3.0855 F2.
G03 X-6.9136 Y3.0986 I.0031 J.0126
X-6.9308 Y3.1166 Z.2134 I-.0175 J.0005
X-6.9507 Y3.0974 Z.2247 I-.0005 J-.0195
X-6.9295 Y3.0756 Z.2359 I.0214 J-.0003
X-6.9131 Y3.082 Z.2415 I.0004 J.023
X-6.9057 Y3.0989 Z.2472 I-.0166 J.0173
X-6.9309 Y3.1185 Z.2584 I-.0208 J-.0007
G01 G40 X-6.9302 Y3.0981
Z.8822 F833.
Z1.3822
G187
(THREAD 12)
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
#7381 = #5321 (P20 X = G59 X)
#7382 = #5322 (P20 Y = G59 Y)
#7383 = #5323 + #7223 (P20 Z = G59 Z + P12 Z)
#7384 = #5324 (P20 A = G59 A)
#7385 = #5325 (P20 B = G59 B)
G103 (TURNS LOOK AHEAD BACK ON)
G154 P20 G17 G90
X-6.4307 Y3.0772 Z1.3832
G187 P3 E.002
Z.8832
Z.2032 F25.
G41 D31 X-6.4302 Y3.0646 F2.
G03 X-6.4142 Y3.0777 I.0031 J.0126
X-6.4313 Y3.0957 Z.2144 I-.0174 J.0005
X-6.4511 Y3.0764 Z.2257 I-.0005 J-.0195
X-6.4299 Y3.0546 Z.2369 I.0214 J-.0003
X-6.4135 Y3.0611 Z.2425 I.0004 J.023
X-6.4062 Y3.0779 Z.2482 I-.0167 J.0173
X-6.4313 Y3.0976 Z.2594 I-.0208 J-.0007
G01 G40 X-6.4307 Y3.0772
Z.2032 F25.
G41 D31 X-6.4302 Y3.0646 F2.
G03 X-6.4142 Y3.0777 I.0031 J.0126
X-6.4313 Y3.0957 Z.2144 I-.0174 J.0005
X-6.4511 Y3.0764 Z.2257 I-.0005 J-.0195
X-6.4299 Y3.0546 Z.2369 I.0214 J-.0003
X-6.4135 Y3.0611 Z.2425 I.0004 J.023
X-6.4062 Y3.0779 Z.2482 I-.0167 J.0173
X-6.4313 Y3.0976 Z.2594 I-.0208 J-.0007
G01 G40 X-6.4307 Y3.0772
Z.8832 F833.
Z1.3832
G187
G49
G91 G00 G28 Z0.
(THREAD 08)
G103 P1 (FORCE LOOK AHEAD TO 1 BLOCK)
#7381 = #5321 (P20 X = G59 X)
#7382 = #5322 (P20 Y = G59 Y)
#7383 = #5323 + #7143 (P20 Z = G59 Z + P8 Z)
#7384 = #5324 (P20 A = G59 A)
#7385 = #5325 (P20 B = G59 B)
G103 (TURNS LOOK AHEAD BACK ON)
G154 P20 G17 G90
G00 A-121.288 B-74.385
G187 P3 E.002
G01 X-4.2676 Y3.0167 F833.
G43 H31 Z0.
Z-1.
Z-1.6255 F25.
G41 D31 X-4.2658 Y3.0043 F2.
G03 X-4.2513 Y3.0191 I.0017 J.013
X-4.2703 Y3.0351 Z-1.6143 I-.0174 J-.0015
X-4.2879 Y3.0138 Z-1.603 I.0017 J-.0195
X-4.2644 Y2.9944 Z-1.5918 I.0213 J.002
X-4.2434 Y3.0203 Z-1.5805 I-.0024 J.0234
X-4.2705 Y3.037 Z-1.5693 I-.0206 J-.003
G01 G40 X-4.2676 Y3.0167
Z-1.6255 F25.
G41 D31 X-4.2658 Y3.0043 F2.
G03 X-4.2513 Y3.0191 I.0017 J.013
X-4.2703 Y3.0351 Z-1.6143 I-.0174 J-.0015
X-4.2879 Y3.0138 Z-1.603 I.0017 J-.0195
X-4.2644 Y2.9944 Z-1.5918 I.0213 J.002
X-4.2434 Y3.0203 Z-1.5805 I-.0024 J.0234
X-4.2705 Y3.037 Z-1.5693 I-.0206 J-.003
G01 G40 X-4.2676 Y3.0167
Z-1. F833.
Z0.
G187
... etc.

Threads #12, #13, and #14 are coplanar.

Link to comment
Share on other sites
  • 2 years later...
1 hour ago, FLR169 said:

Great information here.  Can anyone shed a direction to figure out how to probe 4 corners and have the lowest corner inputted into my desired Z work offset'

Thanks Mike

4 Corners? Are you do a Edge Probe or a single surface of each face? If you are doing a single face then you will need to run the routine and then save the collected variable out to a new variable. Then run again and rinse and repeat collecting all 4 points. then would need to establish a nominal position to do the match from. You could do a highest and lowest calculation and then from there establish a mid point or you could just collect the points. Then compare to a dummy number to see which one is the lowest and then have the macro use it. Macro needs to know a base line to do the work from, but once you have that then should be pretty straight forward.

Link to comment
Share on other sites
2 hours ago, FLR169 said:

Can anyone shed a direction to figure out how to probe 4 corners and have the lowest corner inputted into my desired Z work offset?

That would take some MACRO work.

Me, I'd hit a corner write to a work offset (G54 for example), take the Z from that work offset (#5223) and write it off somewhere else (#191). Rinse and repeat 3 more times (#192, #193, and #194). Then after you find the one you want write a MACRO that makes the one you want your work Offset Value (say #193 is the winner)

#5223=#193

Maybe not elegant, but it'll get the job done... on a FANUC.  :yes

  • Like 1
Link to comment
Share on other sites

I guess I should of left more information

Part is a weldment . The top surface needs to be faced. Just enough so it's a clean machined surface. I'd like to figure out how to do it with the probe.

( This macro stuff is completely new to me. )

Been messing around with #5221=-41.8508 (G54 X)  as an example and have that all sorted out. So my X...Y...Z offsets are now populated via the macro.

So with this weldment I would like to probe the top surface (Z) in all 4 corners . Then have the lowest corner become my desired Z offset #.

Hopefully that makes more sense.

 

Thanks Mike

Link to comment
Share on other sites

G65 P9820 X1. Y1. Z0. I20. J1. I20. J5. I1. J5.

That is using the Stock Allowance Cycle that James pointed out for you, and probes in 4 places:

X1. Y1. = P1

I20. J1. = P2 (@ X20. Y1.)

I20. J5.  = P3 (@ X20. Y5.)

I1. J5. = P4 (@ X1. Y5.)

The 1st Point is given by XYZ

The 2nd Point is given by the first pair of "I and J Parameters".

The 3rd and 4th Point is given by the 2nd and 3rd pair of IJ Parameters.

The only thing I'm not sure of is this: Do you also need to include the "K Parameter", when describing the additional P2-P6 Points for this cycle? (I think the "K" values should just repeat whatever the "Z" parameter is, but I'm not 100% sure.)

 

  • Like 2
Link to comment
Share on other sites
51 minutes ago, JoshC said:

I mean, it has it's place.

It also costs money (not insignificant money mind you), and requires training to use.

In this case, he needs 1 line of code to get the results he is looking for. (Not including Tool change, and startup lines, or retracting after probing.)

This is a perfect example of where both Custom Drill Cycles, and/or Manual Entry, are also great solutions.

  • Like 3
Link to comment
Share on other sites
4 hours ago, Colin Gilchrist said:

G65 P9820 X1. Y1. Z0. I20. J1. I20. J5. I1. J5.

That is using the Stock Allowance Cycle that James pointed out for you, and probes in 4 places:

X1. Y1. = P1

I20. J1. = P2 (@ X20. Y1.)

I20. J5.  = P3 (@ X20. Y5.)

I1. J5. = P4 (@ X1. Y5.)

The 1st Point is given by XYZ

The 2nd Point is given by the first pair of "I and J Parameters".

The 3rd and 4th Point is given by the 2nd and 3rd pair of IJ Parameters.

The only thing I'm not sure of is this: Do you also need to include the "K Parameter", when describing the additional P2-P6 Points for this cycle? (I think the "K" values should just repeat whatever the "Z" parameter is, but I'm not 100% sure.)

 

I started to write that out today and when I went to try it, batteries dead in the probe...:(  Now I need to wait till batteries come in.

1 hour ago, Colin Gilchrist said:

I mean, it has it's place.

It also costs money (not insignificant money mind you), and requires training to use.

In this case, he needs 1 line of code to get the results he is looking for. (Not including Tool change, and startup lines, or retracting after probing.)

This is a perfect example of where both Custom Drill Cycles, and/or Manual Entry, are also great solutions.

Could you share this information... :)

Link to comment
Share on other sites
10 minutes ago, FLR169 said:

I started to write that out today and when I went to try it, batteries dead in the probe...:(  Now I need to wait till batteries come in.

Could you share this information... :)

http://www.emastercam.com/board/index.php?showtopic=15291

http://www.emastercam.com/board/index.php?showtopic=19194

http://www.emastercam.com/board/index.php?showtopic=24313

http://www.emastercam.com/board/index.php?showtopic=28834

www.emastercam.com/board/index.php?showtopic=31183

Link to comment
Share on other sites
18 minutes ago, FLR169 said:

I started to write that out today and when I went to try it, batteries dead in the probe...:(  Now I need to wait till batteries come in.

Could you share this information... :)

Ron just posted some links to previous threads here where we've talked about Productivity Plus. 

It is a nice add-in to Mastercam, if you do a lot of Probing, and/or, you want to build custom Probing cycles, and use the Prod+  interface to write custom macro logic and add Sequence Blocks for program jumps (based on Probe results).

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...