2222
« on: February 01, 2007, 04:40:56 AM »
For a first attempt this is very good, I can't find a fault, but I have cleaned it up a bit, I have found that % can cause problems.
When you run the code through Mach3 it will display the tool path that it will cut.
When you cycle through the code the tool path will be drawn on the first part of the path only, It can't draw using the G52 offsets. But it will cut it right.
Graham.
O0001
(GCodeGenericGameBoard - route pockets in flat surface for tiles)
(design parameters used)
#101=3. ( board width )
#102=3. ( board height )
#103=.5 ( left border )
#104=.5 ( right border )
#105=.25 ( top border )
#106=.25 ( bottom border )
#107=.05 ( horizontal divider )
#108=.05 ( vertical divider )
#109=.1 ( depth of pockets )
#111=4 ( rows )
#112=4 ( columns )
#201=.1875 ( cutter size )
#202=.050 ( cutter depth of cut per pass )
#203=6. ( feed rate )
(calculated parameters)
#301=[[#101-#103-#104-[[#111-1]*#107]]/#111] ( pocket width )
#302=[[#102-#105-#106-[[#112-1]*#108]]/#112] ( pocket height )
#311=0
#312=0
(main program - move to start and iterate rows)
f#203
#311=[#103]
#312=[#106]
m98 p1000 l#111
g52 x0 y0
g90
g0 x0 y0
m30
O1000(do a row)
m98 p1100 l#112
#311=[#103]
#312=[#312+#302+#108]
m99
O1100(do a single box within a row)
g52 x#311 y#312 z0
g90
g0 x0 y0
m98 p2000
g90
g0 x0 y0
#311=[#311+#301+#107]
m99
O2000 (do a layer of routing for a box)
#401=[#201/2] ( half the cutter size )
#411=[#301-#401] ( width of path based on cutter size )
#412=[#302-#401] ( height of path based on cutter size )
g91
g0 x#401 y#401
g1 y#412
g1 x#411
g1 y[0-#412]
g1 x[0-#411]
#501=[[#411]-.02] ( left/right pass size )
#502=[[#201]-.02] ( y move each pass )
#503=[FIX[[[#302-.02]/#502]]-1] ( left/right pass count )
g1 x.01 y.01
m98 p2100 l#503
m99
O2100 (do a left/right pass to route the area withing a box)
g91
g1 y#502 ( move to next pass )
g1 x#501 ( do a pass )
#501=[0-#501] ( setup for reverse )
m99