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:

How to add an M04 at the End of Drill Cycle


Recommended Posts

I am using the MPMaster post on a Haas VF2. I am wanting to turn the spindle on in reverse and add a dwell after a drill cycle to clear chips off the drill. I want to add this to a G83 and a G73. But not a G81 or G82.

 

Here is what I would like to do

 

T15 M6

G0 G90 G54 X0. Y0. A0. S2300 M3

G43 H15 Z2.

G98 G83 Z-.75 R.1 Q.1 F7.5

G80

#########

S5000 M4 add these

G4 P1 two lines

#########

M5

G91 G28 Z0.

G28 Y0.

M30

%

 

Can this be done?

Thanks

Link to comment
Share on other sites

Open your post in the mastercam editor. Serach for pdrill

 

 

pdrill$ #Canned Drill Cycle

pdrlcommonb

pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,

prdrlout, dwell$, *feed, strcantext, e$

pcom_movea*************************************************add after this line your code with quotaions

pbld, n$, "##################", e$

pbld, n$, "S5000 M4", e$

pbld, n$, "G4 P1", e$

pbld, n$ ,"##################", e$

 

The quotation will insert your lines as is all the time every time

Link to comment
Share on other sites

That works, but can it be made to post it only one time right before the M05?

Putting it after pdrill$ places this after the G81 and G82 cycles. Placing this after ppeck$ and pchpbrk$ places this on the cycles I want. Just the peck and chip break.

 

T137 M06 ( 7/16 DRILL)

(MAX - Z.1)

(MIN - Z0.)

G00 G17 G90 G54 X0. Y0. S611 M03

G43 H137 Z.1

G94

G99 G81 Z0. R.1 F4.21

S5000 M4

G4 P1

G80

G99 G83 Z0. R.1 Q.1313 F4.21

S5000 M4

G4 P1

G80

G99 G73 Z0. R.1 Q.1313 F4.21

S5000 M4

G4 P1

G80

M05

G91 G28 Z0.

G28 Y0.

G90

S50

M30

 

 

T137 M06 ( 7/16 DRILL)

(MAX - Z.1)

(MIN - Z0.)

G00 G17 G90 G54 X0. Y0. S611 M03

G43 H137 Z.1

G94

G99 G81 Z0. R.1 F4.21

G4 P1

G80

G99 G83 Z0. R.1 Q.1313 F4.21

G4 P1

G80

G99 G73 Z0. R.1 Q.1313 F4.21

G4 P1

G80

S5000 M4

M05

G91 G28 Z0.

G28 Y0.

G90

S50

M30

Link to comment
Share on other sites

Try this instead

 

 

pcanceldc$ #Cancel canned drill cycle

pbld, n$, "test", e$

pbld, n$, "test", e$

pbld, n$, "test", e$

result = newfs(9, feed)

result = newfs(three, zinc)

result = nwadrs(strq, peck1$)

z$ = initht$

if cuttype = one, prv_zia = initht$ + (rotdia$/two)

else, prv_zia = initht$

pxyzcout

!zabs, !zinc

prv_gcode$ = zero

pcan

 

 

 

 

 

N120 T5 M6

N130 G0 G90 G54 X1.4766 Y.778 A0. S1069 M3

N140 G43 H5 Z.1

N150 M8

N160 G99 G81 Z-.125 R.1 F1.1

N170 X2.9715 Y1.1653

N180 X3.5344 Y-.3659

N190 X2.2271 Y-.608

N200 test

N210 test

N220 test

N230 G80

N240 M5

N250 G91 G28 Z0. M9

N260 A0.

N270 M01

N280 T4 M6

N290 G0 G90 G54 X1.4766 Y.778 A0. S534 M3

N300 G43 H4 Z.1

N310 M8

N320 G99 G83 Z-.6602 R.1 Q.125 F4.3

N330 X2.9715 Y1.1653

N340 X3.5344 Y-.3659

N350 X2.2271 Y-.608

N360 test

N370 test

N380 test

N390 G80

N400 M5

N410 G91 G28 Z0. M9

N420 A0.

N430 M01

N440 T22 M6

N450 G0 G90 G54 X1.4766 Y.778 A0. S534 M3

N460 G43 H22 Z.1

N470 M8

N480 G99 G83 Z-.51 R.1 Q.125 F41.1

N490 X2.9715 Y1.1653

N500 X3.5344 Y-.3659

N510 X2.2271 Y-.608

N520 test

N530 test

N540 test

N550 G80

N560 M5

N570 G91 G28 Z0. M9

N580 G28 X0. Y0. A0.

N590 M30

%

Link to comment
Share on other sites

OK so I moved the notes to output the code after the G80 so now with this it will always output

your notes after any G80 code

 

 

pcanceldc$ #Cancel canned drill cycle

 

result = newfs(9, feed)

result = newfs(three, zinc)

result = nwadrs(strq, peck1$)

z$ = initht$

if cuttype = one, prv_zia = initht$ + (rotdia$/two)

else, prv_zia = initht$

pxyzcout

!zabs, !zinc

prv_gcode$ = zero

pcan

pcan1, pbld, n$, sg80, strcantext, e$

pcan2

pbld, n$, "S5000 M4", e$

pbld, n$, "G4 P1", e$

 

 

 

N120 T5 M6

N130 G0 G90 G54 X1.4766 Y.778 A0. S1069 M3

N140 G43 H5 Z.1

N150 M8

N160 G99 G81 Z-.125 R.1 F1.1

N170 X2.9715 Y1.1653

N180 X3.5344 Y-.3659

N190 X2.2271 Y-.608

N200 G80

N210 S5000 M4

N220 G4 P1

N230 M5

N240 G91 G28 Z0. M9

N250 A0.

N260 M01

N270 T4 M6

N280 G0 G90 G54 X1.4766 Y.778 A0. S534 M3

N290 G43 H4 Z.1

N300 M8

N310 G99 G83 Z-.6602 R.1 Q.125 F4.3

N320 X2.9715 Y1.1653

N330 X3.5344 Y-.3659

N340 X2.2271 Y-.608

N350 G80

N360 S5000 M4

N370 G4 P1

N380 M5

N390 G91 G28 Z0. M9

N400 A0.

N410 M01

N420 T22 M6

N430 G0 G90 G54 X1.4766 Y.778 A0. S534 M3

N440 G43 H22 Z.1

N450 M8

N460 G99 G83 Z-.51 R.1 Q.125 F41.1

N470 X2.9715 Y1.1653

N480 X3.5344 Y-.3659

N490 X2.2271 Y-.608

N500 G80

N510 S5000 M4

N520 G4 P1

N530 M5

N540 G91 G28 Z0. M9

N550 G28 X0. Y0. A0.

N560 M30

%

Link to comment
Share on other sites

the drillcyc$ variable is used to indicate which drill cycle you are using. Assuming you are using the standard G83 and G73 in mpmaster, you would need to add logic saying:

 

if drillcyc$ = 1 | drillcyc$ = 2,

[

pbld, n$, "S5000", "M4", e$

pbld, n$, "G4", "P1", e$

]

 

Note that this method is hard coded, so anytime the drill cycle is cancelled, you will get an M4 output regardless of the direction of rotation for the drill. If you want you can look at the spdir2 direction to determine the current direction of travel:

 

if drillcyc$ = 1 | drillcyc$ = 2,

[

if spdir2 = 0, pbld, n$, "S5000", "M3", e$

else, pbld, n$, "S5000", "M4", e$

pbld, n$, "G4", "P1", e$

]

 

Again, this will output every time the G80 is output which I believe is not quite what you are looking for.

Link to comment
Share on other sites

Chris, I have been following this thread because i'm interseted, just wondering if I missed something. The logic that you have put into the fixed cycle now checks for chip break and peck drill cycle...

 

if drillcyc$ = 1 | drillcyc$ = 2

 

won't that mean if drillcyc$ = 0 in other words drill/ counterbore that it will bypass the logic to do the S5000 m04? which is what Rotary Ninja wanted.

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