Change travel order after M6 in MACH ATC post processor

This forum is for requests and queries about machine tool support for Vectric Products
Post Reply
hellenic
Posts: 2
Joined: Sun Mar 04, 2012 4:48 pm
Model of CNC Machine: Custom made

Change travel order after M6 in MACH ATC post processor

Post by hellenic »

Hello,

I have setup an ATC on my machine and I use MACH4, Mach 2/3 ATC post processor in VCarve pro 11.5. When a tool change command M6 is executed at the end of the tool change, the Z-height of the spindle is at its maximum height. My tools are located at the long end of the table. As the gantry travels to the opposite side, where my workpiece is, to continue executing the G-code program, the z-height progressively approaches the safe z-height as it reaches the next x,y location in the code, while it is traveling there. I would rather that it go to the x,y location and then drop to the right z-height. Here is the g-code:

N1270T1M6
N1280 (Tool: #46170-K SC COMPRESSION 2 FL 1/4" DIAx7/8x1/4" Shank Spektra)
N1290G43H1
N1300S18000M03
(position pegs)
()
N1330G00X3.6440Y2.6088Z0.2000

I would rather have the above line of code be generated in the post processor as this:
N1330G00X3.6440Y2.6088
N1331G00Z0.2000


So that the spindle only descends once it has reached its destination, after a tool change.

HERE IS THE CODE IN THE POST PROCESSOR:

POST_NAME = "Mach2/3 ATC (inch) (*.txt)"

FILE_EXTENSION = "txt"

UNITS = "inches"

DIRECT_OUTPUT = "Mach|Mach4.Document"

+------------------------------------------------
+ Line terminating characters
+------------------------------------------------

LINE_ENDING = "[13][10]"

+------------------------------------------------
+ Block numbering
+------------------------------------------------

LINE_NUMBER_START = 0
LINE_NUMBER_INCREMENT = 10
LINE_NUMBER_MAXIMUM = 999999

+================================================
+
+ Formating for variables
+
+================================================

VAR LINE_NUMBER = [N|A|N|1.0]
VAR SPINDLE_SPEED = [S|A|S|1.0]
VAR FEED_RATE = [F|C|F|1.1]
VAR X_POSITION = [X|C|X|1.4]
VAR Y_POSITION = [Y|C|Y|1.4]
VAR Z_POSITION = [Z|C|Z|1.4]
VAR X_HOME_POSITION = [XH|A|X|1.4]
VAR Y_HOME_POSITION = [YH|A|Y|1.4]
VAR Z_HOME_POSITION = [ZH|A|Z|1.4]
VAR SAFE_Z_HEIGHT = [SAFEZ|A|Z|1.0|1.4]
+================================================
+
+ Block definitions for toolpath output
+
+================================================

+---------------------------------------------------
+ Commands output at the start of the file
+---------------------------------------------------

begin HEADER

"( [TOOLPATH_NAME] )"
"( Mach2/3 Postprocessor )"
"[N]G00G20G17G90G40G49G80"
"[N]G70G91.1"
"[N]T[T]M06"
"[N]G00G43[ZH]H[T]"
"[N][S]M03"
"[N]G94"
"[N][XH][YH][F]"


+---------------------------------------------------
+ Commands output for rapid moves
+---------------------------------------------------

begin RAPID_MOVE

"[N]G00[X][Y][Z]"


+---------------------------------------------------
+ Commands output for the first feed rate move
+---------------------------------------------------

begin FIRST_FEED_MOVE

"[N]G1[X][Y][Z][F]"


+---------------------------------------------------
+ Commands output for feed rate moves
+---------------------------------------------------

begin FEED_MOVE

"[N]G1[X][Y][Z]"

+---------------------------------------------------
+ Commands output at toolchange
+---------------------------------------------------

begin TOOLCHANGE

"T[T]M6"
"G43H[T]"
"[S]M03"

+---------------------------------------------------
+ Commands output for a new segment - toolpath
+ with same toolnumber but maybe different feedrates
+---------------------------------------------------

begin NEW_SEGMENT

"[N]G0[SAFEZ]"
"[N][S]M03"

+---------------------------------------------------
+ Commands output at the end of the file
+---------------------------------------------------

begin FOOTER

"[N]G00[ZH]"
"[N]G00[XH][YH]"
"[N]M09"
"[N]M30"
%

Would it be correct to assume that this part:

+---------------------------------------------------
+ Commands output for rapid moves
+---------------------------------------------------

begin RAPID_MOVE

"[N]G00[X][Y][Z]"

... needs to be changed to this:

+---------------------------------------------------
+ Commands output for rapid moves
+---------------------------------------------------

begin RAPID_MOVE

"[N]G00[X][Y]"
"[N]G00[Z]"

Please let me know if I am going about this the right way. If not thank you in advance for proper guidance.

Post Reply