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:

Coolant / Air ON OFF help


Recommended Posts

Trying to get my machine def to post g83 air on g84 air off, I can change the post and get air on but still get m9 for off and I need g84, using a custom haas post, I have changed the setting in post for the code I want but its not working.

 

PLEASE HELP

 

spending to much time editing programs for air

Link to comment
Share on other sites


# Coolant output code selection for X style coolant
# Note: To enable X style coolant, click on the General Machine Parameters icon
#   in the Machine Definition Manager, Coolant tab, disable first check box
#   Output of X style coolant commands in this post is controlled by pcan, pcan1, & pcan2
scool50    : "M8"                 #Coolant 1 on value
scool51    : "M9"                 #Coolant 1 off value
scool52    : "M7"                 #Coolant 2 on value
scool53    : "M9"                 #Coolant 2 off value
scool54    : "M88"                #Coolant 3 on value
scool55    : "M89"                #Coolant 3 off value



Are you using X style? could you just use one of the above and change the Mcode right there in what I posted?

  • Like 1
Link to comment
Share on other sites

If you're using the old coolant commands this could solve your problem.

 

Define label "used_coolant". use this to save your coolant$ value in ptlch$. Then set up a condition in pretract.

 

 

 


used_coolant : 0
# Coolant M code selection for V9 style coolant
sm09 : "M09"	 #Coolant Off
sm08 : "M08"	 #Coolant Flood
sm08_1 : "G83"	 #Coolant Mist
sm08_2 : "M08"	 #Coolant Tool
scoolant : ""	 #Target for string

ptlch$

....
n$, *sgcode, pfzout, strr0, smaxrate, scoolant, e$
used_coolant = coolant$ #Make sure to put this line after scoolant.

....

pretract
....
if used_coolant = 2, n$, "G84", !scoolant, e$, else, n$, scoolant, e$ #Add this in front of scoolant.
...

Link to comment
Share on other sites
  • 7 months later...

I'm trying to use Alex's method above with the old style coolant. The M83 turns on the air properly but I still get M9 instead of M84 to turn it off. Does anyone see why this wouldn't work? Here are some snippets from my post. I'm using the Haas post from the install CD.

 

 

used_coolant : 0
sm09 : "M9"	 #Coolant Off
sm08 : "M8"	 #Coolant Flood
sm08_1 : "M83"	 #Coolant Air
sm08_2 : "M8"	 #Coolant Tool
scoolant : ""	 #Target string

 

 

ptlchg$		 #Tool change									
 pcuttype
 toolchng = one
 if mi1$ = one, #Local Work coordinate system
 [
 pfbld, n$, *sg28ref, "X0.", "Y0.", e$
 pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
 ]
 if mi1$ = three | mi1$ = four, #Work coordinate shift
 [
 pfbld, n$, *sg28ref, "Z0.", e$
 pbld, n$, sg52, *xh$, *yh$, *zh$, e$
 if xh$ | yh$ | zh$, shft_flg = one
 else, shft_flg = zero	
 ]
 if prog_stop = 1, pbld, n$, *sm01, e$
 if prog_stop = 2, pbld, n$, *sm00, e$
 pcom_moveb
 pcheckaxis
 c_mmlt$ #Multiple tool subprogram call
 ptoolcomment
 comment$
 pcan
 pbld, n$, *t$, sm06, e$
 pindex
 sav_absinc = absinc$
 if mi1$ > one, absinc$ = zero
 pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout,
 *speed, *spindle, pgear, strcantext, e$
 pbld, n$, sg43, *tlngno$, pfzout, pstagetool, scoolant, e$
 used_coolant = coolant$										 #line added to be able to turn off air coolant with G84 tws 6-5-13
 absinc$ = sav_absinc
 pbld, n$, sgabsinc, e$
 pcom_movea
 toolchng = zero
 c_msng$ #Single tool subprogram call
 !xnci$, !ynci$, !znci$

 

pretract	 #End of tool path, toolchange
 sav_absinc = absinc$
 absinc$ = one
 sav_coolant = coolant$
 coolant$ = zero
#	 if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless
 [				 # explicitely turned off through a canned text edit
 if all_cool_off,
	 [
	 #all coolant off with a single off code here
	 if coolant_on, pbld, n$, sall_cool_off, e$
	 coolant_on = zero
	 ]
 else,
	 [
	 local_int = zero
	 coolantx = zero
	 while local_int < 20 & coolant_on > 0,
	 [
	 coolantx = and(2^local_int, coolant_on)
	 local_int = local_int + one
	 if coolantx > zero,
		 [
		 coolantx = local_int
		 pbld, n$, scoolantx, e$
		 ]
	 coolantx = zero
	 ]
	 coolant_on = zero
	 ]
 ]
 #cc_pos is reset in the toolchange here
 cc_pos$ = zero
 gcode$ = zero
 pbld, n$, sccomp, *sm05, psub_end_mny, e$
 if used_coolant = 2, n$, "M84", !scoolant, e$, else, n$, scoolant, e$			 #line added to be able to turn off air coolant with G84 tws 6-5-13
 n$, sgabsinc, sgcode, *sg28ref, "Z0.", e$
 if nextop$ = 1003 | tlchg_home, pbld, n$, "X0.", "Y0.", e$
 if (subactv = zero & use_g52_shft & wrkofs_num = zero) | shft_flg = one,
 [
 n$, *sg52, "X0. Y0. Z0.", e$ #Cancel Work Shift
 shft_flg = zero
 ]
 absinc$ = sav_absinc
 coolant$ = sav_coolant

 

Posted code...

 

%
O0( T )
( PROGRAMMED ON 05-06-13 AT 07:16 )
( T1 | .750 SPOT DRILL | H1 )
G20
G0 G17 G40 G49 G80 G90
( SPOT DIA, PRG )
T1 M6
G0 G90 G54 X-1.8269 Y.6042 S750 M3
G43 H1 Z2. M83   <-------RIGHT
G98 G81 Z-.1 R.1 F3.
X-.3539 Y.5041
X.0286 Y-.261
X-1.6231 Y-.4934
G80
M5
M9		 <-------WRONG
G91 G28 Z0.
X0. Y0.
M30
%

Link to comment
Share on other sites

This is interesting. If I add more tools to the program, different things happen. Notice the different behaviors below.

 

%
O0( T )
( PROGRAMMED ON 06-06-13 AT 07:09 )
G20
G0 G17 G40 G49 G80 G90
( SPOT DIA, PRG )
T1 M6
G0 G90 G54 X0. Y0. S750 M3
G43 H1 Z2. M83 <--------RIGHT
G98 G82 Z-.1 R.1 P.5 F3.
X1. Y0.
X1. Y-1.
X0. Y-1.
G80
M5
M9    <-------WRONG
G91 G28 Z0.
M01
( FW WEAR COMP, .250 FIN EM, PRG )
T14 M6
G0 G90 G54 X1.8423 Y1.325 S3100 M3
G43 H14 Z2. M83   <------RIGHT
Z.1
G1 Z0. F12.
G41 D14 X1.6423
G1 G40 X1.9423
G0 Z2.
M5
M84	  <------RIGHT
G91 G28 Z0.
M01
( FW WEAR COMP, .250 FIN EM, PRG )
T13 M6
G0 G90 G54 X1.8423 Y1.4062 S2450 M3
G43 H13 Z2.	  <------WRONG, MISSING THE M83
Z.1
G1 Z0. F22.
G41 D13 X1.5923
G3 X2.1923 Y1.4062 I0. J.25
G1 G40 X1.9423
G0 Z2.
M5
M84	 <-------RIGHT
G91 G28 Z0.
X0. Y0.
M30
%

Link to comment
Share on other sites

I belive that the answer may be in the machine definition. The general machine parameters allow you to create new coolent commands. If you uncheck the "support coolent using coolent value in post processor" you can then make a new coolent command for the air. I have done this for the bed wash option on HAAS mills before.

Link to comment
Share on other sites

With the "old style" coolant, in the post the off command is ONLY defined as M9.

 

You need to set a check when turning it on, so that it understand which coolant on command was used, then you can set which command to use to turn off the one you actually turned on.

Link to comment
Share on other sites

I belive that the answer may be in the machine definition. The general machine parameters allow you to create new coolent commands. If you uncheck the "support coolent using coolent value in post processor" you can then make a new coolent command for the air. I have done this for the bed wash option on HAAS mills before.

 

I tried that initially (using X style coolant) but didn't like where the coolant was turned on or off. Changing the location of the on/off codes didn't seem as straight forward as the old style coolant with my limited post editing abilities so I opted for the method that I'm now trying to get working. Alex's method seemed like an easy option. I also have an extensive ops library that would need every op changed because the coolant dialog box is different with the X style coolant. That was a major factor in the decision as well.

Link to comment
Share on other sites
  • 1 month later...

After no success with Alex's method, I'm switching over to X style coolant. As shown below, I've made K2csq7's recommended change, along with unchecking the first box in the machine def. However, my post is still outputting a M9 to turn the air off, rather than a M84.

 

Thoughts?

 

# --------------------------------------------------------------------------
# Coolant output code selection for X style coolant
# Note: To enable X style coolant, click on the General Machine Parameters icon
#   in the Machine Definition Manager, Coolant tab, disable first check box
#   Output of X style coolant commands in this post is controlled by pcan, pcan1, & pcan2
scool50 : "M8"				 #Coolant 1 on value
scool51 : "M9"				 #Coolant 1 off value
scool52 : "M83"				 #Coolant 2 on value
scool53 : "M84"				 #Coolant 2 off value
scool54 : "M88"			    #Coolant 3 on value
scool55 : "M89"			    #Coolant 3 off value

 

%

O0( XCOOLANT TEST )

G20

G0 G17 G40 G49 G80 G90

T14 M6

G0 G90 G54 X3.2039 Y.325 S3100 M3

G43 H14 Z2.

M83 <---------GOOD

Z.1

G1 Z0. F12.

G41 D14 X3.0039

G3 X3.2039 Y.125 I.2 J0.

G1 X6.4078

G1 X3.2039

X3.3039

G3 X3.5039 Y.325 I0. J.2

G1 G40 X3.3039

G0 Z2.

M09 <--------NO GOOD

M5

G91 G28 Z0.

X0. Y0.

M30

%

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