Post processor files on a Mac?

Discussion of post processors for various CNC machines

Post processor files on a Mac?

Postby RNC » Wed Oct 28, 2015 6:45 pm

Hi guys, just finished my trial and purchased yesterday. I'm only missing one thing at this point that I can see.

I have my tooling set up in repeatable height holders with one as a master tool, so I need to send G43 H# commands in my programs, where would I go about finding the postprocessor files on a Mac to modify one to add those?
RNC
 
Posts: 13
Joined: Wed Oct 14, 2015 11:40 pm

Re: Post processor files on a Mac?

Postby RNC » Mon Nov 02, 2015 10:51 pm

Answering my own questions, to an extent...

The files are in (Application/View Contents) Contents/Resources/Posts on the mac version.

But a problem...going by the variable list at http://www.grzsoftware.com/manual/overview.htm I lack the ability to change a post processor to issue G43 H# commands, because H# is not an available variable.

Here's the existing tool change block from Mach3-Inch.nc..

Code: Select all
;
TOOLCHANGE = "([CUTVIEWERTOOL])"
TOOLCHANGE = "M6 [T]"
TOOLCHANGE = "M3 [S]"
;


In a sample program, this would call a tool change as follows...

Code: Select all
(TOOL/MILL,0.3750,0.18750,1.000,0.0)
M6 T4
M3 S2500


Now, I can add another line after the M6 to quote "G43" but there is no variable to call the height from the tool table in relation to the current tool.

I attempted to call the tool number variable by modifying the NC file as follows in the tool change section...

Code: Select all
TOOLCHANGE = "G43 H[T]"


But the result of that is this...

Code: Select all
(TOOL/MILL,0.3750,0.18750,1.000,0.0)
M6 T4
G43 HT4
M3 S2500
G0X0.0000Y0.0000Z0.1000


Any way to get the post processor to not print the variable name, but rather just the value, for this purpose? (Removing the 'T'?)
RNC
 
Posts: 13
Joined: Wed Oct 14, 2015 11:40 pm

Re: Post processor files on a Mac?

Postby RNC » Mon Nov 02, 2015 11:07 pm

And I figured out the solution ;)...

The instructions are a bit vague but you must define the variable output format. Tool variables have no format definition so you have to add one.


At the top of an NC post file you'll have the following, for example from Mach3-Inch.nc...

Code: Select all
;Feeds
FORMAT = [F|#|F|1.1]
;Moves
FORMAT = [I|@|I|1.4]
FORMAT = [J|@|J|1.4]
FORMAT = [X|#|X|1.4]
FORMAT = [Y|#|Y|1.4]
FORMAT = [Z|#|Z|1.4]
FORMAT = [R|#|A|1.4]
;


What you want to do is add an output format for [T], the tool variable, like so...

Code: Select all
;Tools
FORMAT = [T|@||1.0]


What this does, per the above linked manual, is force the tool variable number to always be written when called, to have no preliminary output associated with it (the blank || part), and for it to be a single number with no decimal places.

If you add that to your Mach3-Inch.nc, the output of your generated code is now the following....

Code: Select all
(TOOL/MILL,0.3750,0.18750,1.000,0.0)
M6 4
M3 S2500
G0X0.0000Y0.0000Z0.1000


Aha, now we're making progress, the above has removed the leading [T] from the tool number, you can work with that.

So you can then modify the tool change section in the NC file as follows...

Code: Select all
;
TOOLCHANGE = "([CUTVIEWERTOOL])"
TOOLCHANGE = "M6 T[T]"
TOOLCHANGE = "G43 H[T]"
TOOLCHANGE = "M3 [S]"
;


And this will produce the desired output, when running the same toolpath generation again...

Code: Select all
(TOOL/MILL,0.3750,0.18750,1.000,0.0)
M6 T4
G43 H4
M3 S2500
G0X0.0000Y0.0000Z0.1000


That's precisely what a Mach3 file with G43 tool length offsets should look like. Note the line break, you DO want to put your G43 offset on a separate line from the tool change. That's against the conventional wisdom you'll find in lots of G code documentation, but Mach3 has a long standing bug that causes weird assumptions to take place if you put the G43 on the same line.
RNC
 
Posts: 13
Joined: Wed Oct 14, 2015 11:40 pm

Re: Post processor files on a Mac?

Postby Randy » Tue Nov 03, 2015 1:32 am

RNC, I'm sorry for having left you out to hang, becuase I thought you knew what you wanted to edit and just needed to know where the Mac posts are (I have no conception of the Mac version of MeshCAM--my only Mac is a Plus...) And double shame on me for not checking back at the forum until now. But you have arrived at the correct answer in the meantime. Doubleplusgood on your reasoning. Here is my own Mach3 post which I have customized for my Tormach

Code: Select all
; MeshCAM config
; This config is for Randy's Tormach PCNC
;
; 2/29/04Changed comments to be enclosed by () rather than start with ;
;  Added CutViewer config output
; 5/13/04Added toolchange gcode
; 3/17/05   Changed stock definition to use CUTVIEWERSTOCK variable
; 3/22/05   Added UNITS statement
; 8/02/05   Removed [F] statement from rapid moves
; 11/19/06  Added G43, M3 lines to toolchange (RG-G)
; 11/26/06  Added PLUNGE_RATE_MOVE, Tools FORMAT (courtesy JeffD)
; 12/16/06  Moved CUTVIEWERTOOL to M6 line
; 1/1/07Added S word format
; 1/20/07   Added dummy "S4500" for default rpm
; 7/21/07   Added M9 and M8 statements to toolchange
; 8/8/07Added M998 statement to toolchange
; 8/19/07   Changed M2 to M30
; 9/23/07   Added FP and SZ formats, added SZ and FP to PLUNGE_RATE_MOVE
; 11/17/08  Reworked toolchange
; 10/22/09  Changed SZ format from # to @
; 3/30/10   Added COMMENT lines, courtesy jeffD and Robert
; 12/23/10  Added arc moves for V4
; 2/4/11Added A axis format
;
DESCRIPTION = "Tormach-Inch RG-G(*.nc)"
FILE_EXTENSION = "nc"
UNITS = INCH
;Feeds
FORMAT = [F|#|F|1.1]
FORMAT = [FP|#|F|1.1]
;Moves
FORMAT = [X|#|X|1.4]
FORMAT = [Y|#|Y|1.4]
FORMAT = [Z|#|Z|1.4]
FORMAT = [I|#|I|1.4]
FORMAT = [J|#|J|1.4]
FORMAT = [R|#|A|1.4]
FORMAT = [SZ|@|Z|1.4]
;Tools
FORMAT = [T|@||1.0]
FORMAT = [S|@|S|1.0]
;
START = "%"
START = "(FILENAME: [FILENAME])"
START = "([CUTVIEWERSTOCK])"
START = "G20 G17 G40 G80 G90"
;
TOOLCHANGE = "M09 (coolant off)"
TOOLCHANGE = "M05 (spindle off)"
TOOLCHANGE = "M998"
TOOLCHANGE = "M06 T[T] G43 H[T] ([CUTVIEWERTOOL])"
TOOLCHANGE = "G0[SZ]"
TOOLCHANGE = "M08 (flood coolant on)"
TOOLCHANGE = "M03 S4500 (spindle CW) (dummy speed-edit as necessary)"
;
COMMENT_START = "("
COMMENT_END = ", Tool [T])"
;
RAPID_RATE_MOVE= "G0[X][Y][Z]"
FIRST_FEED_RATE_MOVE   = "G1[X][Y][Z][F]"
FEED_RATE_MOVE = "G1[X][Y][Z]"
;
FIRST_CW_ARC_MOVE  = "G2[X][Y][I][J][F]"
CW_ARC_MOVE= "G2[X][Y][I][J]"
;
FIRST_CCW_ARC_MOVE = "G3[X][Y][I][J][F]"
CCW_ARC_MOVE   = "G3[X][Y][I][J]"
;
;
;rapid down to safe Z, plunge to final Z
PLUNGE_RATE_MOVE   = "G0[SZ]"
PLUNGE_RATE_MOVE   = "G1[Z] [FP]"
;
END = "M09 (coolant off)"
END = "M05 (spindle off)"
END = "M998"
END = "M30 (END OF PROGRAM)"
END = "%"


but Mach3 has a long standing bug that causes weird assumptions to take place if you put the G43 on the same line.

Interesting. What version of Mach are you running? I'm running 3.043.066, but always have put M06 and G43 on the same line since 2006 when I started using Mach (was 2.something when I started using it) and have never had a problem.

Randy
All opinions in this post are mine alone. I am not a MeshCAM employee, I do not have a financial interest in MeshCAM, nor do I speak for MeshCAM. MeshCAM user since Beta 5 in 2003. viewtopic.php?f=11&t=15333 :ugeek:
Randy
 
Posts: 1812
Joined: Wed May 14, 2008 9:50 am
Location: North Texas, USA

Re: Post processor files on a Mac?

Postby RNC » Tue Nov 03, 2015 8:00 am

No worries, Randy, I didn't mess with it much in the last couple of days so I wasn't waiting on pins and needles for a reply. If anyone else asks, Mac OSX program files, configs, settings, etc are generally stored with the program itself or in the user's home folder. In the case of the former (the Mac way), you simply go to the applications folder, right click on the application you want to see support files for, and click "show package contents" and everything that goes with that program is right there. In the case of the latter (the Unix way), in the user's home folder there will be hidden files that start with a period containing config info relative to the application in question. MeshCAM apparently uses the "Mac way", I don't see any home folder hidden files related to MeshCAM.


There are two long-standing Mach bugs in relation to TLOs.

One of the ways you can set repeatable height tools in the screenset I'm using, and the one I happen to be using, is by defining your measuring tool (in my case a probe) as the master tool, and you can set offsets for all other tools relative to that. The other tools get a positive value if they're longer than the probe, and a negative value if they're shorter than the probe. Therefore if everything is in repeatable height holders, and the master tool never changes, there's never any need for measuring or touching off, you just store tool offsets based on each tool's relative length to the master tool and as long as you issue G43s with every tool change you're good to go.

The problem is, Mach will randomly turn tool length offsets off globally when you load that tool that has a zero offset.

The bugs with how Mach reads tool change G codes on the same line are detailed here...

http://www.calypsoventures.com/forums/v ... ?f=6&t=176

I have an Ethernet Smoothstepper so run v3.43.66, the recommended version for that controller.
RNC
 
Posts: 13
Joined: Wed Oct 14, 2015 11:40 pm

Re: Post processor files on a Mac?

Postby Randy » Tue Nov 03, 2015 9:02 am

Ah, got it, RNC. I use Tormach Tooling System, and have my offsets as lengths from the TTS flange (I measure offline with a tooling plate and height gage), so they are all positive and at least 2". I don't have a probe, but I do have a dowel pin mounted up as my "master" tool with which I touch off. So I've never encountered a zero or negative offset so I guess I've successfully avoided the bug, of which I was totally unaware...

Randy
All opinions in this post are mine alone. I am not a MeshCAM employee, I do not have a financial interest in MeshCAM, nor do I speak for MeshCAM. MeshCAM user since Beta 5 in 2003. viewtopic.php?f=11&t=15333 :ugeek:
Randy
 
Posts: 1812
Joined: Wed May 14, 2008 9:50 am
Location: North Texas, USA


Return to Post Processors