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:

Machining time in NC file?


Recommended Posts

Hi guys!

I want to get machining time (shown in backplot) in my post to output it at the start of NC file.

Actually, I'd like to get it for the each tool in my program (to output it in the ptooltable section), but any advice would be appreciated.

Any Ideas? Is it possible at all?

I found only 15105 parameter in MCAMX5_NCI_Parameter_Ref.pdf (but I'm not sure because it's always equal to zero). What's this parameter for?

Thanks.

Link to comment
Share on other sites

Yes, I checked it couple of times and it was always zero.

I thought if Mastercam had so many parameters it must had such parameters for machining time (hours, minutes and seconds enough).

May be such parameters are not implemented yet (and 15105 parameter is just a dummy). Or may be they even ain't planned to implement. Who knows.

Anyway, I couldn't figured out what's the parameter for. MCAMX5_NCI_Parameter_Ref says something about "Calculated cycle time for NCI section", but who must calculate the time - post or me, and why it's always zero?

Link to comment
Share on other sites

Thanks for good advice! I looked at it and found a couple of bugs :)

For instance, here is the ptime section:

ptime #Distance calculations

dx = x$ - prv_x$

dy = y$ - prv_y$

dz = z$ - prv_z$

len = sqrt(dx^2 + dy^2 + dz^2)

if gcode$ = zero, ptimer #RAPID time and length calc

if gcode$ = one, ptimel #FEED time and length calc

!x$, !y$, !z$, !fr_pos$ #Update previous [prv_?] variables

if fr_limits, pfrcheck #Track MAX/MIN Feedrates if requested

What about arc motions? Shouldn't they be calculated as well as linear and rapid motions?

Nevertheless it's a good start indeed. Thanks again!

When I fix it (or if I fix it ;) ) I'm gonna post here the result for other people.

P.S. It's a pity that Mastercam doesn't have operation's parameters for backplotted time - it would be easier to output it at the top of NC file.

Link to comment
Share on other sites

Cycle times need to be calculated based upon the distance traveled and the speed at which those distances are traveled. Mill.set linearizes arcs and forces long hand dill cycle output to break the motion into rapid and linear motion which can in turn be calculated for time estimates. It is not possible to do this while you are actively post processing a file for output. The best I could suggest would be to use a the ppost$ postblock to reprocess the NCI file using some kind of stripped down .set file and then to merge the results in to the NC file previously generated by the pst file (not for the faint at heart).

Link to comment
Share on other sites

You could find the length of the arc with something like this:

 

#HomeMade variables
arc_ratio : 0
arc_length : 0

pfind_arc_length        #Find arc_length by using sweep angle and radius
    arc_ratio = abs(sweep$) / 360                         # Find ratio from sweep angle / 360
    arc_length = ((arcrad$ * 2) * 3.14159)) * arc_ratio   # Find circumference of total cirlce then multiply by arc_ratio to get length

 

I think this will work (as long as I got my variables right :) )

 

Once you have the length you could add a ptimea post block for gcode$ = 2 or gcode$ = 3

Link to comment
Share on other sites

hi, listen i am a new guy so this may not help but we use a excel file to change tools amoung machines,\it is on lathes

but say a cnmg on 3101 is diffent than 3104 the mastercam is programmed to a cnmg then the sheet takes over and corrects it for both machines.

Link to comment
Share on other sites

Paul is right, doing this while posting is a pain, I had to do this once and it was not as easy as it looked like at the beginning!

 

It was for tool life management along with a cell management system. Not only is it a pain to calculate it right, but to have it at the beginning of the NC it means that you need to output the G codes into a sub file while you calculate the time based on each moves and then at the end you need to bring everything back into the main NC file to have the time at the beginning instead of the end of the file. Also you need to find a way to store each tool time separatly and to add to each of them if the tool is re-used later in the program.

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