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:

Planes with sign or name of the axes changed in multi-axis operation


eltklas
 Share

Recommended Posts

Hello everyone. When I try to extract the values of the construction or tool planes values with a table, or through OPINFO, the values of the axes appear changed in sign or axis. It is a multi-axis operation that groups several operations, and also those operations are in different construction planes. How can I get the correct values? Thanks for the help.

Link to comment
Share on other sites

It might come down to the base WCS and the planes in question relationship to back to it. Might have to spin the Plane 180 degrees on Z to get the values you are expecting. NCI is matrix based as much as it is numerical based. Depending on the matrix what you see that doesn't make sense makes perfect since to the post because it is looking to the MMD to decipher the primary axis direction. With a properly configured post that has this setup to output G68.2 or CYCLE800 then we get the correct output when the planes are not sharing the same base point as the WCS. It sounds like that is what you are trying to accomplish is mapping of planes back a WCS that most post that support DWO already have built into them.

  • Thanks 1
Link to comment
Share on other sites

I'm sorry but I'm Spanish and I don't speak English, I use a translator and I haven't been able to understand your explanation well. Is there no possibility of obtaining the values that actually appear in the construction plans of each operation? I need to write those values at the beginning of each operation, it's an old machine and it doesn't work otherwise. It is usually done by hand and it is a job that I thought I could automate by modifying the post. Thanks for your help anyway.

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

I'm sorry but I'm Spanish and I don't speak English, I use a translator and I haven't been able to understand your explanation well. Is there no possibility of obtaining the values that actually appear in the construction plans of each operation? I need to write those values at the beginning of each operation, it's an old machine and it doesn't work otherwise. It is usually done by hand and it is a job that I thought I could automate by modifying the post. Thanks for your help anyway.

Put together a Z2G with a sample part and then maybe someone can help you.

 

Link to comment
Share on other sites

I see where you have pulled the value of variables with tabla de valores and then created the process to output them. Problem is are these are back to the Mastercam file before the NCI has been processed. You need to process certain things like you would for output of the NC code. Once you establish what the mathematical difference is then you will be able to map it like you want correctly. xout, yout, zout are all being processed using the MMD to take what you have programmed and converted through that matrix to output the code. You are pulling the raw data from Mastercam that has not really been processed for output like you are doing.

The other thing I am seeing is you didn't pull the variables through pwrttparam$ or pparameter$, but pulled them raw. I am not sure or know enough to understand if pulling them from there helps align the output you are looking for, but when ever I have done what you are doing in the past I have always go through and defined everything there first then started working on getting output. It looks like they are pulled without running them through this process. Might try that and see if that is pushing everything through correctly to give the output you are looking for. 

Here is some of what I got with a post and stuff I added. This goes back 15 years ago so my memory is foggy.

# --------------------------------------------------------------------------
# Machine definition and control definition parameter capture:
# --------------------------------------------------------------------------

pparameter$      #Information from parameters
           #"pparameter", ~prmcode$, ~sparameter$, e$  #Brute Force Method for finding Vaules
           if opcode$=13 | opcode$=14, result = fprm (opcode$)
           if prmcode$ = 10000, stoper = sparameter$
           if stoper=snull, stoper = snullop
           if prmcode$ = 15552, toolangle = rpar(sparameter$,1)
           if prmcode$ = 10005, tdia = rpar(sparameter$,1)         # Tool Dia Milling
           if prmcode$ = 10006, tradius = rpar(sparameter$,1)      # Tool Corner Radius Milling
           if prmcode$ = 10010, stock = rpar(sparameter$,1)        # Stock to leave in Z Milling
           if prmcode$ = 10068, stock1 = rpar(sparameter$,1)       # Stock to leave in XY Milling
           if prmcode$ = 10102, lfstockx = rpar(sparameter$,1)     # Amount of Stock Left X Turning Finishing
           if prmcode$ = 10103, lfstockz = rpar(sparameter$,1)     # Amount of Stock Left Z Turning Finishing
           if prmcode$ = 10202, lrstockx = rpar(sparameter$,1)     # Amount of Stock Left X Turning Roughing
           if prmcode$ = 10203, lrstockz = rpar(sparameter$,1)     # Amount of Stock Left Z Turning Roughing
           if prmcode$ = 13343, lrdepth = rpar(sparameter$,1)      # Depth of Cut Lathe Roughing
           if prmcode$ = 10214, lathdir = rpar(sparameter$,1)      # Direction 0=ID,1=OD,2=FACE,3=BACK Turning
           if prmcode$ = 12068, stock2 = rpar(sparameter$,1)       # Stock to leave in Z facing Milling
           if prmcode$ = 10020, clearinc = rpar(sparameter$,1)     # param 10020 is clearance now and 10021 indicates abs or inc
           if prmcode$ = 13359, lgrstockx = rpar(sparameter$,1)    # Amount of Stock Left X Turning Groove Roughing
           if prmcode$ = 13360, lgrstockz = rpar(sparameter$,1)    # Amount of Stock Left Z Turning Groove Roughing
           if prmcode$ = 10366, lgfstockx = rpar(sparameter$,1)    # Amount of Stock Left X Turning Groove Finishing
           if prmcode$ = 10367, lgfstockz = rpar(sparameter$,1)    # Amount of Stock Left Z Turning Groove Finsihing
           if prmcode$ = 10331, lgwidth = rpar(sparameter$,1)      # Width of Groove
           if prmcode$ = 15100, clearflg = rpar(sparameter$,1)
           if prmcode$ = 15145, metvals = rpar(sparameter$,1)
           if prmcode$ = 15147, lturret = rpar(sparameter$,1)      # Turret Being Used
           if prmcode$ = 15148, lspindle = rpar(sparameter$,1)     # Spindle Being Used
           if prmcode$ = 15339, clearstrt = rpar(sparameter$,1)
           if prmcode$ = 15346, comp_type = rpar(sparameter$,1)    #Cutter Compensaation Type (Lathe)
           if prmcode$ = 15347, comp_dir = rpar(sparameter$,1)     #Cutter Comp Direction (Lathe and Mill)
           #if prmcode$ = 15182, miscvalon = rpar(sparameter$,1)
           if prmcode$ = 20010, sconstplname = ucase(sparameter$)
           if prmcode$ = 20011, sconstplcomm = ucase(sparameter$)
           if prmcode$ = 20012, stoolplname = ucase(sparameter$)
           if prmcode$ = 20013, stoolplcomm = ucase(sparameter$)
           if prmcode$ = 20014, swcsplname = ucase(sparameter$)
           if prmcode$ = 20015, swcsplcomm = ucase(sparameter$)
           if prmcode$ = 20016, smatlname1 = ucase(sparameter$)
           if prmcode$ = 20017, smatlname2 = ucase(sparameter$)
           if prmcode$ = 20018, stpgrpname = ucase(sparameter$)
           if prmcode$ = 20103, stinsert2 = sparameter$
           if prmcode$ = 20110, stholder2 = sparameter$
           #if prmcode$ = 20100, ltooltype = sparameter$
           if prmcode$ = 12025, rotary_axis2 = rpar(sparameter$,1) #Capture the axis of rotation in Multiaxis Drill and Curve 5 Axis
           if prmcode$ = 15371, axissubdir = rpar(sparameter$,1)
           if prmcode$ = 12628,
             [
             hst_flg = 1
             hststyle = rpar(sparameter$,1)
             ]
           if prmcode$ = 20111, shape = rpar(sparameter$,15)
           if prmcode$ = 20008, head_x = rpar(sparameter$,9)

# --------------------------------------------------------------------------
# NCI file pre-read look ahead routines
# Build the toolchange buffer, sets cycle and turret flags
# --------------------------------------------------------------------------
pwrttparam$      #Information from parameters
           if opcode$ = 104, result = fprm (opcode$)
           if prmcode$ = 20007, pilot_dia = rpar(sparameter$, 11)
           if prmcode$ = 10005, tdia = rpar(sparameter$,1)         # Tool Dia Milling
           if prmcode$ = 10006, tradius = rpar(sparameter$,1)    #  Tool Corner Radius
           if prmcode$ = 10010, stock = rpar(sparameter$,1)      # Stock to leave in Z Milling
           if prmcode$ = 10068, stock1 = rpar(sparameter$,1)     # Stock to leave in XY Milling
           if prmcode$ = 10102, lfstockx = rpar(sparameter$,1)   # Stock to leave in X Turning Finishing
           if prmcode$ = 10103, lfstockz = rpar(sparameter$,1)   # Stock to leave in Z Turning Finishing
           if prmcode$ = 10202, lrstockx = rpar(sparameter$,1)   # Stock to leave in X Turning Roughing
           if prmcode$ = 10203, lrstockz = rpar(sparameter$,1)   # Stock to leave in Z Turning Roughing
           if prmcode$ = 13359, lgrstockx = rpar(sparameter$,1)    # Amount of Stock Left X Turning Groove Roughing
           if prmcode$ = 13360, lgrstockz = rpar(sparameter$,1)    # Amount of Stock Left Z Turning Groove Roughing
           if prmcode$ = 10366, lgfstockx = rpar(sparameter$,1)    # Amount of Stock Left X Turning Groove Finishing
           if prmcode$ = 10367, lgfstockz = rpar(sparameter$,1)    # Amount of Stock Left Z Turning Groove Finsihing
           if prmcode$ = 13343, lrdepth = rpar(sparameter$,1)      # Depth of Cut Lathe Roughing
           if prmcode$ = 10331, lgwidth = rpar(sparameter$,1)      # Width of Groove
           if prmcode$ = 10214, lathdir = rpar(sparameter$,1)    # Direction 0=ID,1=OD,2=FACE,3=BACK Turning
           if prmcode$ = 12068, stock2 = rpar(sparameter$,1)     # Stock to leave in Z facing
           if prmcode$ = 15145, metvals   = rpar(sparameter$,1)
           if prmcode$ = 15346, comp_type = rpar(sparameter$,1)  # Cutter Compension Type
           if prmcode$ = 15347, comp_dir = rpar(sparameter$,1)   # Compenstion Direction
           if prmcode$ = 20103, stinsert2 = sparameter$
           if prmcode$ = 20110, stholder2 = sparameter$
           if prmcode$ = 20004, slot = rpar(sparameter$,16)
           if prmcode$ = 20006, cut_ability = rpar(sparameter$,8)
           if prmcode$ = 20007, pilot_dia = rpar(sparameter$,11)
           if prmcode$ = 12628,
             [
             hst_flg = 1
             hststyle = rpar(sparameter$,1)
             ]

  • Thanks 1
Link to comment
Share on other sites

Look at the PDF for MP Post Ref Guide - Legacy Chapters > Rotary Processing

This chapter covers:

  • Rotary processing types
  • Variables that control rotary processing
  • Processing 4-axis motion
  • Mastercam view matrixes
  • Examples
  • Processing 5-axis motion
  • Matrix mapping

 

Are you already familiar with Linear Algebra concepts, specifically Vector and Matrix mathematics?

 

  • Thanks 1
Link to comment
Share on other sites

Are you only looking for the Origin of the Construction/Tool Plane, relative to the Active WCS?

Current Toolplane Origin Values are "relative to the Plane orientation", not the original WCS itself. The MP Language has some special variables to help you make sense of the Plane Origin.

Check the variables for "Tool Plane Origin" >

tox$

toy$

toz$

Those variables are the "unmapped origin values", which means the numbers are relative to plane, not the WCS. Look at these:

tox4$

toy4$

toz4$

These variables should contain the "mapped" values, or the XYZ positions relative to the WCS Plane and Origin.

For debugging purposes, just put the variable with a Tilde character on an output line, to see the value:

~tox4$, ~toy4$, ~toz4$, e$

 

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

Sorry for the delay in responding, but it doesn't work either. I have tried with:

tox$ -y -z

tox4$ - y -z

t_orgin_x$ - y - z

corgx$ - y - z

But none of those variables store the coordinates of the construction plane within a multi-axis operation. Sometimes the values coincide and sometimes they don't, and other times they appear but with changed signs.

Any help will be welcome. Thank you

Link to comment
Share on other sites
10 hours ago, eltklas said:

Sorry for the delay in responding, but it doesn't work either. I have tried with:

tox$ -y -z

tox4$ - y -z

t_orgin_x$ - y - z

corgx$ - y - z

But none of those variables store the coordinates of the construction plane within a multi-axis operation. Sometimes the values coincide and sometimes they don't, and other times they appear but with changed signs.

Any help will be welcome. Thank you

Multi-Axis Operations are using Moduleworks paths, so they are likely not being calculated correctly through the MP.DLL post engine.

Hmm.

Try posting out the raw NCI Data, and looking at the 1014, 1016, and 1027 data lines. Are the values correct there, or are they signed differently from what is being entered into your Construction Plane dialog box for Plane Origin?

If the values are correct in the NCI, but the predefined variables are not being populated correctly, it is possible to capture the values using 'pparameter$' Post Block, and manipulate/calculate whatever you need. (But, obviously more work, and not convenient.)

Can I ask "why the Construction Plane Origin", and not the "Tool Plane Origin"? Typically, Construction and Tool Planes would be set identically, but curious if you are setting them identically, or differently?

Do you need values ahead of every operation?

There could be some options, although not ideal, by using 'Misc. Real Numbers' in the Operation, to pass XYZ Data, or, by using the Manual Entry Toolpath, to pass comments or NC Code to the Post. (Need to modify the Comment handling, to store Operation Comments, and suppress output, until the correct time, but this solution presents many opportunities to directly code data into your Toolpaths Manager, and get the output you need where you want it.

Doing this "programmatically" is the best solution, but might be more work dealing with Vector/Matrix math and Parameter Post Blocks, versus just adding Misc. Reals or Manual Entry.

  • Thanks 1
  • Like 1
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...