Page 1 of 2
4TH AXIS tolerance
Posted: Wed Sep 03, 2014 5:30 am
by Brown53
Is there a way to limit the A axis to 3 decimal places instead of 4. My Haas will only work to .001 in the A axis. Or will I have to change this line line at a time? Would there be any problems Using the code for one tooth and then using it as a subroutine? I am new to gear cutting, so am learning on the fly :)
Re: 4TH AXIS tolerance
Posted: Wed Sep 03, 2014 6:00 am
by ArtF
Hi:
The extra decimal shouldnt affect the haas, doesit trip an error?
There will be a post processor this year, but theres no way to eliminate the 4th digit currently.
Yes, you can use 1 tooth many times.. except on the non circulars of course..
Art
Re: 4TH AXIS tolerance
Posted: Wed Sep 03, 2014 8:09 am
by Brown53
Ya, if I leave the 4th decimal in, it alarms out.
Re: 4TH AXIS tolerance
Posted: Wed Sep 03, 2014 11:42 am
by Mooselake
My regular expressions are rusty, and this is the first time I've ever used powershell (yes, I know...) so there's probably an easier way. This assumes windows; linux would be a lot easier since you can just use sed. Better yet, install cygwin and you'll have sed, gawk, and the other goodies.
I copied the g code file in \users\kirk so it would be easy to find. Alternatively you could do a cd to the appropriate directory. Start powershell; you'll get a command prompt window.
Type (or copy/paste) the following, replacing puff and puff2 with the appropriate file names.
cat puff.ngc | %{$_ -replace "(\.[0-9][0-9][0-9])([0-9])","`$1"} > puff2.ngc
It replaces all 4 decimal place numbers with the first 3 places, or at least it did in my test file. No rounding, just cuts off the last digit. There's probably an easy way to make it into a batch file, but I didn't dig that deep.
No warranty, no guarantee, etc.
Kirk
Re: 4TH AXIS tolerance
Posted: Wed Sep 03, 2014 1:51 pm
by ArtF
Kirk:
Thanks for that. I will see if I can quickly lower the A axis to 3 for next release, or at least offer
an option, but that may help till then..
Art
Re: 4TH AXIS tolerance
Posted: Thu Sep 04, 2014 2:04 am
by Wod
Art,
Just so you know, Haas doesn't mind 4 places in the X,Y,and Z. It just doesn't like 4 places in the A or B.
Wiley
Re: 4TH AXIS tolerance
Posted: Thu Sep 04, 2014 3:40 am
by ArtF
Curious isnt it,, youd think any programmer would simply ignore the higher resolution...
Art
Re: 4TH AXIS tolerance
Posted: Thu Sep 04, 2014 4:00 am
by Mooselake
Here's the A and B axis only version. I should have looked into this powershell thing years ago - a now retired programmer/instructor friend (who's girls I used to babysit something like 40 years ago when we both worked at NASA) has been after me to try for years.
O'Reilly (books, not auto parts) has a book "Mastering Regular Expressions" that I almost wore out around 15 years ago. Alas, it stayed when I changed jobs and I never replaced it - time to hit Amazon since bookpool's long gone. Note that M$ REs are, of course, subtly different than the real thing.
Programmers are strange people; who knows why they do things :)
cat puff.ngc | %{$_ -replace "([AB][0-9\-]*\.[0-9][0-9][0-9])([0-9])","`$1"} > puff2.ngc
Fixing the case where there's more than one minus sign is left to the reader that cares.
Kirk
Re: 4TH AXIS tolerance
Posted: Thu Sep 04, 2014 9:36 am
by Ken_Shea
Kirk,
Is that a setting in the Haas post that needs changed ?
Under the MultiAxis tab >Axis Decimals.
Ken
Re: 4TH AXIS tolerance
Posted: Mon Sep 08, 2014 11:47 am
by Brown53
I tried the powershell and I am to dumb :'( I tried the file name a couple of different ways. Here is what it said-
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Documents and Settings\greg beers> cat\Documents and Settings\greg beers\D
esktop\m24357aa.ngc | %{$_ -replace "([AB][0-9\-]*\.[0-9][0-9][0-9])([0-9])","`$
1"} > \Documents and Settings\greg beers\Desktop\m24357aa.ngc
The term 'cat\Documents' is not recognized as the name of a cmdlet, function, s
cript file, or operable program. Check the spelling of the name, or if a path w
as included, verify that the path is correct and try again.
At line:1 char:14
+ cat\Documents <<<< and Settings\greg beers\Desktop\m24357aa.ngc | %{$_ -repl
ace "([AB][0-9\-]*\.[0-9][0-9][0-9])([0-9])","`$1"} > \Documents and Settings\g
reg beers\Desktop\m24357aa.ngc
+ CategoryInfo : ObjectNotFound: (cat\Documents:String) [], Comma
ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Documents and Settings\greg beers> cat Documents and Settings\greg beers\D
esktop\m24357aa.ngc | %{$_ -replace "([AB][0-9\-]*\.[0-9][0-9][0-9])([0-9])","`$
1"} > Documents and Settings\greg beers\Desktop\m24357aa.ngc
Get-Content : A positional parameter cannot be found that accepts argument 'and
'.
At line:1 char:4
+ cat <<<< Documents and Settings\greg beers\Desktop\m24357aa.ngc | %{$_ -repl
ace "([AB][0-9\-]*\.[0-9][0-9][0-9])([0-9])","`$1"} > Documents and Settings\gr
eg beers\Desktop\m24357aa.ngc
+ CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBin
dingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell
.Commands.GetContentCommand
Re: 4TH AXIS tolerance
Posted: Mon Sep 08, 2014 9:22 pm
by Mooselake
It looks like you're typing the full path. In the first one there's no space between cat and \Documents. The spaces in the filename n the second one are confusing it.
Copy the file to the home directory and just leave the path off. Stupid windoze directory names. You have to put them in quotes because of the embedded spaces.
Kirk
Re: 4TH AXIS tolerance
Posted: Tue Sep 09, 2014 10:36 am
by Brown53
Did that, it saved the file with the .ngc attached. when I open that one it is blank. I might just have to bite the bullet and change a couple of thousand lines of code by hand :o
Thanks for the effort though :)
Re: 4TH AXIS tolerance
Posted: Tue Sep 09, 2014 10:44 am
by ArtF
Hi:
No, cant have you do all that.. Send me a note to
support@gearotic.com and Ill send you a special zipped up exe that will make he A axis to 3 digits..
Art
Re: 4TH AXIS tolerance
Posted: Thu Sep 11, 2014 5:14 am
by Brown53
;D ;D ;D ;D THANKS
Re: 4TH AXIS tolerance
Posted: Thu Sep 11, 2014 7:27 am
by Mooselake
And while you're waiting, highlight and copy the following line, get a command prompt, and type powershell. Do a "cd desktop" (assuming the files are still there).
Click on the screen image in the upper left corner of the command prompt window, then select edit, then paste. Hit enter.
I don't think you can read and write the same file this way, when I looked both of your file names were the same. It worked, with these exact file names, when I tried it here.
Regular expressions are pretty weird looking, and hard to retype. They're hard to type the first time :)
cat m24357aa.ngc | %{$_ -replace "([AB][0-9\-]*\.[0-9][0-9][0-9])([0-9])","`$1"} > m24357aa2.ngc
I didn't know you could change the desktop from a command prompt, so it was an interesting exercise. HTH
Kirk