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:

forcing 5 digit output in NC code


Don Trust
 Share

Recommended Posts

for MC 8, 9, and X..

 

I need a way to force 5 decimal place output on X, Y, I, & J codes. Our current posts will output anywhere from 2 to 5 decimal places, even when the number out to 5 places isn't zero. I have the post variables set to output 5 places after the decimal.

 

This is causing a problem with a couple machines that crap out with an error "can't compute radius" in certain cases.

 

It was never a problem in version 8, but 9 and X produce different NC code than ver 8, with the exact same model. All the tolerances in setup are the same in all 3 versions, so I don't know why they would produce different nc code. I figure that if I could force 5 decimal place output, it may solve my problem.

 

Anyone know how to do this? (my reseller doesn't)

 

partial examples follow....

 

Version 8 output

%00000

N10 (33917GP )

N20 G1 X.36227 Y-.15623 F20.

N30 M97

N40 G1 X.31227 F30.

N50 G2 X.29796 Y-.1526 I0. J.03

N60 G3 X0. Y-.077 I-.29796 J-.5494

N70 G3 X-.29796 Y-.1526 I0. J-.625

N80 G2 X-.31227 Y-.15623 I-.0143 J.02637

N90 G2 X-.34065 Y-.13593 I0. J.03

 

Version 9 output...

%00000

N10 (33917GP )

N20 G1 X.36227 Y-.15623 F20.

N30 M97

N40 G1 X.31227 F30.

N50 G2 X.298 Y-.1526 I0. J.03

N60 G3 X0. Y-.07698 I-.298 J-.5494

N70 G3 X-.298 Y-.1526 I0. J-.62502

N80 G2 X-.3123 Y-.15622 I-.0143 J.0264

N90 G2 X-.3407 Y-.1359 I0. J.03002

Link to comment
Share on other sites

Its in the In-House Solutions MP Master post

 

In a V9 Mpfan based post there is a vairiable called vtol. By defualt its set to .0001.

Try changing it to .000001. That MAY prevent

the 4 decimal place rounding that's causing your problem.

I've had similar problems in X that were fixed by bumping the tolerances on the Control Definition page

 

edit: I don't think you need 5 place output, but it looks like you control wants 5 palce accuracy.

( the numbers are good to five places, but the 5th

digit is not output)

Link to comment
Share on other sites

gcode,

 

Found the vtol variable, changed it to .000001, but no joy. Output exactly the same code.

 

Thanks anyway. One would think there is a way to FORCE the 5 (or 6, or 3, or 8, or whatever) decimal output. Just have to find it.

 

p.s. you are probably right about the control wanting 5 decimal place accuracy.

 

Terry,

 

The post is putting out anywhere from 3 to 5 decimal places, seemingly at random, even on the I's & J's. Doesn't make any sense to me. You would think both versions of MC would put out the exact same code from the same model.

Link to comment
Share on other sites

From the generic Fanuc 3 Axis

code:

fs2 2   0.4 0.3      #Decimal, absolute, 4/3 place

fs2 3 0.4 0.3d #Decimal, delta, 4/3 place

code:

fmt  X  2   xabs        #X position output

fmt Y 2 yabs #Y position output

fmt Z 2 zabs #Z position output

fmt X 3 xinc #X position output

fmt Y 3 yinc #Y position output

fmt Z 3 zinc #Z position output

fmt I 3 iout #Arc center description in X

fmt J 3 jout #Arc center description in Y

could / did you try changing this?

 

code:

fs2 2   0.5 0.4      #Decimal, absolute, 5/4 place

fs2 3 0.5 0.4d #Decimal, delta, 5/4 place

Link to comment
Share on other sites

quote:

could / did you try changing this?

 

 

fs2 2 0.5 0.4 #Decimal, absolute, 5/4 place

fs2 3 0.5 0.4d #Decimal, delta, 5/4 place

 


That is exactly how my post reads. Thanks, though. cheers.gif

 

I have an hour or so tonight to play with this. Maybe I'll stumble on something. confused.gif

Link to comment
Share on other sites

AHA!

 

gcode, you were right right off the bat. I tried ADDING the mtol variable to my post and I get 5 decimal places anywhere there is something other than zero. Don't know why it wasn't there in the first place, or how I got along without it all that time in ver 8.

 

It doesn't FORCE 5 decimal output, but it does put out 5 places in spots where before there were only 4. I think this will do the trick, but I can't test it until I get to work tomorrow.

 

 

Look especially at lines N20 & N170 from both outputs.

 

sample output without mtol...

 

%00000

N10 (1 )

N20 G1 X.31227 Y-.15623 F20.

N30 M97

N40 G2 X.298 Y-.1526 I0. J.03 F6.16

N50 G3 X0. Y-.07698 I-.298 J-.5494

N60 X-.298 Y-.1526 I0. J-.62502

N70 G2 X-.3123 Y-.15622 I-.0143 J.0264

N80 X-.3407 Y-.1359 I0. J.03002

N90 X-.36004 Y-.0195 I.3407 J.1164

N100 X-.3547 Y.0423 I.36004 J0.

N110 X-.3372 Y.0646 I.0296 J-.0051

N120 X0. Y.13548 I.3372 J-.7666

N130 X.3372 Y.0646 I0. J-.83748

N140 X.3547 Y.0423 I-.0121 J-.0274

N150 X.36004 Y-.0195 I-.3547 J-.0618

N160 X.3407 Y-.1359 I-.36004 J0.

N170 X.3123 Y-.1562 I-.0284 J.0097

N180 M99

N190 M30

 

 

sample WITH mtol (set to .00001)

 

%00000

N10 (1 )

N20 G1 X.31227 Y-.15623 F20.

N30 M97

N40 G2 X.29796 Y-.1526 I0. J.03 F6.16

N50 G3 X0. Y-.077 I-.29796 J-.5494

N60 G3 X-.29796 Y-.1526 I0. J-.625

N70 G2 X-.31227 Y-.15623 I-.01431 J.02637

N80 G2 X-.34065 Y-.13593 I0. J.03

N90 G2 X-.36 Y-.0195 I.34065 J.11643

N100 G2 X-.35465 Y.04232 I.36 J0.

N110 G2 X-.33718 Y.06463 I.02955 J-.00515

N120 G2 X0. Y.1355 I.33718 J-.76663

N130 G2 X.33718 Y.06463 I0. J-.8375

N140 G2 X.35465 Y.04232 I-.01208 J-.02746

N150 G2 X.36 Y-.0195 I-.35465 J-.06182

N160 G2 X.34065 Y-.13593 I-.36 J0.

N170 G2 X.31227 Y-.15623 I-.02838 J.0097

N180 M99

N190 M30

Link to comment
Share on other sites

mtol controls the precision at which all internal calculations are performed in MP. For best results it should be set to the same precision as your output variables. Setting it too far off can result in rounding errors, which is most often noticed in arc endpoints if multiple arc checking routines are used. For Mill, Lathe and Router, the default for mtol is .0001, for Wire it is .00001

 

If mtol is not initialized in the post (V9.1 with MP.DLL v9.19 or 9.19) the default precision is used which means that the most you will get output is 4 places past the decimal point.

 

In X, this value is controlled in the Tolerances topic of the control definition.

Link to comment
Share on other sites

quote:

Quick question here. Why does it output G2's and G3's on every linewhen you add the "mtol"?

 


Opps, I just checked and I ran it through a test post by mistake in the one without gcodes. Ran it though correctly, and the result was the same as far as the decimal places. The mtol variable has no effect on the G2's, G3's, etc.

 

Nice catch, Jake.

Link to comment
Share on other sites

quote:

If mtol is not initialized in the post (V9.1 with MP.DLL v9.19 or 9.19) the default precision is used which means that the most you will get output is 4 places past the decimal point.


Paul, in my original ver 9 post file, I did not have the mtol variable, but on some lines got 5 decimal places anyway. There must be something else that allowed the 5 decimals *sometimes* confused.gif

 

oy, I going to bed. gotta be at work in 4 hours.

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