CNC 2D Optimization - Masterwood 313 - 2007
Optimization of 2D rectangular grid pattern for position location (drilling) on a CNC that does not support
a to 2 axis drill command and is only capable of a drill command in a line.
See downloads for example programs
Program Function Overviews:
X - Axis (Start, End, X-Increment)
Y - Axis (Start, End, Y-Increment).
Types of Boundary Conditions:
Boundary Cut off
Boundary Even Spaced
Boundary Inner even spaced
Board Spacing thickness
X & Y Axis Speed for optimization
Sub Program Calling (allows mini, relative coordinate beds)
Force-axis runout (Leaving direction on completion of pattern)
Reversing of running
Override Axis Direction too auto,X,Y
The last three mainly allow the optimization when drilling multi-grid configurations.
Technical challenges
The CNC programing language G-Codes, but the style doesn't support nesting of code.
This means basic common language styles found in today's programming languages
are not support, the following are some examples of styles that are not supported.
IF(condition)
{
While (condition)
..
}
If(condition)
{
if(condition)
{.......}
}
While (condition)
{
IF(condition)
....
}
While(condition)
{
While(condition)
{.......}
}
if (condition and condition)
if ( condition or condition)
not
While(condition and condition)
While(condition or condition)
The only program that may be executed inside a while or and if is CNC Drill codes or variables calculations use math,
which also has its complexity limitations at a point. The conditions statements can only be singular,
as in no and or or's could be used only, variable < > = variable.
Therefore using mathematical logic of division and round of fractions to whole numbers,
I could effectively create if conditions in while loops.
Mathematical if statement in couple of forms that were used:
@P88=P88-(2*((INT(P91/P89))*((P87+1)/2)))
@P91=P91-((P91)*INT(P91/P89))
@P98=P98+(P80-P98)*((INT(P99/1))*(INT(1/P99)))
@P97=P97+(9-P97)*INT((P88+1)/P88)
Examples of gird patterns for drilling or subprogram, and there possible optimization.
Small white blocks can be sub programs or drill commands.
This shows drill patterns for holes and there optimization when there more than one drilling pattern.
This shows drill patterns for holes and there optimization when there more than one drilling pattern.
Screen Shot of a Drill Pattern using this program.
Screen Shot of CD-Case drill whole pattern for plastic slide plat.
Its optimized for speed and simple altering of board size parameters.
Because this pattern has to run hundreds of times for single 1.5m bookcase.
.