Category:Custom Drill Cycles

From Macros Wiki
Jump to: navigation, search

Up

Custom Drill Cycles require one set of macros for each cycle.
In order to use custom cycles, you must first define the name of the cycle in the MDD.

Each Custom Drill Cycle definition contains the cycle name (seen on the dropdown menu of the drill dialog)
and the cycle folder name. This folder name is used to define the location of the custom macros.

Custom drill cycle macros are located in the Program Data folder, in the folder that is specific to the version of GibbsCAM
that you are running. In here you will find the "Macros\CustomDrillCycles" folder. It is in this folder that you need to create
one folder for each Custom Drill Cycle, using a folder name that matches the custom cycle definition in the MDD.

Each Custom Drill Cycle macro folder must contain the following files (with these exact filenames)
DefineData.txt
CycleData.mac
CycleData.dlg
ToolPath.mac

The first file contains a list of the variables used by the cycle, with default values.
The second file is the macro that is run when you press the Cycle Data button on the Drill Dialog.
The third file is the dialog definition used by the CycleData macro.
The fourth file is used to define the toolpath for each hole in the cycle.

Note: When creating the toolpath, all moves are defined in a CS that has its origin at the start of the hole
and the depth axis pointing along the axis of the hole. So, for example, a hole that is 3 inches deep will contain
moves that start at 0, 0, 0 and have a final depth position of at 0, 0, -3.

The DefineData.txt file may contain variables that are used to control the appearance of the main drilling dialog.
These are used to enable input boxes for the cycle that may remove the need for a custom macro dialog.
Each variable, if used, must be set to 0 (do not use) or 1 (use this input box). The full list of variables is:

DrillDialogPeck
DrillDialogRetract
DrillDialogClearance
DrillDialogTap
DrillDialogRigidTap
DrillDialogPulloff
DrillDialogDwell

In addition, you may also use the variable "DrillDialogDrillUp" to indicate that the material top value can be below the final depth
(as it is for a BackBore cycle). The variable "UseMacroDialog" may also be set to zero if no macro dialog is required. Setting this value
to zero will remove the Cycle Data button from the drilling dialog and remove the need for the "CycleData.mac" and "CycleData.dlg" files

The default value for each of the above variables if they are not used is zero, except for DrillDialogDwell and UseMacroDIalog which
both have a default setting of 1.

A minimal macro to create toolpath that simply feeds to the bottom of the hole and rapids out would contain 3 lines:

get_custom_drill_cycle_data hole_depth, zz  ! the depth of the hole
add_custom_drill_cycle_path feed_z, zz  ! feed to depth
callback_returncode = 0  ! no error



The full list of parameters for the get_custom_drill_cycle_data command is:

hole_num the hole number in the process, first hole will be 1
hole_depth depth of the hole, will always be negative
entry_z the entry clear plane height on the drill dialog
exit_z the exit clear plane height on the drill dialog
retract_plane the retract plane height
x the x position of the hole
y the y position of the hole
z the z position of the (bottom of) the hole



The full list of parameters for the add_custom_drill_cycle_path command is:

rapid 3 axis rapid move, 3 values required
rapid_x rapid in x direction only, 1 value required
rapid_y rapid in y direction only, 1 value required
rapid_z rapid in z direction only, 1 value required
rapid_ijk 3 axis rapid move with ijk vector, 6 values required
feed 3 axis feed move, 3 values required
feed_x feed in x direction only, 1 value required
feed_y feed in y direction only, 1 value required
feed_z feed in z direction only, 1 value required
feed_ijk 3 axis feed move with ijk vector, 6 values required
arc arc, 6 values required (xe, ye, ze, xc, yc, dir)
arc_360 360 degree arc, 3 values required (xc, yc, dir)
feedrate change feedrate, 1 value required (feedrate)
rpm change spindle speed, 1 value required (rpm)
dwell add a dwell, 1 value required (time in seconds)



The following example macros are available.


Peck Drilling, adjust by Distance. Input an initial peck depth and a peck reduction amount. The depth of each peck will be
the depth of the previous peck, less the peck reduction amount. A minimum peck depth is also provided for. Download


Peck Drilling, adjust Percentage. Input an initial peck depth and a percentage value. The depth of each peck will be
the depth of the previous peck, multiplied by this percentage. A minimum peck depth is also provided for. Download


Fagor Style Variable Peck Drilling. Input an initial peck depth and a peck reduction amount. The depth of each peck
will be the depth of the previous peck, less the peck reduction amount. A minimum peck depth is also provided for.
An additional cycle option provides for a full out retract after a given number of pecks. Download


Peck Drilling with a Fast Feed Retract. Input the number of pecks or a peck depth. If the peck is based on the number
pecks it will be calculated over the full depth, or else it will peck at the amount entered. A minimum peck depth is also provided.
Feedrates for drilling and a fast feed retract are also provided. Download


Tapered Square. Custom Drill Cycles are not limited to Depth Axis moves. Input a number of pecks. The peck depth will be
calculated as the total depth divided by the number of pecks. A series of squares will be calculated at each depth, the length of
each side at the start of the hole will be equal to the tool diameter and the side length will reduce at each depth down to zero
at the final depth. The tool center will be driven around the square at each depth to created a tapered square hole. Download


Peck Chamfer. Peck Drill, using equal depth pecks, then mill a chamfer around the top of the hole. The inputs are the peck
depth, the retract distance and chamfer depth. The total hole depth is divided by the peck depth to get the number of pecks.
The peck depth will be reduced if the result is not a hole number of pecks. The hole will be peck drilled using a partial retract
by the given retract distance bwteen each peck. After the final depth, the tool is retracted to the top of the hole, minus the
chamfer depth. A chamfer is then cut using a line and 90 degree arc entry move, 360 degree arc, followed by 90 degree arc
and line exit moves back to the center of the hole. Download


The following example MDDs that include all of the above Custom Drill Cycles are available.


3 Axis Vertical Mill. Download

5 Axis Vertical Mill. Download

2 Axis Horizonal Lathe. Download



The following example part files that show some of the above Custom Drill Cycles are available.


3 Axis Vertical Mill. Download

5 Axis Vertical Mill. Download

2 Axis Horizonal Lathe. Download



A single zip containing all of the Custom Drill Cycle Macros, the example MDDs and parts files is available here. Download

This category currently contains no pages or media.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox