Compare commits

..

118 Commits

Author SHA1 Message Date
andrea.villa 238361859e Merge branch 'develop' 2025-02-04 12:27:08 +01:00
andrea.villa 83613f2fad Piccola modifica nel calcolo posizione dei rulli di pinzaggio. 2025-02-04 12:26:56 +01:00
andrea.villa a28c536971 Merge branch 'main' into develop 2025-02-03 08:46:45 +01:00
andrea.villa 01cb082121 Merge remote-tracking branch 'origin/develop' 2025-02-03 08:46:27 +01:00
andrea.villa 1431cfcee5 Corretta simulazioen che non mandava testa in home in caso di utensile lungo. Generazione era già ok. 2025-02-03 08:46:11 +01:00
andrea.villa 546b3c01ef Merge remote-tracking branch 'origin/main' into develop 2025-01-28 12:01:15 +01:00
andrea.villa d1ac93ff71 Merge commit '15034765ac4542f10b835816dc7d3fd54a24c119' 2025-01-28 12:00:58 +01:00
andrea.villa 15034765ac In MLSE aggiunta piccola correzione quota Z in caso di direzione Z tra 0.5 e 0.707 2025-01-28 12:00:44 +01:00
andrea.villa 9bc55636aa Merge remote-tracking branch 'origin/main' into develop 2025-01-17 09:26:27 +01:00
andrea.villa fd0b0f6093 Merge remote-tracking branch 'origin/develop' 2025-01-17 09:26:06 +01:00
andrea.villa e088be7b1d Corretto primo punto X preselezione utensile 2025-01-17 09:25:57 +01:00
andrea.villa 643188ac75 Piccola correzione posizione X in preselezione utensile 2025-01-15 12:57:35 +01:00
andrea.villa abc95d7b38 Merge branch 'main' into develop 2024-12-19 10:26:38 +01:00
andrea.villa 0310daed48 HOTFIX : corretto posizione Z zero alla selezione dell'utensile in caso di motosega 2024-12-19 10:26:20 +01:00
andrea.villa 67edcfc59b Merge commit '301ff170331694a46aed93badb4169a6bf67d309' into develop 2024-12-18 16:58:54 +01:00
andrea.villa 301ff17033 Merge remote-tracking branch 'origin/develop' 2024-12-18 16:58:40 +01:00
andrea.villa 70cf39d693 Commit per versione 2024-12-18 16:58:17 +01:00
andrea.villa ec0fbde5cc Aggiunta variabile 'SafeX2RotAxis' in sostituzionme della 'ParkMchY2' che era usata impropriamente 2024-12-17 13:33:23 +01:00
andrea.villa 36e3c35e82 Merge remote-tracking branch 'origin/main' into develop 2024-12-17 11:42:43 +01:00
andrea.villa 808456ed60 Merge branch 'develop' 2024-12-17 11:42:23 +01:00
andrea.villa da3f3c0db0 Corretta posizione iniziale testa 2 2024-12-17 11:42:10 +01:00
andrea.villa ad7579e0ae Merge remote-tracking branch 'origin/main' into develop 2024-12-16 13:19:24 +01:00
andrea.villa 0c2b92cd89 HOTFIX : In MLSE ripristinati vecchi valori indici calcolo Z massima 2024-12-16 13:19:06 +01:00
andrea.villa 3c754c329c Merge remote-tracking branch 'origin/main' into develop 2024-12-16 09:50:04 +01:00
andrea.villa f8520a90c3 Merge commit '6e79e47885f2e1c0e1cddf7e237871734f29a6a5' 2024-12-16 09:49:48 +01:00
andrea.villa 6e79e47885 - Corretto scarico utensile se aggregato. Se non presente utensile di default, non seleziona nulla.
- In MLSE ritoccati indici calcolo Z massima. Ticket#2210
2024-12-16 09:49:35 +01:00
andrea.villa eef2b3911f Merge remote-tracking branch 'origin/main' into develop 2024-12-13 17:44:22 +01:00
andrea.villa 2524ba9443 HOTFIX : Corretta chiamata calcolo asse virtuale 2024-12-13 17:44:04 +01:00
andrea.villa ce2887c579 Merge remote-tracking branch 'origin/main' into develop 2024-12-13 17:06:51 +01:00
andrea.villa 77fdc8c12a Merge remote-tracking branch 'origin/develop' 2024-12-13 17:06:33 +01:00
andrea.villa ca86c79672 - Corretto primo movimento in X quando si parte con testa 3. Ticket#2216
- Se su testa 1 c'è un aggregato e si utilizzerà la testa 3, si pscarica aggregato e si prende utensile di default. Ticket#2222
- Durante utilizzo della testa 3, non si preselezionano altre teste. Ticket#2220
- Se lavorazione con testa dedicata lama e su testa 1 c'era aggregato, viene scaricato. Ticket#2216
2024-12-13 17:06:23 +01:00
andrea.villa f8dc3b691a Controllo esistenza terzo asse ausiliario 2024-12-11 17:07:06 +01:00
andrea.villa 2c5a16eeae - Non si fa preselezione se testa 3
- Corretta emissione coordinata rotazione testa 3 in zona sicura
- A fine barra, testa 3 sempre in home
2024-12-11 10:45:31 +01:00
andrea.villa 58b8f07446 Corretta gestione in caso di prima lavorazione con motosega 2024-12-04 08:19:57 +01:00
andrea.villa 4cf4d57d2a Corretto errore di collisione per errata simulazione cambio utensile da lama a motosega 2024-12-03 08:56:55 +01:00
andrea.villa 7e6822b6c6 Gestione aggregato foratore multiplo (H14) 2024-12-02 08:51:59 +01:00
andrea.villa 6920fd4272 Merge branch 'main' into develop 2024-12-02 08:49:49 +01:00
andrea.villa b93a21605d Merge remote-tracking branch 'origin/hotfix/PreselLongToolCorrection' 2024-11-26 15:57:52 +01:00
andrea.villa d22e223017 Corretto controllo preselezione per utensili lunghi 2024-11-26 15:57:39 +01:00
andrea.villa 71875429cd Gestione caricamento utensili in caso di testa con uscita multipla 2024-11-25 16:50:34 +01:00
andrea.villa a005386b7d Merge remote-tracking branch 'origin/main' into develop 2024-11-25 15:59:51 +01:00
andrea.villa 7c208a3c34 Merge branch 'hotfix/PreselLongTools' 2024-11-25 15:59:40 +01:00
andrea.villa 525175586b Se si preseleziona su testa 1 un utensile lungo, non si va alla X successiva di lavoro ma si resta in home. Infatti potrebbe toccare le paratie in caso di scambio pezzo. 2024-11-25 15:59:27 +01:00
andrea.villa 76f2de42d0 Merge remote-tracking branch 'origin/main' into develop 2024-11-04 08:29:47 +01:00
andrea.villa a08cc7ac7e Merge remote-tracking branch 'origin/develop' 2024-11-04 08:29:31 +01:00
andrea.villa a2068fc437 Commit per versione 2024-11-04 08:29:15 +01:00
andrea.villa 46893aed18 Gestione terza testa 5 assi dedicata lama (H38) 2024-10-29 17:24:27 +01:00
andrea.villa dffcc50b34 Merge branch 'main' into develop 2024-10-25 13:01:38 +02:00
andrea.villa 635457269e - Piccola correzione per capire se testa 3 presente
- In caso di lavorazione successiva alla prima, rivisto primo posizionamento alla quota Z di lavoro se precedentemente spostati a quota rotazione assi rotanti
2024-10-25 13:00:57 +02:00
andrea.villa 4fe1fee036 Piccola correzione per capire se testa 3 presente 2024-10-23 10:53:33 +02:00
andrea.villa f51cf52864 Merge branch 'main' into develop 2024-10-23 10:17:07 +02:00
andrea.villa 43b441d069 Merge remote-tracking branch 'origin/develop' 2024-10-23 10:16:56 +02:00
andrea.villa 8a30ac309e - Per movimento a ZMAX si considera utensile attuale o precedente
- Post con gestione 3 testa dedicata lama
2024-10-23 10:16:37 +02:00
andrea.villa 63bba61c19 Aggiunto parametro ParkTc1X1 in MLDE per simulazione quota parcheggio Testa 1 su TC1 2024-10-16 12:01:10 +02:00
andrea.villa 92d983451c Merge remote-tracking branch 'origin/main' into develop 2024-10-01 08:21:58 +02:00
andrea.villa b2ce94eeb3 Merge remote-tracking branch 'origin/develop' 2024-10-01 08:21:32 +02:00
andrea.villa 059e150bb1 Commit per versione 2024-10-01 08:21:18 +02:00
andrea.villa 7c81481da4 Per lavorazione in doppio: messaggio bloccante in caso di extra-corsa durante un movimento standard su piano generico della lavorazione. 2024-09-23 12:42:50 +02:00
andrea.villa 272705acf2 Aggiunta gestione solidi collisione per TC verticali e TC rotante sotto 2024-09-16 12:30:53 +02:00
andrea.villa 709c6ebccf Migliorato calcolo chiusura paratia rulli con aggiornamento lunghezza della barra in caso di ultimo taglio e grezzo residuo in coda 2024-09-12 13:02:26 +02:00
andrea.villa ab03fa02c1 Merge remote-tracking branch 'origin/main' into develop 2024-09-10 10:24:39 +02:00
andrea.villa 4e60812c29 Merge remote-tracking branch 'origin/develop' 2024-09-10 10:24:25 +02:00
andrea.villa 3c8d626277 Commit per versione 2024-09-10 10:24:15 +02:00
andrea.villa f90003d85a se diametro utensile più del truciolatore standard grande, non si preseleziona 2024-09-10 10:23:09 +02:00
andrea.villa 5cc80c6ce7 Merge remote-tracking branch 'origin/main' into develop 2024-08-28 10:00:24 +02:00
andrea.villa 2e2e56b86b Merge branch 'develop' 2024-08-28 10:00:05 +02:00
andrea.villa 344c135410 Primo movimento testa sotto in posizione rotazione assi rotanti dopo eventuale apertura rulli 2024-08-28 09:59:49 +02:00
andrea.villa e4b72f36de Quando si aprono i rulli, se la trave non può seguire i rulli perchè la pinza andrebbe in extra-corsa, si sposta comunque la pinza fino al massimo della sua corsa. 2024-08-07 13:14:34 +02:00
andrea.villa 6cd8cc0aa6 Merge remote-tracking branch 'origin/main' into develop 2024-08-07 09:18:11 +02:00
andrea.villa abeea33183 Corretto chiamata file TPA con nuovo nome 2024-08-07 09:18:00 +02:00
andrea.villa dbc72d38db Merge remote-tracking branch 'origin/main' into develop 2024-08-07 09:09:16 +02:00
andrea.villa 6bef01fec7 Merge remote-tracking branch 'origin/develop' 2024-08-07 09:09:04 +02:00
andrea.villa ae9de373fb Commit per versione 2024-08-07 09:08:49 +02:00
andrea.villa f5d4c8d8b7 - Rinominato file da "Common-" a "Common_" 2024-08-02 09:33:42 +02:00
andrea.villa c577ddf692 Ridotto limite minimo intervallo di pinzaggio 2024-07-30 14:37:49 +02:00
andrea.villa f750918c0e Migliorata gestione riposizionamenti fatta con la 2.6g1 2024-07-30 12:17:11 +02:00
andrea.villa 9fdaeee8d1 Viene ripristinato il tipo di arco corretto 2024-07-29 09:59:21 +02:00
andrea.villa 0041fea1b2 Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco 2024-07-29 09:18:28 +02:00
andrea.villa c3ca7da19c Merge remote-tracking branch 'origin/main' into develop 2024-07-24 13:05:04 +02:00
andrea.villa aea3cf168f Per OnSetHead chiamata da simulazione, aggiunta lettura TOTDIAM. Serve per limitare corse assi testa sotto 2024-07-24 13:04:46 +02:00
andrea.villa aa20eb6959 Merge branch 'main' into develop 2024-07-23 13:13:09 +02:00
andrea.villa 118298e841 Merge remote-tracking branch 'origin/develop' 2024-07-23 13:12:50 +02:00
andrea.villa ffeedc5fd6 Corretta ultima modifica per controllo collisioni testa non utilizzata. Trovava collisioni in lavorazioni in doppio. 2024-07-23 13:12:38 +02:00
andrea.villa 7686361567 Merge remote-tracking branch 'origin/main' into develop 2024-07-22 15:05:23 +02:00
andrea.villa fd1c2d2a21 Piccola correzione controllo collisione 2024-07-22 15:05:06 +02:00
andrea.villa 6ac9b67b8d Merge branch 'main' into develop 2024-07-22 15:00:54 +02:00
andrea.villa 1c1124ac39 Merge remote-tracking branch 'origin/develop' 2024-07-22 15:00:47 +02:00
andrea.villa ce46627885 In caso di grezzo piuttosto piccolo, concesso pinzaggio fino al massimo possibile, oltre al calcolo con coefficienti 2024-07-22 14:53:37 +02:00
andrea.villa 8755104f2f In calcolo pinzaggio al carico, si aggiunge anche alla quota massima l'offset aggiuntivo. 2024-07-22 12:52:02 +02:00
andrea.villa f5669d9e62 Si aggiunge al controllo collisioni anche Tool e ToolHolder della testa non utilizzata 2024-07-19 16:36:02 +02:00
andrea.villa 6560c27fed Merge remote-tracking branch 'origin/main' into develop 2024-07-12 16:21:36 +02:00
andrea.villa 962ea6f461 Corretto movimento testa sotto che andava in collisione tra una lavorazione e la successiva se tra le due c'era un riposizionamento pinze. 2024-07-12 16:21:20 +02:00
andrea.villa a4f8a81186 Merge branch 'main' into develop 2024-07-08 12:38:36 +02:00
andrea.villa e4704572da Corretto movimento che pinzava nel vuoto durante riposizionamento 2024-07-08 12:38:25 +02:00
andrea.villa e1c20e5152 Merge branch 'main' into develop 2024-06-06 16:33:43 +02:00
andrea.villa d3684186c7 Merge branch 'develop' 2024-06-06 16:33:27 +02:00
andrea.villa 69e4539fad Quando si va a ZMAX, si azzerano tutte le coordinate ".pp" 2024-06-06 16:33:18 +02:00
andrea.villa 7d563d06ab Merge branch 'main' into develop 2024-06-03 12:22:42 +02:00
andrea.villa e6fe268062 Merge branch 'develop' 2024-06-03 12:22:37 +02:00
andrea.villa 3854c6a24c Versione 2.6f1 2024-06-03 12:22:26 +02:00
andrea.villa 25bcad240a Migliorata gestione approccio al pezzo con lama aggregato da sotto. Va al minimo in X solo se necessario. 2024-05-29 12:17:36 +02:00
andrea.villa db5230a402 Merge branch 'main' into develop 2024-05-28 09:57:54 +02:00
andrea.villa 7ec4bfd76e Corretta versione 2024-05-28 09:57:43 +02:00
andrea.villa 2d97e2cb51 Merge branch 'develop' 2024-05-28 09:56:55 +02:00
andrea.villa d66abca2e7 - Ripristinato controllo extra-corsa per testa 2
- Corretto movimento testa sotto su prima lavorazione
2024-05-28 09:56:44 +02:00
andrea.villa b65e6f805d Aggiunta possibilità di scrivere nome utensile doppio anche in lavorazione con parametro "TOOLDOUBLE". Note sulla lavorazione hanno precedenza su note utensile. 2024-05-24 11:43:39 +02:00
andrea.villa e18023d094 Merge branch 'main' into develop 2024-05-23 14:44:05 +02:00
andrea.villa bd96eb55e2 Merge branch 'develop' 2024-05-23 14:43:57 +02:00
andrea.villa 73cdbd2df5 Se lavorazione con testa 2 e stesso utensile, piccola correzione che manda a parcheggio se cambiano assi rotanti solo se si trova a ZMAX 2024-05-23 14:43:47 +02:00
andrea.villa b28c999198 Corretta lettura e salvataggio coordinala asse L2 con coordinate rispetto origine. Prima erano locali e sbagliava alcuni calcoli 2024-05-16 15:09:21 +02:00
andrea.villa 44def6c43e Controllo extra-corsa per testa 2 in caso di lavorazioni in doppio in Y 2024-05-15 16:19:03 +02:00
andrea.villa d20c149686 Merge branch 'main' into develop 2024-05-15 13:13:28 +02:00
andrea.villa e6033e1f8d Miglioramento gestione lama su aggregato da sotto 2024-05-15 13:13:08 +02:00
andrea.villa f8974da04c Merge remote-tracking branch 'origin/main' into develop 2024-05-09 12:41:43 +02:00
andrea.villa dcb80bec7c Corretto prelievo lama 2 (H16). Prima di visualizzare utensile, si sposta la Z alla quota massima. 2024-05-09 12:41:32 +02:00
andrea.villa fde0489fe7 Merge branch 'main' into develop 2024-05-06 10:08:11 +02:00
andrea.villa d7f4fb0ef3 In parcheggio paratie/pinze, viene considerato sovramateriale di testa 2024-05-06 10:07:58 +02:00
andrea.villa efa56704d7 Merge branch 'main' into develop 2024-04-30 10:47:14 +02:00
5 changed files with 923 additions and 202 deletions
+401 -108
View File
@@ -128,6 +128,8 @@ function OnToolData()
dAddLen = -SawOffsZ
elseif EMT.HEAD == 'H16' then
dAddLen = -Saw2OffsZ
elseif EMT.HEAD == 'H14' then
dAddLen = 206 -- dimensione aggregato
end
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( dAddLen + EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( dAddLen + EMT.TTOTLEN, 3)
@@ -166,7 +168,7 @@ function OnDispositionStart()
' P15='..EmtLenToString( -DeltaTabY, 2)..' P16='..EmtLenToString( DeltaTabZ - MillOffs, 2)..
' P17='..EmtLenToString( Delta2TabY, 2)..' P18='..EmtLenToString( -Delta2TabZ - Mill2Offs, 2)
-- se è in configurazione a 3 teste
if EgtGetHeadId( 'H31') then
if IsHeadExisting( 3) then
sOut = sOut .. ' P19='..EmtLenToString( -Delta3TabY, 2)..' P20='..EmtLenToString( Delta3TabZ - Mill3Offs, 2)..
' P21='..EmtLenToString( Mill3Offs, 2).. ' P22='.. EmtLenToString( -ParkInLavZ2, 2)
else
@@ -397,6 +399,8 @@ function OnMachiningStart()
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- se sega a catena, aggiusto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H13' then
-- valore dell'asse virtuale
@@ -404,19 +408,34 @@ function OnMachiningStart()
-- imposto home dell'asse C1 (A=0 -> T101, A=90 -> T104)
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
EmtModifyAxisHome( 'C1', MyParkCSawC1)
-- aggregato foratura multipla, aggiusto subito angolo scelto per asse virtuale A
elseif EMT.HEAD == 'H14' then
-- valore dell'asse virtuale
dPosA = GetCurrMultiDrillVirtualAxis()
-- imposto home dell'asse C1 (A=0 -> T121, A=90 -> T124)
local MyParkMultiDrillC1 = GetMultiDrillCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
EmtModifyAxisHome( 'C1', MyParkMultiDrillC1)
-- se lama su aggregato testa sotto, aggiusto subito angolo scelto per asse virtuale A
elseif EMT.HEAD == 'H22' then
-- valore dell'asse virtuale
local dPrevA = dPosA
dPosA = GetCurrSawingVirtualAxis()
-- imposto home dell'asse C2 (A=0 -> T201, A=90 -> T204)
local MyParkCSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkCSawC2)
-- se lavorazione attuale e precedente con lama su aggregato da sotto con angolo A diverso, devo scaricare e ricaricare
if EMT.HEAD == EMT.PREVHEAD_H2 then
if abs( dPosA - dPrevA) > 1 then
EMT.TO_ZMAX = true
EMT.R3_CHANGED = true
end
end
end
-- gestione eventuale lavorazione in doppio
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
if nDouType == 2 or nDouType == 3 then
local sDouTool = EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
local sDouTool = EgtGetValInNotes( EMT.MCHUSERNOTES, 'TOOLDOUBLE', 's') or EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
local sOldTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
if EgtTdbSetCurrTool( sDouTool) and EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
-- salvo dati
@@ -465,18 +484,18 @@ function OnMachiningEnd()
EmitRemark( 'PART UNLOAD')
elseif EMT.AUXTYPE == 'P' then
if EMT.PREROT then
EmitZmax( false, true, EMT.R1, EMT.R2)
EmitZmax( false, true, EMT.R1, EMT.R2, false, false, false)
EMT.ZMAX = true
EmitRemark( 'PART ROTATION')
elseif EMT.FALL then
if EMT.TO_ZMAX and not EMT.ZMAX then
EmitZmax( false, true, EMT.R1, EMT.R2)
EmitZmax( false, true, EMT.R1, EMT.R2, false, false, false)
EMT.ZMAX = true
EMT.TO_ZMAX = nil
end
EmitRemark( 'PART FALL')
else
EmitZmax( false, true, EMT.R1, EMT.R2)
EmitZmax( false, true, EMT.R1, EMT.R2, false, false, false)
EMT.ZMAX = true
EmitRemark( 'PART SPLIT 2')
end
@@ -525,7 +544,10 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = EMT.DOU_TYPE end
EMT.DOU_TYPE = nil
-- se taglio finale, aggiorno lunghezza barra
if EMT.MCHCUT then
EMT.LB = EMT.LT + ( EMT.X_OFF or 0)
end
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
@@ -556,10 +578,12 @@ function OnPathStart()
--MyOutput( 'CNT='.. tostring( EMT.CNT or 0))
-- se utensile non cambiato, salvo eventuali precedenti rotanti
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
EMT.L2pp = EMT.L2op
EMT.L3pp = EMT.L3op
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
else
EMT.L2pp = nil
EMT.L3pp = nil
EMT.R1pp = nil
EMT.R2pp = nil
@@ -575,6 +599,10 @@ function OnPathEnd()
if not EMT.ZMAX then
EmitResetMachining()
end
-- salvo dati precedenti
EMT.L2pp = EMT.L2o
EMT.AUXTYPE = nil
EMT.UNL = nil
EMT.PREROT = nil
@@ -710,9 +738,12 @@ function OnRapid()
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
local bXSpec = EgtIf( BD.RIGHT_LOAD, ( EMT.L2 > -DeltaTabY), ( EMT.L2 < -DeltaTabY))
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MyMaxZ1, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
-- se non è aggregato, posso preselezionare testa e andare in posizione
if EMT.HEAD ~= 'H13' and EMT.HEAD ~= 'H14' then
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MyMaxZ1, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
-- se necessario allargo le cabine
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
@@ -738,6 +769,9 @@ function OnRapid()
-- se sega a catena
if EMT.HEAD == 'H13' then
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=HomeZ1, B=HomeR2, C=HomeR1, TRad=dTRad, TLen=dTLen, S=Speed})
-- aggregato foratore multiplo
elseif EMT.HEAD == 'H14' then
EmitMoveDataHead( 1, { X=-ParkMultiDrillX1, Z=HomeZ1, B=HomeR2, C=HomeR1, TRad=dTRad, TLen=dTLen, S=Speed})
-- utensili standard
else
-- utensili lunghi
@@ -805,12 +839,20 @@ function OnRapid()
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=MinX2, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
EmitMoveDataHead( 2, { X=ParkSawX2, Z=ParkZ2, B=0, C=ParkC2, S=Speed})
EMT.L2pp = ParkSawX2
else
EmitMoveDataHead( 2, { X=ParkX2, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
EMT.L2pp = ParkX2
end
else
EmitMoveDataHead( 2, { X=ParkX2, S=Speed})
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=ParkSawX2, S=Speed})
EMT.L2pp = ParkSawX2
else
EmitMoveDataHead( 2, { X=ParkX2, S=Speed})
EMT.L2pp = ParkX2
end
end
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
@@ -821,8 +863,19 @@ function OnRapid()
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, bSplitCut)
end
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, C=EMT.R1, S=Speed})
-- vado a quota sicurezza in X per permettere rotazione assi rotanti
if ( not EMT.L2pp or ( EMT.L2pp and EMT.L2pp > SafeX2RotAxis)) and ( ParkB2 ~= EMT.R2 or ParkC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=SafeX2RotAxis, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
end
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.HEAD == 'H22' and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { B=EMT.R2, C=EMT.R1, S=Speed})
end
if EMT.ZMAX then
EmitMoveDataHead( 2, { X=EMT.L2, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
end
EmitMoveStartHead( 2)
-- eventuale preselezione successiva testa 1
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
@@ -832,11 +885,12 @@ function OnRapid()
else
-- selezione testa (posso muovere X solo a Zmax)
local MaxZ3 = EgtGetAxisMax( 'Z3')
local MyParkX3 = EgtGetAxisHomePos( 'X3')
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 3, { X=EMT.L2, Z=MaxZ3, B=ParkB3, C=0, S=Speed})
EmitMoveDataHead( 3, { X=MyParkX3, Z=MaxZ3, B=ParkB3, C=ParkC3, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=MaxZ3, S=Speed})
EmitMoveDataHead( 3, { X=MyParkX3, Z=MaxZ3, S=Speed})
end
EmitMoveStartHead( 3)
EmitMoveWaitHead( 3)
@@ -849,13 +903,42 @@ function OnRapid()
end
-- eseguo movimenti
local Speed = EMT.S
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
-- se gruppo lama dedicato, senza cambio utensile
elseif EgtGetHeadId( 'H38') then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
EmitMoveDataHead( 3, { X=-SafeX3RotAxis, S=Speed})
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
if ( EMT.L3 - SafeZ3RotAxis) > 100 * GEO.EPS_SMALL then
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
end
EmitMoveDataHead( 3, { X=EMT.L2, S=Speed})
end
-- muovo in posizione finale
EmitMoveDataHead( 3, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
-- errore, testa non gestita
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
-- dati aggancio a trave
local BhData = { T=EMT.L1, SetHead=0}
@@ -899,7 +982,7 @@ function OnRapid()
EmitParkedLines()
-- se sfrido grande, emetto comando speciale
if EMT.HOVM > 99 then
if EgtGetHeadId( 'H31') then
if IsHeadExisting( 3) then
MyOutput( 'M107')
else
MyOutput( ';M107')
@@ -909,7 +992,18 @@ function OnRapid()
else
--MyOutput( string.format( 'V1Pos=%.3f V2Pos=%.3f', EMT.V1POS, EMT.V2POS))
if not EMT.RELOAD and not EMT.ZMAX and #EMT.AUXCMD > 0 and EMT.TO_ZMAX then
EmitZmax( false, false, PrevR1, PrevR2)
-- caso speciale in cui bisogna solo cambiare presa aggregato lama sotto
if EMT.R3_CHANGED then
-- EmitZmax è fatta per essere chiamata con utensile attuale. In questo caso l'attuale è già quello con nuova rotazione
-- Allora salvo l'attuale e imposto il vecchio solo momentanemente, per poi ripristinarlo
local sBckTcPos = EMT.TCPOS
EMT.TCPOS = EMT.PREVTCPOSREAL_H2
EmitZmax( false, false, PrevR1, PrevR2, false, false, true)
EMT.TCPOS = sBckTcPos
EMT.R3_CHANGED = nil
else
EmitZmax( false, false, PrevR1, PrevR2, false, false, true)
end
EMT.ZMAX = true
EMT.TO_ZMAX = nil
PrevR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
@@ -946,7 +1040,7 @@ function OnRapid()
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut', 1, true) then
-- se sfrido grande, emetto comando speciale
if EMT.LB - EMT.LT > 99 then
if EgtGetHeadId( 'H31') then
if IsHeadExisting( 3) then
MyOutput( 'M107')
else
MyOutput( ';M107')
@@ -987,9 +1081,20 @@ function OnRapid()
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- caso standard
else
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
-- se ero in posizione speciale, prima ruoto poi scendo
if bXSpec then
local dZPos = max( HomeZ1, EMT.L3)
EmitMoveDataHead( 1, { Z=dZPos, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
if abs( dZPos - EMT.L3) > 1 then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
else
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
end
end
-- altrimenti sega a catena
else
@@ -1069,7 +1174,7 @@ function OnRapid()
local CurrC2 = PrevR1
local dSafeZ2 = EgtGetAxisHomePos( 'Z2')
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H22', 1, 1.65)
if not EMT.L2p then EMT.L2p = EgtGetAxisHomePos( 'X2') end
if not EMT.L2pp then EMT.L2pp = EgtGetAxisHomePos( 'X2') end
-- calcolo posizione reale
EMT.TCPOSREAL = 'T' .. AdjustTcPos( false, EMT.TCPOS, EMT.R3)
-- se utensile cambiato (controllo il reale perchè per aggregato dipende come è stato caricato)
@@ -1078,34 +1183,48 @@ function OnRapid()
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=MinX2, Z=-CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
EmitMoveDataHead( 2, { X=ParkSawX2, Z=-dSafeZ2, B=0, C=CurrC2, S=Speed})
EMT.L2pp = ParkSawX2
else
EmitMoveDataHead( 2, { X=SafeX2, Z=-CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
EmitMoveDataHead( 2, { X=SafeX2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
EMT.L2pp = SafeX2
end
else
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=ParkSawX2, S=Speed})
EMT.L2pp = ParkSawX2
else
EmitMoveDataHead( 2, { X=SafeX2, S=Speed})
EMT.L2pp = SafeX2
end
end
-- scrivo solo se gli assi rotanti sono cambiati
EmitMoveDataHead( 2, { Z=-dSafeZ2, S=Speed})
if EMT.L2p > ParkMchY2 and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
if EMT.L2pp > SafeX2RotAxis and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=SafeX2RotAxis, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
else
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.L2p > ParkMchY2 and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
if EMT.L2pp > SafeX2RotAxis and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=SafeX2RotAxis, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
end
-- se stesso utensile vado già alla X di lavoro
else
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.L2p > ParkMchY2 and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
if EMT.ZMAX and EMT.L2pp > SafeX2RotAxis and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=SafeX2RotAxis, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
end
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.HEAD == 'H22' and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { B=EMT.R2, C=EMT.R1, S=Speed})
end
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
if EMT.ZMAX then
EmitMoveDataHead( 2, { X=EMT.L2, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
end
EmitMoveStartHead( 2)
-- eventuale preselezione successiva testa 1
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
@@ -1119,20 +1238,45 @@ function OnRapid()
local HomeC3 = EgtGetAxisHomePos( 'C3')
local HomeB3 = EgtGetAxisHomePos( 'B3')
local Speed = EMT.S
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local CurrB3 = PrevR2
local CurrC3 = PrevR1
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, B=CurrB3, C=CurrC3, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, S=Speed})
end
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local CurrB3 = PrevR2
local CurrC3 = PrevR1
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, B=CurrB3, C=CurrC3, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, S=Speed})
end
EmitMoveDataHead( 3, { Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmitMoveDataHead( 3, { Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
end
-- se gruppo lama dedicato, senza cambio utensile
elseif EgtGetHeadId( 'H38') then
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
EmitMoveDataHead( 3, { X=-SafeX3RotAxis, S=Speed})
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
if ( EMT.L3 - SafeZ3RotAxis) > 100 * GEO.EPS_SMALL then
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
end
EmitMoveDataHead( 3, { X=EMT.L2, S=Speed})
end
end
-- muovo in posizione finale
EmitMoveDataHead( 3, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmtSetLastError( 1212, "HEAD not managed")
end
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
@@ -1195,6 +1339,10 @@ function OnRapid()
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
-- dato che la testa 2 è slave, bisogna controllare eventuale extra-corsa da post
if dZ2 > MaxZ2 then
EmtSetLastError( 1220, EMT.MCHNAME..' ==> Out of Stroke: Z2 : '.. EgtNumToString( dZ2-MaxZ2, 2))
end
local dC2 = EMT.R1
local dB2 = EMT.R2
EmitMoveDataHead( 2, { Z=-dZ2, B=dB2, C=dC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
@@ -1242,6 +1390,14 @@ function OnRapid()
EMT.R1p = nil
EMT.R2p = nil
else
-- se lavorazione in doppio controllo le corse
if EMT.DOU_TYPE == 2 then
local dZ2 = -Head2Z + MillOffs + Mill2Offs + EMT.L3
-- dato che la testa 2 è slave, bisogna controllare eventuale extra-corsa da post
if dZ2 > MaxZ2 then
EmtSetLastError( 1220, EMT.MCHNAME..' ==> Out of Stroke: Z2 : '.. EgtNumToString( dZ2-MaxZ2, 2))
end
end
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
end
@@ -1266,8 +1422,10 @@ function OnRapid()
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
-- porto in home la testa corrente se lavorazione successiva sopra con testa diversa oppure se punta lunga
local nNextTopHSet = GetNextTopHSet( EMT.MCHID)
local bTopGoHome = ( nHSet ~= 2 and nNextTopHSet ~= 0 and nHSet ~= nNextTopHSet) or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
EmitZmax( true, true, EMT.R1p, EMT.R2p, bSplitCut, bTopGoHome)
-- ricavo prossimo utensile
local sNextTool = GetNextTool( EMT.MCHID)
local bTopGoHome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) or ( nHSet ~= 2 and nNextTopHSet ~= 0 and nHSet ~= nNextTopHSet) or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
EmitZmax( true, true, EMT.R1p, EMT.R2p, bSplitCut, bTopGoHome, false)
-- aggiorno quota finale trave dopo Zmax
EMT.L1o = EMT.TPOS
EMT.ZMAX = true
@@ -1375,6 +1533,54 @@ end
---------------------------------------------------------------------
function OnArc()
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- 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 (se presente devo annullare l'offset in X per sovramateriale di testa)
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
if EMT.X_OFF then EMT.L1 = EMT.L1 - EMT.X_OFF end
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
MyOutput( 'M105 P1=' .. GetFaceCode() .. ' P2='..GetHeadSetCode()..' P3='..EgtIf( EMT.DOU_TYPE, 2, 0))
MyOutput( 'M98')
MyOutput( 'M6 ' .. GetHeadToolCode() .. AdjustTcPos( true))
MyOutput( 'G24' .. EMT.IPLGLSTR)
-- emissione movimento
EMT.R1p = nil
EMT.R2p = nil
if EmitRapidInG1 then
local sFeed = ' F30000'
sOut = 'G1'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')..sFeed
else
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
end
MyOutput( sOut)
-- aggiorno precedenti
local nOriginalMove = EMT.MOVE
EMT.MOVE = 0
EmtUpdatePrev()
EMT.MOVE = nOriginalMove
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
end
-- se primo movimento in feed della lavorazione, dichiaro inizio lavorazione
if EMT.MCHFIRSTFEED then
EMT.MCHFIRSTFEED = nil
@@ -2101,42 +2307,66 @@ function AdjustTcPos( bLen3, sTcPos, dAxR3)
end
if sPos == '101' then
if not dAxR3 then dAxR3 = EMT.R3 end
if abs( dAxR3 - 0) < 0.1 then
sPos = '101'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '102'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '103'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '104'
else
EmtSetLastError( 1210, 'Chain saw orientation not allowed')
-- controllo che il valore esista. Altrimenti è una testa senza asse ausiliario
if dAxR3 then
if abs( dAxR3 - 0) < 0.1 then
sPos = '101'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '102'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '103'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '104'
else
EmtSetLastError( 1210, 'Tool T101 orientation not allowed')
end
end
end
if sPos == '111' then
if not dAxR3 then dAxR3 = EMT.R3 end
if abs( dAxR3 - 0) < 0.1 then
sPos = '111'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '112'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '113'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '114'
else
EmtSetLastError( 1210, 'Chain saw orientation not allowed')
-- controllo che il valore esista. Altrimenti è una testa senza asse ausiliario
if dAxR3 then
if abs( dAxR3 - 0) < 0.1 then
sPos = '111'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '112'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '113'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '114'
else
EmtSetLastError( 1210, 'Tool T111 orientation not allowed')
end
end
end
if sPos == '121' then
if not dAxR3 then dAxR3 = EMT.R3 end
-- controllo che il valore esista. Altrimenti è una testa senza asse ausiliario
if dAxR3 then
if abs( dAxR3 - 0) < 0.1 then
sPos = '121'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '122'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '123'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '124'
else
EmtSetLastError( 1210, 'Tool T121 orientation not allowed')
end
end
end
if sPos == '201' then
if not dAxR3 then dAxR3 = EMT.R3 end
if abs( dAxR3 - 0) < 0.1 then
sPos = '201'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '202'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '203'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '204'
-- Lama su aggregato da sotto non può essere presa in queste posizioni per problemi di collisione durante parcheggio
--elseif abs( dAxR3 - 270) < 0.1 then
-- sPos = '202'
--elseif abs( dAxR3 - 180) < 0.1 then
-- sPos = '203'
else
EmtSetLastError( 1210, 'Saw orientation not allowed')
end
@@ -2230,11 +2460,12 @@ function GetHeadToolCode()
end
---------------------------------------------------------------------
function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome, bUsePrevDelta)
if bReset then
EmitResetMachining()
end
local nSetHead = GetHeadSet( EMT.HEAD)
local dXPos = EgtIf( bUsePrevDelta, EMT.L2pp or EMT.L2o, EMT.L2o)
-- se testa 1
if nSetHead == 1 then
-- posizioni sicure
@@ -2255,12 +2486,12 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
local dZref = dHomeZ1 + GetZExtra( EMT.HEAD, PrevR2)
dZref = min( dZref, dMaxZ1)
local MovH = { Z = EgtIf( dZref > EMT.L3o, dZref, EMT.L3o)}
MovH.X = -EMT.L2o ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
EmitMoveDataHead( 1, MovH)
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( dHomeC1 - PrevR1) > 30.1 or abs( dHomeB1 - PrevR2) > 30.1) then
EmitMoveDataHead( 1, { Z=dMaxZ1, B=0, Fmt=1})
end
if EgtIf( BD.RIGHT_LOAD, ( EMT.L2 > -DeltaTabY), ( EMT.L2 < -DeltaTabY)) then
if EgtIf( BD.RIGHT_LOAD, ( -dXPos > -DeltaTabY), ( -dXPos < -DeltaTabY)) then
EmitMoveDataHead( 1, { X=-DeltaTabY, Fmt=1})
end
EmitMoveDataHead( 1, { C=dHomeC1, Fmt=1})
@@ -2282,7 +2513,17 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
-- salgo in Z sicurezza raddrizzando la B
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dHomeB1, Fmt=1})
EmitMoveDataHead( 1, { X=-dHomeX1, C=dHomeC1, Fmt=1})
-- lascio la motosega a parcheggio. In caso di utilizzo della testa 3, la motosega viene scaricata automaticamente dalla macro.
EmitMoveDataHead( 1, { X=-ParkCSawX1, C=dHomeC1, Fmt=1})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
-- se ho degli aggregati e la prossima è la testa 3, scarico e prendo utensile di default
local nNextTopHSet = GetNextTopHSet( EMT.MCHID)
if IsHeadExisting( 3) and nNextTopHSet == 3 and ( EMT.TCPOS == 'T101' or EMT.TCPOS == 'T111' or EMT.TCPOS == 'T121') then
-- lascio la motosega a parcheggio. In caso di utilizzo della testa 3, la motosega viene scaricata automaticamente dalla macro.
local sDefToolToLoad = AdjustTcPos( false, DefTcPos1)
EmitMoveDataHead( 1, { X=-ParkX1, TPos=sDefToolToLoad, Fmt=1})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
@@ -2306,8 +2547,8 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
else
EmitMoveDataHead( 2, { X=dHomeX2, Fmt=1})
end
-- solo se è macchina a 3 teste, devo stare più alto
if EgtGetHeadId( 'H31') then
-- solo se è macchina a 3 teste con gruppo truciolatore 4 assi, devo stare più alto
if EgtGetHeadId( 'H39') then
EmitMoveDataHead( 2, { Z=-ParkInLavZ2, Fmt=1})
end
EmitMoveStartHead( 2)
@@ -2318,14 +2559,44 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
local dMaxZ3 = EgtGetAxisMax( 'Z3')
local dHomeX3 = EgtGetAxisHomePos( 'X3')
local dHomeB3 = EgtGetAxisHomePos( 'B3')
-- eseguo la salita a Z3max
EmitMoveDataHead( 3, { Z=dMaxZ3, Fmt=1})
if bTopGoHome then
EmitMoveDataHead( 3, { X=-dHomeX3, B=dHomeB3, Fmt=1})
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
-- eseguo la salita a Z3max
EmitMoveDataHead( 3, { Z=dMaxZ3, Fmt=1})
if bTopGoHome then
EmitMoveDataHead( 3, { X=-dHomeX3, B=dHomeB3, Fmt=1})
end
-- se gruppo lama dedicato, senza cambio utensile
elseif EgtGetHeadId( 'H38') then
local dHomeC3 = EgtGetAxisHomePos( 'C3')
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, dHomeC3, dHomeB3) then
local dPosT = EgtIf( bEnd, EMT.L1o, EMT.TPOS or EMT.L1op)
EmitParkRoller( dPosT, bSplitCut)
end
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( dHomeC3 - PrevR1) > 1 or abs( dHomeB3 - PrevR2) > 1 then
EmitMoveDataHead( 3, { X=-SafeX3RotAxis, Fmt=1})
EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, Fmt=1})
EmitMoveDataHead( 3, { B=dHomeB3, C=dHomeC3, Fmt=1})
end
-- eseguo la salita a Z3max
EmitMoveDataHead( 3, { Z=dMaxZ3, Fmt=1})
if bTopGoHome then
EmitMoveDataHead( 3, { X=-dHomeX3, Fmt=1})
end
else
EmtSetLastError( 1212, "HEAD not managed")
end
EmitMoveStartHead( 3)
EmitMoveWaitHead( 3)
end
-- resetto posizione precedente assi
EMT.L2pp = nil
EMT.L3pp = nil
EMT.R1pp = nil
EMT.R2pp = nil
end
---------------------------------------------------------------------
@@ -2412,7 +2683,7 @@ function EmitParkRoller( dPosT, bSplitCut)
local dPosY1 = dPosT + EMT.Y1DELTA
local DiffY1 = MyParkY1 - dPosY1
local dMoveY1 = EgtIf( DiffY1 > 0.1, dMoveV1, 0)
local dTryMoveY1 = ParkV1 - dPosT - EgtIf( bSplitCut or EMT.FALL, EMT.LT, 0)
local dTryMoveY1 = min( ParkV1 - dPosT - EgtIf( bSplitCut or EMT.FALL, EMT.LT, 0), MaxY1 - dPosY1 - 10)
if ( dPosT > ParkV2 - ExtraParkV and dPosT < ParkV1 and dPosY1 + dTryMoveY1 < MaxY1) then dMoveY1 = max( dMoveY1, dTryMoveY1) end
--MyOutput( string.format( 'PosT=%.3f PosY1=%.3f V1POS=%.3f Split=%s', dPosT, dPosY1, EMT.V1POS, EgtIf( bSplitCut, '1', '0')))
MDChar.Y1 = dPosY1 + dMoveY1
@@ -2424,8 +2695,8 @@ function EmitParkRoller( dPosT, bSplitCut)
local dPosY2 = dPosT + EMT.Y2DELTA
local DiffY2 = MyParkY2 - dPosY2
local dMoveY2 = EgtIf( DiffY2 < -0.1, dMoveV2, 0)
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT
if ( dPosT + EMT.LT < ParkV1 + ExtraParkV and dPosT + EMT.LT > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
local dTryMoveY2 = max( ParkV2 - dPosT - EMT.LT - EMT.HOVM, MinY2 - dPosY2 + 10)
if ( dPosT + EMT.LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
--MyOutput( string.format( 'PosT=%.3f LT=%.3f PosY2=%.3f V2POS=%.3f', dPosT, EMT.LT, dPosY2, EMT.V2POS))
MDChar.Y2 = dPosY2 + dMoveY2
MDChar.MovType = 2
@@ -2500,6 +2771,8 @@ function PreselectNextDiffHead( nMchId, sHead)
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then return end
-- se la Z di lavoro è più bassa del cambio della minima Z
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
-- se diametro utensile più del truciolatore standard grande, si rischia di collidere anche con il carro X testa sotto (quindi indipendentemente dalla Y della lavorazione)
if EMT.TTOTDIAM > 201 then return end
-- verifico quota del TC
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + 200) then return end
@@ -2538,38 +2811,56 @@ function PreselectNextDiffHead( nMchId, sHead)
end
-- altrimenti (testa 3)
else
-- se preselezione testa 1
if nNextHSet == 1 then
-- TC su montante destro
if nPrevTc == 1 then return
-- TC su montante sinistro
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
-- se preselezione testa 1
if nNextHSet == 1 then
local nNextTc = GetTcForTopHeadTool( sNextTcPos) -- utensile da caricare
local nPrevTc = GetTcForTopHeadTool( EMT.PREVTCPOS_H1) -- utensile da depositare
-- se devo lasciare o prelevare da TC1 oppure non so cosa c'è montato, non posso preselezionare
if nNextTc == 1 or nPrevTc == 1 or nPrevTc == 0 then return
-- TC su montante sinistro
else
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
end
-- se preselezione testa 2
else
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
end
-- se preselezione testa 2
else
-- se agregato lama speciale non preseleziono mai
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then return end
-- se la Z di lavoro è più bassa del cambio utensili, verifico quota X (la nostra Y)
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
-- se agregato lama speciale non preseleziono mai
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then return end
-- se la Z di lavoro è più bassa del cambio utensili, verifico quota X (la nostra Y)
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
end
end
-- se gruppo lama dedicato, senza cambio utensile non si preseleziona mai
elseif EgtGetHeadId( 'H38') then
return
end
end
-- faccio preselezione ( se sono arrivato qui, vuol dire che posso preselezionare)
if nNextHSet == 1 then
-- Recupero quota X1 (nostro L2)
local dNextX = GetStartMachiningXaxis( nNextMchId)
local dNextX
-- se sto lavorando con testa 3, la testa 1 preselezionata deve restare in home
if nHSet == 3 then
dNextX = - EgtGetAxisHomePos( 'X1')
-- se il prossimo utensile su testa 1 è utensile lungo, resta in home
elseif sNextHead == 'H11' and dNextTotLen > LongTool then
dNextX = - EgtGetAxisHomePos( 'X1')
-- altrimenti recupero quota X1 (nostro L2)
else
dNextX = GetStartMachiningXaxis( nNextMchId)
end
-- Emetto preselezione
if sNextHead == 'H11' then
if dNextTotLen < LongTool then
EmitMoveDataHead( 1, { X=dNextX, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
else
local nNextTc = GetTcForTopHeadTool( sNextTcPos)
EmitMoveDataHead( 1, { X=dNextX, B=ParkLongB1, C=EgtIf( nPrevTc ~= 2, ParkLongTc1C1, ParkLongTc2C1), TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
EmitMoveDataHead( 1, { X=dNextX, B=ParkLongB1, C=EgtIf( nNextTc ~= 2, ParkLongTc1C1, ParkLongTc2C1), TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
end
EmitMoveStartHead( 1)
elseif sNextHead == 'H12' or sNextHead == 'H16' then
@@ -2583,9 +2874,11 @@ function PreselectNextDiffHead( nMchId, sHead)
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, dNextX), B=ParkCSawB1, C=MyParkCSawC1, TPos=AdjustTcPos( false, sNextTcPos, dPosA), Fmt=2})
EmitMoveStartHead( 1)
end
else
elseif nNextHSet == 2 then
EmitMoveDataHead( 2, { B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
EmitMoveStartHead( 2)
else
; -- non si preseleziona testa 3
end
end
end
+343 -82
View File
@@ -16,7 +16,7 @@ local sBaseDir = EgtGetCurrMachineDir()
if NumericalControl == 'NUM' then
error( 'Numerical Control error : NUM not yet managed')
elseif NumericalControl == 'TPA' then
dofile( sBaseDir .. '\\Common-PF1250.TPA.mlpe')
dofile( sBaseDir .. '\\Common_PF1250.TPA.mlpe')
else
error( 'Numerical Control error : unkwnown type')
end
@@ -76,10 +76,12 @@ function OnSimulStart()
if vTcPos then
for i = 1, #vTcPos do
local vTools = EgtGetToolsInCurrSetupPos( vTcPos[i])
if vTools and vTools[1] and #(vTools[1]) > 0 then
EgtLoadTool( vTcPos[i], 1, vTools[1])
ShowToolInTcPos( vTcPos[i], true)
for j = 1, #( vTools or {}) do
if vTools[j] ~= '' then
EgtLoadTool( vTcPos[i], j, vTools[j])
end
end
ShowToolInTcPos( vTcPos[i], true)
end
end
-- Carico gli utensili iniziali o di default sulle due teste
@@ -106,7 +108,7 @@ function OnSimulStart()
AddToCollisionCheck( 'X2', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'C2', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'B2', 'COLLISION', EMT.COLLOBJ)
if EgtGetHeadId('H31') then
if IsHeadExisting( 3) then
AddToCollisionCheck( 'Z3', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'C3', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'B3', 'COLLISION', EMT.COLLOBJ)
@@ -121,12 +123,15 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'CEIL'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TCR'},
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL1'},
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'CHAIN'},
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}}
if EgtGetHeadId('H31') then
if IsHeadExisting( 3) then
table.insert( McdData, { Grp = 'X3', Sub = 'COLLISION', Name = 'STM'})
end
@@ -449,15 +454,19 @@ function OnSimulToolSelect( dPosA)
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
-- recupero il gruppo
local nSetHead = GetHeadSet( EMT.NEXTHEAD)
local nSetHead = GetHeadSet( EMT.HEAD)
-- se fresa o lama su testa 1, reset assi rotanti
if nSetHead == 1 then
-- se ho la testa 3, la mando a parcheggio
if EgtGetHeadId( 'H31') then
if IsHeadExisting( 3) then
EgtSetAxisPos( 'X3', ParkX3)
end
if EMT.HEAD == 'H12' then
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' then
EgtSetAxisPos( 'Z1', MaxZ1Blade)
elseif EMT.HEAD == 'H13' then
EgtSetAxisPos( 'Z1', ParkCSawZ1)
else
EgtSetAxisPos( 'Z1', MaxZ1)
end
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
@@ -467,6 +476,8 @@ function OnSimulToolSelect( dPosA)
end
-- se sega a catena, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H13' then
-- se prima lavorazione con motosega, parto dalla sua posizione di parcheggio
EgtSetAxisPos( 'X1', ParkCSawX1)
-- valore dell'asse virtuale
dPosA = dPosA or GetNextChainSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A
@@ -478,14 +489,29 @@ function OnSimulToolSelect( dPosA)
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end
-- se aggregato foratura multipla, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H14' then
-- valore dell'asse virtuale
dPosA = dPosA or GetNextMultiDrillVirtualAxis( EMT.MCHID)
-- imposto il valore di A
EgtSetAxisPos( 'A1', dPosA)
-- imposto home dell'asse C1 (A1=0 -> T121, A1=90 -> T124)
local MyParkCSawC1 = GetMultiDrillCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
EmtModifyAxisHome( 'C1', MyParkCSawC1)
EgtSetAxisPos( 'C1', MyParkCSawC1)
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end
-- se lama su aggregato da sotto, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H22' then
-- se c'era un altro utensile, imposto subito asse virtuale
if EMT.PREVHEAD_H2 ~= 'H22' then
dPosA = dPosA or GetNextSawingVirtualAxis( EMT.MCHID)
end
if dPosA then
-- valore dell'asse virtuale
dPosA = dPosA or GetNextSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A
EgtSetAxisPos( 'A2', dPosA)
-- imposto home dell'asse C1 (A2=0 -> T101, A2=90 -> T104)
-- imposto home dell'asse C1 (A2=0 -> T201, A2=90 -> T204)
local MyParkSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkSawC2)
EgtSetAxisPos( 'C2', MyParkSawC2)
@@ -521,7 +547,7 @@ end
---------------------------------------------------------------------
function OnSimulToolDeselect( dPrevA)
-- se prossimo utensile non cambia e non è sega a catena o lama su rinvio da sotto, esco
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and EMT.NEXTHEAD ~= 'H13' and ( EMT.NEXTHEAD ~= 'H22' or not dPrevA) then return end
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and ( EMT.NEXTHEAD ~= 'H13' or EMT.NEXTHEAD ~= 'H14') and ( EMT.NEXTHEAD ~= 'H22' or not dPrevA) then return end
-- deposito utensile
EgtOutText( 'Tool change in progress...')
-- recupero il gruppo attuale e il successivo
@@ -530,8 +556,9 @@ function OnSimulToolDeselect( dPrevA)
-- se devo deselezionare testa 3, la mando a parcheggio
if nSetHead == 3 then
SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID)
end
-- per testa gruppo 2
elseif nNextSetHead == 2 and EMT.PREVTCPOS_H2 then
if nNextSetHead == 2 then
-- deposito lama su aggregato testa sotto
if EMT.PREVHEAD_H2 == 'H22' then
-- simulo movimento
@@ -557,12 +584,12 @@ function OnSimulToolDeselect( dPrevA)
local nPrevTc = GetTcForTopHeadTool( EMT.PREVTCPOS_H1)
if EMT.PREVTTOTLEN_H1 < LongTool then
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
local dPosX = EgtIf( nPrevTc ~= 2, ParkX1, ParkTc2X1)
local dPosX = EgtIf( nPrevTc ~= 2, ParkTc1X1, ParkTc2X1)
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
else
if nPrevTc ~= 2 then
SimulMoveAxes( 'B1', ParkLongB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc1C1, MCH_SIM_STEP.RAPROT)
local dPosX = ParkX1
local dPosX = ParkTc1X1
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'B1', ParkLongB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc2C1, MCH_SIM_STEP.RAPROT)
@@ -574,7 +601,7 @@ function OnSimulToolDeselect( dPrevA)
elseif EMT.PREVHEAD_H1 == 'H12' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X1', ParkTc1X1, MCH_SIM_STEP.RAPID)
-- deposito utensile sega a catena
elseif EMT.PREVHEAD_H1 == 'H13' then
-- simulo movimento
@@ -584,12 +611,23 @@ function OnSimulToolDeselect( dPrevA)
end
SimulMoveAxes( 'B1', ParkCSawB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkCSawX1, MCH_SIM_STEP.RAPID)
-- deposito utensile aggregato foratore multiplo
elseif EMT.PREVHEAD_H1 == 'H14' then
-- simulo movimento
local ParkC1 = EgtGetAxisHomePos( 'C1')
if dPrevA then
ParkC1 = GetMultiDrillCHomeFromVirtualAxis( dPrevA)
end
-- simulo movimento
SimulMoveAxes( 'B1', ParkMultiDrillB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkMultiDrillX1, MCH_SIM_STEP.RAPID)
-- deposito utensile seconda lama
elseif EMT.PREVHEAD_H1 == 'H16' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkTc2X1, MCH_SIM_STEP.RAPID)
end
-- breve pausa
EgtPause( 100)
-- visualizzo utensile su TcPos
@@ -597,14 +635,28 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
end
-- se passo da testa 1 a 3 o viceversa
-- se passo da testa 1 a 3 scarico aggregato
if nNextSetHead == 3 then
-- deposito eventuale sega a catena
if EMT.PREVHEAD_H1 == 'H13' then
-- deposito utensile prelevato da posizioni speciali
if EMT.TCPOS == 'T101' or EMT.TCPOS == 'T111' or EMT.TCPOS == 'T121' then
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
local sTool, sTcPos, sHead
local vTools = EgtGetToolsInCurrSetupPos( DefTcPos1)
if vTools and vTools[1] then
sTool = vTools[1]
sTcPos = DefTcPos1
sHead = GetAdjHeadFromTcPos( 1, sTcPos)
-- carico l'utensile
EgtLoadTool( sHead, 1, sTool)
ShowToolInTcPos( DefTcPos1, false)
end
EMT.PREVTOOL_H1 = sTool
EMT.PREVHEAD_H1 = sHead
EMT.PREVTCPOS_H1 = DefTcPos1
end
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
@@ -613,19 +665,24 @@ function OnSimulToolDeselect( dPrevA)
if EMT.NEXTHEAD == 'H11' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
local dPosX = EgtIf( GetTcForTopHeadTool( EMT.NEXTTCPOS) ~= 2, ParkX1, ParkTc2X1)
local dPosX = EgtIf( GetTcForTopHeadTool( EMT.NEXTTCPOS) ~= 2, ParkTc1X1, ParkTc2X1)
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
-- prendo utensile lama
elseif EMT.NEXTHEAD == 'H12' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X1', ParkTc1X1, MCH_SIM_STEP.RAPID)
-- prendo utensile sega a catena
elseif EMT.NEXTHEAD == 'H13' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkCSawB1, MCH_SIM_STEP.RAPROT, 'C1', EgtGetAxisHomePos( 'C1'), MCH_SIM_STEP.RAPROT)
SimulMoveAxes( 'X1', ParkCSawX1, MCH_SIM_STEP.RAPID, 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
-- prendo aggregato multi drill
elseif EMT.NEXTHEAD == 'H14' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkMultiDrillB1, MCH_SIM_STEP.RAPROT, 'C1', EgtGetAxisHomePos( 'C1'), MCH_SIM_STEP.RAPROT)
SimulMoveAxes( 'X1', ParkMultiDrillX1, MCH_SIM_STEP.RAPID, 'Z1', ParkMultiDrillZ1, MCH_SIM_STEP.RAPID)
-- prendo utensile seconda lama
elseif EMT.NEXTHEAD == 'H16' then
-- simulo movimento
@@ -649,8 +706,22 @@ end
---------------------------------------------------------------------
function OnSimulMachiningStart()
-- se lavorazione attuale e precedente con sega a catena con angolo A diverso, devo scaricare e ricaricare
if EMT.HEAD == 'H13' and EMT.HEAD == EMT.PREVHEAD_H1 then
-- se lavorazione è con gruppo a forare, abilito le altre punte alla lavorazione del VMILL
if EMT.HEAD == 'H14' then
local OtherTools = EgtGetToolsInCurrSetupPos( 'T121')
if OtherTools and #OtherTools > 1 then
for i = 1, #OtherTools do
if OtherTools[i] ~= '' and OtherTools[i] ~= EMT.TOOL then
EmtAddToolForVmill( OtherTools[i], 'H14', i, EMT.VMILL)
-- dichiaro utensile per verifica collisioni
local nInd = 1011
AddToolToCollisionObj( OtherTools[i], 'H14', i, nInd, true)
end
end
end
end
-- se lavorazione attuale e precedente con sega a catena o aggregato foratore multiplo e con angolo A diverso, devo scaricare e ricaricare
if ( EMT.HEAD == 'H13' or EMT.HEAD == 'H14') and EMT.HEAD == EMT.PREVHEAD_H1 then
local dPrevA = EgtGetAxisPos( 'A1')
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
local dPosA = tonumber( sVal:sub( 4))
@@ -660,16 +731,23 @@ function OnSimulMachiningStart()
OnSimulToolSelect( dPosA)
end
end
-- se lavorazione attuale e precedente con sega a catena con angolo A diverso, devo scaricare e ricaricare
-- se lavorazione attuale e precedente con aggregato lama da sotto con angolo A diverso, devo scaricare e ricaricare
if EMT.HEAD == 'H22' and EMT.HEAD == EMT.PREVHEAD_H2 then
local dPrevA = EgtGetAxisPos( 'A2')
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
local dPosA = tonumber( sVal:sub( 4)) or 0
if abs( dPosA - dPrevA) > 1 then
ExecParkRoller( nil, nil, nil, nil, false, bAgg)
-- setto i valori per la funzione ToolDesel
EMT.NEXTHEAD = EMT.HEAD
EMT.NEXTTOOL = EMT.TOOL
EMT.NEXTEXIT = EMT.EXIT
OnSimulToolDeselect( dPrevA)
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.ON)
OnSimulToolSelect( dPosA)
-- aggiorno dati utensile su testa
EMT.TCPOSREAL = 'T' .. AdjustTcPos( false, EMT.TCPOS, dPosA)
EMT.PREVTCPOSREAL_H2 = EMT.TCPOSREAL
end
end
-- recupero alcuni dati della lavorazione
@@ -717,6 +795,35 @@ function OnSimulMachiningStart()
EmtSetLastError( 1211, 'Missing or not active double tool of '..sOldTool)
end
EgtTdbSetCurrTool( sOldTool)
else
-- recupero il gruppo
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead ~= 1 and ( EMT.PREVTOOL_H1 and EMT.PREVHEAD_H1) then
local nPrevExit_H1 = 1
local nInd_H1 = 1001
AddToolToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1, true)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1 + 1)
end
if nSetHead ~= 2 and ( EMT.PREVTOOL_H2 and EMT.PREVHEAD_H2) then
local nPrevExit_H2 = 1
local nInd_H2 = 1011
AddToolToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2, true)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2 + 1)
end
if nSetHead ~= 3 and IsHeadExisting( 3) then
local nPrevExit_H3 = 1
local nInd_H3 = 1001
local sHeadName
if EgtGetHeadId( 'H39') then
sHeadName = 'H39'
elseif EgtGetHeadId( 'H38') then
sHeadName = 'H38'
else
EmtSetLastError( 1212, "HEAD not managed")
end
AddToolToCollisionObj( nil, sHeadName, nPrevExit_H3, 1001)
AddToolHolderToCollisionObj( nil, sHeadName, nPrevExit_H3, 1002)
end
end
-- se precedente in doppio ma ora solo testa 1 e non in sicurezza
if EMT.DOU_TO_ZMAX then
@@ -759,18 +866,20 @@ function OnSimulMachiningEnd()
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
EMT.PREVTTOTLEN_H1 = EMT.TTOTLEN
EMT.PREVTCPOSREAL_H1 = EMT.TCPOSREAL
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
EMT.PREVTTOTLEN_H2 = EMT.TTOTLEN
-- per gruppo testa 3 (resetto dati testa 1)
EMT.PREVTCPOSREAL_H2 = EMT.TCPOSREAL
-- per gruppo testa 3
else
EMT.PREVTOOL_H3 = nil
EMT.PREVHEAD_H3 = nil
EMT.PREVTCPOS_H3 = nil
EMT.PREVTTOTLEN_H3 = nil
EMT.PREVTOOL_H3 = EMT.TOOL
EMT.PREVHEAD_H3 = EMT.HEAD
EMT.PREVTCPOS_H3 = EMT.TCPOS
EMT.PREVTTOTLEN_H3 = EMT.TTOTLEN
end
end
@@ -926,10 +1035,21 @@ function OnSimulMoveStart()
if WriteAllCoordsOnFirstM101 then
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
-- se ero in posizione speciale, prima ruoto poi scendo
if bXSpec then
local dZPos = max( Z1Home, EMT.L3)
SimulMoveAxis( 'Z1', dZPos, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
if abs( dZPos - EMT.L3) > 1 then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
else
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
end
-- altrimenti sega a catena
@@ -957,39 +1077,84 @@ function OnSimulMoveStart()
local X2Pos = EgtGetAxisPos( 'X2')
local B2Pos = EgtGetAxisPos( 'B2')
local C2Pos = EgtGetAxisPos( 'C2')
if EMT.TOOL ~= EMT.PREVTOOL_H2 then
-- calcolo posizione reale
EMT.TCPOSREAL = 'T' .. AdjustTcPos( false, EMT.TCPOS, EMT.R3)
-- se utensile cambiato (controllo il reale perchè per aggregato dipende come è stato caricato)
if EMT.PREVTCPOSREAL_H2 ~= EMT.TCPOSREAL then
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
if EMT.HEAD == 'H22' and EMT.PREVHEAD_H2 ~= EMT.HEAD then
SimulMoveAxes( 'X2', MinX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
if EMT.HEAD == 'H22' then
SimulMoveAxes( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID, 'B2', 0, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
X2Pos = ParkSawX2
else
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
X2Pos = SafeX2
end
else
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
X2Pos = ParkSawX2
else
SimulMoveAxis( 'X2', SafeX2, MCH_SIM_STEP.RAPID)
X2Pos = SafeX2
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
-- Porto la X alla giusta quota
if X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
end
else
-- Porto la X alla giusta quota
if X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
if X2Pos > SafeX2RotAxis and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', SafeX2RotAxis, MCH_SIM_STEP.RAPID)
end
end
else
-- solo se è macchina a 3 teste con gruppo truciolatore 4 assi, devo andare prima in Z0
if EgtGetHeadId( 'H39') then
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
end
-- Porto la X alla giusta quota
if X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
if EMT.ZMAX and X2Pos > SafeX2RotAxis and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', SafeX2RotAxis, MCH_SIM_STEP.RAPID)
end
end
if EMT.HEAD == 'H22' then
SimulMoveAxes( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- se ero a ZMAX, mi sposto in posizione a Z home. Ultimo movimento muove in Z
if EMT.ZMAX then
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- altrimenti testa 3
else
; -- non devo fare alcunchè di speciale
else
-- testa 4 assi dedicata truciolatore
if EgtGetHeadId( 'H39') then
if EMT.ZMAX then
local MaxZ3 = EgtGetAxisMax( 'Z3')
SimulMoveAxes( 'X3', EMT.L2, MCH_SIM_STEP.RAPID, 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
-- testa 5 assi dedicata lama
elseif EgtGetHeadId( 'H38') then
if EMT.ZMAX then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
if ( EMT.L3 - SafeZ3RotAxis) > 100 * GEO.EPS_SMALL then
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'X3', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
-- si muovono tutti gli assi assieme
-- altre configurazioni
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
end
-- se lavorazione split, muovo per riaggancio del carro Y1
@@ -1104,6 +1269,8 @@ end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- rimozione eventuali sfridi
if EMT.FLAG == 301 then
ExecRemoveScraps()
@@ -1148,8 +1315,12 @@ function OnSimulMoveEnd()
if EMT.MOVE == 0 and EMT.FLAG == 3 then
-- eventuale rimozione sfridi
ExecRemoveScraps()
-- ricavo prossimo utensile
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT)
ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
EMT.TO_ZMAX = nil
end
end
@@ -1259,7 +1430,7 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
elseif Cmd[1] == '11' then
local bClose = Cmd[2] ~= '0'
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
if bPathStart and EMT.MCHSPLIT and not ( EMT.FALL or EMT.TO_FALL) and GetPY2Light() then bClose = false end
ExecMovePY1( bClose)
elseif Cmd[1] == '12' then
ExecMovePY2( Cmd[2] ~= '0')
@@ -1318,7 +1489,9 @@ function ExecStartHome()
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
-- Testa 2
EgtSetAxisPos( 'X2', SafeX2)
local _, sHead, _, _, _, _ = FindFirstToolOnHeadSet( 2)
local PosXStart = EgtIf( sHead == 'H22', SafeX2, ParkX2)
EgtSetAxisPos( 'X2', PosXStart)
EgtSetAxisPos( 'Z2', MinZ2)
EgtResetAxisPos( 'C2')
EgtResetAxisPos( 'B2')
@@ -1327,14 +1500,17 @@ end
---------------------------------------------------------------------
function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit)
-- se testa sotto e macchian a 3 teste
if GetHeadSet( EMT.HEAD) == 2 and EgtGetHeadId( 'H31') then
if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then
ExecMoveZmax( bMchSplit, true)
-- se testa sotto e macchina a 3 teste
if GetHeadSet( EMT.HEAD) == 2 and IsHeadExisting( 3) then
if not SimulMoveAxis( 'X2', EgtIf( EMT.HEAD == 'H22', SafeX2, ParkX2), MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
end
if not SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
-- se gruppo truciolatore a 4 assi
if EgtGetHeadId( 'H39') then
if not SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : Z2')
end
end
end
EMT.TO_ZMAX = nil
@@ -1350,19 +1526,19 @@ function ExecMoveHome( bNearV, bMchSplit)
end
---------------------------------------------------------------------
function ExecMoveZmax( bMchSplit)
function ExecMoveZmax( bMchSplit, bGoToHome)
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
-- posizioni correnti degli assi testa
local CurrX = EgtGetAxisPos( EgtIf( nSetHead == 1, 'X1', 'X2'))
local CurrZ = EgtGetAxisPos( EgtIf( nSetHead == 1, 'Z1', 'Z2'))
local CurrC = EgtGetAxisPos( EgtIf( nSetHead == 1, 'C1', 'C2'))
local CurrB = EgtGetAxisPos( EgtIf( nSetHead == 1, 'B1', 'B2'))
local CurrX = EgtGetAxisPos( 'X'..nSetHead)
local CurrZ = EgtGetAxisPos( 'Z'..nSetHead)
local CurrC = EgtGetAxisPos( 'C'..nSetHead)
local CurrB = EgtGetAxisPos( 'B'..nSetHead)
-- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'X1', 'X2'))
local HomeZ = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'Z1', 'Z2'))
local HomeC = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'C1', 'C2'))
local HomeB = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'B1', 'B2'))
local HomeX = EgtGetAxisHomePos( 'X'..nSetHead)
local HomeZ = EgtGetAxisHomePos( 'Z'..nSetHead)
local HomeC = EgtGetAxisHomePos( 'C'..nSetHead)
local HomeB = EgtGetAxisHomePos( 'B'..nSetHead)
-- verifico se necessario ruotare la testa
local bRot = ( abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1)
-- se necessario ruotare la testa, allargo i carrelli
@@ -1390,6 +1566,9 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID)
if bGoToHome then
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
else
-- salgo in Z sicurezza raddrizzando la B
@@ -1419,14 +1598,30 @@ function ExecMoveZmax( bMchSplit)
else
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- solo se è macchina a 3 teste, devo stare più alto
if EgtGetHeadId( 'H31') then
-- solo se è macchina a 3 teste con gruppo truciolatore 4 assi, devo stare più alto
if EgtGetHeadId( 'H39') then
SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID)
end
-- altrimenti testa 3
else
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', ParkB3, MCH_SIM_STEP.COLLROT)
if EgtGetHeadId( 'H39') then
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', ParkB3, MCH_SIM_STEP.COLLROT)
elseif EgtGetHeadId( 'H38') then
local MyMaxZ3 = EgtGetAxisMax( 'Z3')
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1 then
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'C3', HomeC, MCH_SIM_STEP.COLLROT, 'B3', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z3', MyMaxZ3, MCH_SIM_STEP.RAPID)
if bGoToHome then
SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID)
end
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
EMT.ZMAX = true
end
@@ -1580,7 +1775,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV1 = ParkV1 - PosV1
local DiffY1 = MyParkY1 - PosY1
local MoveY1 = EgtIf( DiffY1 > 0.1, MoveV1, 0)
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0)
local TryMoveY1 = min( ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0), MaxY1 - PosY1 - 10)
if ( PosT > ParkV2 - ExtraParkV and PosT < ParkV1 and PosY1 + TryMoveY1 < MaxY1) then MoveY1 = max( MoveY1, TryMoveY1) end
-- se appena eseguito taglio di separazione
if bSpliCut then
@@ -1610,7 +1805,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV2 = ParkV2 - PosV2
local DiffY2 = MyParkY2 - PosY2
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
local TryMoveY2 = ParkV2 - PosT - EMT.LT
local TryMoveY2 = max( ParkV2 - PosT - EMT.LT, MinY2 - PosY2 + 10)
if ( PosT + EMT.LT < ParkV1 + ExtraParkV and PosT + EMT.LT > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
'V1', ParkV1, MCH_SIM_STEP.RAPID,
@@ -1858,11 +2053,20 @@ end
---------------------------------------------------------------------
function ShowToolInTcPos( sTcPos, bShow)
-- recupero il gruppo dell'utensile
local TcExitId = EgtGetFirstNameInGroup( EgtGetTcPosId( sTcPos or '') or GDB_ID.NULL, 'T1')
if not TcExitId then return end
-- imposto lo stato di visualizzazione
EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
-- recupero identificativo della posizione sul TC
local TcPosId = EgtGetTcPosId( sTcPos or '')
if not TcPosId then return end
-- ciclo sulle possibili uscite
for i = 1, 100 do
-- recupero il gruppo dell'utensile
local TcExitId = EgtGetFirstNameInGroup( TcPosId, 'T'..tostring( i))
if not TcExitId then break end
-- imposto lo stato di visualizzazione
EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
end
-- recupero eventuale gruppo ausiliario da visualizzare/nascondere
local TcHSId = EgtGetFirstNameInGroup( TcPosId, sTcPos..'_HS')
if TcHSId then EgtSetStatus( TcHSId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) end
end
---------------------------------------------------------------------
@@ -1870,7 +2074,11 @@ function LoadFirstTool( nHSet, sTcPosDef)
if nHSet ~= 1 and nHSet ~= 2 then return end
EgtUnloadTool( EgtIf( nHSet == 1, 'H11', 'H21'), 1)
if GetHeadSetFromTcPos( sTcPosDef) ~= nHSet then return end
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis = FindFirstToolOnHeadSet( nHSet)
local sTool, sHead, sTcPos, sTTotLen, sTotDiam, sBlockedAxis = FindFirstToolOnHeadSet( nHSet)
-- se primo utensile motosega, non lo carico e visualizzo quello di default
if sHead == 'H13' then
sTool = nil
end
if not sTool then
local vTools = EgtGetToolsInCurrSetupPos( sTcPosDef)
if vTools and vTools[1] then
@@ -1882,7 +2090,7 @@ function LoadFirstTool( nHSet, sTcPosDef)
if sTool then
-- imposto correttamente i dati di testa
local OrigEMC = EMC
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = sTTotLen, BLOCKEDAXIS = sBlockedAxis}
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = sTTotLen, TOTDIAM = sTotDiam, BLOCKEDAXIS = sBlockedAxis}
OnSetHead()
EMC = OrigEMC
if sBlockedAxis then
@@ -1895,6 +2103,19 @@ function LoadFirstTool( nHSet, sTcPosDef)
-- carico l'utensile
EgtLoadTool( sHead, 1, sTool)
ShowToolInTcPos( sTcPos, false)
-- salvo utensili caricati
if nHSet == 1 then
EMT.PREVTOOL_H1 = sTool
EMT.PREVHEAD_H1 = sHead
EMT.PREVTCPOS_H1 = sTcPos
EMT.PREVTTOTLEN_H1 = sTTotLen
-- per gruppo testa 2
elseif nHSet == 2 then
EMT.PREVTOOL_H2 = sTool
EMT.PREVHEAD_H2 = sHead
EMT.PREVTCPOS_H2 = sTcPos
EMT.PREVTTOTLEN_H2 = sTTotLen
end
end
return sTool
end
@@ -2308,7 +2529,7 @@ function FindFirstToolOnHeadSet( nHSet)
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
local sTool, sHead, sTcPos, sTTotLen, sTotDiam, sBlockedAxis
local OpId = EgtGetFirstActiveOperation()
while OpId do
local nType = EgtGetOperationType( OpId)
@@ -2318,9 +2539,15 @@ function FindFirstToolOnHeadSet( nHSet)
if EgtTdbSetCurrTool( sTest) then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if GetHeadSet( sHead) == nHSet then
sTool = sTest
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
-- aggregato lama non si può mai preselezionare e viene sempre scaricato, quindi non sarà mai già caricato
if nHSet == 2 and sTcPos == 'T201' then
sTcPos = nil
break
end
sTool = sTest
sTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
sTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
sBlockedAxis = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
break
end
@@ -2333,7 +2560,7 @@ function FindFirstToolOnHeadSet( nHSet)
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
return sTool, sHead, sTcPos, sTTotLen, sTotDiam, sBlockedAxis
end
---------------------------------------------------------------------
@@ -2378,6 +2605,33 @@ function GetNextChainSawingVirtualAxis( MchId)
return dPosA
end
---------------------------------------------------------------------
function GetNextMultiDrillVirtualAxis( MchId)
-- recupero la lavorazione successiva
local NextMchId
if MchId then
NextMchId = EgtGetNextActiveOperation( MchId)
else
NextMchId = EgtGetFirstActiveOperation()
end
while NextMchId and EgtGetOperationType( NextMchId) == MCH_OY.DISP do
NextMchId = EgtGetNextActiveOperation( NextMchId)
end
-- verifico sia un taglio con sega a catena
if EgtGetOperationType( NextMchId) ~= MCH_OY.DRILLING then
return nil
end
-- la imposto come lavorazione corrente
EgtSetCurrMachining( NextMchId)
-- recupero il valore dell'asse virtuale bloccato A
local dPosA = GetCurrMultiDrillVirtualAxis()
-- ripristino la lavorazione corrente
if MchId then
EgtSetCurrMachining( MchId)
end
return dPosA
end
---------------------------------------------------------------------
function GetCurrSawingVirtualAxis()
-- recupero il valore dell'asse virtuale bloccato A
@@ -2424,12 +2678,19 @@ function GetStartMachiningXaxis( nMchId)
end
end
---------------------------------------------------------------------
function IsLastPath( nPathId)
return not EgtGetNext( nPathId)
end
---------------------------------------------------------------------
function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H16' then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
elseif sHead == 'H21' or sHead == 'H22' then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
elseif sHead == 'H38' then
return ( abs( dAng1 - dAng1p) > 1 or abs( dAng2 - dAng2p) > 1)
end
end
+57 -11
View File
@@ -54,6 +54,9 @@ function OnSpecialGetMaxZ()
elseif nSetHead == 2 then
EMC.R1p = ParkC2
EMC.R2p = ParkB2
elseif nSetHead == 3 then
EMC.R1p = ParkC3
EMC.R2p = ParkB3
end
end
local vtT = Vector3d( EMC.TDIR)
@@ -74,6 +77,8 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
elseif vtTp:getZ() > 0.5 or vtT:getZ() > 0.5 then
EMC.MAXZ = ParkZ1 + 100
else
EMC.MAXZ = ParkZ1 + 1
end
@@ -92,6 +97,8 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
elseif vtTp:getZ() > 0.5 or vtT:getZ() > 0.5 then
EMC.MAXZ = ParkZ1 + 100
else
EMC.MAXZ = ParkZ1 + 1
end
@@ -111,14 +118,16 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}}
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H38' then
EMC.MAXZ = SafeZ3RotAxis
end
end
---------------------- OnSpecialMoveZup -----------------------------
function OnSpecialMoveZup()
--EgtOutLog( 'OnSpecialMoveZup : ' .. EMC.HEAD .. '.' .. tostring( EMC.EXIT))
-- Inizializzazioni
EMC.ERR = 0
EMC.MODIF = false
@@ -135,7 +144,7 @@ function OnSpecialMoveZup()
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' or EMC.HEAD == 'H22' then
;
-- se lama
else
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H16' then
-- riporto i valori tra -179 e + 180
local dCheckAxR1 = EMC.R1
if dCheckAxR1 < -180 then
@@ -180,6 +189,12 @@ function OnSpecialMoveZup()
end
end
end
elseif EMC.HEAD == 'H38' then
EMC.L3 = SafeZ3RotAxis
-- dichiaro modificato
EMC.MODIF = true
else
; -- non si fa nulla
end
end
@@ -194,7 +209,7 @@ local SIC_V = 50 -- sicurezza da testa
local MIN_ENG_V = 115 -- ingombro asse Z
local MIN_ENG_RACK_V = 161 -- ingombro asse Z con cremagliera
local MIN_ENG_XZ2_V = 180 -- ingombro assi XZ sotto
local MIN_Z2_FOR_ENG_XZ2_V = 270 -- quota Z2 da cui considerare ingombro assi XZ sotto
local MIN_Z2_FOR_ENG_XZ2_V = 250 + EgtIf( MaxZ2 > 1100, 300, 0) -- quota Z2 da cui considerare ingombro assi XZ sotto
local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza
local MaxLenSmT = 1500 -- massima lunghezza pezzo scaricato con nastri verdi
local DIST_Y1MAX_LOAD = 100 -- distanza carrello Y1 da massimo asse al carico
@@ -574,7 +589,11 @@ function OnPostApplyMachining()
-- Verifico flag di separazione e fase di scarico
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
local bPreSplit = ( false and sNotes:find( 'Presplit', 1, true) ~= nil)
-- bPreSplit sempre a falso per obbligare a pinzare il pezzo con 1 morsa anche se iniziato il taglio che dividerà grezzo e finito (in genere per sezioni grandi con 2 tagli di lama)
-- Tra un taglio e l'altro infatti c'e' inversione del braccio e quindi un'apertura delle rulliere. Se pinzano entrambe le pinze, potrebbero esserci problemi di collisone rulli-morse
local bPreSplit = false --( sNotes:find( 'Presplit', 1, true) ~= nil)
local bSplitting = ( sNotes:find( 'Split', 1, true) ~= nil)
local bPreCut = ( sNotes:find( 'Precut', 1, true) ~= nil)
local bCutting = ( sNotes:find( 'Cut', 1, true) ~= nil)
@@ -655,6 +674,14 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
-- Verifico se lavorazione pareti
local bWall = ( EgtGetInfo( EgtGetCurrMachGroup() or GDB_ID.NULL, 'Wall', 'd') == 1)
-- mi salvo info lavorazione su una lista
local AuxInfoMach = {}
AuxInfoMach.bPreSplit = bPreSplit
AuxInfoMach.bSplitting = bSplitting
AuxInfoMach.bPreCut = bPreCut
AuxInfoMach.bCutting = bCutting
AuxInfoMach.bUnload = bUnload
-- Assegno flag di pezzo separato dal resto del grezzo
SPLIT = IsEndPhase( EMC.PHASE)
@@ -741,7 +768,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
local dPosT = LoadT
local vCmd = SpecCalcLoad( dPosT, dDistFront, max( dDistBack, MinJoin, EMC.LB - ( MaxY1 - MinY1) + 6))
EMC.LOAD = true
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
EMC.LOAD = nil
if bSplitting and EMC.ERR == 18 then
table.insert( vCmd, { 22, dRollBack, -dRollFront})
@@ -754,7 +781,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
-- Se altrimenti non eseguito SPLIT, eseguo calcoli per carrelli
elseif not SPLIT then
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
-- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller
if SpecTestOnlyRemarkInCmds( vCmd) then
table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)})
@@ -883,7 +910,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
EgtSetAxisPos( 'A2', vAxMid[6])
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
else -- 'H31'
else -- testa 3
EgtSetAxisPos( 'C3', vAxMid[4])
EgtSetAxisPos( 'B3', vAxMid[5])
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C3'), GDB_BB.ONLY_VISIBLE)
@@ -991,7 +1018,11 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
local dNewY1min = max( EMC.LB - dDistBack, MinOther + AggLoad + EMC.HCING + EMC.HOVM)
local dNewY1max = min( ( MaxY1 - MinY1) - 5, EMC.LB - MinJoin)
if dNewY1min > dNewY1max then return nil end
local dNewY1Delta = EgtClamp( BD.CHAR_LOAD_DIST or 3000, 0.75 * dNewY1min + 0.25 * dNewY1max, 0.25 * dNewY1min + 0.75 * dNewY1max)
-- minimo posizionamento pinza 1 per permettere scarico del restante
local dMinLengthRestToUnload = abs( MinY1) + abs( MinV1) + abs( MaxV2) + abs( MaxY2) + MinJoin + AggLoad + EMC.LT + 10
-- calcolo posizionamento con i coefficienti, ma verifico che sia tra il minimo e il massimo pinzabile
local dNewY1DeltaMax = EgtClamp( 0.25 * dNewY1min + 0.75 * dNewY1max, dMinLengthRestToUnload, dNewY1max)
local dNewY1Delta = EgtClamp( BD.CHAR_LOAD_DIST or 3000, 0.75 * dNewY1min + 0.25 * dNewY1max, dNewY1DeltaMax)
local dNewY2Delta = nil
local dNewY1 = dPosT + dNewY1Delta
local vCmd = {}
@@ -1035,7 +1066,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
end -- SpecAdjustLoad [L]
---------------------------------------------------------------------
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
local MinFrontJoin = MinJoin + EMC.HCING + EMC.HOVM
local MyMinOther = MinOther + EgtIf( EMC.CNT == 1, AggLoad, 0)
@@ -1069,11 +1100,19 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dY1DeltaMaxF = min( EMC.LB - MinJoin, MaxY1 + dDistFront + dRollFront + AGG_V)
WorkTab.dY2DeltaMinF = nil
WorkTab.dY2DeltaMaxF = nil
if dY1DeltaMaxSP then WorkTab.dY1DeltaMaxF = min( WorkTab.dY1DeltaMaxF, dY1DeltaMaxSP) end
WorkTab.dV1PosF = dRollBack
WorkTab.bV1CloseF = false
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
if WorkTab.dY1DeltaMinF > WorkTab.dY1DeltaMaxF + 10 * GEO.EPS_SMALL then
EMC.ERR = 18
@@ -1110,6 +1149,13 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
if WorkTab.dY1DeltaMinF > WorkTab.dY1DeltaMaxF + 10 * GEO.EPS_SMALL then
EMC.ERR = 18
@@ -1988,7 +2034,7 @@ local function PosY2Y1B( TabI, vCmd)
if TabI.dY2PosI > MinY2 and
TabI.dY2PosI > TabI.dTPosI + MinJoin + EMC.HOVM + EMC.HCING - 10 * GEO.EPS_SMALL then
-- allontanamento morse, trascinamento trave con Y2
MaxDispl( TabI, vCmd, 'M2')
MaxDispl( TabI, vCmd, 'M2')
else
-- accentramento morse, trascinamento trave con Y1
MaxDispl( TabI, vCmd, 'M3')
+121
View File
@@ -1,5 +1,126 @@
==== Common_PF1250 Update Log ====
Versione 2.7b2 (04/02/2025)
- (SIM-GEN) Piccola modifica nel calcolo posizione dei rulli di pinzaggio.
Versione 2.7b1 (03/02/2025)
- (SIM) Corretta simulazioen che non mandava testa in home in caso di utensile lungo. Generazione era già ok. Ticket#2280
Versione 2.7a2 (28/01/2025)
- (SIM-GEN) In MLSE aggiunta piccola correzione quota Z in caso di direzione Z tra 0.5 e 0.707.
Versione 2.7a1 (17/01/2025)
- (GEN) Piccola correzione posizione X in preselezione utensile
- (GEN) Corretto primo punto X preselezione utensile. Ticket#2183 e #2250
Versione 2.6l7 (19/12/2024)
- (SIM) HOTFIX : corretto posizione Z zero alla selezione dell'utensile in caso di motosega. Ticket#2235
Versione 2.6l6 (18/12/2024)
- (MLDE-SIM-GEN) Aggiunta variabile 'SafeX2RotAxis' in sostituzione della 'ParkMchY2' che era usata impropriamente
Versione 2.6l5 (17/12/2024)
- (SIM) Corretta posizione iniziale testa 2. Ticket#2228
Versione 2.6l4 (16/12/2024)
- (SIM-GEN) In MLSE ripristinati vecchi valori indici calcolo Z massima. In alcuni casi peggioravano la situazione.
Versione 2.6l3 (16/12/2024)
- (SIM) Corretto scarico utensile se aggregato. Se non presente utensile di default, non seleziona nulla.
- (SIM-GEN) In MLSE ritoccati indici calcolo Z massima. Ticket#2210
Versione 2.6l2 (13/12/2024)
- (SIM) Corretta chiamata calcolo asse virtuale
Versione 2.6l1 (13/12/2024)
- (SIM) Gestione caricamento utensili in caso di testa con uscita multipla.
- (SIM) Corretto errore di collisione per errata simulazione cambio utensile da lama a motosega.
- (SIM-GEN) Corretta gestione in caso di prima lavorazione con motosega.
- (GEN) Non si fa preselezione della testa 3
- (GEN) Corretta emissione coordinata rotazione testa 3 in zona sicura
- (SIM-GEN) A fine barra, testa 3 sempre in home
- (GEN) Controllo esistenza terzo asse ausiliario
- (GEN) Corretto primo movimento in X quando si parte con testa 3. Ticket#2216
- (GEN) Se su testa 1 c'è un aggregato e si utilizzerà la testa 3, si scarica aggregato e si prende utensile di default. Ticket#2222
- (GEN) Durante utilizzo della testa 3, non si preselezionano altre teste. Ticket#2220
- (SIM-GEN) Se lavorazione con testa dedicata lama e su testa 1 c'era aggregato, viene scaricato. Ticket#2216
Versione 2.6k3 (26/11/2024)
- (GEN) Corretta modifica fatta in versione 2.6k2. Ticket#2183
Versione 2.6k2 (25/11/2024)
- (GEN) Se si preseleziona su testa 1 un utensile lungo, non si va alla X successiva di lavoro ma si resta in home. Infatti potrebbe toccare le paratie in caso di scambio pezzo. Ticket#2183
Versione 2.6k1 (04/11/2024)
- (SIM-GEN) Gestione terza testa 5 assi dedicata lama (H38)
Versione 2.6j3 (25/10/2024)
- (GEN) Piccola correzione per capire se testa 3 presente
- (SIM-GEN) In caso di lavorazione successiva alla prima, rivisto primo posizionamento alla quota Z di lavoro se precedentemente spostati a quota rotazione assi rotanti.
Versione 2.6j2 (23/10/2024)
- (MLDE-SIM) Aggiunto parametro ParkTc1X1 in MLDE per simulazione quota parcheggio Testa 1 su TC1.
- (SIM-GEN) Per movimento a ZMAX si considera utensile attuale o precedente
- (SIM-GEN) Prima versione con gestione testa 3 dedicata lama
Versione 2.6j1 (01/10/2024)
- (GEN) Migliorato calcolo chiusura paratia rulli con aggiornamento lunghezza della barra in caso di ultimo taglio e grezzo residuo in coda. Ticket#2017
- (NGE-SIM) Aggiunta gestione solidi collisione per TC verticali e TC rotante sotto
- (GEN) Per lavorazione in doppio: messaggio bloccante in caso di extra-corsa durante un movimento standard su piano generico della lavorazione.
Versione 2.6i1 (10/09/2024)
- (GEN) Se diametro utensile più del truciolatore standard grande, non si preseleziona. Ticket#2028
Versione 2.6h2 (28/08/2024)
- (SIM-GEN) Quando si aprono i rulli, se la trave non può seguire i rulli perchè la pinza andrebbe in extra-corsa, si sposta comunque la pinza fino al massimo della sua corsa. Ticket#1949
- (GEN) La testa veniva spostata a quota X sicurezza rotazione assi rotanti prima di aprire le rulliere. Ticket#1991
Versione 2.6h1 (07/08/2024)
- (GEN) Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. Ticket#1891
- (SIM-GEN) Migliorata gestione riposizionamenti fatta con la 2.6g1. Ticket#1836
- (MLDE-SIM-GEN) Rinominato file da "Common-" a "Common_" per uniformità con i file common delle altre macchine. Serve modifica a MLDE macchina.
Versione 2.6g5 (24/07/2024)
- (SIM) Per OnSetHead chiamata da simulazione, aggiunta lettura TOTDIAM. Serve per limitare corse assi testa sotto. Ticket#1946
Versione 2.6g4 (23/07/2024)
- (SIM) Corretta ultima modifica per controllo collisioni testa non utilizzata. Trovava collisioni in lavorazioni in doppio.
Versione 2.6g3 (22/07/2024)
- (SIM) Si aggiunge al controllo collisioni anche Tool e ToolHolder della testa non utilizzata. Ticket#1937
- (SIM-GEN) In caso di grezzo piuttosto piccolo, concesso pinzaggio fino al massimo possibile, oltre al calcolo con coefficienti. Ticket#1942
Versione 2.6g2 (12/07/2024)
- (SIM-GEN) Corretto movimento testa sotto che andava in collisione tra una lavorazione e la successiva se tra le due c'era un riposizionamento pinze. Ticket#1925
Versione 2.6g1 (08/07/2024)
- (SIM-GEN) Corretto movimento che pinzava nel vuoto durante riposizionamento. Ticket#1836
Versione 2.6f2 (06/06/2024)
- (GEN) Quando si va a ZMAX, si azzerano tutte le coordinate ".pp". Scriveva una Z bassa quando era a Z massima. Ticket#1839
Versione 2.6f1 (03/06/2024)
- (SIM-GEN) Migliorata gestione approccio al pezzo con lama aggregato da sotto. Va al minimo in X solo se necessario.
Versione 2.6e6 (28/05/2024)
- (GEN) Aggiunta possibilità di scrivere nome utensile doppio anche in lavorazione con parametro "TOOLDOUBLE". Note sulla lavorazione hanno precedenza su note utensile.
- (GEN) Ripristinato controllo extra-corsa per testa 2 in caso di lavorazioni in doppio in Y (si era perso in un vecchio commit)
- (SIM-GEN) Corretto movimento testa sotto su prima lavorazione. Ruotava a parcheggio invece di andare a quota sicurezza rotazione assi.
Versione 2.6e5 (23/05/2024)
- (GEN) Controllo extra-corsa per testa 2 in caso di lavorazioni in doppio in Y
- (GEN) Corretta lettura e salvataggio coordinala asse L2 con coordinate rispetto origine. Prima erano locali e sbagliava alcuni calcoli
- (SIM-GEN) Se lavorazione con testa 2 e stesso utensile, piccola correzione che manda a parcheggio se cambiano assi rotanti solo se si trova a ZMAX
Versione 2.6e4 (15/05/2024)
- (SIM-GEN) Miglioramento gestione lama su aggregato da sotto
Versione 2.6e3 (09/05/2024)
- (SIM) Corretto prelievo lama 2 (H16). Prima di visualizzare utensile, si sposta la Z alla quota massima. Prima trovava collisione in caso utensile precedente non lama (perchè era già oltre la quota massima).
Versione 2.6e2 (06/05/2024)
- (GEN) In parcheggio paratie/pinze, viene considerato sovramateriale di testa. Simulazione era corretta. Ticket#1789
Versione 2.6e1 (30/04/2024)
- (SIM-GEN) Per macchina a 3 teste, ripristinato posizionamento testa 2 tramite parametro ParkInLavZ2. La gestione era stata persa dal common.
- (MLDE-GEN) Gestione facoltativa parametro WOOD_DENSITY settabile in Ts3. In MLDE, mettere il valore di WOOD_DENSITY nella nostra variabile 'WoodDensity'.
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6e1', -- versione script
VERSION = '2.7b2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}