CNC machining centers come with a series of hole-machining canned cycles that are commanded by G81 through G89. These cycles are very helpful, but they have limitations. If a hole must be machined in a manner different than the cycles allow, then you cannot use them.With FANUC’s version of parametric programming, Custom Macro, you can create your own canned cycles to make them do whatever you want. And with a little work, your user-created, hole-machining canned cycle can be made to work in much the same way as built-in canned cycles:Our example commands a porting tool, a combination tool that drills the hole and machines a (larger) hole feature, like a spot face, counterbore or special porting contour. This requires two or more feedrates and possibly two or more spindle speeds. One feedrate is used for the drilling portion and at least one other for the porting portion(s).The example we show uses Metric mode and was created by Martin Buchan of Orlick Industries in Ontario, Canada. For his application, the X- and Y-coordinates are specified with permanent common variables (#500 and above) that have been previously calculated. Here is a portion of a main (calling) program that invokes the user-created canned cycle and machines 16 holes:G123 is the user-selected G code used to invoke the canned cycle. Arguments X and Y specify the hole center coordinates. R specifies the rapid plane. Z is the position to which the drill portion of the cutting tool will machine. A is the feed rate (mm/minute) to be used for the drilling portion. W is the position to which the spot-facing portion of the cutting tool will machine. B is the feed rate to be used for the spot-facing portion. P, if included, specifies dwell time after spot facing. G98 (or G99) specifies the position to which the tool will retract after machining the hole.Our example is pretty simple, having just two diameters to deal with. If your porting tool has more than two diameters to machine, you could add input variables for more depths and feed rates.The cutting tool will:Here is the porting tool user-created canned cycle in action. Coolant is turned off and feed rate is lowered so you can more easily see the motions. Source: Mike LynchHere is the custom macro:What else must be done?There are a few more things needed to make this custom macro behave like a built-in, hole-machining canned cycle. Parameter settings shown are for a 30 series FANUC CNC: