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:

Macro B question


So not a Guru
 Share

Recommended Posts

We have a part that has countersinks that are recessed into a curved surface. To measure c'sinks that can't be reached with a c'sink gauge, we usually use a gage ball & indicator to determine if the c'sink diameter is correct.

Since this part has the c'sinks on a curved surface, we can't do that. So I thought I'd try my hand at using a probe & writing a macro to extrapolate the measurement. I can't seem to get it to work. The machine is a Mazak VCU500 with a Matrix II controller.

Can anyone point me to what I've got messed up here?

This is what I've got:

 

(MEASURE CENTER OF PART "Z")
/G53 Z0.
/G53 X0. Y0.
/G53  B0. C0.
/T30 M06
/G0 G90 G54 X0.0 Y0.0 G43 H30 Z4.0
/G65 P9810 Z1.32 F50.(PROTECTED MOVE)
/G65 P9811 Z0. S2. (SINGLE SURFACE MEASURE, STORE IN G55)
/G65 P9810 Z3.5 F50.  (PROTECTED MOVE)
/G53 Z0.
/M01


M00
(PLACE A 7/16" GAGE BALL IN THE CSINKED HOLE)
(TURN THE RAPID DOWN TO 25%)


(MEASURE THE TOP OF THE BALL)
/G53 Z0.
/G53 X0. Y0.
/G53  B0. C0.
/T30 T20 M06
/G0 G90 G54 X-0.50 Y-0.50 G43 H30 Z4.0
/G65 P9810 Z1.56 F50.(PROTECTED MOVE)
/G65 P9811 Z0. S3. (SINGLE SURFACE MEASURE, STORE IN G56)
/G65 P9810 Z4.0 F50.  (PROTECTED MOVE)
/G53 Z0.
/T20 M6
/M01


#100=(ABS(#5243))
#101=(ABS(#5263))
#103=(#101-#100)

M00
(CHECK THE  0.382" - 0.392" 100° CSINK DIA)
(MACRO VARIABLE #153 SHOULD BE BETWEEN 0.2849 & 0.2891)
(ADJUST THE OFFSET AS REQUIRED)
(THE NEXT OP WILL RERUN THE PREVIOUS CSINK)

 

CSINK.PNG

Link to comment
Share on other sites

I would do it more like this...I would capture the z value immediately after it was taken...then calculate it at the end..

I use the calculation to read the correct offset register for the active offset...in doing it this way, I can use this code on whatever offsets I need without have to change it all the time

 (MEASURE CENTER OF PART "Z")
/G53 Z0.
/G53 X0. Y0.
/G53  B0. C0.
/T30 M06
/G0 G90 G54 X0.0 Y0.0 G43 H30 Z4.0
/G65 P9810 Z1.32 F50.(PROTECTED MOVE)
/G65 P9811 Z0. S2. (SINGLE SURFACE MEASURE, STORE IN G55)
/G65 P9810 Z3.5 F50.  (PROTECTED MOVE)
/#100=ABS[#[5203+[20*[#19-101]]]]<------------HERE
/G53 Z0.
/M01


M00
(PLACE A 7/16" GAGE BALL IN THE CSINKED HOLE)
(TURN THE RAPID DOWN TO 25%)


(MEASURE THE TOP OF THE BALL)
/G53 Z0.
/G53 X0. Y0.
/G53  B0. C0.
/T30 T20 M06
/G0 G90 G54 X-0.50 Y-0.50 G43 H30 Z4.0
/G65 P9810 Z1.56 F50.(PROTECTED MOVE)
/G65 P9811 Z0. S3. (SINGLE SURFACE MEASURE, STORE IN G56)
/#101=ABS[#[5203+[20*[#19-101]]]] <-----------HERE
/G65 P9810 Z4.0 F50.  (PROTECTED MOVE)
/G53 Z0.
/T20 M6
/M01


#103=(#101-#100)<------------------HERE

M00
(CHECK THE  0.382" - 0.392" 100° CSINK DIA)
(MACRO VARIABLE #153 SHOULD BE BETWEEN 0.2849 & 0.2891)
(ADJUST THE OFFSET AS REQUIRED)
(THE NEXT OP WILL RERUN THE PREVIOUS CSINK)

 

  • Thanks 1
  • Like 1
Link to comment
Share on other sites
10 hours ago, So not a Guru said:

Thanks John, I'll try it in the morning.

It worked perfectly, thanks again.

 

15 hours ago, JParis said:

#100=ABS[#[5203+[20*[#19-101]]]]

How does this work?

I get the 1st part #100=Abs[#[5203+[20*[#19-101]]]], but I don't understand how subtracting 101 from the S value returns the correct offset register.

Wouldn't #100=ABS[#[5203+[20*#19]]] work ?

Link to comment
Share on other sites
1 hour ago, So not a Guru said:

How does this work?

I get the 1st part #100=Abs[#[5203+[20*[#19-101]]]], but I don't understand how subtracting 101 from the S value returns the correct offset register.

Wouldn't #100=ABS[#[5203+[20*#19]]] work ?

It might work just fine for G54-G59 but once you get to G54.1P1-G54.1P300....as Renishaw uses 101 to equal G54.1P1 you need to subtract to get the correct register.

 

and I live in the extened offsets...rarely using G54-G59

  • Like 2
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...