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:

Needs some Fanuc Macro Gurus help.


Guess_who
 Share

Recommended Posts

I'm looking for some help writing a Fanuc Macro to calculate the center X, Y, Z position of a sphere using 4 points in space on a 5th axis Makino D500

I found some information online, but the formulas I'm finding use matrix math. Which I know very little about. My goal it to get the math worked out to put it in a fanuc macro long hand. There is no matrix function in Fanuc 31i as far as I know. 

The point of this is to give the operator the ability to run this program and adjust the centerline of the 5th axis swing using parameters 19700, 19701, etc.

And help is appreciated.

Thanks

 

Link to comment
Share on other sites

Buy AxisSet from Renishaw.  Spend your time making money programming more chip making activities.  I am not sure if it can compensate the machine, but you could at least get the values and write another macro to update it if needed.  Why are things changing, and by how much?  I thought Makino's were pretty stable?

If I had a probe, I would definitely have it.  No question.  I spend way to much time checking and correcting rotational centers / zero positions on our routers.  Usually for us it is crash related.  Or in some cased due to taking a bit too heavy of a cut.  Or a piece of wood splitting and overloading a tool.

Small bump = 2 hours minimum to check and correct...

Link to comment
Share on other sites

They don't change by much. But the operator will notice some positions not holding. Could be someone bumped the fixture or something. Anyway, to determine if we lost centerline, we have to do it the old fashioned way. Which we could automate, but I was thinking we should be able to do it with just 4 points.

We actually already own Axisset that we use in our Matsuura MX520. That's where I got the idea. I already ran it past the boss to buy more. But we have 5 more Makino D500's 5th axis machines and two Jidic 5th axis coming in a month or so. Starts to get expensive.

Plus it's sounds fun to try to get it to work. :lol:

Link to comment
Share on other sites

So, I am sure you already know this, but it is all about tracking the error vector.  If you don't mind it taking a little bit longer execution wise, do it in two steps.  This way you are only doing one axis transformation at a time which is easy to accomplish long hand.  No need to get all fancy and do it with only 4 measured points.  Find the tilt, then find the rotate.  Use a pocket measure function on the waistline of the sphere, single surface the top, then interate until you pass a repeating trap that checks to make sure your measurement repeats to a given tolerance.  With a strain gage probe, I would guess you will be good on the second go around.  If you want to make sure it is perfect, index the spindle 180 and hit it again to take out probe error, by averaging the two results.  Then move onto the next point.

Link to comment
Share on other sites
56 minutes ago, jlw™ said:

that might be kinda small to get the results you need.  worth trying tho.

give me a few days (if you got it) and I'll send you something.

 
 

We have plenty of time. This is more of a learning experience, but something that can be useful. And I guess I didn't think of the small sample size. I guess I could run 2 sets of 4 and average.

 

43 minutes ago, huskermcdoogle said:

So, I am sure you already know this, but it is all about tracking the error vector.  If you don't mind it taking a little bit longer execution wise, do it in two steps.  This way you are only doing one axis transformation at a time which is easy to accomplish long hand.  No need to get all fancy and do it with only 4 measured points.  Find the tilt, then find the rotate.  Use a pocket measure function on the waistline of the sphere, single surface the top, then interate until you pass a repeating trap that checks to make sure your measurement repeats to a given tolerance.  With a strain gage probe, I would guess you will be good on the second go around.  If you want to make sure it is perfect, index the spindle 180 and hit it again to take out probe error, by averaging the two results.  Then move onto the next point.

 

That's pretty much what we do now, but we don't really have it automated. It takes a while to run, but probably more accurate. I just noticed the MX-520 only uses a few points and thought, hey, I wanna do that. 

Link to comment
Share on other sites

I'm a little confused. Are you just looking for a Macro to find the center of a sphere? Will you be running vectors parallel to an axis (such as in z) and are your machines a table-table configuration? Also, how close will the repositioning of the tooling ball be? +/- .125? 

 

edit: Actually, a picture would be awesome. I am happy to walk you through a few things on macros (because they are freaking awesome) and show you how to build a probe cycle I'm just not sure what's going on yet. 

Link to comment
Share on other sites
8 minutes ago, ahaslam said:

I'm a little confused. Are you just looking for a Macro to find the center of a sphere? Will you be running vectors parallel to an axis (such as in z) and are your machines a table-table configuration? Also, how close will the repositioning of the tooling ball be? +/- .125? 

 

Actually, I'm looking for the math to solve for center of a sphere given 4 points that can be done using a macro in the machine. I'm capable of writing the macro, I just don't understand the math.

Yes, our configuration is table/table. As far as the positioning, I would do it similar to how the MX-520 does it. We place the sphere at approximately the 12  O'Clock position. Step one would be to find the location and set an offset, then do the probe checks.

Link to comment
Share on other sites

OHHHHH, okay. Well geez, you just took all the fun out of it. I'm not sure if I am going to start giving the right info but here it goes. 

 

The simplest way to define points on a sphere is to think of the points like a bolt hole circle. so calculate a 3 point circle at the radius of your tooling ball then toss one point at the top. For example, on a .500" tooling ball you would have

X 0.0000 Y 0.2500
X 0.2165 Y-.12500
X-0.2165 Y-.12500

These would be you hit points. (your G31 lines)

To find your start points such as  .25 (or what ever) away from the ball, just calculate a bolt hole circle that has a radius .25 larger.

X 0.0000 Y 0.5000
X 0.4330 Y-0.2500
X-0.4330 Y-0.2500

To calculate this by macro you will have to build an equation using the math functions built into macro-b. It has all the trig functions available.

The 4th point (being z) is pretty self-explanatory.

I'm just about to leave work so when I get in tomorrow I can show you that part if you want but the machinery's handbook has a pretty good breakdown on how to do it. Gotta run.

 

Edit: So now that I am home rereading your post and realizing something, Are you asking for the points on a chord of a sphere? If you are only using a section of the sphere then you might have more issues with error based on how small the ball is but you can calculate points of a chord with trig on the machines.

Link to comment
Share on other sites

Ahaslam,

        Thanks for the reply. But I don't think I explain this well enough. In your example,  you have a know sphere diameter, when I'm finding the centerline of the nutting axis, I won't know the exact radius.  For example, let say I have 4 points in space; 

point 1 X0.|Y12.| Z3.0,   point 2  X8|Y1|Z2,    point 3  X-2|Y-6|Z-3 ,   point 4  X -11|Y2|Z4  

Now given those 4 points I should be able to calculate the Center swing as   X-1.5879|Y2.5125|Z1.6583 - And I only know that because of those handy, dandy calculators on the interwebz. And then I can compare that to my parameter 19700, 19701, and 19702 (X, Y, Z, Centerline) and make adjustments automatically.

Link to comment
Share on other sites
Quote

Buy AxisSet from Renishaw. 

+100000

AxisSet will get the most out of your machine. It is extremely handy when trying to find the shift between the c/l of rotation for two rotaries. Not to mention you can check the error plots and really dial in the CLR. 

Link to comment
Share on other sites
  • 3 weeks later...

If anyone was following this, I ended up doing this in two stages. Math was easier. I calculated the X using 2 points. Simple stuff.  Then I calculated the Z and Y using 3 co-planer points around the -A- axis. If anyone cares, the math looks like this.

#750= ( Y position 1st point)
#751= ( Z position 1st point)
#752= ( Y position 2nd point)
#753= ( Z position 2nd point) 
#754= ( Y position 3rd point)
#755= ( Z position 3rd point)

 

(MATH TO CALCULATE CL OF Y IS WITH 3 POINTS)
#101=[[#750*#750]+[#751*#751]]*[#753-#755]
#102=[[#752*#752]+[#753*#753]]*[#755-#751]
#103=[[#754*#754]+[#755*#755]]*[#751-#753]
#104=#101+#102+#103
#105=#750*[#753-#755]
#106=#751*[#752-#754]
#107=#752*#755
#108=#754*#753
#109=2*[#105-#106+#107-#108]
#763=#104/#109 ( CALCULATE Y CENTERLINE)
#763=#763*100000 ( USED TO TRANSFER TO PARAMETER SIDE)

(MATH TO CALCULATE CL OF Z IS WITH 3 POINTS)
#101=[[#750*#750]+[#751*#751]]*[#754-#752]
#102=[[#752*#752]+[#753*#753]]*[#750-#754]
#103=[[#754*#754]+[#755*#755]]*[#752-#750]
#104=#101+#102+#103
#105=#750*[#753-#755]
#106=#751*[#752-#754]
#107=#752*#755
#108=#754*#753
#109=2*[#105-#106+#107-#108]
#764=#104/#109 ( CALCULATE Z CENTERLINE)
#764=#764*100000 ( USED TO TRANSFER TO PARAMETER SIDE)

 

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