Most programmers do not overly consider program restarting when they develop programs. Most will simple include all CNC words and commands necessary to start up the program at the beginning of each tool, even if it means some redundancy in the program. They then expect the setup person or operator to possess the skill required to restart programs (determining and scanning to the correct command in the program and executing from there). But as many CNC-using companies have found out, restart mistakes can be very costly
Unfortunately, it may be impossible to make the process of re-running tools totally fail-safe. Some kind of mistake can always be made, regardless of how simple you make the procedure. But if you're willing to modify the way programs are written - and if your machines have custom macro B - there is a way to dramatically simplify the task. Again, it requires modification to your current programs. If you have but a few programs to run (lots of repeat business), it shouldn't be too bad. Consider this simple program:
O0004
N001 G17 G20 G23
N002 G40 G50 G64
N003 G67 G69 G80
(TEST FOR RESTART HERE)
IF [#500 EQ 0] GOTO 5 (NO RESTART)
IF [#500 EQ 1.0] GOTO 5
IF [#500 EQ 2.0] GOTO 105
IF [#500 EQ 3.0] GOTO 150
IF [#500 EQ 4.0] GOTO 240
#3000 = 100 (BAD RESTART NUMBER)
(CENTER DRILL)
N005 #500 = 0
N008 T01 M06
N010 G54 G90 S1200 M03 T02
N015 G00 X0 Y0 (pt 1)
N020 G43 H01 Z0.1
N025 M08
N030 G01 Z-0.12 F4.0
N035 G00 Z0.1
N040 Y1.125 (pt 2)
N045 G01 Z-0.12
N050 G00 Z0.0
N055 X1.125 Y0 (pt 3)
N050 G01 Z-0.12
N055 G00 Z0.1
N060 X0 Y-1.125 (pt 4)
N065 G01 Z-0.1
N070 G00 Z0.1
N075 X-1.125 Y0 (pt 5)
N080 G01 Z-0.1
N085 G00 Z0.1
N090 G00 Z0.1 M09
N095 G91 G28 Z0 M19
N100 M01
(1.0 DRILL)
N105 #500 = 0
N108 T02 M06
N110 G54 G90 S350 M03 T03
N115 G00 X0 Y0 (pt 1)
N120 G43 H02 Z0.1
N125 M08
N130 G01 Z-0.83 F6.5
N135 G00 Z0.1 M09
N140 G91 G28 Z0 M19
N145 M01
(3/8 DRILL)
N150 #500 = 0
N153 T03 M06
N155 G54 G90 S800 M03 T04
N165 G00 X0 Y1.125 (pt 2)
N170 G43 H03 Z0.1
N175 M08
N180 G01 Z-0.64 F5.0
N185 G00 Z0.1
N190 X1.125 Y0 (pt 3)
N195 G01 Z-0.64
N200 G00 Z0.1
N205 X0 Y-1.125 (pt 4)
N210 G01 Z-0.64
N215 G00 Z0.1
N220 X-1.125 Y0 (pt 5)
N225 G01 Z-0.64
N230 G00 Z0.1 M09
N235 G91 G28 Z0 M19
N240 M01
(3/4 END MILL)
N245 #500 = 0
N248 T04 M06
N250 G54 G90 S450 M03 T01
N255 G00 X0 Y0 (pt 1)
N260 G43 H04 Z0.1
N265 M08
N270 G01 Z-0.25 F50.0
N275 Y0.125 F5.5 (pt 6)
N280 G42 D34 X-0.625 (pt 7)
N285 G02 X0 Y0.75 R0.625 (pt 8)
N290 Y-0.75 R0.75 (pt 9)
N295 Y0.75 R0.75 (pt 8)
N300 X0.625 Y0.125 R0.625 (pt 10)
N305 G01 G40 X0 (pt 6)
N310 G00 Z0.1 M09
N315 G91 G28 Z0 M19
N400 G28 Y0
N405 M30
We're using permanent common variable #500 to specify the station number for the tool at which the program must be restarted (I'm assuming that you'd only be restarting at the beginning of each tool, but similar techniques could be used if you want to restart in the middle of tools).
#500 (or any permanent common variable) can be set manually, just like an offset. With many controls you can even place a message next to this variable on the variables page by giving this command:
SETVN 500 [RESTART TOOL NO.]
Normally the value of #500 will be zero - so the program will run in its normal manner. When a tool must be rerun, the operator simply enters (manually) the restart tool station number in this permanent common variable. The series of IF statements determine which tool is to be rerun and jump to the appropriate command. Note that each tool resets #500 back to zero so the next time the program is run, it will not restart again (unless the operators sets a value in #500.
While there will still be some obstacles to overcome (some tool changers require different restart commands depending upon which tool is currently in the spindle), with a little more work, you should be able to get the needed results.
Comments