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 at wrong place


Recommended Posts

Hello everyone,
   My company just bought a "BRAND NEW" DMG MORI with a MITSUBISHI G-CODE control.  One of the dumpest question from me (i've tried for a month but I failed to modified the COOLANT M-CODE POSITION) that I think I have to ask regardless of my embarrassment.  Is there away to make the post turn off COOLANT at the same line of CLEARANCE PLANE?  Below here is the G-CODE and my defined for my post.  Thank you you guys.

 

PS: I hate DMG MORI because it demands certain G-CODES and M-CODES in order to run even COOLANT, AIR THRU... etc...

 

======================

N1( 2.0000,2.000 SHELL MILL, CB, .005RAD, USED TOOL,)
(3FLTS .500LOC, 2.00LOH)
(SEMT13TAGSN-JM VP15TF INSERT TYPE)
G0 G17 G40 G49 G80 G90
G91 G28 Z0 M19
G28 Y0
T1 M6(SKIM CUT TOP OF SURFACE, CUT#2)
G90 G54 X.8747 Y-14.5
S6000 M3(XY STK= -.125)
(.7 STEPOVER, .005 FINISH)
(.0087 - .0175 PER RAMP)
G43 H1 Z1. T9 M8(DOC= Z0.) ====================> GOOD, M8 HERE IS GOOD FOR THE MACHINE TO RUN (IT DEMANDS SO)
Z.5
G1 X.8751 Y-11.625 Z0. F10.
Y-.875 F100.
(CUTTING...)
Y-.875
G0 Z1.  ============> I WANT M9 HERE
G91 G28 Z0. M9 =====> NOT HERE
/G28 Y0. M5
M1

 

==============POST====================

#Region COOLANT SECTION
# --------------------------------------------------------------------------
# Coolant M code selection
sm09    : "M9"      #Coolant Off (Use sm09_0 through sm09_2)
sm08    : "M8"      #Coolant Flood 
sm08_1  : "M08"     #Coolant Mist
sm08_2  : "M7"      #Air Blast
sm09_0  : "M9"      #Coolant Flood Off
sm09_1  : "M09"     #Coolant Flood Off
sm09_2  : "M9"      #Coolant / Air Blast Off
scoolant : ""        #Target for string

fstrsel sm09 coolant$ scoolant 7 -1
# --------------------------------------------------------------------------
# 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
#   This string select is setup using the "Coolant Commands" tab in the "General Machine Parameters"
scool50 : "Coolant 1 on value"    #Coolant 1 on value
scool51 : "Coolant 1 off value"    #Coolant 1 off value
scool52 : "Coolant 2 on value"    #Coolant 2 on value
scool53 : "Coolant 2 off value"    #Coolant 2 off value
scool54 : "Coolant 3 on value"    #Coolant 3 on value
scool55 : "Coolant 3 off value"    #Coolant 3 off value
scool56 : "Coolant 4 on value"    #Coolant 4 on value
scool57 : "Coolant 4 off value"    #Coolant 4 off value
scool58 : "Coolant 5 off value"    #Coolant 5 on value
scool59 : "Coolant 5 on value"    #Coolant 5 off value
scool60 : "Coolant 6 off value"    #Coolant 6 on value
scool61 : "Coolant 6 on value"    #Coolant 6 off value
scool62 : "Coolant 7 on value"    #Coolant 7 on value
scool63 : "Coolant 7 off value"    #Coolant 7 off value
scool64 : "Coolant 8 on value"    #Coolant 8 on value
scool65 : "Coolant 9 off value"    #Coolant 8 off value
scool66 : "Coolant 10 on value"    #Coolant 9 on value
scool67 : "Coolant 11 off value"    #Coolant 9 off value
scool68 : "Coolant 12 on value"    #Coolant 10 on value
scool69 : "Coolant 12 off value"    #Coolant 10 off value
scoolantx : ""                    #Target for string

fstrsel scool50 coolantx scoolantx 20 -1
# --------------------------------------------------------------------------
#X coolant has the option - First coolant off command shuts off ALL coolant options
sall_cool_off  : "M1" #Coolant off command output with all_cool_off
# --------------------------------------------------------------------------
#EndRegion

 

 

pncoutput       #Movement output
      pcom_moveb
      comment$
      if coolant$ <> 0 & coolant$ <> sav_coolant,
        [
        pbld, n$, sm09, e$
        sav_coolant = coolant$
        ]
      if coolant$ = 1, sm09 = sm09_0
      if coolant$ = 2, sm09 = sm09_1
      if coolant$ = 3, sm09 = sm09_2
      if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero
      pcan =================> I think this is the one

COOLANT.png

Link to comment
Share on other sites

You are in the wrong place that is going to be in here. See the scoolant that is what control your M09 output. Problem is where you want is in a really a bad place to want it. That will be in the prapid part of the post. I would try before verses after and see if that gives me the out put I am looking for verses trying to make a post mode since the scoolant exist in prapid section already.

pretract        #End of tool path, toolchange
      phsm_off
      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,
            [
            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
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      else, gcode$ = zero
      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$
#      if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
#      pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
#      if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
      if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
        [
        if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
        rotretflg = 1
        pbld, n$, `sg28, protretinc, e$
        rotretflg = 0
        if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]
      absinc$ = sav_absinc
      coolant$ = sav_coolant
      uninhibit_probe$

pretract0        #End of tool path, null toolchange
      phsm_off
      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,
#            [
#            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
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      else, gcode$ = zero
#      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      pbld, n$, sccomp, psub_end_mny, e$
      pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$
#      if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
#      pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
#      if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
      if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
        [
        if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
        rotretflg = 1
        pbld, n$, `sg28, protretinc, e$
        rotretflg = 0
        if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]
      absinc$ = sav_absinc
      coolant$ = sav_coolant

 

Link to comment
Share on other sites
On 12/07/2017 at 11:21 AM, C^Millman said:

You are in the wrong place that is going to be in here. See the scoolant that is what control your M09 output. Problem is where you want is in a really a bad place to want it. That will be in the prapid part of the post. I would try before verses after and see if that gives me the out put I am looking for verses trying to make a post mode since the scoolant exist in prapid section already.


pretract        #End of tool path, toolchange
      phsm_off
      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,
            [
            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
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      else, gcode$ = zero
      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$
#      if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
#      pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
#      if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
      if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
        [
        if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
        rotretflg = 1
        pbld, n$, `sg28, protretinc, e$
        rotretflg = 0
        if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]
      absinc$ = sav_absinc
      coolant$ = sav_coolant
      uninhibit_probe$

pretract0        #End of tool path, null toolchange
      phsm_off
      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,
#            [
#            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
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      else, gcode$ = zero
#      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      pbld, n$, sccomp, psub_end_mny, e$
      pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$
#      if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
#      pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
#      if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
      if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
        [
        if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
        rotretflg = 1
        pbld, n$, `sg28, protretinc, e$
        rotretflg = 0
        if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]
      absinc$ = sav_absinc
      coolant$ = sav_coolant

 

 

Hi C^MillMan,
   After I looked your code and I tried to play around with it, I think I may found the solution but correct me if I am wrong since I'm not expert in writing post as a full time job.

 

Thank you for your help, it really works.

 

 

=======================G-CODES SPIT OUT==================================
N2( .1250,#1 CENTER DRILL, CB,)
(2FLTS .115LOC, .120LBS, 1.25LOH)
G0 G17 G40 G49 G80 G90
G91 G28 Z0 M19
G28 Y0 
T2 M6(SPOT 8X .275 THRU HOLES, CUT#2)
G90 G54 X0. Y.8661
S1500 M3
G43 H2 Z2. T3 M8(DOC= Z-.675) ==================> (Good code as M8 here, pcan2, coolant after)
G98 G81 Z-.675 R-.55 F2.5
X-.6125 Y.6125
X-.8661 Y0.
X-.6125 Y-.6125
X0. Y-.8661
X.6125 Y-.6125
X.8661 Y0.
X.6125 Y.6125
G80 M9 ==================> (Good code as M9 here)
G91 G28 Z0.
/G28 Y0. M5
M1
(*)
N3( .2720,LTR. I DRILL, HSS, 118.DEGS,)
(2FLTS 2.000LOC, 3.00LOH)
G0 G17 G40 G49 G80 G90
G91 G28 Z0 M19
G28 Y0 
T3 M6(SPOT 8X .275 THRU HOLES, CUT#3)
G90 G54 X0. Y.8661
S1404 M3
G43 H3 Z2. T1 M8(DOC= Z-.9729)==================> (Good code as M8 here, pcan2, coolant after)
(13 PECKS, .8661 FLAT DEPTH)
(.1067 DRILLED THROUGH)
G98 G83 Z-.9729 R-.55 Q.025 F2.5
X-.6125 Y.6125
X-.8661 Y0.
X-.6125 Y-.6125
X0. Y-.8661
X.6125 Y-.6125
X.8661 Y0.
X.6125 Y.6125
G80 M9 ==================> (Good code as M9 here)
G91 G28 Z0.
/G28 Y0. M5
M1
(*)
N1( .2500,1/4 EM, TiNC, USED TOOL,)
(4FLTS .750LOC, 1.50LOH)
G0 G17 G40 G49 G80 G90
G91 G28 Z0 M19
G28 Y0 (.025 BREAK THROUGH ADDED)
T1 M6(FINISH 8X .275 THRU HOLES, CUT#4)
G90 G54 X.5997 Y.6125
S2500 M3
G43(D1)H1 Z2. T2 M8(DOC= Z-.8911)==================> (Good code as M8 here, pcan2, coolant after)
Z.2 G1 Z-.8911 F10.
G3 G41 D1 X.5997 Y.6125 I.0128
G0 Z2.
(CUTTING...)
G3 X.8534 Y0. I.0128
G0 X.8533 Z2.
(*)
N102(FINISH 8X .275 THRU HOLES, CUT#5)
G0 G90 G54(DYNAMIC PEEL MILL)
S6000 M3(XY STK= .01)
(.0125 STEPOVER, 5.PERCENT TDIA.)
G43 H1 Z1.(DOC=Z-.0984)
X.2912 Y.6758 Z.1 G1 Z-.0984 F100.
G3 X.3061 Y.6891 R.1699
X.3219 Y.7184 R.0812
(CUTTING....)
G3 X-.8587 Y2.0798 Z-.0959 R.0063
G1 X-.8642 Y2.0664 Z-.0884
G0 Z1.M9 ==================> (Good code as M9 here)
G91 G28 Z0.
/G28 Y0. M5
G40
G0 G90 G54 X0.
M1
T2 M6(FIRST PROGRAMMED TOOL)
M30(215,006CHARS - 215.71KB)
%

===========================================================POST=====================================

pcanceldc$       #Cancel canned drill cycle
      result = newfs (three, zinc)
      z$ = initht$
      prv_zia = initht$
      pxyzcout
      !zabs, !zinc
      prv_gcode$ = zero
      if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero
      pcan
      #if sav_mi1 <> zero & sav_mi2 <> zero,
        #[
         #*sav_mi2, e$
         #sav_mi1 = zero
         #]
      pcan1, pbld, no_spc$, [if drillcyc$ < 12, sg80], strcantext, scoolant,
      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,
            [
            coolantx = and(2^local_int, coolant_on)
            local_int = local_int + one
            if coolantx > zero,
              [
              coolantx = local_int
              pbld, n$, scoolantx, #COOLANT AFTER OFF
              ]
            coolantx = zero
            ]
          coolant_on = zero
          ]
#        ]

      #pbld, scoolant,e$ # Extra coolant code here
      #pbld, no_spc$, [if gcode$ = 1, sgfeed], *sg91, sg28, "Z0.", sm05, e$ # Z Home Here
      coolant$ = sav_coolant
      coolant_on = zero
      #pbld, scoolant,e$
      e$


pretract        #End of tool path, toolchange
      #"DEBUG: PRETRACT",e$
      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,
            [
            coolantx = and(2^local_int, coolant_on)
            local_int = local_int + one
            if coolantx > zero,
              [
              coolantx = local_int
              pbld, n$, scoolantx, #COOLANT AFTER OFF
              ]
            coolantx = zero
            ]
          coolant_on = zero
          ]
#        ]

      #pbld, scoolant,e$ # Extra coolant code here
      #pbld, no_spc$, [if gcode$ = 1, sgfeed], *sg91, sg28, "Z0.", sm05, e$ # Z Home Here
      coolant$ = sav_coolant
      coolant_on = zero
      #pbld, scoolant,e$      

      
      "G91 G28 Z0.", #END OF TOOL RETRACT VERTICAL INDEX
      phsm_off
      e$

Link to comment
Share on other sites
5 hours ago, C^Millman said:

You only checked drilling what about the other 100 types of operations you can do int Mastercam?

Hi C^MillMan,
   I use tool_op$ and opcode$.  I'm not sure the best way to do but so far I can only think of and it works for not.  You are right, not sure for the future.  

Do you have any suggestions?  Don't know why certain of the "DMG MORI" demands certain M-CODES at exact position as I just showed.  My company shouldn't buy the DMG MORI but.... but I have to deal with it if I want to sustain.

 

Thank you C^MillMan, your inputs really educated me.  Please help me if I did something consider as "DUMP QUESTION" because I'm not a professional post writer.

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