Compare commits

...

146 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
andrea.villa 1f388d6b36 Merge branch 'develop' 2024-04-30 10:46:56 +02:00
andrea.villa c3a31403ce Modifica file log 2024-04-30 10:46:46 +02:00
andrea.villa 40cdb9ec93 Gestione parametro WoodDensity (WOOD_DENSITY in Ts3) 2024-04-30 10:37:32 +02:00
andrea.villa 33cb7da920 per macchina a 3 teste, ripristinato posizionamento testa 2 tramite parametro ParkInLavZ2 2024-04-23 16:40:16 +02:00
andrea.villa 0c8b706f9a Merge branch 'main' into develop 2024-04-23 15:49:03 +02:00
andrea.villa 6736907045 Merge branch 'develop' 2024-04-23 15:48:43 +02:00
andrea.villa 3d4e235a23 - Aggiunto parametro MaxZ1Blade per differenziare Z massima aggregato lama e altri utensili.
- Aggiunto controllo con solido di collisione per verificare di non salire oltre il massimo
- Corretta simulazione scambio testa 3 -> testa 1
2024-04-23 15:48:27 +02:00
andrea.villa 557bfcbe74 Ripristinato movimento iniziale testa sopra assieme alle pinze. 2024-04-22 10:25:39 +02:00
andrea.villa 6ac8ad5bfd - Modificato movimenti testa sotto. Prima si muove in quota 'ParkMchY2'.
- Per lavorazioni in doppio, viene subito scritta la quota Z.
2024-04-17 11:02:19 +02:00
andrea.villa b3b4061a07 Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni 2024-04-15 12:45:18 +02:00
andrea.villa 7b00a25b15 Aggiunto parametro 'IS_TEST_MACHINE' per test interni 2024-04-12 09:26:46 +02:00
andrea.villa 918ba0f7e5 Merge branch 'main' into develop 2024-04-09 11:48:57 +02:00
andrea.villa c7a867746c Merge remote-tracking branch 'origin/develop' 2024-04-09 11:48:48 +02:00
andrea.villa e795838473 - Corretto posizionamento assi in home se primo utensile punta lunga 2024-04-09 11:48:36 +02:00
andrea.villa 8d8d06022a - Corretto impostazione piano G24
- Corretta posizione prelievo/parcheggio se lama su aggregato da sotto
- Aggiunta variabile 'ForceToCloseRollersGate' per forzare chiusura paratie rulli
- Corretta scrittura lista utensili iniziale M992
-  Corretto movimento punte lunghe
- Corretto adeguamento speed aggregato lama da sotto
- Aumentato numero riposizionamenti possibili a 10
2024-04-09 09:58:09 +02:00
andrea.villa 3dc67b0861 Merge branch 'main' into develop 2024-03-26 13:28:18 +01:00
andrea.villa b291bc488b Merge branch 'develop' 2024-03-26 13:28:03 +01:00
andrea.villa c65aff1bed - Modificate collisioni traversa. Ora non comprende carro X1, il quale ha il proprio oggetto di collisione
- Aggiornati log per versione
2024-03-26 13:27:54 +01:00
andrea.villa 5f0f2a5961 Aggiunta gestione parametro "SECDIST" 2024-03-26 08:54:27 +01:00
andrea.villa d75d1ca9ea Corretto primo movimento in rapido della lavorazione per testa sotto 2024-03-21 11:42:50 +01:00
andrea.villa 2b23501bf6 Merge branch 'main' into develop 2024-03-14 09:09:58 +01:00
andrea.villa f0dcfb4b92 Merge branch 'develop' 2024-03-14 09:09:40 +01:00
andrea.villa 05f0d95c87 Migliorata preselezione utensile 2024-03-14 09:09:26 +01:00
andrea.villa b00c0e1213 Miglioramento visualizzazione spigoli VMILL alla fine della simulazione 2024-03-12 14:50:53 +01:00
andrea.villa 8084c2843e Merge branch 'main' into develop 2024-03-12 12:51:40 +01:00
andrea.villa 33b6c92e9a Merge branch 'develop' 2024-03-12 12:51:30 +01:00
andrea.villa 4f6d50c76b Migliorata gestione movimenti con lama su aggregato su testa sotto 2024-03-12 12:51:23 +01:00
andrea.villa c028617d57 Merge branch 'main' into develop 2024-03-04 10:32:35 +01:00
5 changed files with 1211 additions and 297 deletions
File diff suppressed because it is too large Load Diff
+436 -113
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)
@@ -120,12 +122,16 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL1'},
{ 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 = 'Z2', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}}
if EgtGetHeadId('H31') then
table.insert( McdData, { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'})
if IsHeadExisting( 3) then
table.insert( McdData, { Grp = 'X3', Sub = 'COLLISION', Name = 'STM'})
end
@@ -448,13 +454,20 @@ 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' 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')
-- se testa 3 parcheggio la 1
@@ -463,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
@@ -474,19 +489,36 @@ function OnSimulToolSelect( dPosA)
-- 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 aggregato foratura multipla, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H14' then
-- valore dell'asse virtuale
dPosA = dPosA or GetNextSawingVirtualAxis( EMT.MCHID)
dPosA = dPosA or GetNextMultiDrillVirtualAxis( EMT.MCHID)
-- imposto il valore di A
EgtSetAxisPos( 'A2', dPosA)
-- imposto home dell'asse C1 (A2=0 -> T101, A2=90 -> T104)
local MyParkSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkSawC2)
EgtSetAxisPos( 'C2', MyParkSawC2)
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
-- imposto il valore di A
EgtSetAxisPos( 'A2', dPosA)
-- imposto home dell'asse C1 (A2=0 -> T201, A2=90 -> T204)
local MyParkSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkSawC2)
EgtSetAxisPos( 'C2', MyParkSawC2)
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end
end
-- carico utensile, con breve pausa
EgtPause( 100)
EgtOutText( '')
@@ -514,14 +546,19 @@ end
---------------------------------------------------------------------
function OnSimulToolDeselect( dPrevA)
-- se prossimo utensile non cambia e non è sega a catena, esco
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and EMT.NEXTHEAD ~= 'H13' and EMT.NEXTHEAD ~= 'H22' then return end
-- 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' or EMT.NEXTHEAD ~= 'H14') and ( EMT.NEXTHEAD ~= 'H22' or not dPrevA) then return end
-- deposito utensile
EgtOutText( 'Tool change in progress...')
-- recupero il gruppo
local nSetHead = GetHeadSet( EMT.NEXTHEAD)
-- recupero il gruppo attuale e il successivo
local nNextSetHead = GetHeadSet( EMT.NEXTHEAD)
local nSetHead = GetHeadSet( EMT.HEAD)
-- 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
if nSetHead == 2 and EMT.PREVTCPOS_H2 then
if nNextSetHead == 2 then
-- deposito lama su aggregato testa sotto
if EMT.PREVHEAD_H2 == 'H22' then
-- simulo movimento
@@ -529,6 +566,7 @@ function OnSimulToolDeselect( dPrevA)
if dPrevA then
ParkC2 = GetSawCHomeFromVirtualAxis( dPrevA)
end
SimulMoveAxis( 'Z2', MinZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkSawB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
end
@@ -539,22 +577,22 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetStatus( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_ST.OFF)
-- se testa gruppo 1
elseif nSetHead == 1 and EMT.PREVTCPOS_H1 then
elseif nNextSetHead == 1 and EMT.PREVTCPOS_H1 then
-- deposito utensile fresa
if EMT.PREVHEAD_H1 == 'H11' then
-- simulo movimento
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', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc1C1, MCH_SIM_STEP.RAPROT)
local dPosX = ParkX1
SimulMoveAxes( 'B1', ParkLongB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc1C1, MCH_SIM_STEP.RAPROT)
local dPosX = ParkTc1X1
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc2C1, MCH_SIM_STEP.RAPROT)
SimulMoveAxes( 'B1', ParkLongB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc2C1, MCH_SIM_STEP.RAPROT)
local dPosX = ParkTc2X1
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
end
@@ -563,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
@@ -573,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
@@ -586,37 +635,54 @@ 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)
elseif nNextSetHead == 1 then
SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID)
end
-- movimento per prendere nuovo utensile
-- prendo utensile fresa
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
@@ -640,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))
@@ -651,39 +731,25 @@ 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
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
EMT.PREVTTOTLEN_H1 = EMT.TTOTLEN
-- 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)
else
EMT.PREVTOOL_H3 = nil
EMT.PREVHEAD_H3 = nil
EMT.PREVTCPOS_H3 = nil
EMT.PREVTTOTLEN_H3 = nil
end
-- recupero alcuni dati della lavorazione
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
@@ -729,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
@@ -744,6 +839,7 @@ function OnSimulMachiningStart()
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
EMT.DOU_TO_ZMAX = nil
end
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
end
@@ -761,6 +857,31 @@ function OnSimulMachiningEnd()
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = EMT.DOU_TYPE end
EMT.DOU_TYPE = nil
EMT.DOU_TOOL = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
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
EMT.PREVTCPOSREAL_H2 = EMT.TCPOSREAL
-- per gruppo testa 3
else
EMT.PREVTOOL_H3 = EMT.TOOL
EMT.PREVHEAD_H3 = EMT.HEAD
EMT.PREVTCPOS_H3 = EMT.TCPOS
EMT.PREVTTOTLEN_H3 = EMT.TTOTLEN
end
end
---------------------------------------------------------------------
@@ -895,6 +1016,7 @@ function OnSimulMoveStart()
local C1Home = EgtGetAxisHomePos( 'C1')
local Z1Pos = EgtGetAxisPos( 'Z1')
local Z1Home = EgtGetAxisHomePos( 'Z1')
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- se fresa o lama
if EMT.HEAD ~= 'H13' then
-- se movimento iniziale da Zmax con lama o fresa
@@ -903,7 +1025,7 @@ function OnSimulMoveStart()
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( C1Pos - EMT.R1) > 1 or abs( B1Pos - EMT.R2) > 1) and ( abs( C1Home - EMT.R1) > 30.1 or abs( B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
@@ -913,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
@@ -941,17 +1074,87 @@ function OnSimulMoveStart()
local C2Home = EgtGetAxisHomePos( 'C2')
local Z2Home = EgtGetAxisHomePos( 'Z2')
local X2Home = EgtGetAxisHomePos( 'X2')
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
local X2Pos = EgtGetAxisPos( 'X2')
local B2Pos = EgtGetAxisPos( 'B2')
local C2Pos = EgtGetAxisPos( 'C2')
-- 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' 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 > SafeX2RotAxis and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', SafeX2RotAxis, MCH_SIM_STEP.RAPID)
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
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 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
@@ -999,7 +1202,7 @@ function OnSimulMoveStart()
EmtSetLastError( 1208, sErr)
end
-- se appena sopra inizio, sistemo subito la quota in Z
if EMT.MOVE == 0 and EMT.FLAG == 1 then
if EMT.MOVE == 0 then
SimulMoveAxes( 'Z2', EMT.A6, MCH_SIM_STEP.RAPID)
end
end
@@ -1061,10 +1264,13 @@ function OnSimulMoveStart()
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
end
EMT.ZMAX = nil
EMT.TO_ZMAX = nil
end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- rimozione eventuali sfridi
if EMT.FLAG == 301 then
ExecRemoveScraps()
@@ -1109,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
@@ -1220,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')
@@ -1275,11 +1485,13 @@ end
function ExecStartHome()
-- Testa 1
EgtResetAxisPos( 'X1')
EgtResetAxisPos( 'Z1')
EgtSetAxisPos( 'Z1', MaxZ1)
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
-- Testa 2
EgtResetAxisPos( 'X2')
local _, sHead, _, _, _, _ = FindFirstToolOnHeadSet( 2)
local PosXStart = EgtIf( sHead == 'H22', SafeX2, ParkX2)
EgtSetAxisPos( 'X2', PosXStart)
EgtSetAxisPos( 'Z2', MinZ2)
EgtResetAxisPos( 'C2')
EgtResetAxisPos( 'B2')
@@ -1288,14 +1500,20 @@ end
---------------------------------------------------------------------
function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit)
EMT.TO_ZMAX = nil
-- se testa sotto
if GetHeadSet( EMT.HEAD) == 2 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
-- 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
-- se richiesto, avvicino i rulli
if bNearV then
ExecOpenRoller( 1)
@@ -1308,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
@@ -1332,13 +1550,14 @@ function ExecMoveZmax( bMchSplit)
end
-- se testa sopra
if nSetHead == 1 then
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- se fresa o lama
if EMT.HEAD ~= 'H13' then
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) then
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
end
if ( not BD.RIGHT_LOAD and EMT.L2 > DeltaTabY) or ( BD.RIGHT_LOAD and EMT.L2 < DeltaTabY) then
SimulMoveAxis( 'X1', DeltaTabY, MCH_SIM_STEP.RAPID)
@@ -1346,7 +1565,10 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
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
@@ -1371,11 +1593,35 @@ function ExecMoveZmax( bMchSplit)
elseif nSetHead == 2 then
SimulMoveAxis( 'Z2', ParkZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', SafeX2, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- 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
@@ -1400,10 +1646,14 @@ function ExecUnloading()
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
@@ -1525,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
@@ -1555,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,
@@ -1803,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
---------------------------------------------------------------------
@@ -1815,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
@@ -1827,12 +2090,32 @@ 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
local dPosA = tonumber( sBlockedAxis:sub( 4) or '') or 0
if dPosA ~= 0 then
-- imposto il valore di A
EgtSetAxisPos( EgtIf( nHSet == 1 , 'A1', 'A2'), dPosA)
end
end
-- 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
@@ -2246,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)
@@ -2256,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
@@ -2271,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
---------------------------------------------------------------------
@@ -2316,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
@@ -2362,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
+95 -28
View File
@@ -1,4 +1,4 @@
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/04/09
-- Intestazioni
require( 'EmtGenerator')
@@ -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)
@@ -71,14 +74,16 @@ function OnSpecialGetMaxZ()
elseif EMC.HEAD == 'H12' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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
elseif bBSameSign and EMC.R1p > 29.9 and EMC.R1p < 180.1 and EMC.R1 > 29.9 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and EMC.R1p > -0.1 and EMC.R1p < 180.1 and EMC.R1 > -0.1 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
@@ -89,14 +94,16 @@ function OnSpecialGetMaxZ()
elseif EMC.HEAD == 'H16' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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
elseif bBSameSign and EMC.R1p > 29.9 and EMC.R1p < 180.1 and EMC.R1 > 29.9 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and EMC.R1p > -0.1 and EMC.R1p < 180.1 and EMC.R1 > -0.1 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
@@ -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,15 +910,19 @@ 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)
end
-- Forzo la distanza di sicurezza da utensile
local nSecRollerDist = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES), 'SECDIST', 'i') or SIC_V
local dMinFrontEng = EgtIf( nSetHead ~= 2, MIN_ENG_RACK_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dRollFront = max( b3Enc:getMax():getX(), dMinFrontEng) + SIC_V
local dRollFront = max( b3Enc:getMax():getX(), dMinFrontEng) + nSecRollerDist
local dMinBackEng = EgtIf( nSetHead ~= 2, MIN_ENG_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dRollBack = max( -b3Enc:getMin():getX(), dMinBackEng) + SIC_V
local dRollBack = max( -b3Enc:getMin():getX(), dMinBackEng) + nSecRollerDist
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip
@@ -987,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 = {}
@@ -1031,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)
@@ -1065,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
@@ -1106,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
@@ -1280,21 +1330,30 @@ end
---------------------------------------------------------------------
local function ChangedTool( nMchId)
local bChanged = false
local nChanged = 0
-- Salvo lavorazione e utensile correnti, per ripristinarli alla fine
local nOrigMchId = EgtGetCurrMachining()
local sOrigTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
local sOrigBlockedAx = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
-- Recupero l'utensile della lavorazione precedente
local nPrevMchId = EgtGetPrevActiveOperation( nMchId or GDB_ID.NULL)
if nPrevMchId and EgtGetOperationType( nPrevMchId) ~= MCH_OY.DISP then
EgtSetCurrMachining( nPrevMchId)
local sTool = EgtGetMachiningParam( MCH_MP.TOOL)
bChanged = ( sTool ~= sOrigTool)
nChanged = EgtIf( sTool ~= sOrigTool, 1 , 0)
local sBlockedAx = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
-- se stesso utensile, ma modo caricamento diverso, è come se fosse un cambio utensile. Vale solo se aggregato su lama da sotto.
if sTool == sOrigTool then
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if sHead == 'H22' and sOrigBlockedAx ~= sBlockedAx then
nChanged = 2
end
end
end
-- Ripristino lavorazione e utensile correnti
if nOrigMchId then EgtSetCurrMachining( nOrigMchId) end
if sOrigTool then EgtTdbSetCurrTool( sOrigTool) end
return bChanged
return nChanged
end
--------------------------------------------------------------------------------------------------------
@@ -1303,9 +1362,9 @@ end
function SpecAdjustCarriages( WorkTab)
--EgtOutLog( ' --->>> CNT=' .. EgtIf( EMC.CNT, '1', '_'))
local bChangedTool = ChangedTool( EMC.MCHID)
-- Aggiorno la posizione dei rulli per eventuale cambio utensile
if ChangedTool( EMC.MCHID) then
if bChangedTool ~= 0 then
WorkTab.dV1PosI = ParkV1
WorkTab.dV2PosI = ParkV2
end
@@ -1314,15 +1373,24 @@ function SpecAdjustCarriages( WorkTab)
if WorkTab.dY1DeltaI then
local dY1DeltaLim = MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EMC.HCING + EMC.HOVM + EgtIf( EMC.CNT == 1, AggLoad, 0)
if WorkTab.dY1DeltaI <= dY1DeltaLim or ( WorkTab.dY1DeltaMaxF and WorkTab.dY1DeltaMaxF <= dY1DeltaLim) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaI then
local dY2DeltaLim = MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V
if EMC.LB - WorkTab.dY2DeltaI <= dY2DeltaLim or ( WorkTab.dY2DeltaMinF and EMC.LB - WorkTab.dY2DeltaMinF <= dY2DeltaLim) then
bCloseV = true
bCloseV = true
end
end
-- se ho cambiato modo di prendere utensile, forzo chiusura
if bChangedTool == 2 then
bCloseV = true
end
-- se i pezzi del cliente sono molto storti, si forza la chiusura per evitare che vada a sbattere. Se parametro non presente, si chiude solo se necessario
if ForceToCloseRollersGate then
bCloseV = true
end
WorkTab.bCloseV = bCloseV
-- |POSIZIONO Y1| **[A]**
@@ -1835,7 +1903,7 @@ local function PosY1Y2B( TabI, vCmd)
end
end
nCnt = nCnt + 1
if nCnt > 5 then return end
if nCnt > 10 then return end
until ( not bXW)
-- chiusura/parcheggio dei trascinatori in funzioni chiamanti
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
@@ -1899,7 +1967,6 @@ local function PosY2Y1A( TabI, vCmd)
MaxDispl( TabI, vCmd, 'M1')
end
end
until ( not bXW)
-- chiusura/parcheggio dei trascinatori in funzioni chiamanti
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
@@ -1967,14 +2034,14 @@ 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')
end
end
nCnt = nCnt + 1
if nCnt > 5 then return end
if nCnt > 10 then return end
until ( not bXW)
-- la chiusura delle morse è fatta sopra
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
+160 -1
View File
@@ -1,5 +1,164 @@
==== 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'.
Versione 2.6d2 (23/04/2024)
- (MLDE-GEN) Aggiunto parametro 'IS_TEST_MACHINE' FACOLTATIVO. Se non esiste o 'false' è macchina standard, se 'true' è una macchina utilizzata per i test Egalware interni
- (GEN) Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni, equivalente a settare 'IS_TEST_MACHINE' (che comunque rimane)
- (SIM-GEN) Modificato movimenti testa sotto. Prima si muove in quota 'ParkMchY2' e poi va alla coordinata di lavoro ruotando gli assi
- (SIM) Per lavorazioni in doppio, viene subito scritta la quota Z. La generazione era già corretta. Ticket#1377
- (GEN) Ripristinato movimento iniziale testa sopra assieme alle pinze. Spostato comando wait dopo primo movimento testa. Ticket#1730
- (MLDE-SIM-GEN) Aggiunto parametro MaxZ1Blade per differenziare Z massima aggregato lama e altri utensili.
- (SIM) Aggiunto controllo con solido di collisione per verificare di non salire oltre il massimo
- (SIM) Corretta simulazione scambio testa 3 -> testa 1
Versione 2.6d1 (09/04/2024)
- (GEN) Corretto impostazione piano G24 con testa da sotto con aggregato
- (SIM-GEN) Corretta posizione prelievo/parcheggio se lama su aggregato da sotto
- (MLDE-SIM-GEN) Aggiunta variabile FACOLTATIVA 'ForceToCloseRollersGate' ( che legge la variabile da TS3 'CHIUDI_PINZE_2_3_SCAMBIO') in mlde per forzare chiusura paratie rulli
durante scambio pinze per facilitare passaggio pezzi molto storti. Se non presente chiude solo se necessario.
- (GEN) Corretta scrittura lista utensili iniziale M992 per doppia motosega e aggregato lama sotto
- (SIM-GEN) Corretto movimento punte lunghe
- (GEN) Corretto adeguamento speed per aggregato lama da sotto con coefficiente moltiplicativo
- (SIM-GEN) Aumentato numero riposizionamenti possibili a 10 ( per pezzi molto lunghi non bastava il valore precedente: 5)
- (GEN) Corretto posizionamento assi in home se primo utensile punta lunga
Versione 2.6c5 (26/03/2024)
- (SIM) Corretto primo movimento in rapido della lavorazione per testa sotto. Ora allineata a generazione
- (SIM-GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile
- (MLDE-SIM) Modificate collisioni traversa. Ora non comprende carro X1, il quale ha il proprio oggetto di collisione
Versione 2.6c4 (14/03/2024)
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. N.B.= serve CAM5 2.6c2 NON OBBLIGATORIO
- (GEN) Modifica controlli a preselezione utensile. Margine ridotto da 400m a 200mm.
- (GEN) Corretto controllo preselezione testa H1 quando H2 in lavoro
Versione 2.6c3 (12/03/2024)
- (SIM-GEN) Migliorata gestione movimenti con lama su aggregato su testa sotto
Versione 2.6c2 (04/03/2024)
- (GEN) I commenti iniziali si scrivono in modo standard, per poterli commentare nella macchina di test
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
@@ -11,7 +170,7 @@ Versione 2.6b4 (23/02/2024)
- (MLDE-SIM-GEN) EgtAddToPackagePath spostato in mlde
Versione 2.6b3 (20/02/2024)
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4 NON OBBLIGATORIO
- (SIM-GEN) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
Versione 2.6b2 (15/02/2024)
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6c2', -- versione script
VERSION = '2.7b2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}