Help modifying a post

1st post here, so I hope this is the right place.
I’d like to use Esprit CAD/CAM for my S3 XXL. I found a generic post but it needs to be modified. If I change out a few lines CM will run it, obviously I’d like it to post without the manual editing. Does anyone have experience with this?

Thanks

Is the EspritCAM post-processor syntax documented and is that documentation shareable?
If so we can probably collectively figure out how to modify it. @neilferreri is the post-proc guru around here.

1 Like

There is some discussion of modifying post processors at:

https://wiki.shapeoko.com/index.php/G-Code#Post_Processors

I’m sorry I don’t know what syntax documented means.
It an .ASC file that can be edited.

here is a sample of what i get
%
O0001
(YCM XV.ASC 11/10/06)

( ******* PART SETUP INFO ******* )

( ******* TOOL SETUP DATA ******* )

( ******** PART PROGRAM ********* )

N0018 G00 G17 G28 G40 G80 G91 Z0
T18 M06
G00 G90 X-5.175 Y60.0 S18000 M03
G43 H18 Z50.0 M08
Z2.0
G01 Z0 F5000
X60.0 F19050

and one of what i want

%

(YCM XV.ASC 11/10/06)

( ******* PART SETUP INFO ******* )

( ******* TOOL SETUP DATA ******* )

( ******** PART PROGRAM ********* )

N0018 G53G0Z-5.000
T18 M06
G00 G90 X-5.175 Y60.0 S18000 M03
G43 H18 Z50.0 M08
Z2.0
G01 Z0 F5000
X60.0 F1905.0

is the ASC file you are using shareable ? (sorry I’m not familiar with EspritCAM, I have no clue whether this post processor you mention is proprietary, or public)

By “documented syntax” I meant, is there a user manual somewhere that describes the formatting of those ASC files ? It’s usually straightforward enough to be able to do simple changes anyway.

Yes it’s shareable. I also use it at work for a wire EDM and was able to make a small change years ago. That post was quite different from a milling post so I was able to make the changes. Now anytime I make any changes it gives an error. I’m sure there is a manual somewhere, but I wouldn’t know where to find it. Here is the text in the post

************************** SYSTEM VARIABLES ****************************

POSTNAME : YCM XV MXP200I 01/12/06

XSTART : 0
YSTART : 0
ZSTART : 0
UPPERCASECOMMENTS : 1
TOOLCHANGE_HIGHZ : 999.9999
MACHINETOLERANCE : 0.0001

**************************** MACHINE MODES *******************************

COORDINATEMODE : ABSOLUTE
MEASUREMENTMODE : INCH
CIRCLEMODE : FULLCIRCLE
CENTERMODE : INCREMENTFROMSTART
RAPIDMODE : PLUNGE
WORKPLANEMODE : XYPLANE
RETURNPLANEMODE : RRETURN
MILLRETRACTMODE : MILLPLUNGE
LENGTHCOMPOUTMODE : TOOLCHANGEONLY

************************* FORMATABLE CODES *******************************

PROGRAMNUMBER : O Y 4 N N 0 Y 4 N N 0 0 1 N 0 0
SEQUENCENUMBER : N Y 4 N N 0 Y 4 N N 0 0 1 N 0 0
XABSOLUTE : X 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
YABSOLUTE : Y 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
ZABSOLUTE : Z 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
CIRCLERADIUS : R 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
XCENTERABSOLUTE : I 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
YCENTERABSOLUTE : J 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
ZCENTERABSOLUTE : K 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
FEEDRATE : F 1 3 Y 1 2 1 4 N 1 0 0 1 N 0 0
RPLANE : R_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
DWELLTIME : P 1 5 Y 1 3 1 5 Y 1 3 0 1 N 0 0
PECK : Q 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
INITPECKINCREMENT : I_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
POCKETRADIUS : I__ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
POCKETDEPTH : Z__ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
MISCFORMAT1 : L 1 2 N N 0 1 5 Y 1 3 1 1 N 0 0
STEP : Q_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
MISCFORMAT2 : J_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0

RETRACTAMOUNT : K_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
SPINDLESPEED : S N 4 N N 0 N 4 N N 0 0 1 N 0 0
TOOLNUMBER : T Y 2 N N 0 Y 2 N N 0 0 1 N 0 0
DIAMETERCOMPENSATION : D Y 2 N N 0 Y 2 N N 0 0 1 N 0 0
LENGTHCOMPENSATION : H Y 2 N N 0 Y 2 N N 0 0 1 N 0 0
MISCFORMAT3 : G Y 2 N N 0 Y 2 N N 0 0 - - - -
MISCFORMAT4 : X_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
MISCFORMAT5 : Y_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0
MISCFORMAT6 : Z_ 1 4 Y 1 4 1 5 Y 1 3 1 1 N 0 0

************************* SYMBOLIC CODES ***************************

MOTIONRAPID : G00
MOTIONLINEAR : G01
MOTIONCW : G02
MOTIONCCW : G03
DWELL : G04
SPIRALCW : G12
SPIRALCCW : G13
XYPLANE : G17
ZXPLANE : G18
YZPLANE : G19
INCH : G20
METRIC : G21
ZERORETURN : G28
COMPENSATIONOFF : G40
COMPENSATIONLEFT : G41
COMPENSATIONRIGHT : G42
COMPENSATIONPLUS : G43
COMPENSATIONMINUS : G44
LENGTHCANCEL : G49
WORKSYSTEM1 : G54
WORKSYSTEM2 : G55
WORKSYSTEM3 : G56
WORKSYSTEM4 : G57
WORKSYSTEM5 : G58
WORKSYSTEM6 : G59
INZONEPOSITIONING : G64
CANCEL : G80
DRILL1 : G81
DRILL2 : G82
PECK1 : G83
PECK2 : G73
TAP1 : G84
TAP2 : G74
BORE1 : G85
BORE2 : G86
BORE3 : G76
BORE4 : G89
ABSOLUTE : G90
INCREMENTAL : G91
SETORIGIN : G92
IRETURN : G98
RRETURN : G99
PERCENTSIGN : %

PROGRAMSTOP : M00
OPTIONALSTOP : M01
REWINDSTOP : M02
SPINDLECW : M03
SPINDLECCW : M04
SPINDLEOFF : M05
TOOLCHANGE : M06
COOLANTON : M08
COOLANTOFF : M09
ENDPROGRAM : M30
MISCSYMBOLICCODE1 : Y0_Z0

**************************** EXAMPLES ********************************

VARIABLE : StartPointFlag Test Tap

EX_STARTPOINT : IF (StartPointFlag)
: G00 G90 WORKSYSTEMCODE* X Y IF(Tap<>(4))S SPINDLEDIRECTION ENDIf
: G43* H* Z_(initialclearance) M08 IF(nexttool>0) T(nexttool) ELSE T(firsttool) ENDIF
: IF (nextdim(3)<>initialclearance) Z ELSE NCOUTPUTOFF Z NCOUTPUTON ENDIF
: StartPointFlag=(0)
: ENDIF

EX_RAPID : IF (StartPointFlag) EXITEXAMPLE ENDIF
: G00 X Y Z

EX_LINEAR : Test=(nextclfile(631))
: G01 X Y Z F

EX_CIRCLE : IF (xpresent = xlast && ypresent = ylast)
: G17 CIRCLEDIRECTION X Y Z I* J* F
: ELSE
: G17 CIRCLEDIRECTION X Y Z R* F
: ENDIF

EX_CIRCLEZX : IF (xpresent = xlast && ypresent = ylast)
: G18 CIRCLEDIRECTION X* Z* I* K*
: ELSE
: G18 CIRCLEDIRECTION X* Z* R*
: ENDIF

EX_CIRCLEYZ : IF (xpresent = xlast && ypresent = ylast)
: G19 CIRCLEDIRECTION Y* Z* J* K*
: ELSE
: G19 CIRCLEDIRECTION Y* Z* R*
: ENDIF

EX_COMPENSATION : G01* COMPENSATIONSIDE X Y Z D F M08

EX_COMPENSATIONOFF : G01* G40 X Y Z F

EX_CYCLESTART : COMMENT(1)

EX_TOOLCANCEL : “Z5.0” M09*
: “G91” G28* “Z0” M05*
: M01*

EX_PARK : IF (PARKRETURNCODE = PARKRETURNYZ)
: “G00 G53 Y0 Z0”
: PARKRETURNCODE*
: BLANKLINE
: COMMENT
: BLANKLINE
: G43* H* Z_(initialclearance) M08
: ENDIF

VARIABLE : opnum

EX_STARTCODE : opnum=(0)
: %
: O* PROGRAMNAME
: “(YCM XV.ASC 11/10/06)”
: BLANKLINE
: “( ******* PART SETUP INFO ******* )”
: BLANKLINE
: SETORIGINCOMMENT
: BLANKLINE
: “( ******* TOOL SETUP DATA ******* )”
: BLANKLINE

EX_TOOLDEFINITION : TOOLCHANGECOMMENT

EX_MAINSTART : BLANKLINE
: “( ******** PART PROGRAM ********* )”

EX_FIRSTTOOLCHANGE : BLANKLINE
: N(presenttool) G00* G17* G28* G40* G80* “G91 Z0”
: T* M06* TOOLCHANGECOMMENT(1)
: StartPointFlag=(1)
: Tap=(nextclfile(110))

EX_OTHERTOOLCHANGE : BLANKLINE
: N(presenttool) G00* G17* G28* G40* G80* “G91 Z0”
: T* M06* TOOLCHANGECOMMENT(1)
: StartPointFlag=(1)
: Tap=(nextclfile(110))

EX_LASTTOOLCHANGE : BLANKLINE
: N(presenttool) G00* G17* G28* G40* G80* “G91 Z0”
: T* M06* TOOLCHANGECOMMENT(1)
: StartPointFlag=(1)
: Tap=(nextclfile(110))

EX_ENDCODE : G28* “Y0”
: T*(firsttool) M06*
: G90* M30*
: %

EX_DRILLSTART : COMMENT
: RETURNPLANECODE* DRILLCYCLECODE* X Y Z* R_* F* M08
EX_DRILLBODY : RETURNPLANECODE DRILLCYCLECODE X Y Z R_ M08
EX_DRILLCANCEL : G80*

EX_DRILL2START : COMMENT
: RETURNPLANECODE* DRILLCYCLECODE* X Y Z* R_* F* P* M08
EX_DRILL2BODY : RETURNPLANECODE DRILLCYCLECODE X Y Z R_ F P M08
EX_DRILL2CANCEL : G80*

EX_PECKSTART : COMMENT
: RETURNPLANECODE* PECKCYCLECODE* X Y Z* R_* Q* F* M08
EX_PECKBODY : RETURNPLANECODE PECKCYCLECODE X Y Z R_ Q F M08
EX_PECKCANCEL : G80*

EX_TAPSTART : COMMENT
: “M29” S*
: RETURNPLANECODE* TAPCYCLECODE* X Y Z* R_* F* M08
EX_TAPBODY : RETURNPLANECODE TAPCYCLECODE X Y Z R_ F M08
EX_TAPCANCEL : G80*

EX_BORESTART : COMMENT
: RETURNPLANECODE* BORECYCLECODE* X* Y* Z* R_* P* F* M08
EX_BOREBODY : RETURNPLANECODE BORECYCLECODE X Y Z R_ P F M08
EX_BORECANCEL : G80*

**************************** END EXAMPLES *********************************
I know I have to make the changes in the first tool change area, but every time I change anything I get an error.

1 Like

So based on the example you included, I undertand you would like:
a) to remove the “O0001” from the second line
b) to replace G00 G17 G28 G40 G80 G91 Z0 by G53G0Z-5.000
c) to output feedrate with a decimal point

Disclaimer: this is my first time looking at an ASC file, I did find a user manual but of dubious origin, so I won’t upload it here.

a) should be as simple as deleting the : O* PROGRAMNAME in:

b) should be doable by modifying the line

in EX_FIRSTTOOLCHANGE, EX_OTHERTOOLCHANGE, and EX_LASTTOOLCHANGE, to

: N(presenttool) “G53G0Z-5.000”

c) Feedrate formatting is conditioned by this line

and that’s where I struggle, the documentation I found shows this format for formatable codes:

image

which does not quite match that ASC file. And it’s getting very late here so I’m not game for puzzles until tomorrow morning :slight_smile:

I’m afraid it will be a matter of trial and error about the formatting of those changes, unless you have the documentation of the post-processor somewhere on your machine as part of your EspritCAM install.

Heading up to my bed now, hopefully someone else’s interest will be piqued and will help you determine the right modification.

1 Like

Wow that’s awesome. Thanks so much. Yes that’s pretty much the changes I’m looking for. I’ll try those changes and let you know.
I really appreciate your help. Thanks again.

So I made all the changes except for the feed rate one and it works perfectly!!
Thanks again, you’re awesome

1 Like

Great. For the feedrate, based on the other formatting rules I have a hunch that this could work

F 1 3 Y 1 2 1 5 Y 1 3 1 1 N 0 0

As far as I can tell, the first 5 letters after the F relate to the format when using imperial units, the following 5 are for the format when using metric, then there is a 0/1 I don’t get, and finally the 1N00 is the formatting of the default value.

I see you used the post in metric units, if you could generate the G-code in inches for the sake of comparing the outputs, it would help verifying this.


This is what I have in my edit post. Is this the line you mean?

yes that’s the one. The 5/5/1/4 format is clearer on that snapshot.

1 Like

Ok I just made the change and it worked!!
But now the line just above my feed rate also changed. From 5000 to 500.0
Is it possible to keep the 5000? I’m assuming you change one you change them all

It’s the rapid of the machine. I’d like to keep it at 5000 if I can

The rapid feedrate and cutting feedrate are probably set independently in your CAM project settings ?
I would be surprised if one was 5000 and the other was 1905 initially ?
The line we changed only affects how the value of any feedrate is formatted in the output G-code, so yes it will impact all feedrate values (but I think that rapid feedrate can be set in the CAM somewhere?)

1 Like

Ok I will have a look. Thanks again so much. I really appreciate you taking the time to help me. I didn’t think I’d ever get this to work.

1 Like


You were right again.
I changed to rapid down as seen in the snapshot and it posted correctly.
I think that’s it. Everything should be ok now. I’ll make a new program with a little more than just a facing cycle and try that.
You Rock!!

1 Like