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:

Question for maths and post gurus


David Colin
 Share

Recommended Posts

Hello all,

 

I'd like to improve my DMU60P(axis-5) postpro and i need a little help... Here is my problem: I need to map in another matrix plane some toolpathes NCI points (x$,y$,z$). Currently, they are expressed in Mastercam tool plane matrix (m1$->m9$). I found in MP.dll help file that a formula (vmap) allows to map vectors expressed in WCS into any matrix. But i don't know how to express my NCI points into WCS... I also read into my MP help file (perhaps outdated because it came with V9) that a matrix formula wasn't still implemented (mmap). Its name sounds great^^ i'll give it a try. Otherwise, anyone can help to express NCI points to WCS?

 

Thanks

Link to comment
Share on other sites

My machine is a Deckel DMU60P with a nutating table (A-axis +45°/-30° and C-axis 0-360°) and a 2-position head (Horizontal/vertical). For axis-5 positionning, my post (Heidenhain) is using a useful function ("CYCLE DEF 19" in Heidenhain).

 

Currently, to make correct output with my post (which is pretty reliable though), i need to create my Mastercam toolplanes in a unique way. First of all, I must match every X-axis tool plane parallel to X-axis front WCS view (=sides/back...). Once i did this first step, there are still 2 possible planes (the one i created and the one rotated 180° around Z-axis) so i must check (=to choose this one) Y-axis tool plane is pointing toward positive Z-axis WCS. That's it. Pratically with Mastercam GUI, to get my X-axis i usually need to project a line onto a surface in front or side view. With years of training i'm pretty fast to do it. But, lately i had to program a pretty complex part with many (many...) different planes. And this procedure is really tiring... even if i'm using a Spacepilot, a lot of hotkeys and a double-click macro with my mouse (an Evoluent vertical to prevent repetitive stress injuries that i already have...). I recorded more than 10'000 clicks a day. I was the first surprised.lol.

 

Well, here is what i'd like to achieve: To create my tool planes in a much more friendly way (like any C-planes), by selecting an entity (ie:arc, normal or face,...). Just care about Z-axis and that's it!

 

During the past 2 days, I worked on this and implemented it in my post. I 'basically' MP programmed what i was making with my mouse in Mastercam GUI:

 

- I projected a point on my tool-plane (m1$->m9$). The point(1,0,0) in WCS front view or the point (0,1,0) in WCS side view if the first one failed. First projected point is (1,-m7$/m8$,0). Second one is (-m8$/m7$,1,0)

- So theses coordinates give me a vector which is paralell to X-axis WCS

- I unitize this vector which will be my new virtual X-axis

- I rotate it 90° around z-axis tool plane to get my new virtual Y-axis. I assigned the numeric variables axisx$, axisy$,axisz$ to (m7$,m8$,m9$) then used MP formula My_axis_Y = Rotv(90, my_axis_X)

- I calculated my new Z-axis with crossed product formula My_axis_Z = vaxb( my_axis_X, my_axis_Y)

- I tested that My_axis_Z is matching (m7$,m8$,m9$) to check that my projected point above was OK

- Then i checked that My_Y_axis is pointing upward by testing its z-wcs coordinate > 0. If not then I rotate 180°, My_axis_X and My_axis_Y (see above in Mastercam GUI)

 

So I was stuck there when i sent my message... As i couldn't find how to map a point not expressed in WCS matrix.

 

I found a turn around:

 

- My new virtual tool plane is defined so i created a square matrix (My_axis_Xx,My_axis_Xy,My_axis_Xz,My_axis_Yx,.....,My_axis_Zz)

- I mapped original X-axis tool plane(m1$,m2$,m3$) into this new plane thanks to the MP formula Vmap, to get its coordinates expressed into my new virtual tool plane.

- Working in 2D plane now, i finally calculated this 'precious' angle between original X-axis tool plane and my new virtual tool plane (with Acos/Asin).

- Then i rotated every nci points needed with that angle

 

I still need to debug but it seems to work fine. I just get a problem, it seems that system is rounding some variables. I could notice some little errors with the calculated angle (0.005°). That's why i'd like to try another way to calculate, perhaps with a matrix. I don't understand why it is rounding. Is there a system tolerance numeric variable?

 

Yours

Link to comment
Share on other sites
Well, here is what i'd like to achieve: To create my tool planes in a much more friendly way (like any C-planes), by selecting an entity (ie:arc, normal or face,...). Just care about Z-axis and that's it!

 

Might look at the Verisurf Free Hole Axis topic. We have some great free tools and it might have Verisurf WCS in it. Cool thing is just picking 2 lines to create a WCS and when you are done it is active without you have to tell Mastercam to make it active. I was going to tell you if you had the old V9 Heidenhain post 5 axis post you could maybe you some of the logic to achieve what you are after. Rounding error might be coming from the setting on the computer itself. See what the decimal place is on the setting for the Windows environment. I would think you could pull the WCS matrix out of the NCI and use that without having to use m1$,m2$,m3$ since that is manual process every time error could be introduced that way. Might also need look at the place value you have assigned the m1$,m2$,m3$ in the post if that is not set to 6 places using the correct format statement then that might be causing some of your rounding errors. There is some nice math in the MP, but if you are not using the already built in functions then you might not be fully using features on the MP and the math correctly. See the problem with all of this top secret MP and Post stuff is things that would help you are strictly forbidden to help you. Do a search about 3 years ago someone from Brazil was nice enough to share an Excel template that had a lot of this math done in for finding matrix and shifts points when doing this type of post work. Look on the FTP it is called DMU70v Kinematics and might help you see some of the problems you are having.

Link to comment
Share on other sites

Thank you for giving me clues to find this annoying bugbug. I checked windows settings and variables statements, both were ok and it was my mistake... I was calculating my angle with Acos formula only and even with a 9 digits number: acos(0.999999999) is still far from 0! Atan is much more precise. All seems OK now.

 

I'd like to try this Hole-axis C(or net)-hook, but where may i find an X3 version?

 

Yours

Link to comment
Share on other sites

If your machine support CYCLE19 (or CYCLE800 for Sinumerik or G53.1 Fanuc)you don't need to care about how your programmed plane is oriented. The controller will transform your angles(can be any combination A+C B+C OR A+B+C) to a vector then if your machine kinematics can orient the spindle or table to that plane and if necessary rotate your tool path in that plane. Don't waste your time trying to do that in Mastercam. I just create planes by solid face and if your post is properly set-up I even sometimes leave the origin of the new plane where the Mastercam will put it (add a datum shift before Cycle 19.

pbld, pn, "CYCL DEF 7.0", "DATUM SHIFT", peob, e$

pbld, pn, "CYCL DEF 7.1", *tox4$, peob, e$

pbld, pn, "CYCL DEF 7.2", *toy4$, peob, e$

pbld, pn, "CYCL DEF 7.3", *toz4$, peob, e$

For 5X simultaneous do the same thing use vectors instead of real machine axes. Those controllers are smarter then most of people know. You don't need specific posts for every machine configuration. Just modify your post so it will give you vectors like that:

Sinumerik (the best of the best of the best):

TRAORI ;TOOL TIP COMPENSATION ON

;************************************

N8 G90 G0 X1.0766 Y-.6729 Z.5 A3=-.3976 B3=-.8803 C3=.2588

N10 X1.0766 Y-.6729 Z-.6991 A3=-.3976 B3=-.8803 C3=.2588

N11 X1.2157 Y-.3648 Z-.7896 A3=-.3976 B3=-.8803 C3=.2588

N12 G1 X1.2356 Y-.3207 Z-.8026 A3=-.3976 B3=-.8803 C3=.2588

N13 X1.0532 Y-.2388 Z-.8031 A3=-.3976 B3=-.8803 C3=.2588

A3 B3 C3 = VECTOR COMPONENT in Mastercam *vtoolx$, *vtooly$, *vtoolz$,

 

FANUC:

G43.5 and I J K AS VECTOR COMPONENTS

 

HEIDENHAIN:

M128 and NX NY NZ as vector components..

just read controllers manuals.

Cheers

Link to comment
Share on other sites

I think your post is smarter than you think! So here was my problem... mine didn't work as you said (but now yes!). CYCL DEF 19 was correctly set (angles) and i didn't changed them. In this macro (DEF 19), you only set virtual 'angles' in parameters. Controller manages physical angles motions and work offset, but... your post still needs to output good X/Y/Z coordinates because for one job, there is only one set of X/Y/Z coordinates. And in Mastercam if you set a random tool plane, you get randoms X,Y,Z in your NCI... so your post must do all the job.

Link to comment
Share on other sites

That's not true.

My post for example is give me for Mastercam front plane A+90.

Physicaly there is no A axis on the machine (it's a DMU50 with B 45 nutator and rotary C).

The post is giving me for an operation on that plane coordonates XYZ.

Phisicaly my machine is rotating B+180 C0, and if let's say my toolpath is just a cut let's say only in x+ direction actualy in the machine the cut will be in x- direction

Same thing let's say a Matsuura 5X with A and C. The travel for A axis is from 0 to -90. My angle from post for front plane is like I said A+90. There is no A+ on that machine but is still doing my operation but my toolpath is rotated in plane 180deg.

Giveit a thought.

Cheers.

Link to comment
Share on other sites

I am totally agree with that, mine is working the same! I'm talking about x,y,z coordinates here. Just give it a try: make a toolpath in Mastercam with a random toolplane. Post. Now make another tool plane from the first one which you rotate around its axis-Z with a random value. Then use this toolplane with your toolpath operation. Post.

If you compare both programs, i'm pretty sure you get the same output! But... NCI wasn't the same at all, though. So the post did the job. If not... then you have something else in your program which is telling the controller to deal with your program. Perhaps an other special function.

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...