Configuring a Custom Drilling Cycle on Fanuc 16i-MB

Jason IP4 min read
FanucOther TopicPLC Programming
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

A Fanuc 16i-MB can implement a user-defined machining cycle when the Custom Macro option is available. Do not attempt to edit the built-in G81-G89 cycles; place the required motion in a separate macro program and call it from the machining program. The supplied implementation uses a modal G66 call to program O09010, followed by G67 to cancel the call.

Choose Between a Built-In Cycle and a Custom Macro

Use a built-in cycle when its motion already matches the process. The evidence identifies one important limitation: the stated G73 implementation provides incremental chip-breaking motion but does not include bottom dwell. The requested process instead needs three feed stages and controlled chip breaking between intermediate depths.

Requirement Supported approach
Standard drilling behavior Use an existing G81-G89 cycle.
Edit an existing built-in cycle Not supported by the supplied evidence.
Create application-specific motion Use a Custom Macro program if that option is installed.
Repeat the custom cycle at several positions Call the macro modally with G66, program the positions, and cancel it with G67.

Define the Macro Call Interface

The proposed call is G66 P9010 X.. Y.. Z.. R.. Q.. D.. E.. F.. V... In this interface, the address arguments map to local macro variables as follows:

Address Macro variable Meaning in this macro
X #24 First absolute partial depth
Y #25 Second absolute partial depth
Z #26 Absolute final working depth
R #18 Start/retract plane
Q #17 Depth increment
D #7 Feed rate for stage 1
E #8 Feed rate for stage 2
F #9 Feed rate for stage 3
V #22 Chip-breaking retract distance

This interface repurposes X and Y as depth arguments. While G66 remains active, confirm how the 16i-MB interprets later X/Y positioning blocks before production use. The supplied program uses subsequent X/Y blocks to repeat the macro at new hole locations.

Program the Modal Cycle Call

%
O00001
N10 T1 M06
N20 (DRILL)
N30 S3000 M03
N40 G54
N50 G00 X0 Y0
N60 G43 Z50. H01 M08
N70 G66 P9010 X-2. Y-45. Z-60. R1. Q5. D100 E300. F50. V0.5
N80 X30. Y0
N90 X30. Y30.
N100 G67
N110 G00 Z200.
N120 M9
N130 M30
%

In the supplied call, the three depths are -2, -45, and -60; the increment is 5; the three feed values are 100, 300, and 50; and the chip-breaking retract distance is 0.5. Units follow the active control and program modes; the evidence does not establish whether they are metric or inch values.

Implement the Macro Motion

%
O09010 (MACRO FAST G73)
(G98 BEHAVIOR)
N70 #100=#5003
N71 G00 Z#18
N72 G01 Z#24 F#7
N74 IF [#17 GE [#24-#25]] GOTO81
N75 #101=#24-#17
N76 G01 Z#101 F#8
N77 G00 Z[#101+#22]
N79 #101=#101-#17
N80 IF [#101 GT #25] GOTO76
N81 G01 Z#25 F#8
N82 G00 Z[#25+#22]
N83 G01 Z#26 F#9
N84 G00 Z#100
N85 M99
%

The macro records the entry Z position in #100, moves to the R plane, feeds to the first depth, advances toward the second depth in Q increments, feeds to the final depth, and returns to the recorded entry position. Variable #101 holds the changing intermediate target.

This code does not implement dwell-only chip breaking. Lines N77 and N82 command positive Z movements by V, so the tool retracts by the specified chip-breaking distance. If the process strictly requires no intermediate withdrawal, this sample does not meet that requirement and must not be represented as such. The evidence supplies repeated G4 X0.5 dwell commands as the desired concept, but it does not provide a completed parameterized dwell-only macro.

Commission and Verify the Cycle

  1. Confirm that the Custom Macro option is present on the control and that program O09010 can be stored and called.
  2. Verify the argument-to-variable mapping, active units, coordinate mode, feed mode, and machine-builder restrictions against the manuals for the specific machine.
  3. Check that the three absolute depths are ordered in the intended cutting direction and that Q and V produce safe motion. The supplied macro contains no evidence-supported input validation.
  4. Single-block the macro above the workpiece with reduced operating conditions. Observe the move to R, each Q increment, every V retract, the final Z move, and the return to the entry Z position.
  5. Test every modal position block and confirm that G67 prevents additional macro executions before commanding the final retract.

The supplied macro was explicitly presented without a guarantee of error-free operation. Treat it as a starting implementation and validate axis direction, clearances, tool loading, and modal behavior on the actual 16i-MB machine before cutting a part.

FAQ

Can I create a custom drilling cycle on a Fanuc 16i-MB?

Yes, if the Custom Macro option is installed. Store the motion in a macro program such as O09010, call it with G66 P9010, and cancel the modal call with G67.

Can I open and modify Fanuc G81-G89 canned cycles?

The supplied evidence says the existing Fanuc cycles cannot be modified. Implement different behavior as a separate custom macro instead.

Does this custom macro break chips without retracting?

No. It executes G00 Z[#101+#22] and G00 Z[#25+#22], retracting by the V value; the sample call sets V0.5. A dwell-only version would require different, separately validated logic.

Back to blog