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:

Tap/Feed calculations


Recommended Posts

I have my post setup to double check the correct feeds/speeds are output for the tap. This works great for inch taps but metric I'm getting rounding errors.

 

Here's the post line

 

if n_tap_thds$ > 0,
     [
     if feed <> (speed/n_tap_thds$), [if mprint(stapfeed, 1) = 1, exitpost$] #Tap Feedrate check
     ]

 

So basically I convert my metric taps to inch in the tool definition.

 

M5x0.8

To get TPI I type into the field

0.8/25.4=0.031496(pitch)

1/0.031496=31.750064(TPI)

 

Now if I type 200RPM I get a feedrate of 6.3IPM

 

Now when the post does its calculation:

 

200/6.3=31.74603175

 

This alarms out.

 

How can I simplify this so it has a percentage or rounding effect in the equation?

 

Thanks,

 

Josh-

Link to comment
Share on other sites

What's the format statement for "n_tap_thds$"

Not sure but if you format it to only 2 decimal places it might do the rounding for you....

Also,

I have never used it but I saw this in the V9 post ref guide...

fmtrnd

Formula Type Advanced Math Functions

Description Returns the rounded value of the argument. The format statement (fs)

for the variable is used for rounding. If no format assignment was

given, the format statement one (fs 1) is used. This does not modify the

internal state of the argument value.

Form function argument

Argument numeric variable, value (scalar)

Return Type numeric variable (scalar)

Formula Code Ex. real_result = fmtrnd(x)

Boolean Code Ex. if fmtrnd(x) <> prv_x, “CURRENT VALUE DOES NOT EQUAL PREVIOUS”

Notes Nested return values are stored internally to the post executable. This

formula is normally used to compare rounded values (updated variable)

to un-rounded values

 

The fmtrnd function may be what you are looking for.

 

HTH

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