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:

Adding another peck drill cycle


Recommended Posts

Hi,

I am quite struggling with my post processing macro. I would like to add another peck drilling macro with additional parameters. So far I have had no luck in getting it working.

The custom peck drill cycle I am trying to add is described in G-code as:

 

Code name: G84

 

G90/G91 G99/G98 G84 X_Y_Z_R_I_D_Q_(J_K)(P_)F_(L_);

The values in brackets are optional.

X: X coordinate

Y: Y coordinate

Z: Z coordinate

R: Z coordinate of return point (prdrlout)

I: First cutting depth (initial cut)

D: Runout distance from drilling depth

Q: Basic cutting depth after second cutting (peck1)

J: Every cutting decreasing depth after third cutting

K: Minimum cutting depth

P: Dwell time

F: Cutting feed rate

L: Repeated number

 

Example:

N106 G99 G84 X-.14 Y-.575 Z-2.76 R.5 I.6 D1. Q.1 F150.

N107 X1.14 Y-2.575

N108 G80

 

Here is the post macro I have done:



fmt "Q" 2 peck1$ #First peck increment (positive)
fmt "D" 2 runout$ #Runout distance
fmt "I" 2 initial$ #Initial cut


prdrlout #R drill position
refht_a = refht$
refht_i = refht$ - initht$
if absinc$ = zero, refht_a, !refht_i
else, refht_i, !refht_a

ppeckdetail$ #Detailed Peck Drill Cycle
pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sg84drl, pfxout, pfyout, pfzout,
prdrlout, *initial$, *runout$, *peck1$, *feed, strcantext, e$
pcom_movea


pdrill_2$ #Canned Drill Cycle, additional points
pdrlcommonb
pcan1, pbld, n$, pfxout, pfyout, pzout, prdrlout, feed, strcantext, e$
pcom_movea


ppeckdetail_2$ #Canned Peck Drill Cycle
pdrill_2$


# --------------------------------------------------------------------------
# POST TEXT
# --------------------------------------------------------------------------
[CTRL_MILL|DEFAULT]

[peckdetail drill]
1. "Peck drill detail"
3. ""
7. "Peck"
8. "Initial cut"
9. ""
10. "Runout distance"
11. ""

 

The variables in brackets are not so necessary at first.

 

What am I doing wrong and how could I make it working?

Link to comment
Share on other sites

Do not add the $ symbol to any variables that you create. This is reserved for system variables.

 

Also, you may have some issues using G84 for your cycle, as that is coded in most posts for tapping. The standard coding can be undone, but if this was my post, I would not do away with the standard cycle. Just create a custom cycle, and have it output G84 the way that you would like.

 

HTH

Link to comment
Share on other sites

You are trying to create a custom drill cycle, but you need to do it within mastercams preset operations and parameters. For instance, there are a total of 20 different drill cycles possible in mastercam, each one corresponding to a specific post block. The drill parameters text found at the bottom of the post and in the control def are linked to these specific post blocks:

[simple drill] = pdrill$

[peck drill] = ppeck$

[chip break] = pchpbrk$

[tap] = ptap$

[bore1] = pbore1$

[bore2] = pbore2$

[misc1] = pmisc1$

[misc2] = pmisc2$

[drill cycle 9 - 20] = pdrlcst$ (drillcyc$ controls which cycle is actually being called)

 

You will not need to define any new post blocks, just use those that are available already in the post.

 

You will need to pick one of these cycles and customize it with the code you have for peck drilling. Most posts already utilize the basic drill cycles from simple drill to bore2, so I would recommend looking at pmisc1$ and pmisc2$ to see if there is any customization there, if not, this is where your code should go.

 

Also the drill parameters in the text section of the post link to specific parameters:

[misc1]

1. "Peck drill detail"

3. "" -> dwell$

7. "Peck" ->peck1$

8. "Initial cut" -> peck2$

9. "" -> peckclr$

10. "Runout distance" -> retr$

11. "" ->shftdrl$

 

Use these predefined variables when outputting your cycle. You can set your custom variables equal to these values so you don't have to change the formatting:

 

fmt "Q" 2 peck1$ #First peck increment (positive) <- Already a predefined mastercam variable

fmt "D" 2 runout #Runout distance

fmt "I" 2 initial #Initial cut

 

runout = retr$

initial = peck2$

 

Hopefully this will help you understand how the post works. If you continue to have issues, contact your local reseller, they should be able to help you out with adding in this cycle.

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