De komende 3 weken staan beide CNC machines 60 uur per week te frezen voor een spoedklus: Het frezen van 7000 behuizingen uit 24 mm multiplex.
Mooie klus maar wel met een risico: frees breuk en dus een halve plaat weg gooien.
Ik heb een ATC die automatisch de hoogte van de tool inmeet, deze lengtes staan in de tooltabel.
Eigenlijk wil ik dus aan het begin van een toolwissel eerst de huidige tool controleren of deze nog even lang is. Stel je wisselt 2 frezen bij de klus dan zou ik graag het volgende willen:
M6 TX ->
Lengte van huidige tool opmeten en vergelijken met de tooltabel (+/- wat speling voor meetfouten) ->
Tool wegzetten en volgende pakken ->
Lekker programma afwerken
En het truckje herhalen:
M6 TX ->
Lengte van huidige tool opmeten en vergelijken met de tooltabel (+/- wat speling voor meetfouten) ->
Tool wegzetten en volgende pakken ->
Lekker programma afwerken
Hiermee controleert de machine na elke bewerking dus even of de frees nog heel is. Wellicht is het wat overdreven voorzichtig maar als het niet zo moeilijk is en het kost maar 15 seconden dan kan het veel tijd/geld schelen.
Wat vinden jullie van dit idee en zijn er mensen die weten hoe je dit zou moeten programmeren? Ik kan zelf wel wat dingen aanpassen in de marco maar echt zelf programmeren is helaas niet aan mij besteed.
Code: Selecteer alles
sub change_tool
; only perform toolchange while not rendering
if [#5397 == 0]
; check tool in spindle and exit sub
If [ [#5011] <> [#5008] ]
;Switch off guard for tool change area collision
TCAGuard off
;Check ZHeight comp and switch off when on, remember the state in #5019
;#5051 indicates that ZHeight comp is on
#5019 = #5051
if [#5019 == 1]
ZHC off
endif
;brush up
M55 P2
;wait .5 second before reading brush up signal
G4 P0.5
;check is brush up signal is active
M56 P2
if [#5399 == 1]
ErrMsg "ERROR: timeout waiting for brush up signal"
Endif
gosub spindle_off
;Use #5015 to indicate succesfull toolchange
#5015 = 0 ; Tool change not performed
G49 ; set tool length compensation off
if [ [[#5011> 32] or [#5011 < 21]] and [#5011 <> 0] ] Hoe tool nul toevoegen?
errmsg "Please select a tool from 21 to 32 or tool 0."
else
;Drop current tool
If [[#5008] == 0]
GoSub DropTool0
endif
If [[#5008] == 21]
GoSub DropTool21
endif
If [[#5008] == 22]
GoSub DropTool22
endif
If [[#5008] == 23]
GoSub DropTool23
endif
If [[#5008] == 24]
GoSub DropTool24
endif
If [[#5008] == 25]
GoSub DropTool25
endif
If [[#5008] == 26]
GoSub DropTool26
endif
If [[#5008] == 27]
GoSub DropTool27
endif
If [[#5008] == 28]
GoSub DropTool28
endif
If [[#5008] == 29]
GoSub DropTool29
endif
If [[#5008] == 30]
GoSub DropTool30
endif
If [[#5008] == 31]
GoSub DropTool31
endif
If [[#5008] == 32]
GoSub DropTool32
endif
;Pick new tool
if [[#5011] == 0]
GoSub PickTool0
endif
if [[#5011] == 21]
GoSub PickTool21
endif
if [[#5011] == 22]
GoSub PickTool22
endif
if [[#5011] == 23]
GoSub PickTool23
endif
if [[#5011] == 24]
GoSub PickTool24
endif
if [[#5011] == 25]
GoSub PickTool25
endif
if [[#5011] == 26]
GoSub PickTool26
endif
if [[#5011] == 27]
GoSub PickTool27
endif
if [[#5011] == 28]
GoSub PickTool28
endif
if [[#5011] == 29]
GoSub PickTool29
endif
if [[#5011] == 30]
GoSub PickTool30
endif
if [[#5011] == 31]
GoSub PickTool31
endif
if [[#5011] == 32]
GoSub PickTool32
endif
endif
If [[#5015] == 1]
msg "Tool "#5008" Replaced by tool "#5011" G43 switched on"
m6t[#5011]
if [#5011 <> 0]
G43 ;we use tool-length compensation.
else
G49 ;tool length compensation off for tool 0.
endif
else
errmsg "tool change failed"
endif
;Set default motion type to G1
g1
g53 g0 y3100
;Switch on guard for tool change area collision
TCAGuard on
;brush down
M54 P2
;Check if ZHeight comp was on before and switch ON again if it was.
if [#5019 == 1]
ZHC on
endif
else
msg "Tool already in spindle"
#5015 = 1 ;indicate tool change performed
endif
endif
EndSub