Compare commits

...

41 Commits

Author SHA1 Message Date
andrea.villa 1ee22cf974 - Merge branch 'master' into ProbingWithTool
- Prima versione installata in macchina da cliente
2026-04-23 10:55:41 +02:00
andrea.villa a2c3e80b5b Merge remote-tracking branch 'origin/master' into ProbingWithTool 2025-10-21 10:52:35 +02:00
andrea.villa a280c0ea3d Merge branch 'master' into ProbingWithTool 2025-10-08 13:18:56 +02:00
andrea.villa 9f3fbfe597 Merge branch 'master' into ProbingWithTool 2025-09-10 12:13:38 +02:00
andrea.villa eeb9a93132 Aggiornato NGE con Aggregato BH 2025-09-10 11:21:07 +02:00
andrea.villa 76c52eecce Merge branch 'master' into ProbingWithTool 2025-09-10 11:13:07 +02:00
andrea.villa 09aacf8327 - Prima versione funzionante gestione motosega da sotto diretta verso l'alto
- Aggiunto solido collisione a NGE
2025-08-29 15:58:05 +02:00
andrea.villa 9c7e546e47 Merge branch 'develop' into ProbingWithTool 2025-08-28 15:26:00 +02:00
andrea.villa 321a91ae5e Merge remote-tracking branch 'origin/master' into ProbingWithTool 2025-07-23 12:29:53 +02:00
andrea.villa 449f03fb09 - IsToolCompatibleWithProbe spostata in MLDE
- in OnPostApplyMachining si salta risalita se tastatura e utensile già precaricato. NB: serve CAM5 2.7f3
2025-06-30 16:02:09 +02:00
andrea.villa 7c91df35fc - Spostate funzioni da MLPE a MLDE perchè servono anche a MLSE
- In MLSE su lavorazione tastatura, si seleziona utensile di default sul mandrino per calcoli ingombri per paratie
2025-06-27 16:38:57 +02:00
andrea.villa 0d99310258 Cambiati limiti feed massima pinze 2025-06-25 09:58:27 +02:00
andrea.villa 0b49335c8e Corretto calcolo accelerazioni massima/minima 2025-06-25 08:39:01 +02:00
andrea.villa 0d87a703ce Corretto nome file 2025-06-23 17:58:31 +02:00
andrea.villa 475b0a7ebf - Se si mantiene utensile vecchio, allora si ribadiscono i dati vecchi
- Aggiunta lista lavorazioni probing
2025-06-23 15:06:38 +02:00
andrea.villa c54ddd02e9 Disattivazione tastatura spostata prima della risalita a Z massima 2025-06-20 11:39:26 +02:00
andrea.villa fd9314ea5a Aggiunto aggregato BIG per motosega 2025-06-20 10:27:07 +02:00
andrea.villa d075af1a91 Corretta lettura posizione home testa 1 2025-06-18 18:20:59 +02:00
andrea.villa f229fae4d3 Corretto segni movimento pre e post tastatura 2025-06-18 16:58:20 +02:00
andrea.villa 5219330a4d Cambio versione per rilascio a Essetre 2025-06-18 15:26:14 +02:00
andrea.villa fd85570cfd Corretta disattivazione tastatura 2025-06-18 15:21:59 +02:00
andrea.villa 2adb157b28 - Corretto ingombro lavorazione in caso di tastatura
- Migliorie generazione
2025-06-17 18:20:13 +02:00
andrea.villa 5e6121703c - Se tastatura orizzontale, ci si alza sopra pezzo in sicurezza
- Prima versione scrittura macro tastatura
2025-06-17 12:14:34 +02:00
andrea.villa 5316abecf4 In generazione, si seleziona utensile compatibile per tastatura 2025-06-17 10:34:02 +02:00
andrea.villa f958dc8a0a Simulazione con movimenti corretti. 2025-06-16 10:45:48 +02:00
andrea.villa 4989ae5d99 Prima versione funzionante in simulazione 2025-06-13 16:50:55 +02:00
andrea.villa 9ac0aafea0 Aggiunta lavorazione e primi test 2025-06-11 17:30:59 +02:00
andrea.villa 1c047b1890 Aggiunto testa in TC e varie info 2025-06-11 12:37:59 +02:00
andrea.villa 7eea1439c4 Prima versione gestione Probe con utensile dedicato 2025-06-11 11:00:25 +02:00
andrea.villa 7b35cccaf5 Corretto indice faccia e legato al tipo di macchina, carico desto o sinistro. 2025-06-11 10:02:37 +02:00
andrea.villa da6d0bed2a Movimento tastatura aumentato a 20mm. Poi bisognerà metterlo a configurazione 2025-06-11 09:29:08 +02:00
andrea.villa 75ff61f3dc Cambio versione 2025-06-10 10:01:47 +02:00
andrea.villa dba8997045 Quando fa tastatura, si scrivono comandi di start del movimento 2025-06-10 10:01:06 +02:00
andrea.villa 263758a422 Dopo tastatura ci si sposta nel punto delle lavorazione o in Z sopra al pezzo 2025-06-06 12:36:14 +02:00
andrea.villa 1e6bc44019 Tastatore portato a 170 2025-06-06 10:25:09 +02:00
andrea.villa 0909656a6c Azzeramento tastatura con EF0 2025-06-06 10:23:08 +02:00
andrea.villa 23e17d9623 Prima della macro tastatura, si manda la testa nel punto dal quale azionare il tastatore. Per il momento si tasta sempre al centro della trave in altezza se facce verticali, o al centro in larghezza se faccia sopra. La posizione della trave invece è quella di lavorazione. 2025-06-06 09:17:32 +02:00
andrea.villa 7ba04b6e17 - Migliorata gestione presenza Probe
- Probe settato false per default
2025-06-04 15:55:16 +02:00
andrea.villa 67401b8799 Piccola correzione calcolo accelerazioni 2025-06-04 15:46:54 +02:00
andrea.villa 8b9a77cdaf - Allineamento con common ver. 2.7f1
- Gestione parametri accelerazioni pinze
2025-06-04 15:43:07 +02:00
andrea.villa 9662b22f03 Proma versione gestione PROBE 2025-06-04 11:48:35 +02:00
14 changed files with 741 additions and 198 deletions
+3
View File
@@ -49,3 +49,6 @@
[Sawing] [Sawing]
1=Sawing 1=Sawing
[Probing]
1=DTMortise
+11
View File
@@ -0,0 +1,11 @@
-- Probingata.lua by Egaltech s.r.l. 20/06/2025
-- Gestione dati lavorazioni per Travi
-- Tabella per definizione modulo
local ProbingData = {
{ On = true, Name = 'Probing_H1', Type = 'DTMortise'},
{ On = true, Name = 'Probing_H2', Type = 'DTMortise'}
}
---------------------------------------------------------------------
return ProbingData
+329 -167
View File
@@ -27,7 +27,7 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee --EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed --EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed --EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 102000, 20000, 102000) -- feed massima pinze EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 102000, 20000, 155000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
@@ -421,6 +421,7 @@ function OnToolSelect()
if MCH_TP.DIST then EMT.TDIST = EgtTdbGetCurrToolParam( MCH_TP.DIST) end if MCH_TP.DIST then EMT.TDIST = EgtTdbGetCurrToolParam( MCH_TP.DIST) end
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES) EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
EMT.ISPROBING = HeadIsProbe( EMT.HEAD)
end end
end end
@@ -454,6 +455,7 @@ function OnMachiningStart()
local MyParkCSawC2 = GetChainSawCHomeFromVirtualAxis( dPosA) local MyParkCSawC2 = GetChainSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkCSawC2) EmtModifyAxisHome( 'C2', MyParkCSawC2)
end end
-- gestione eventuale lavorazione in doppio -- gestione eventuale lavorazione in doppio
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i') local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
if nDouType == 2 or nDouType == 3 then if nDouType == 2 or nDouType == 3 then
@@ -821,8 +823,8 @@ function OnRapid()
EMT.IPLGL = false EMT.IPLGL = false
MyAdjustLinearAxes() MyAdjustLinearAxes()
EmtAdjustRotaryAxes() EmtAdjustRotaryAxes()
local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2')) local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1 or nHSet == 11, 'C1', 'C2'))
local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2')) local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1 or nHSet == 11, 'B1', 'B2'))
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1 local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
local PrevR2 = EMT.R2p or EMT.R2pp or HomeR2 local PrevR2 = EMT.R2p or EMT.R2pp or HomeR2
EmtResetPrev() EmtResetPrev()
@@ -832,6 +834,101 @@ function OnRapid()
EMT.L3 = EMT.L3s EMT.L3 = EMT.L3s
end end
end end
-- se tastatore
if EMT.ISPROBING then
local nSetHead = GetHeadSet( EMT.HEAD)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
local idProbeMachining = EMT.MCHID
local bFound = false
local nProbeHead = GetHeadSet( EMT.HEAD)
local idProbeNextMachining = EgtGetNextActiveOperation( idProbeMachining)
while not bFound do
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
local sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
if sToolNameNextProbe then
local sToolHeadNextProbe, sToolTcPosNextProbe = GetToolHead( sToolNameNextProbe)
local nToolHead = GetHeadSet( sToolHeadNextProbe)
-- se sono sulla stessa testa
if bIsFirstHead and nProbeHead == 11 then
EMT.PROBENEXTTOOL_H1 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H1 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H1 = sToolTcPosNextProbe
bFound = true
elseif not bIsFirstHead and nProbeHead == 21 then
EMT.PROBENEXTTOOL_H2 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H2 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H2 = sToolTcPosNextProbe
bFound = true
end
end
else
break
end
idProbeNextMachining = EgtGetNextActiveOperation( idProbeNextMachining)
end
-- ripristino lavorazione corrente
EgtSetCurrMachining( EMT.MCHID)
local bChanged = true
if bIsFirstHead then
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H1, EMT.TOOL) then
EMT.TCPOS = EMT.PROBENEXTTCPOS_H1
EMT.HEAD = EMT.PROBENEXTHEAD_H1
EMT.TOOL = EMT.PROBENEXTTOOL_H1
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H1, EMT.TOOL) then
bChanged = false
EMT.TCPOS = EMT.PREVTCPOS_H1
EMT.HEAD = EMT.PREVHEAD_H1
EMT.TOOL = EMT.PREVTOOL_H1
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos1
EMT.TOOL = GetToolNameFromTcPos( DefTcPos1)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
end
else
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H2, EMT.TOOL) then
EMT.TCPOS = EMT.PROBENEXTTCPOS_H2
EMT.HEAD = EMT.PROBENEXTHEAD_H2
EMT.TOOL = EMT.PROBENEXTTOOL_H2
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H2, EMT.TOOL) then
bChanged = false
EMT.TCPOS = EMT.PREVTCPOS_H2
EMT.HEAD = EMT.PREVHEAD_H2
EMT.TOOL = EMT.PREVTOOL_H2
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos2
EMT.TOOL = GetToolNameFromTcPos( DefTcPos2)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
-- se prima lavorazione -- se prima lavorazione
if EMT.LOAD then if EMT.LOAD then
EMT.V2POS = ParkV2 EMT.V2POS = ParkV2
@@ -1189,8 +1286,8 @@ function OnRapid()
EMT.TO_XHOME = nil EMT.TO_XHOME = nil
EMT.L1pp = nil EMT.L1pp = nil
EMT.L3pp = nil EMT.L3pp = nil
PrevR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2')) PrevR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1 or nHSet == 11, 'C1', 'C2'))
PrevR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2')) PrevR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1 or nHSet == 11, 'B1', 'B2'))
end end
-- calcolo Movimento Pinze (potrebbe richiedere movimento testa in Home) -- calcolo Movimento Pinze (potrebbe richiedere movimento testa in Home)
for i = 1, #EMT.AUXCMD do for i = 1, #EMT.AUXCMD do
@@ -1205,7 +1302,7 @@ function OnRapid()
local nPrevHSet = GetHeadSet( EMT.PREVHEAD) local nPrevHSet = GetHeadSet( EMT.PREVHEAD)
-- vado in parcheggio sempre con utensile precedente -- vado in parcheggio sempre con utensile precedente
if not HeadIsChainSaw( EMT.PREVHEAD) then if not HeadIsChainSaw( EMT.PREVHEAD) then
if nPrevHSet == 1 then if nPrevHSet == 1 or nPrevHSet == 11 then
local HomeX1 = EgtGetAxisHomePos( 'X1') local HomeX1 = EgtGetAxisHomePos( 'X1')
EmitMoveDataHead( 1, { X=-EMT.PREVHOMEX_H1, Z=MaxZ1, B=EMT.PREVHOMEB_H1, C=EMT.PREVHOMEC_H1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)}) EmitMoveDataHead( 1, { X=-EMT.PREVHOMEX_H1, Z=MaxZ1, B=EMT.PREVHOMEB_H1, C=EMT.PREVHOMEC_H1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1, 'EA1') EmitMoveStartHead( 1, 'EA1')
@@ -1580,81 +1677,89 @@ function OnRapid()
EMT.ZMAX = false EMT.ZMAX = false
-- se standard -- se standard
elseif EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then elseif EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then
local sPostMove = '' if EMT.ISPROBING then
if EMT.MCHFIRST then -- emetto movimenti in Zero macchina
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']') EmitMoveDataHead( GetHeadSet( EMT.HEAD), { X=-EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
if EMT.DOU_TYPE then sOut = sOut .. ' Double' end EmitMoveStartHead( GetHeadSet( EMT.HEAD))
EmtOutput( '( *** '..sOut..' *** )') EmitMoveWaitHead( GetHeadSet( EMT.HEAD))
-- gestione comandi rulli
local sPreMove = ''
if GetV1ToCloseNum( true) then
sPostMove = ' EC-3'
else
sPreMove = ' EC3'
end
if GetV2ToCloseNum( true) then
sPostMove = sPostMove .. ' ED-3'
else
sPreMove = sPreMove .. ' ED3'
end
-- comandi rulli prima di movimento (aperture)
if #sPreMove > 0 then
EmtOutput( 'G157 EA2' .. sPreMove)
end
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut', 1, true) then
EmtOutput( 'M175')
end
EMT.MCHFIRST = false
EMT.PLANEACTIVE = true
end
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- se lavorazione in doppio
if EMT.DOU_TYPE == 2 then
-- aggiusto assi
EMT.L2 = -EMT.L2
-- emetto movimenti in Zero macchina
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12', 1, 1.65)
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 1)
local dX2 = - ( Delta2TabY - EMT.DOU_TLEN - ( -DeltaTabY - EMT.L2 - EMT.TLEN + EgtIf( BD.RIGHT_LOAD, -EMT.HB, EMT.HB)))
local dZ2 = -Head2Z + MillOffs - Mill2Offs + EMT.L3
local dC2 = -EMT.R1
local dB2 = -EMT.R2
EmitMoveDataHead( 2, { X=dX2, Z=dZ2, B=dB2, C=dC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
EmitMoveStartHead( 2)
-- aspetto esecuzione movimento testa 2 e 1
EmitMoveWaitHead( 2)
EmitMoveWaitHead( 1)
-- ripristino assi
EMT.L2 = -EMT.L2
end
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- forzo successiva emissione assi rotanti
EMT.R1p = nil
EMT.R2p = nil
else else
MyAdjustLinearAxes() local sPostMove = ''
EmtAdjustRotaryAxes() if EMT.MCHFIRST then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']')
if EMT.DOU_TYPE then sOut = sOut .. ' Double' end
EmtOutput( '( *** '..sOut..' *** )')
-- gestione comandi rulli
local sPreMove = ''
if GetV1ToCloseNum( true) then
sPostMove = ' EC-3'
else
sPreMove = ' EC3'
end
if GetV2ToCloseNum( true) then
sPostMove = sPostMove .. ' ED-3'
else
sPreMove = sPreMove .. ' ED3'
end
-- comandi rulli prima di movimento (aperture)
if #sPreMove > 0 then
EmtOutput( 'G157 EA2' .. sPreMove)
end
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut', 1, true) then
EmtOutput( 'M175')
end
EMT.MCHFIRST = false
EMT.PLANEACTIVE = true
end end
-- emissione movimento -- se necessario, impostazione riferimento locale
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3').. if EMT.REFLOC == 0 then
EmtGetAxis('R2')..EmtGetAxis('R1') -- se lavorazione in doppio
-- comandi rulli dopo movimento (chiusure) if EMT.DOU_TYPE == 2 then
EmtOutput( sOut) -- aggiusto assi
if #sPostMove > 0 then EMT.L2 = -EMT.L2
EmtOutput( 'G157 EA2' .. sPostMove) -- emetto movimenti in Zero macchina
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12', 1, 1.65)
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 1)
local dX2 = - ( Delta2TabY - EMT.DOU_TLEN - ( -DeltaTabY - EMT.L2 - EMT.TLEN + EgtIf( BD.RIGHT_LOAD, -EMT.HB, EMT.HB)))
local dZ2 = -Head2Z + MillOffs - Mill2Offs + EMT.L3
local dC2 = -EMT.R1
local dB2 = -EMT.R2
EmitMoveDataHead( 2, { X=dX2, Z=dZ2, B=dB2, C=dC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
EmitMoveStartHead( 2)
-- aspetto esecuzione movimento testa 2 e 1
EmitMoveWaitHead( 2)
EmitMoveWaitHead( 1)
-- ripristino assi
EMT.L2 = -EMT.L2
end
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR
..EgtIf( nHSet~=2 and nHSet~=22, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- forzo successiva emissione assi rotanti
EMT.R1p = nil
EMT.R2p = nil
else
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
end
-- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
-- comandi rulli dopo movimento (chiusure)
EmtOutput( sOut)
if #sPostMove > 0 then
EmtOutput( 'G157 EA2' .. sPostMove)
end
end end
-- se altrimenti risalita a Z max a fine lavorazione -- se altrimenti risalita a Z max a fine lavorazione
elseif EMT.FLAG == 3 then elseif EMT.FLAG == 3 then
@@ -1669,12 +1774,15 @@ function OnRapid()
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT ( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
local CurrL3o = EMT.L3o local CurrL3o = EMT.L3o
EMT.L3o = EMT.L3op EMT.L3o = EMT.L3op
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, EMT.MCHSPLIT) local bZMax = EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, EMT.MCHSPLIT)
EMT.L3o = CurrL3o EMT.L3o = CurrL3o
-- aggiorno quota finale trave dopo Zmax -- aggiorno quota finale trave dopo Zmax
EMT.L1o = EMT.TPOS EMT.L1o = EMT.TPOS
EMT.ZMAX = true if bZMax then
ToolPreSelectionSingleHead( EMT.MCHID) EMT.ZMAX = true
ToolPreSelectionSingleHead( EMT.MCHID)
end
-- se altrimenti movimento in Home -- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then elseif EMT.FLAG == 4 then
-- non previsto -- non previsto
@@ -1689,86 +1797,111 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnLinear() function OnLinear()
-- se necessario, impostazione riferimento locale -- se tastatore
if EMT.REFLOC == 0 then if EMT.ISPROBING then
-- gruppo della testa if not EMT.PROBE then
local nHSet = GetHeadSet( EMT.HEAD) local p3FirstPoint = Point3d( EMT.L1, EMT.L2, EMT.L3)
-- calcolo per piano generico local p3SecondPoint = Point3d( EMT.L1p, EMT.L2p, EMT.L3p)
CalcInterpPlane() local dProbingDist = dist( p3FirstPoint, p3SecondPoint) * 2
EMT.REFLOC = 1 local vtE = Vector3d( EMT.EXTR)
-- salvo posizione attuale local sFace, ProbePosZ
local OldL1 = EMT.L1 if AreSameVectorApprox( vtE, Y_AX()) then
local OldL2 = EMT.L2 sFace = EgtIf( BD.RIGHT_LOAD, 4, 2)
local OldL3 = EMT.L3 elseif AreSameVectorApprox( vtE, -Y_AX()) then
-- imposto posizione precedente (non contiene l'offset in X per sovramateriale di testa EMT.X_OFF) sFace = EgtIf( BD.RIGHT_LOAD, 2, 4)
EMT.L1 = EMT.L1o elseif AreSameVectorApprox( vtE, Z_AX()) then
EMT.L2 = EMT.L2o sFace = 3
EMT.L3 = EMT.L3o else
-- trasformo i punti nel piano error( "PROBING DIRECTION NOT MANAGED")
end
local sProbeHead = ' ET' .. GetHeadSet( EMT.HEAD)
EmtOutput( 'G145 Z-'.. EgtNumToString( dProbingDist).. ' EF'..sFace..sProbeHead)
-- tastatura attivata
EMT.PROBE = true
end
else
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- salvo posizione attuale
local OldL1 = EMT.L1
local OldL2 = EMT.L2
local OldL3 = EMT.L3
-- imposto posizione precedente (non contiene l'offset in X per sovramateriale di testa EMT.X_OFF)
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR
..EgtIf( nHSet~=2 and nHSet~=22, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
-- aggiorno precedenti
EMT.MOVE = 0
EmtUpdatePrev()
EMT.MOVE = 1
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
end
-- aggiustamento valori
MyAdjustLinearAxes() MyAdjustLinearAxes()
EmtAdjustRotaryAxes() EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
EMT.PLANEACTIVE = true
-- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
-- aggiorno precedenti
EMT.MOVE = 0
EmtUpdatePrev()
EMT.MOVE = 1
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
end
-- aggiustamento valori -- se lavorazione in doppio e fondo foro, inverto movimento punta doppia
MyAdjustLinearAxes() local bDouHoleBott = ( EMT.MCHTYPE == MCH_MY.DRILLING and EMT.DOU_TYPE == 2 and EMT.FLAG == 101)
EmtAdjustRotaryAxes() if bDouHoleBott then
EmtOutput( "G157 EE-1")
-- se lavorazione in doppio e fondo foro, inverto movimento punta doppia
local bDouHoleBott = ( EMT.MCHTYPE == MCH_MY.DRILLING and EMT.DOU_TYPE == 2 and EMT.FLAG == 101)
if bDouHoleBott then
EmtOutput( "G157 EE-1")
end
-- valori degli assi
local sL1, bL1 = EmtGetAxis( 'L1')
local sL2, bL2 = EmtGetAxis( 'L2')
local sL3, bL3 = EmtGetAxis( 'L3')
local sR1, bR1 = EmtGetAxis( 'R1')
local sR2, bR2 = EmtGetAxis( 'R2')
local sAxes = sL1 .. sL2 .. sL3 .. sR2 .. sR1
-- se nulla da emettere, esco
if #sAxes == 0 then return end
-- arresto preciso in angoli di fresature per utensili (non penne) di piccolo diametro
local sSlowDown = ''
if EMT.MCHTYPE == MCH_MY.MILLING and EMT.TTOTDIAM < 15 and abs( EMT.S) > 1000 and ( bL1 or bL2) and not bL3 then
sSlowDown = ' G9'
end
-- aggiungo feed
local sFeed = EmtGetFeed()
-- emetto linea
EmtOutput( "G1"..sSlowDown..sAxes..sFeed)
-- se lavorazione in doppio e fondo foro, muovo punta 2 e poi ripristino movimento standard punta doppia
if bDouHoleBott then
if EMT.DOU_TYPE == 2 or EMT.DOU_TYPE == 3 then
local dZ = 2 * EMT.L3p - EMT.L3
EmtOutput( "G1 Z" .. EgtNumToString( dZ, 3))
EmtOutput( "G1 Z" .. EgtNumToString( EMT.L3p, 3))
end end
EmtOutput( "G157 EE1")
end
-- aggiorno valori come precedenti -- valori degli assi
EMT.TPOS = EMT.L1o local sL1, bL1 = EmtGetAxis( 'L1')
EmtUpdatePrev() local sL2, bL2 = EmtGetAxis( 'L2')
local sL3, bL3 = EmtGetAxis( 'L3')
local sR1, bR1 = EmtGetAxis( 'R1')
local sR2, bR2 = EmtGetAxis( 'R2')
local sAxes = sL1 .. sL2 .. sL3 .. sR2 .. sR1
-- se nulla da emettere, esco
if #sAxes == 0 then return end
-- arresto preciso in angoli di fresature per utensili (non penne) di piccolo diametro
local sSlowDown = ''
if EMT.MCHTYPE == MCH_MY.MILLING and EMT.TTOTDIAM < 15 and abs( EMT.S) > 1000 and ( bL1 or bL2) and not bL3 then
sSlowDown = ' G9'
end
-- aggiungo feed
local sFeed = EmtGetFeed()
-- emetto linea
EmtOutput( "G1"..sSlowDown..sAxes..sFeed)
-- se lavorazione in doppio e fondo foro, muovo punta 2 e poi ripristino movimento standard punta doppia
if bDouHoleBott then
if EMT.DOU_TYPE == 2 or EMT.DOU_TYPE == 3 then
local dZ = 2 * EMT.L3p - EMT.L3
EmtOutput( "G1 Z" .. EgtNumToString( dZ, 3))
EmtOutput( "G1 Z" .. EgtNumToString( EMT.L3p, 3))
end
EmtOutput( "G157 EE1")
end
-- aggiorno valori come precedenti
EMT.TPOS = EMT.L1o
EmtUpdatePrev()
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1795,8 +1928,8 @@ function OnArc()
EMT.L2p = nil EMT.L2p = nil
EMT.L3p = nil EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '') local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp()) EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR
EMT.PLANEACTIVE = true ..EgtIf( nHSet~=2 and nHSet~=22, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- emissione movimento -- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3').. local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1') EmtGetAxis('R2')..EmtGetAxis('R1')
@@ -2516,12 +2649,13 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetDiffRotAxAtStart( R1, R2) function GetDiffRotAxAtStart( R1, R2)
local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2')) local nHSet = GetHeadSet( EMT.HEAD)
local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1 or nHSet == 11, 'C1', 'C2'))
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1 local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
if not R1 or not PrevR1 or abs( R1 - PrevR1) > 0.1 then if not R1 or not PrevR1 or abs( R1 - PrevR1) > 0.1 then
return true return true
end end
local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2')) local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1 or nHSet == 11, 'B1', 'B2'))
local PrevR2 = EMT.R2p or EMT.R2pp or HomeR2 local PrevR2 = EMT.R2p or EMT.R2pp or HomeR2
if not R2 or not PrevR2 or abs( R2 - PrevR2) > 0.1 then if not R2 or not PrevR2 or abs( R2 - PrevR2) > 0.1 then
return true return true
@@ -2537,12 +2671,12 @@ function MyAdjustLinearAxes()
if EMT.REFLOC then if EMT.REFLOC then
local vtE local vtE
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H19' then
local dAddLen = EgtIf( EMT.HEAD == 'H12', -SawOffsZ, 0) local dAddLen = EgtIf( EMT.HEAD == 'H12', -SawOffsZ, 0)
local Len = EMT.TLEN + dAddLen + MillOffs local Len = EMT.TLEN + dAddLen + MillOffs
local LenRef = MillOffs local LenRef = MillOffs
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H21' or EMT.HEAD == 'H22' then elseif EMT.HEAD == 'H21' or EMT.HEAD == 'H22' or EMT.HEAD == 'H29' then
local dAddLen = EgtIf( EMT.HEAD == 'H22', -Saw2OffsZ, 0) local dAddLen = EgtIf( EMT.HEAD == 'H22', -Saw2OffsZ, 0)
local Len = EMT.TLEN + dAddLen + Mill2Offs local Len = EMT.TLEN + dAddLen + Mill2Offs
local LenRef = Mill2Offs local LenRef = Mill2Offs
@@ -2563,7 +2697,7 @@ function MyAdjustLinearAxes()
else else
EmtSetLastError( 1211, 'Head not defined ' .. ( EMT.HEAD or '')) EmtSetLastError( 1211, 'Head not defined ' .. ( EMT.HEAD or ''))
end end
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H13' or EMT.HEAD == 'H15' or sHead == 'H17' then if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H13' or EMT.HEAD == 'H15' or sHead == 'H17' or EMT.HEAD == 'H19' then
EMT.L1 = EMT.L1 - vtE:getX() EMT.L1 = EMT.L1 - vtE:getX()
EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY() EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY()
EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ() EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ()
@@ -2772,13 +2906,40 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
if bReset then if bReset then
EmitResetMachining() EmitResetMachining()
end end
if EMT.ISPROBING then
-- se lavorazione successiva con stessa testa non si va a Z massima
local nSetHead = GetHeadSet( EMT.HEAD)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
local sToolNameNextProbe
local idProbeNextMachining = EgtGetNextActiveOperation( EMT.MCHID)
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
EgtSetCurrMachining( EMT.MCHID)
end
if sToolNameNextProbe and bIsFirstHead and EMT.PREVTOOL_H1 == sToolNameNextProbe then
return false
elseif sToolNameNextProbe and not bIsFirstHead and EMT.PREVTOOL_H2 == sToolNameNextProbe then
return false
end
end
-- se tastatura attiva, si disabilita la tastatura
-- gestione eventuale tastatura
local bStopProbing = EgtGetValInNotes( EMT.MCHUSERNOTES, 'PROBE', 'b') or EgtGetValInNotes( EMT.MCHUSERNOTES, 'END-PROBE', 'b')
if bStopProbing then
EmtOutput( 'G145 Z-10 EF0')
end
EMT.PROBE = nil
-- gruppo della testa -- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD) local nHSet = GetHeadSet( EMT.HEAD)
local dXPos = EgtIf( bUsePrevDelta, EMT.L2pp or EMT.L2o, EMT.L2o) local dXPos = EgtIf( bUsePrevDelta, EMT.L2pp or EMT.L2o, EMT.L2o)
-- reset stato di testa in home -- reset stato di testa in home
EMT.XHOME = nil EMT.XHOME = nil
-- se testa 1 -- se testa 1
if nHSet == 1 then if nHSet == 1 or nHSet == 11 then
-- posizioni sicure -- posizioni sicure
local dMaxZ1 = EgtGetAxisMax( 'Z1') local dMaxZ1 = EgtGetAxisMax( 'Z1')
local dSafeX1 = EgtGetAxisHomePos( 'X1') local dSafeX1 = EgtGetAxisHomePos( 'X1')
@@ -2978,6 +3139,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveWaitHead( 2) EmitMoveWaitHead( 2)
end end
end end
return true
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -3007,7 +3169,7 @@ function EmitXhome()
-- gruppo della testa -- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD) local nHSet = GetHeadSet( EMT.HEAD)
-- se testa 1 -- se testa 1
if nHSet == 1 then if nHSet == 1 or nHSet == 11 then
local dMaxZ1 = EgtGetAxisMax( 'Z1') local dMaxZ1 = EgtGetAxisMax( 'Z1')
local dSafeX1 = EgtGetAxisHomePos( 'X1') local dSafeX1 = EgtGetAxisHomePos( 'X1')
local dSafeZ1 = EgtGetAxisHomePos( 'Z1') local dSafeZ1 = EgtGetAxisHomePos( 'Z1')
@@ -3039,7 +3201,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function EmitResetMachining() function EmitResetMachining()
if EMT.PLANEACTIVE then if EMT.PLANEACTIVE and not EMT.ISPROBING then
-- se non sono a Z massima e operatore deve entrare in cabina spango sempre -- se non sono a Z massima e operatore deve entrare in cabina spango sempre
if not EMT.ZMAX and ( GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID)) then if not EMT.ZMAX and ( GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID)) then
EmtOutput( 'M05') EmtOutput( 'M05')
+183 -17
View File
@@ -96,6 +96,10 @@ function OnSimulStart()
if DefTcPos2 then if DefTcPos2 then
LoadFirstTool( 2, DefTcPos2) LoadFirstTool( 2, DefTcPos2)
end end
-- se presenti, nascondo i tastatori
DeactivateProbeTool()
ExecStartHome() ExecStartHome()
-- Se reset o home, esco -- Se reset o home, esco
if EMT.SIM1ST then return end if EMT.SIM1ST then return end
@@ -130,7 +134,8 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'}, { Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'}, { Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}, { Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}} { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM2'}}
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'}) table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'})
@@ -513,9 +518,11 @@ function OnSimulToolSelect( dPosA)
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM) EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES) EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
local nSetHead = GetHeadSet( EMT.HEAD) local nSetHead = GetHeadSet( EMT.HEAD)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
EMT.ISPROBING = HeadIsProbe( EMT.HEAD)
-- se ho due teste, verifico che l'altra sia dalla parte opposta -- se ho due teste, verifico che l'altra sia dalla parte opposta
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
if nSetHead == 1 then if bIsFirstHead then
EgtSetAxisPos( 'X2', MinX2) EgtSetAxisPos( 'X2', MinX2)
else else
EgtSetAxisPos( 'X1', MaxX1) EgtSetAxisPos( 'X1', MaxX1)
@@ -551,6 +558,75 @@ function OnSimulToolSelect( dPosA)
-- Imposto visualizzazione -- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD) EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end end
-- se tastatore
if HeadIsProbe( EMT.HEAD) then
local bChanged = true
if bIsFirstHead then
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H1, EMT.TOOL) then
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
EgtLoadTool( EMT.PROBENEXTHEAD_H1, 1, EMT.PROBENEXTTOOL_H1)
EMT.TCPOS = EMT.PROBENEXTTCPOS_H1
EMT.HEAD = EMT.PROBENEXTHEAD_H1
EMT.TOOL = EMT.PROBENEXTTOOL_H1
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H1, EMT.TOOL) then
bChanged = false
EMT.TCPOS = EMT.PREVTCPOS_H1
EMT.TOOL = EMT.PREVTOOL_H1
EMT.HEAD = EMT.PREVHEAD_H1
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos1
EMT.TOOL = GetToolNameFromTcPos( DefTcPos1)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
end
else
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H2, EMT.TOOL) then
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
EgtLoadTool( EMT.PROBENEXTHEAD_H2, 1, EMT.PROBENEXTTOOL_H2)
EMT.TCPOS = EMT.PROBENEXTTCPOS_H2
EMT.HEAD = EMT.PROBENEXTHEAD_H2
EMT.TOOL = EMT.PROBENEXTTOOL_H2
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H2, EMT.TOOL) then
bChanged = false
EMT.TCPOS = EMT.PREVTCPOS_H2
EMT.TOOL = EMT.PREVTOOL_H2
EMT.HEAD = EMT.PREVHEAD_H2
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos2
EMT.TOOL = GetToolNameFromTcPos( DefTcPos2)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
-- carico utensile, con breve pausa -- carico utensile, con breve pausa
EgtPause( 100) EgtPause( 100)
EgtOutText( '') EgtOutText( '')
@@ -619,10 +695,57 @@ function OnSimulToolDeselect( dPrevA)
LoadNextTool( 2, DefTcPos2) LoadNextTool( 2, DefTcPos2)
end end
end end
-- se presenti, nascondo i tastatori
DeactivateProbeTool()
local bSkipToolChange = false
-- se prossima lavorazione è tastatura, si controlla compatibilità con utensile successivo
if HeadIsProbe( EMT.NEXTHEAD) then
local idProbeMachining = EgtGetNextActiveOperation( EMT.MCHID)
local bFound = false
local nProbeHead = GetHeadSet( EMT.NEXTHEAD)
local idProbeNextMachining = EgtGetNextActiveOperation( idProbeMachining)
while not bFound do
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
local sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
if sToolNameNextProbe then
local sToolHeadNextProbe, sToolTcPosNextProbe = GetToolHead( sToolNameNextProbe)
local nToolHead = GetHeadSet( sToolHeadNextProbe)
-- se sono sulla stessa testa
if nToolHead == 1 and nProbeHead == 11 then
EMT.PROBENEXTTOOL_H1 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H1 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H1 = sToolTcPosNextProbe
bFound = true
elseif nToolHead == 2 and nProbeHead == 21 then
EMT.PROBENEXTTOOL_H2 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H2 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H2 = sToolTcPosNextProbe
bFound = true
end
end
else
break
end
idProbeNextMachining = EgtGetNextActiveOperation( idProbeNextMachining)
end
-- ripristino lavorazione corrente
EgtSetCurrMachining( EMT.MCHID)
if nProbeHead == 11 and not( IsToolCompatibleWithProbe( EMT.PREVTOOL_H1, EMT.TOOL)) then
;
elseif nProbeHead == 21 and not( IsToolCompatibleWithProbe( EMT.PREVTOOL_H2, EMT.TOOL)) then
;
else
bSkipToolChange = true
end
end
-- reset flag sega a catena già depositata -- reset flag sega a catena già depositata
EMT.CHSAW_OUT = nil EMT.CHSAW_OUT = nil
-- se utensile non cambia e non è sega a catena, esco -- se utensile non cambia e non è sega a catena, esco
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end if bSkipToolChange or ( ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD)) then return end
-- deposito utensile -- deposito utensile
EgtOutText( 'Tool change in progress...') EgtOutText( 'Tool change in progress...')
-- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa -- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa
@@ -631,7 +754,7 @@ function OnSimulToolDeselect( dPrevA)
-- se ci sono due teste -- se ci sono due teste
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
local nSetHead = GetHeadSet( EMT.NEXTHEAD) local nSetHead = GetHeadSet( EMT.NEXTHEAD)
if nSetHead == 1 then if nSetHead == 1 or nSetHead == 11 then
-- porto in home testa 1 -- porto in home testa 1
SimulMoveAxis( 'X1', MaxX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', MaxX1, MCH_SIM_STEP.RAPID)
-- deposito utensile fresa -- deposito utensile fresa
@@ -687,7 +810,7 @@ function OnSimulToolDeselect( dPrevA)
if nSetHead == 1 and EMT.PREVHEAD_H1 then if nSetHead == 1 and EMT.PREVHEAD_H1 then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1) local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID)
elseif EMT.PREVHEAD_H2 then elseif nSetHead == 2 and EMT.PREVHEAD_H2 then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end end
end end
@@ -718,7 +841,7 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end end
-- per prossima testa gruppo 1 -- per prossima testa gruppo 1
else elseif nNextSetHead == 1 then
-- visualizzo utensile su TcPos -- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H1, true) ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
-- nascondo l'utensile sulla testa -- nascondo l'utensile sulla testa
@@ -851,6 +974,7 @@ function OnSimulMachiningEnd()
EMT.DOU_TOOL = nil EMT.DOU_TOOL = nil
-- salvo dati utensile -- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD) local nSetHead = GetHeadSet( EMT.HEAD)
-- se non ho già tolto la sega a catena, aggiorno valori -- se non ho già tolto la sega a catena, aggiorno valori
if not EMT.CHSAW_OUT then if not EMT.CHSAW_OUT then
-- per gruppo testa 1 -- per gruppo testa 1
@@ -1657,16 +1781,50 @@ function ExecMoveZmax( bMchSplit, btoXHome)
-- set della testa -- set della testa
local nSetHead = GetHeadSet( EMT.HEAD) local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 0 then return end if nSetHead == 0 then return end
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
if EMT.ISPROBING then
-- se lavorazione successiva con stessa testa non si va a Z massima
local sToolNameNextProbe
local idProbeNextMachining = EgtGetNextActiveOperation( EMT.MCHID)
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
EgtSetCurrMachining( EMT.MCHID)
end
local bMoveToZMax = true
if sToolNameNextProbe and bIsFirstHead and EMT.PREVTOOL_H1 == sToolNameNextProbe then
bMoveToZMax = false
elseif sToolNameNextProbe and not bIsFirstHead and EMT.PREVTOOL_H2 == sToolNameNextProbe then
bMoveToZMax = false
end
-- se non serve alzarsi
if not bMoveToZMax then
local vtE = Vector3d( EMT.EXTR)
local ProbePosZ
-- ci si riporta in posizione fuori ingombro pezzo
if AreSameVectorApprox( vtE, Y_AX()) or AreSameVectorApprox( vtE, -Y_AX()) then
ProbePosZ = EMT.TABORI1[3] + EMT.SB
if nSetHead == 1 then
SimulMoveAxis( 'Z1', ProbePosZ, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'Z2', ProbePosZ, MCH_SIM_STEP.RAPID)
end
end
return
end
end
-- posizioni correnti degli assi testa -- posizioni correnti degli assi testa
local CurrX = EgtGetAxisPos( EgtIf( nSetHead == 1, 'X1', 'X2')) local CurrX = EgtGetAxisPos( EgtIf( bIsFirstHead, 'X1', 'X2'))
local CurrZ = EgtGetAxisPos( EgtIf( nSetHead == 1, 'Z1', 'Z2')) local CurrZ = EgtGetAxisPos( EgtIf( bIsFirstHead, 'Z1', 'Z2'))
local CurrC = EgtGetAxisPos( EgtIf( nSetHead == 1, 'C1', 'C2')) local CurrC = EgtGetAxisPos( EgtIf( bIsFirstHead, 'C1', 'C2'))
local CurrB = EgtGetAxisPos( EgtIf( nSetHead == 1, 'B1', 'B2')) local CurrB = EgtGetAxisPos( EgtIf( bIsFirstHead, 'B1', 'B2'))
-- posizioni home degli assi testa -- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'X1', 'X2')) local HomeX = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'X1', 'X2'))
local HomeZ = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'Z1', 'Z2')) local HomeZ = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'Z1', 'Z2'))
local HomeC = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'C1', 'C2')) local HomeC = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'C1', 'C2'))
local HomeB = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'B1', 'B2')) local HomeB = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'B1', 'B2'))
-- verifico se necessario ruotare la testa -- verifico se necessario ruotare la testa
local bRot = ( abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1) local bRot = ( abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1)
-- se necessario ruotare la testa, allargo i carrelli -- se necessario ruotare la testa, allargo i carrelli
@@ -1677,7 +1835,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
ExecParkRoller( nil, nil, nil, nil, bMchSplit, bAgg) ExecParkRoller( nil, nil, nil, nil, bMchSplit, bAgg)
end end
-- se testa 1 -- se testa 1
if nSetHead == 1 then if bIsFirstHead then
-- se fresa o lama -- se fresa o lama
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
if not HeadIsChainSaw( EMT.HEAD) then if not HeadIsChainSaw( EMT.HEAD) then
@@ -2520,6 +2678,14 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
return sTool return sTool
end end
---------------------------------------------------------------------
function DeactivateProbeTool()
if Probe then
EgtSetMode( EgtGetHeadId( 'H19') or GDB_ID.NULL, GDB_MD.HIDDEN)
EgtSetMode( EgtGetHeadId( 'H29') or GDB_ID.NULL, GDB_MD.HIDDEN)
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** ESTIMATION T&L *** -- *** ESTIMATION T&L ***
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2944,7 +3110,7 @@ function GetHeadSetFromTcPos( sTcPos)
local TCPOS_2A = {} local TCPOS_2A = {}
local TCPOS_2B = {} local TCPOS_2B = {}
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', '501'}
TCPOS_1B = { 'T101'} TCPOS_1B = { 'T101'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'} TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'}
TCPOS_2B = { 'T111'} TCPOS_2B = { 'T111'}
@@ -2952,7 +3118,7 @@ function GetHeadSetFromTcPos( sTcPos)
TCPOS_1A = { 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} TCPOS_1A = { 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'}
TCPOS_1B = { 'T101', 'T201'} TCPOS_1B = { 'T101', 'T201'}
TCPOS_1C = { 'T301'} TCPOS_1C = { 'T301'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'} TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20', '502'}
end end
for _, sVal in ipairs( TCPOS_1A) do for _, sVal in ipairs( TCPOS_1A) do
if sVal == sTcPos then return 1, 1 end if sVal == sTcPos then return 1, 1 end
+67 -3
View File
@@ -4,6 +4,12 @@
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- Carico libreria -- Carico libreria
local BD = require( 'BeamData') local BD = require( 'BeamData')
@@ -267,6 +273,13 @@ function OnSpecialMoveZup()
EMC.MODIF = true EMC.MODIF = true
end end
end end
elseif HeadIsChainSaw( EMC.HEAD) then
EMC.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if EMC.TDIR[3] < -0.15 and EMC.L3 > - EMC.TTOTLEN then
EMC.L3 = EMC.TTOTLEN * EMC.TDIR[3]
-- dichiaro modificato
EMC.MODIF = true
end
end end
end end
@@ -737,8 +750,48 @@ function OnSpecialApplyMachining()
-- Inizializzo codice di errore -- Inizializzo codice di errore
EMC.ERR = 0 EMC.ERR = 0
-- Recupero la posizione della trave e dei carrelli al termine della precedente operazione -- Recupero la precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID) local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- Se esiste lavorazione precedente ed è una tastatura
if nPrevOpeId and EgtGetOperationType( nPrevOpeId) == MCH_OY.PROBING then
-- se stessa testa e montato già utensile corretto
-- recupero valori assi alla fine della lavorazione precedente e all'inizio della corrente
local vPrevAxes = EmtGetFinalAxesPos( nPrevOpeId, true)
local vCurrAxes = EmtGetInitialAxesPos( EMC.MCHID, true)
-- info lavorazione precedente
EgtSetCurrMachining( nPrevOpeId)
local sPrevTool = EgtGetMachiningParam( MCH_MP.TOOL)
local sPrevHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local nSetHead = GetHeadSet( sPrevHead)
local bPrevIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- info lavorazione corrente
EgtSetCurrMachining( EMC.MCHID)
local sCurrTool = EgtGetMachiningParam( MCH_MP.TOOL)
local sCurrHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
nSetHead = GetHeadSet( sCurrHead)
local bCurrIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- se utensile corrente è compatibile (significa che è già stato precaricato) se stessa testa e con stessa configurazioen assi rotanti, annullo risalita
if IsToolCompatibleWithProbe( sCurrTool, sPrevTool) and bPrevIsFirstHead == bCurrIsFirstHead and abs( vCurrAxes[4] - vPrevAxes[4]) < 1 and abs( vCurrAxes[5] - vPrevAxes[5]) < 1 then
-- in lavorazione precedente elimino eventuale retrazione a Zmax
EmtRemoveRise( nPrevOpeId)
-- in lavorazione corrente elimino eventuale approccio da Zmax
EmtRemoveClimb( EMC.MCHID)
-- prendo sempre la Z massima tra le due
local vClimbPoint
if vCurrAxes[3] - 1.0 < vPrevAxes[3] then
vClimbPoint = vCurrAxes
vCurrAxes[3] = vPrevAxes[3]
elseif vPrevAxes[3] - 1.0 < vCurrAxes[3] then
vClimbPoint = vPrevAxes
vPrevAxes[3] = vCurrAxes[3]
end
EmtAddClimb( EMC.MCHID, vClimbPoint, 4, 1, 0)
end
end
-- Recupero la posizione della trave e dei carrelli al termine della precedente operazione
-- se precedente operazione non esiste, errore -- se precedente operazione non esiste, errore
if not nPrevOpeId then if not nPrevOpeId then
EMC.ERR = 1 EMC.ERR = 1
@@ -896,7 +949,6 @@ function OnSpecialApplyMachining()
local vAxes = EmtGetAxesPos( nLastEntId) local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end if #vAxes > 0 then EMC.TPOS = vAxes[1] end
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1174,6 +1226,17 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end end
-- Recupero testa -- Recupero testa
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sToolName = EgtTdbGetCurrToolParam( MCH_TP.NAME)
local nSetHead = GetHeadSet( sHead)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- se lavorazione di tastatura, si considera montato utensile di default
if HeadIsProbe( sHead) then
local sOtherToolName = GetToolNameFromTcPos( EgtIf( bIsFirstHead, DefTcPos1, DefTcPos2))
local sOtherHeadTool, _ = GetToolHead( sOtherToolName)
EgtLoadTool( sOtherHeadTool, 1, sOtherToolName)
end
-- Recupero valore assi macchina -- Recupero valore assi macchina
local nSecId = EgtGetNext( EgtGetFirstInGroup( nPathId)) local nSecId = EgtGetNext( EgtGetFirstInGroup( nPathId))
local vAxes = EmtGetAxesPos( nSecId) local vAxes = EmtGetAxesPos( nSecId)
@@ -1185,7 +1248,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
-- Calcolo dell'ingombro della testa rispetto allo Zero Macchina -- Calcolo dell'ingombro della testa rispetto allo Zero Macchina
local b3Enc local b3Enc
if sHead ~= 'H21' and sHead ~= 'H22' and sHead ~= 'H23' then if bIsFirstHead then
EgtSetAxisPos( 'C1', vAxes[4]) EgtSetAxisPos( 'C1', vAxes[4])
EgtSetAxisPos( 'B1', vAxes[5]) EgtSetAxisPos( 'B1', vAxes[5])
if sHead == 'H13' or sHead == 'H15' then if sHead == 'H13' or sHead == 'H15' then
@@ -1219,6 +1282,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
local dDistFront = - ptMax:getX() - LoadT - dHeadFront local dDistFront = - ptMax:getX() - LoadT - dHeadFront
local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack
EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3) EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3)
return dDistFront, dDistBack, dRollFront, dRollBack return dDistFront, dDistBack, dRollFront, dRollBack
end end
BIN
View File
Binary file not shown.
+11
View File
@@ -91,11 +91,13 @@ Language1=Italiano,Ita.txt
Language2=English,Eng.txt Language2=English,Eng.txt
[Tools] [Tools]
Probe=1
Drillbit=1 Drillbit=1
Sawblade=1 Sawblade=1
Mill=1 Mill=1
Mortise=1 Mortise=1
Chisel=0 Chisel=0
ProbeMaker=MakeProbe.lua
DrillMaker=MakeWoodDrill.lua DrillMaker=MakeWoodDrill.lua
SawbladeMaker=MakeSawblade.lua SawbladeMaker=MakeSawblade.lua
MillMaker=MakeWoodCylMill.lua MillMaker=MakeWoodCylMill.lua
@@ -114,6 +116,7 @@ H21.1:MILL_NOTIP=MillNoTip.nge
H22.1=Saw.nge H22.1=Saw.nge
[Machinings] [Machinings]
Probing=1
Drilling=1 Drilling=1
Sawing=1 Sawing=1
Milling=1 Milling=1
@@ -126,6 +129,8 @@ SawFinishing=0
[Machining] [Machining]
InitScript=InitMach.lua InitScript=InitMach.lua
ExitScript=ExitMach.lua ExitScript=ExitMach.lua
[Probing]
PrbScript1=StdProbe
[Disposition] [Disposition]
;InitScript=InitDisp.lua ;InitScript=InitDisp.lua
@@ -139,10 +144,14 @@ H12=6615
H13=6616 H13=6616
; Angular transmission ; Angular transmission
H17=6617 H17=6617
; Probe
H19=6618
; Second 5 axis head ; Second 5 axis head
H21=6620 H21=6620
; Second 5 axis saw ; Second 5 axis saw
H22=6623 H22=6623
; Probe
H29=6618
[SetUp] [SetUp]
Default=Standard Default=Standard
@@ -155,3 +164,5 @@ WinPlace=0,514,138,628,810
Enable=1 Enable=1
Save=0 Save=0
[ToolTrace]
Enable=1
+112 -6
View File
@@ -42,9 +42,9 @@
-- Intestazioni -- Intestazioni
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( true)
PP_VER = '3.1c1' PP_VER = '3.1c1_DEV1'
PP_NVER = '3.1.3.1' PP_NVER = '3.1.3.1'
MIN_MACH_VER = '2.5k1' MIN_MACH_VER = '2.5k1'
MACH_NAME = EgtGetCurrMachineName() MACH_NAME = EgtGetCurrMachineName()
@@ -178,6 +178,7 @@ OptimizedLoadBeam = true
AutoRotMinLen = 0 AutoRotMinLen = 0
EstimationRapidMultiplier = 1 EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false ForceToCloseRollersGate = false
Probe = nil
AggreBlockHaus = false AggreBlockHaus = false
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
@@ -271,8 +272,12 @@ if EgtExistsFile( sData) then
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end
if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
if Machine.Offsets.PROBE then Probe = Machine.Offsets.PROBE end -- Tastatore su entrembe le teste. 1 = solo testa 1, 2 = solo testa 2, 3 = entrambe le teste
if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
AngTrBHOffs = Machine.Offsets.OFFSETZ_RINV_BH or AngTrBHOffs AngTrBHOffs = Machine.Offsets.OFFSETZ_RINV_BH or AngTrBHOffs
AngTrBHLen = Machine.Offsets.OFFSETX_RINV_BH or AngTrBHLen AngTrBHLen = Machine.Offsets.OFFSETX_RINV_BH or AngTrBHLen
@@ -349,6 +354,13 @@ EmtAxis {
Home = ParkC1, Home = ParkC1,
Geo = 'C1_AXIS/GEO', Geo = 'C1_AXIS/GEO',
Aux = {'C1_AXIS/SOLID', 'C1_AXIS/COLLISION'}} Aux = {'C1_AXIS/SOLID', 'C1_AXIS/COLLISION'}}
-- se tastatore presente
local sBAxisAuxGeom
if Probe == 1 or Probe == 3 then
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION', 'PROBE_B1/SOLID_PROBE', 'PROBE_B1/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}
end
EmtAxis { EmtAxis {
Name = 'B1', Name = 'B1',
Parent = 'C1', Parent = 'C1',
@@ -359,7 +371,7 @@ EmtAxis {
Stroke = {MinB1, MaxB1}, Stroke = {MinB1, MaxB1},
Home = ParkB1, Home = ParkB1,
Geo = 'B1_AXIS/GEO', Geo = 'B1_AXIS/GEO',
Aux = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}} Aux = sBAxisAuxGeom }
-- Frese -- Frese
local H11Id = EmtHead { local H11Id = EmtHead {
Name = 'H11', Name = 'H11',
@@ -387,6 +399,22 @@ local H12Id = EmtHead {
OthColl = {'B1/SOLID', 'C1/SOLID'}, OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H12_HEAD/GEO'} Geo = 'H12_HEAD/GEO'}
--EgtSetInfo( H12Id, 'ZMAXONROT', '1,190') --EgtSetInfo( H12Id, 'ZMAXONROT', '1,190')
-- Tastatore su testa 1
local H19Id
if Probe == 1 or Probe == 3 then
H19Id = EmtHead {
Name = 'H19',
Parent = 'B1',
HSet = 'H19',
Type = MCH_HT.STD,
Pos = Point3d( -60, -81, 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.2,
Rot2Stroke = { MinB1, MaxB1},
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H19_HEAD/GEO'}
end
-- Sega a catena -- Sega a catena
EmtAxis { EmtAxis {
Name = 'A', Name = 'A',
@@ -466,6 +494,12 @@ local C2Id = EmtAxis {
Home = ParkC2, Home = ParkC2,
Geo = 'C2_AXIS/GEO', Geo = 'C2_AXIS/GEO',
Aux = {'C2_AXIS/SOLID', 'C2_AXIS/COLLISION'}} Aux = {'C2_AXIS/SOLID', 'C2_AXIS/COLLISION'}}
-- se presente tastatore
if Probe == 2 or Probe == 3 then
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION', 'PROBE_B2/SOLID_PROBE', 'PROBE_B2/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}
end
local B2Id = EmtAxis { local B2Id = EmtAxis {
Name = 'B2', Name = 'B2',
Parent = 'C2', Parent = 'C2',
@@ -476,7 +510,7 @@ local B2Id = EmtAxis {
Stroke = {MinB2, MaxB2}, Stroke = {MinB2, MaxB2},
Home = ParkB2, Home = ParkB2,
Geo = 'B2_AXIS/GEO', Geo = 'B2_AXIS/GEO',
Aux = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}} Aux = sBAxisAuxGeom}
local vtMove2 = Vector3d( 0, Head2Y, Head2Z) local vtMove2 = Vector3d( 0, Head2Y, Head2Z)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
@@ -486,6 +520,10 @@ EgtMove( EgtGetFirstNameInGroup( C2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( C2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
if Probe == 2 or Probe == 3 then
EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID_PROBE'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION_PROBE'), vtMove2, GDB_RT.GLOB)
end
-- Frese -- Frese
local H21Id = EmtHead { local H21Id = EmtHead {
Name = 'H21', Name = 'H21',
@@ -514,6 +552,22 @@ if SecondSaw then
Geo = 'H22_HEAD/GEO'} Geo = 'H22_HEAD/GEO'}
--EgtSetInfo( H22Id, 'ZMAXONROT', '1,190') --EgtSetInfo( H22Id, 'ZMAXONROT', '1,190')
end end
-- Tastatore su testa 2
local H29Id
if Probe == 2 or Probe == 3 then
H29Id = EmtHead {
Name = 'H29',
Parent = 'B2',
HSet = 'H29',
Type = MCH_HT.STD,
Pos = Point3d( Head2X - 60, Head2Y - 81, Head2Z + 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.2,
Rot2Stroke = { MinB2, MaxB2},
OthColl = {'B2/SOLID', 'C2/SOLID'},
Geo = 'H29_HEAD/GEO'}
end
-- *** Carrelli *** -- *** Carrelli ***
-- Morse -- Morse
local Y1Id = EmtAxis { local Y1Id = EmtAxis {
@@ -945,8 +999,12 @@ end
function GetHeadSet( sHead) function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
return 1 return 1
elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then elseif sHead == 'H19' then
return 11
elseif sHead == 'H21' or sHead == 'H22' then
return 2 return 2
elseif sHead == 'H29' then
return 21
else else
return 0 return 0
end end
@@ -994,6 +1052,54 @@ function HeadIsChainSaw( sHead)
return ( sHead == 'H13') return ( sHead == 'H13')
end end
---------------------------------------------------------------------
-- Funzione che riconosce testa per tastatore
function HeadIsProbe( sHead)
return ( sHead == 'H19' or sHead == 'H29')
end
---------------------------------------------------------------------
function IsToolCompatibleWithProbe( sToolName, sCurrTool)
local bToolIsCompatible = false
if sToolName then
EgtTdbSetCurrTool( sToolName)
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
local dToolLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if dToolDiam < 100 and dToolLen < 160 then
bToolIsCompatible = true
end
EgtTdbSetCurrTool( sCurrTool)
end
return bToolIsCompatible
end
---------------------------------------------------------------------
function GetToolNameFromTcPos( sTcPos)
local sToolName
-- Carico gli utensili sulle barre portautensili
local vTcPos = EgtGetAllTcPosNames()
if vTcPos then
for i = 1, #vTcPos do
if vTcPos[i] == sTcPos then
local sToolsName = EgtGetToolsInCurrSetupPos( vTcPos[i])
sToolName = sToolsName[1]
end
end
end
return sToolName
end
---------------------------------------------------------------------
function GetToolHead( sToolName)
local sHead
local sCurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
EgtTdbSetCurrTool( sToolName)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
EgtTdbSetCurrTool( sCurrTool)
return sHead, sTcPos
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale -- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
function GetChainSawZHomeFromVirtualAxis( dPosA) function GetChainSawZHomeFromVirtualAxis( dPosA)
@@ -1048,6 +1154,7 @@ function GetZExtra( sHead, dAngV)
return 0 return 0
end end
end end
return 0
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1088,7 +1195,6 @@ function GetPY2Light()
return ( EgtGetInfo( PY2LightId, 'On') == '1') return ( EgtGetInfo( PY2LightId, 'On') == '1')
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina -- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine() function OnResetMachine()
+6
View File
@@ -2,6 +2,9 @@
;Index = Type, Description, Default Value ;Index = Type, Description, Default Value
; Type : b=boolean, d=double, l=lenght, s=string ; Type : b=boolean, d=double, l=lenght, s=string
[Probing]
0=s,Type,Head
[Drilling] [Drilling]
[Sawing] [Sawing]
@@ -13,6 +16,9 @@
3=d,TrimExt,0 3=d,TrimExt,0
4=s,VtFaceUse,0,0,0 4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0 5=s,EdgesFaceUse,0
6=b,PROBE,0
7=b,START-PROBE,0
8=b,END-PROBE,0
[Pocketing] [Pocketing]
0=l,MaxElev,0 0=l,MaxElev,0
+13 -1
View File
@@ -31,6 +31,8 @@ local GS = {}
local PositionTable = {} local PositionTable = {}
local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil) local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil)
local AggreBH = ( EgtGetHeadId( 'H17') ~= nil) local AggreBH = ( EgtGetHeadId( 'H17') ~= nil)
local ProbeFirstHead = ( EgtGetHeadId( 'H19') ~= nil)
local ProbeSecondHead = ( EgtGetHeadId( 'H29') ~= nil)
if SecondSaw then if SecondSaw then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"}, PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"}, {Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
@@ -79,7 +81,17 @@ else
table.insert( PositionTable, {Pos = "Pos21", TcPos = "T201", Head = "H13", Group = "G2"}) table.insert( PositionTable, {Pos = "Pos21", TcPos = "T201", Head = "H13", Group = "G2"})
end end
end end
local UsePositionHead = false -- aggiunta tastatori
if ProbeFirstHead then
local sIndex = EgtNumToString( #PositionTable + 1)
table.insert( PositionTable, {Pos = "Pos"..sIndex, TcPos = "T501", Head = "H19", Group = "G4"})
end
if ProbeSecondHead then
local sIndex = EgtNumToString( #PositionTable + 1)
table.insert( PositionTable, {Pos = "Pos"..sIndex, TcPos = "T502", Head = "H29", Group = "G4"})
end
local UsePositionHead = true
local function IsInGeomSet( ToolHead, PosHead) local function IsInGeomSet( ToolHead, PosHead)
for GsIndex = 1, #GS do for GsIndex = 1, #GS do
Binary file not shown.
Binary file not shown.
+4 -3
View File
@@ -36,6 +36,7 @@
4=s,DOUBLE 4=s,DOUBLE
[MORTISE_STD] [MORTISE_STD]
0=b,MORTISE 0=th,TH,
1=d,STEP 1=b,MORTISE
2=d,SIDESTEP 2=d,STEP
3=d,SIDESTEP
+1
View File
@@ -75,6 +75,7 @@ Versione 2.7g1 (01/07/2025)
Versione 2.7f1 (04/06/2025) Versione 2.7f1 (04/06/2025)
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'. - (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'.
- (GEN) Prima versione gestione tastatore
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052 - (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7e1 (28/05/2025) Versione 2.7e1 (28/05/2025)