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:

Peck Cycle, Full Retract


Guest
 Share

Recommended Posts

I recently had a customer that needed to drill some deep holes with multiple drills and needed a full retract.

 

Typically this is a good solution for a macro, except, that they know zero about macros and are not even sure that they have Macro B. So I needed a Mastercam solution....so here is a custom cycle for anyone who can use it

 

 

I created a new fs statement for rounding, if you already have an fs22 change it to something you don't have, just make sure you set the variable for the new fs statement

fs2 22  3 09 3 09   #Output for rounding peck values

variables to be defined

fmt      2  drill_dist  #calulate drilling distance
fmt      2  pck_amt     # Peck amount
fmt      22 pck_no      # Calculate no. OF PECKS
fmt  Z   2  drl_depth   # Calculate Z drill depth
fmt  Z   2  z_return    # Rapid Z dpeth
fmt  Z   2  rtr_hgt
fmt      2  z_calc      #calulated Z doeth
fmt      2  prv_zdrill  # Capture previousl drilled depth
fmt  Z   2  z_clear     # Z clearance return value
fmt      2  z_clear_val  # Clearance distance to previous peck
fmt  Z   2  z_start_pos

pass      :-9999       # Calculate number of pecks remaining

Define the custom call

pdrlcst$         #Custom drill cycles 8 - 19 (user option)
      #Use this postblock to customize drilling cycles 8 - 19
      if drillcyc$ = 8, pdrilldeep
      if drillcyc$ > 8, pdrlcst8

The actual cycle

      
pdrilldeep
      pdrlcommonb
      pck_amt = peck1$
      drill_dist = (-depth$ + tosz$)
      pck_no = (drill_dist/ pck_amt)
      pck_no = fmtrnd(pck_no)
      pass = pck_no
      rtr_hgt = peckclr$
      z_calc = 0
      z_clear_val = peck2$
      z_clear = (tosz$ + z_clear_val)
      z_start_pos = initht$
      
      pbld, n$, pxout, pyout, e$
      pbld, n$, sg00, *rtr_hgt, e$
      while pass > 0,
      [
      drl_depth = ((tosz$-(pck_amt)) + (-z_calc))
      pbld, n$, sg00, z_clear, e$
      pbld, n$, *sg01, *drl_depth, *feed, e$
      pbld, n$, sg00, *rtr_hgt, e$
      
      prv_zdrill = drl_depth
      z_calc = z_calc + pck_amt
      z_clear = (prv_zdrill + z_clear_val)
      pass = pass - 1
      ]
      
      z_clear = (prv_zdrill + z_clear_val)
      pbld, n$, sg00, z_clear, e$
      pbld, n$, sg01, pfzout, *feed, e$
      pbld, n$, sg00, z_start_pos, e$
      pbld, n$, "(", "HOLE COMPLETE", ")", e$
      pbld, n$, "(" ")", e$
      pcom_movea

The field changes

[drill cycle 9]
1. "PECK SPECIAL"
2. ""
3. ""
4. ""
5. ""
6. ""
7. "Peck"
8. "Clearance Distance"
9. "Clearance Height"
10. ""
11. ""

Peck = Amount of Drill Peck

Clearance Distance = Distance away to rapid down from previous drilled depth

Clearance Height = Height to retract to clear hole.

 

2015-02-28_11-12-22_zpscoskjhc8.png

 

and if you want to setup to do multiple holes

pdrlcst_2$       #Custom drill cycles 8 - 19, additional points (user option)     
      #Use this postblock to customize drilling cycles 8 - 19
      if drillcyc$ = 8, pdrilldeep
      if drillcyc$ <> 8, pdrlcst8_2
Link to comment
Share on other sites

Sample

 

2015-02-28_11-17-11_zpsnqwiq2wi.png

 

2015-02-28_11-17-22_zpsrvhhdfne.png

G20
G0 G17 G40 G49 G80 G90
T1 M6
G0 G90 G54 X-.6862 Y.0212 S1681 M3
G43 H1 Z2.
G0 Z.25
G0 Z-1.555
G1 Z-1.655 F4.04
G0 Z.25
G0 Z-1.635
G1 Z-1.735 F4.04
G0 Z.25
G0 Z-1.715
G1 Z-1.815 F4.04
G0 Z.25
G0 Z-1.795
G1 Z-1.895 F4.04
G0 Z.25
G0 Z-1.875
G1 Z-1.975 F4.04
G0 Z.25
G0 Z-1.955
G1 Z-2.055 F4.04
G0 Z.25
G0 Z-2.035
G1 Z-2.135 F4.04
G0 Z.25
G0 Z-2.115
G1 Z-2.215 F4.04
G0 Z.25
G0 Z-2.195
G1 Z-2.295 F4.04
G0 Z.25
G0 Z-2.275
G1 Z-2.375 F4.04
G0 Z.25
G0 Z-2.355
G1 Z-2.455 F4.04
G0 Z.25
G0 Z-2.435
G1 Z-2.535 F4.04
G0 Z.25
G0 Z-2.515
G1 Z-2.615 F4.04
G0 Z.25
G0 Z-2.595
G1 Z-2.695 F4.04
G0 Z.25
G0 Z-2.675
G1 Z-2.775 F4.04
G0 Z.25
G0 Z-2.755
G1 Z-2.855 F4.04
G0 Z.25
G0 Z-2.835
G1 Z-2.935 F4.04
G0 Z.25
G0 Z-2.915
G1 Z-3.015 F4.04
G0 Z.25
G0 Z-2.995
G1 Z-3.095 F4.04
G0 Z.25
G0 Z-3.075
G1 Z-3.175 F4.04
G0 Z.25
G0 Z-3.155
G1 Z-3.2 F4.04
G0 Z2.
( HOLE COMPLETE )
( )
M5
G91 G28 Z0.
G28 X0. Y0.
M30
Link to comment
Share on other sites
  • 1 month later...

I see there is a redundant F4.04, how do I remove all of them but only leave one F4.04?

 

 

Thanks.

 

G20
G0 G17 G40 G49 G80 G90
T1 M6
G0 G90 G54 X
-.6862 Y.0212 S1681 M3
G43 H1 Z2
.
G0 Z.25
G0 Z-1.555
G1 Z-1.655 F4.04
G0 Z.25
G0 Z-1.635
G1 Z-1.735 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-1.715
G1 Z-1.815 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-1.795
G1 Z-1.895 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-1.875
G1 Z-1.975 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-1.955
G1 Z-2.055 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.035
G1 Z-2.135 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.115
G1 Z-2.215 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.195
G1 Z-2.295 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.275
G1 Z-2.375 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.355
G1 Z-2.455 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.435
G1 Z-2.535 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.515
G1 Z-2.615 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.595
G1 Z-2.695 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.675
G1 Z-2.775 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.755
G1 Z-2.855 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.835
G1 Z-2.935 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.915
G1 Z-3.015 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-2.995
G1 Z-3.095 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-3.075
G1 Z-3.175 F4.04 =======> Redundant feed rate, no need this
G0 Z.25
G0 Z-3.155
G1 Z-3.2 F4.04 =======> Redundant feed rate, no need this
G0 Z2.
( HOLE COMPLETE )
( )
M5
G91 G28 Z0
.
G28 X0. Y0.
M30

Link to comment
Share on other sites
  • 3 weeks later...
  • 6 months later...

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