Drill Block Code

Top  Previous  Next

The subject of drilling code and the speed of drilling eventually steers toward the idea of binary tool calls versus standard tool calls for drill blocks and the speed difference noted between the two versions.

 

Standard Drill Code

Typically drill calls use T-Codes similar to any tool calls normally found in an nc program.  For instance, in the following example, an 9 spindle drill block is used to drill multiple holes at the same time in a part and the resulting code has tools called one at a time, and more importantly one on each line.

 

 

(BORING BLOCK)

G28 G91 Z0 M5

G90 T302

T303

T304

T305

T306

T307

M3 S18000

G0 G17 G54 P2 X7.1422 Y6.

G0 G43 H42 Z.25

Z.1

G1 Z-.375 F150.

G0 Z.25

G0 X14.701

Z.1

G1 Z-.375 F150.

G0 Z.25

G0 Y18.

Z.1

 

This code allows tools T302 - T307 all to be called down at the same time, producing 6 holes for each location specified in the program.  This is useful when drilling adjustable shelf holes, for instance.

 

The main issue with this logic is twofold.  One problem is that each time a T-Code is called, the tool drops down and then the program executes the next line, which is another tool call, etc.  From a machine execution standpoint, each tool call is executed by the machine, and then the M3 S18000 turns the drill spindles on.

 

The second issue with this is purely the number of lines of code you need to store and execute in each program.  As memory space is not unlimited and drill blocks can have as many as 30 drills in them, this can be a large amount of code to generate and execute, and each character takes up a little more memory.

 

 

Binary Coded Drills to the Rescue!

To solve the issues noted in the previous example, there is a method of calling drills that will execute faster, and with substantially less code.  This method involves setting up the logic of the machine to accept concatenated tool calls, or binary coded tool calls so that one line of code can call many tools.

 

The basic idea is this; for each drill in the drill block there typically is one T-code.  Instead of using a number that identifies each tool in sequence, instead identify them as factors so that they can be added together.

For instance, normal T-Codes on an 9 spindle drill would be:

T301

T302

T303

T304

T305

T306

T307

T308

T309

Each must be called on a separate line of nc code.

If you were to number them like this:

T1

T2

T4

T8

T19

T32

T64

T128

T256

Then, you could call any or all of them on one line by adding their numbers together.  For instance in the previous example, tools T302-T307 were called to drill 6 holes.  On the same part you could use binary drill code to call T126 which is 2+4+8+16+32+64 that way one line of code, and only one line to execute!  The nc code file would then look like this:

 

(DRILL BLOCK)

T126 M91

M3

G0 G54 P2 X7.1422 Y6.

G43 H42 Z.25

Z.1

G1 Z-.375 F150.

G0 Z.25

G0 X14.701

Z.1

G1 Z-.375 F150.

G0 Z.25

G0 X7.1422 Y18.

Z.1

 

The M91 after the T-Code tells the machine that it is using the Drill Block with binary codes so that the logic is not looking for a T126 as a tool changer tool.  This way you can mount several drill blocks on one machine and just use M91 for the first block, M92 for the second drill block, or even M93 to call both drill blocks down at the same time.

 

The nature of the new drill codes allows for only one T-code no matter how many drills are called, and you can never duplicate a number in any pattern.

 

There is a T-Code limit of 10 characters on the Fanuc control, so there are only so many tools you can mount in a boring block and still use binary drill codes, but with 10 digits, 30 spindle drill blocks will fit.

 

For a 17 spindle drill block the codes would match up like this:

 

Standard T-Code

Binary Tool Code

T301

T1

T302

T2

T303

T4

T304

T8

T305

T16

T306

T32

T307

T64

T308

T128

T309

T256

T310

T512

T311

T1024

T312

T2048

T313

T4096

T314

T8192

T315

T16384

T316

T32768

T317

T65536

 

If you were to call all the heads down together would be T131071.  You can find the number by adding all the binary codes together.

 

 

The real advantage here is that there are less lines of nc code and fewer lines to execute for each drill pattern.  When dealing with nests of cabinet parts that have many shelf holes, this can be a significant savings in code and time.