DryRun beta

Controller notes

FANUC 0i / 31i G-code: PS alarms, the decimal point and M06

After this page you can tell which lines of your program a FANUC Series 0i / 31i milling control stops on, and with which alarm. You can also decide which of DryRun's assumptions to check on your own control before you trust a clean result.

DryRun reads a program as the control does and runs it on a model of your machine. That is the FANUC ROBODRILL α-D21LiB5 from the catalogue, or your own machine with Controller set to FANUC in the Library. The demo /app?demo=demo-fanuc is a ROBODRILL with one program that runs through and one with three typical mistakes.

The page is written from the FANUC ROBODRILL α-DiA5 Operator's Manual, B-85314EN/01, for the Series 31i-B5 control. Where that manual is silent, the usual FANUC rule is used and marked assumed. Nothing here was tried on a real control.

What DryRun does at an alarm

A FANUC control checks a block, and if it cannot accept it, stops the program and shows a numbered alarm. DryRun does the same check. The line gets a Not executed entry with the control's number and message, then the cause:

PS0010 IMPROPER G-CODE: G90.1 is not a FANUC code — the control stops here; the simulation goes on as if you continued

An alarmed line changes nothing. The simulation goes on after it, so one pass shows every alarm. Any alarm makes the verdict DO NOT RUN, for example 1 rejected line — alarm PS0010 on line 4; the control stops the job there.

The decimal point

On a FANUC control a length without a decimal point is counted in thousandths. X100 is 0.100 mm, and X100. is 100 mm. This is parameter 3401 bit 0 at its factory value 0 (assumed; see check T13). The ROBODRILL manual tells you to "Specify each value with a decimal point" (section 33).

DryRun follows the machine's Decimal point setting:

The first such value in a program gets one warning: X100 has no decimal point: read as 0.100 mm (FANUC parameter 3401#0 = 0); write X100. for 100 mm. F, S, T, H, D, L, a canned cycle's K and G04 P are whole numbers in both settings.

How a program is read

PS alarms DryRun reports

The messages are the control's, from the manual's alarm list (Appendix D, pp. 962 and after).

Alarm Message on the control When DryRun reports it
PS0003 TOO MANY DIGIT a length of 100 000 mm or more (the limit is assumed)
PS0005 NO DATA AFTER ADDRESS a letter without a number
PS0006 ILLEGAL USE OF MINUS SIGN a negative T, H, D, cycle K, M98 P or G04 P
PS0007 ILLEGAL USE OF DECIMAL POINT a point in one of those words; two points in one value
PS0009 IMPROPER NC-ADDRESS a letter other than G M X Y Z I J K R F S T H D P Q L N O; A on a machine without an A axis
PS0010 IMPROPER G-CODE a G code that is not in the table below
PS0011 FEED ZERO (COMMAND) G01, G02, G03 or a canned cycle before any F, or with F0; in G93 without F on the block; in G95 without S
PS0020 OVER TOLERANCE OF RADIUS an I, J, K arc whose end is more than 0.005 mm off its radius (the tolerance is assumed, T8)
PS0022 R OR I,J,K COMMAND NOT FOUND G02 or G03 with neither
PS0025 CIRCLE CUT IN RAPID (F0) G02 or G03 with F0
PS0030 ILLEGAL OFFSET NUMBER H or D above 200, the ROBODRILL's offset count
PS0031 ILLEGAL P COMMAND IN G10 G10 L2 with P outside 0–6, G10 L20 or G54.1 with P outside 1–48
PS0043 ILLEGAL T-CODE COMMAND a T word on a block without M06
PS0044 G27-G30 NOT ALLOWED IN FIXED CYC G28 or G30 while a canned cycle is active
PS0045 ADDRESS Q NOT FOUND (G73/G83) G73 or G83 without Q, or with Q0
PS0046 ILLEGAL REFERENCE RETURN COMMAND G30 with a P other than 2
PS0074 ILLEGAL PROGRAM NUMBER O0, or an O number above 9999
PS0076 PROGRAM NOT FOUND M98 P to an O number that is not in the file
PS0077 TOO MANY SUB,MACRO NESTING subprograms more than 10 deep (the depth is assumed)
PS0078 SEQUENCE NUMBER NOT FOUND M99 P to an N number that is not in the file
PS0250 TOOL CHANGE ILLEGAL Z AXIS COMMAND a Z word on the M06 block
PS0251 TOOL CHANGE ILLEGAL T COMMAND M06 T outside 1 to the machine's Tool pockets (21)

Three more stops have no PS number:

G codes

"On the control" is from the manual's G-code list (Appendix B, pp. 953–956) unless the row says assumed. In the DryRun column, Runs means simulated. No effect means accepted without changing the path. Ignored means the code is dropped and the rest of the line runs. Line skipped means the line does not run. Alarm stops the line as above.

Code On the control In DryRun Message
G00 Rapid; each axis at its own speed, so a diagonal move is a dog-leg (assumed, T7) Runs; the path follows G0 path —
G01 Linear feed Runs PS0011 without F
G02, G03 Arc by R (R below 0: over 180°) or by I, J, K from the start point; a third axis makes a helix Runs. An R arc back to its own start point does not move (assumed) PS0020, PS0022, PS0025
G04 Dwell: P in ms, X in seconds (assumed; the manual's examples are G04 P200 and G04 X1.) Runs PS0007 for G04 P1.5
G05.1, G05.4, G08, G09, G61, G62, G63, G64 AI contour control, exact stop and cutting modes No effect —
G10 L2 P1–P6 writes G54–G59, L20 P1–P48 writes G54.1 P1–P48 (manual, section 37) Runs: the offset changes for the rest of the job. L2 P0 and other L values: the line is skipped. L10–L13 (tool offsets): ignored PS0031; G10 changes the stored work offset on the controller (it persists after the job) …
G15, G50, G50.1, G67, G69 Cancel polar coordinates, scaling, mirror, modal macro call, rotation No effect —
G16, G68 Polar coordinates, coordinate rotation Ignored G68: not simulated; positions after this line may differ from the controller
G17, G18, G19, G20, G21, G90, G91, G98, G99 Plane; inch, mm; absolute, incremental; a canned cycle returns to the start level, to R Runs —
G22, G23 Stored stroke check 2 on, off No effect —
G27, G29, G31, G37, G51, G51.1, G76, G87, G88 Reference check and return, skip (probing), tool length measurement, scaling, mirror, fine and back boring Line skipped G31: not simulated; line skipped, positions after this line may differ from the controller
G28 Rapid to the point on the block, then the named axes to the reference position (assumed) Runs, to the machine's G28 position (machine 0). Without axis words nothing moves. In G90 a warning: the point is a work position PS0044 in a canned cycle
G30 The same, to the second reference position Runs, to the G30 position PS0046 for P3 or P4
G40 Cutter compensation off Runs —
G41, G42 Cutter compensation left, right, by offset D Runs without compensation: right only if D holds a wear value, not the cutter radius. The span is a note in the Problems list cutter compensation not simulated: lines 12–40, path off by D1
G43, G44, G49 Tool length compensation +, −, off Runs: H n takes tool n's length from the setup PS0030; tool 5 is not in the setup tool table
G52 Local coordinate system: shifts every work offset; G52 X0 Y0 Z0 cancels (assumed) Runs; M30 cancels it too —
G53 Machine coordinates for this block, at rapid Runs —
G54–G59, G54.1 Work offsets; G54.1 P1–P48 (also written G54 P1) are the 48 additional ones Runs, from the setup's work zeros PS0031; G54.1 P1 is not set for this program; using zero offset
G60 One-direction positioning Runs as G00 G60 one-direction positioning is simulated as G00 …
G65, G66, G66.1 Macro call Line skipped; a note in the Problems list macro P9810 not simulated (line 12); its motion is not checked
G73, G83 Peck drilling; Q is the peck Runs; the retract (G73) and the clearance (G83) are 1 mm (assumed, T9) PS0045
G74, G84 Tapping, left and right Runs: feed to Z, dwell P, feed back to R G84 tapping: the spindle reversal at the bottom is not simulated
G80 Canned cycle off; G00–G03 cancel a cycle too (Appendix B, note 5) Runs —
G81, G82 Drill; drill with dwell P in ms Runs —
G85, G86, G89 Bore: feed out; stop and rapid out; dwell and feed out Runs —
G92, G92.1 Shift the work coordinates; clear the shift on the named axes (assumed) Runs. G92.1 without axis words clears every axis —
G93, G94, G95 Inverse time, feed per minute, feed per revolution Runs. G95 is timed as F × S (assumed) PS0011
Any other G code (G12, G90.1, G59.1) "An unusable G code is specified" (Appendix D) Alarm PS0010

Canned cycles. R and Z are absolute positions and K is the repeat count (assumed). K0 stores the cycle without drilling. L is read as K, with a note. A cycle in G91 or outside G17 is not simulated: its line is skipped with a warning. More than one repeat in G90 warns K3 in G90 repeats the same hole; repeats need G91.

M codes and the tool change

"On the control" is from the manual's M-code list (section IV-2.7.3, pp. 156–158).

Code On the control In DryRun Message
M00, M01, M07, M08, M09, M19, M29 Program stop, optional stop, air blow, coolant on and off, spindle orientation, rigid tapping No effect: the simulation does not pause —
M02, M30 End of program Runs: the program ends and the modes reset —
M03, M04, M05 Spindle clockwise, counter-clockwise, stop Runs: the spindle readout only —
M06 Tool change Runs; see below PS0250, PS0251, alarm 252
M98, M99 Subprogram call and return Runs. M98 P50010 calls O10 five times, and M99 P100 returns to N100 (assumed). M99 in the main program ends the run PS0076, PS0077, PS0078; M99 in the main program repeats it forever on the controller; simulated once
M198 Subprogram from external memory Line skipped M198: not simulated; line skipped …
M10–M17, M20–M28, M31–M79, M90–M97, M100–M133, M170–M172 ROBODRILL machine functions: clamps, probe, doors, counters Ignored M10: machine M code, no motion simulated
Any other M code Depends on the machine builder's ladder (assumed) Ignored M200: not a ROBODRILL M code: what it does depends on the machine's ladder (PMC); ignored
T alone on a block The turret has no pre-selection: "M06 is not specified in a block that specifies a T code" (Appendix D) Alarm PS0043, with The ROBODRILL turret has no pre-selection; turn off 'preload tool' in the post

M06 on the ROBODRILL (manual, section III-6, pp. 198–200). M06 T2 moves Z to the reference position, then changes the tool. X and Y on the same block move at the same time. M06 P2 takes the second pocket clockwise from the current one. DryRun rapids Z to machine 0 and adds the machine's Tool change time (0.9 s) to the estimate. The move above Z 0 into the turret is not simulated.

The manual forbids M06 while tool length compensation, cutter compensation or a canned cycle is active, and allows G49 and G80 on the M06 block. A generic post that writes G91 G28 Z0 and then T2 M06 hits alarm 252 at the second tool. DryRun's hint is Add G49 (and G80) to the M06 block or before it; the ROBODRILL post does this. An S word on the M06 block gets a warning: the manual says not to write it there.

PS0250, PS0251 and alarm 252 apply while the machine's Tool change setting is Tool table (G43 H), the FANUC default.

After M30 or M02 the modes go back to the codes Appendix B marks as the reset state: G00, G17, G90, G54, G40, G49, G80, G94 and G98. G52 is cancelled. Units, the position, the tool and the work offsets stay. G92, F and S are kept (assumed).

Macros

Custom macro B is not executed. DryRun sorts each macro line by what it would do:

Assumed, and how to check it on your control

Each item is what DryRun assumes, then the check.

Sources

Other controllers