Compare commits

...

91 Commits

Author SHA1 Message Date
andrea.villa 2bda916a16 Allineamento a common ver. 3.1f3 2026-06-08 14:44:51 +02:00
andrea.villa 42752eefcd Cambio versione 2026-06-08 10:15:20 +02:00
andrea.villa 86c030f38e Allineamento con common vr.3.1f2 2026-06-05 12:10:44 +02:00
andrea.villa 7d8bb8f03e Tolto debug 2026-06-03 13:08:13 +02:00
andrea.villa 016122276d Cambio versione 2026-06-03 12:23:50 +02:00
andrea.villa 0e78fe9c40 HOTFIX problema simulazione 2026-06-03 11:51:06 +02:00
andrea.villa 6b81b0b686 Merge remote-tracking branch 'origin/develop' 2026-06-03 10:04:29 +02:00
andrea.villa 3c6ed86e75 Allineamento a common ver. 3.1f1 2026-06-03 10:04:16 +02:00
andrea.villa 8984f91cbc Merge branch 'ProbingWithTool' into develop 2026-06-03 10:03:14 +02:00
andrea.villa 2a93cace52 Piccola modifica GetSetHead 2026-06-03 10:02:58 +02:00
andrea.villa 7fd266f3dd Merge remote-tracking branch 'origin/develop' into ProbingWithTool 2026-05-29 13:16:22 +02:00
daniele.nicoli 64d0a46970 Aggiunto Clamp di sicurezza per lettura dei parametri MinJoin da Ts3Data 2026-04-23 12:22:39 +02:00
daniele.nicoli 58db14bc02 Merge remote-tracking branch 'origin/master' into develop 2026-04-23 12:21:55 +02:00
andrea.villa 1ee22cf974 - Merge branch 'master' into ProbingWithTool
- Prima versione installata in macchina da cliente
2026-04-23 10:55:41 +02:00
andrea.villa 87d240b49f Merge remote-tracking branch 'origin/develop' 2026-03-17 15:22:53 +01:00
andrea.villa 14b225a4b0 Allineamento a common ver. 3.1c2 2026-03-17 15:22:40 +01:00
daniele.nicoli d7aa89fad5 Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 09:16:54 +01:00
daniele.nicoli 11459ac20b Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 08:45:06 +01:00
daniele.nicoli ecfae285f3 Aggiunti parametri letti da TS3Data.lua: MIN_JOIN_S, MIN_JOIN_L e MAX_ANGLE_DRILL_CUT 2026-03-05 14:58:47 +01:00
daniele.nicoli db78493a2a Merge remote-tracking branch 'origin/master' into develop 2026-03-05 14:55:54 +01:00
andrea.villa 88d53d6195 Merge remote-tracking branch 'origin/develop' 2026-02-20 09:16:45 +01:00
andrea.villa 81ee9426c1 Allineamento con common ver. 3.1b1 2026-02-20 09:16:32 +01:00
daniele.nicoli c578b2c03d Aggiunta la lettura da TS3Data.lua delle corse dell'asse W (MIN_W e MAX_W) 2026-02-03 11:10:19 +01:00
daniele.nicoli 8ccbe8263e Merge branch 'master' into develop 2026-02-03 11:09:54 +01:00
andrea.villa 1f9a271e7b Allineamento con common ver. 3.1a1 2026-01-16 15:49:36 +01:00
andrea.villa 72cf8717b2 Merge branch 'develop' 2025-12-18 16:17:03 +01:00
andrea.villa af58e92003 - Allineamento a common ver. 2.7l1
- Aggiunto parametro MAX_ANGLE_DRILL_CUT a BeamData
- Recupero nome macchina da funzione EGT
2025-12-18 16:16:47 +01:00
daniele.nicoli 232d5a36c7 Aggiornati mlde e nge in attesa di aggiornamento Common per Controllo Pinzaggio VMILL 2025-12-15 11:39:19 +01:00
daniele.nicoli 957942b623 Merge branch 'master' into develop 2025-12-15 10:57:37 +01:00
andrea.villa 5970cd61c1 Corretto disegno porta utensile 2025-12-11 09:29:16 +01:00
andrea.villa e6a6169f45 - Nuovo ToolHolder
- Allineamento con common ver. 2.7k3
2025-11-28 15:45:30 +01:00
andrea.villa 860e1fc5c1 Merge branch 'develop' 2025-11-20 17:01:24 +01:00
andrea.villa b4b11607e4 - Allineamento a common ver. 2.7k2
- Cambio versione per rilascio a cliente
2025-11-20 17:01:15 +01:00
daniele.nicoli eef2c16193 Aggiunta gestione CUT_SIC impostabile da TS3Data.lua 2025-11-13 12:39:22 +01:00
daniele.nicoli ce72052463 Merge branch 'master' into develop 2025-11-13 12:38:46 +01:00
andrea.villa f9b4eab0c9 Allineamento con common ver. 2.7k1 2025-11-05 13:27:09 +01:00
andrea.villa 7b4293688d Allineamento con common ver. 2.7j3 2025-10-23 07:54:10 +02:00
andrea.villa a2c3e80b5b Merge remote-tracking branch 'origin/master' into ProbingWithTool 2025-10-21 10:52:35 +02:00
andrea.villa 09baa44e02 #critical# Allineamento con common ver. 2.7j2 2025-10-21 10:51:45 +02:00
andrea.villa a280c0ea3d Merge branch 'master' into ProbingWithTool 2025-10-08 13:18:56 +02:00
andrea.villa 0dea456d13 Allineamento con common ver. 2.7j1 2025-10-08 13:17:42 +02:00
andrea.villa 9f3fbfe597 Merge branch 'master' into ProbingWithTool 2025-09-10 12:13:38 +02:00
andrea.villa 24d88cde41 Allineamento con common ver. 2.7i1, HOTFIX 2025-09-10 12:13:11 +02:00
andrea.villa eeb9a93132 Aggiornato NGE con Aggregato BH 2025-09-10 11:21:07 +02:00
andrea.villa 76c52eecce Merge branch 'master' into ProbingWithTool 2025-09-10 11:13:07 +02:00
andrea.villa e5ee956c8e Merge remote-tracking branch 'origin/develop' 2025-09-10 10:40:42 +02:00
andrea.villa 5e1c975ef7 - Allineamento common ver. 2.7i1
- Aggiunto solido collisione per tappeto
2025-09-10 10:40:28 +02:00
andrea.villa 842c491713 Merge branch 'NewAggregateBH' into develop 2025-09-10 10:38:33 +02:00
andrea.villa 09aacf8327 - Prima versione funzionante gestione motosega da sotto diretta verso l'alto
- Aggiunto solido collisione a NGE
2025-08-29 15:58:05 +02:00
andrea.villa 9c7e546e47 Merge branch 'develop' into ProbingWithTool 2025-08-28 15:26:00 +02:00
andrea.villa d49127232e Merge branch 'develop' into NewAggregateBH 2025-08-28 15:21:27 +02:00
andrea.villa 6627aae2de Merge branch 'master' into develop 2025-08-28 15:20:55 +02:00
andrea.villa 1b613a97a4 Allineamento con common ver. 2.7h2 2025-08-28 15:20:17 +02:00
andrea.villa 53e583b9d2 Merge branch 'master' into NewAggregateBH 2025-08-20 14:41:31 +02:00
andrea.villa 12e7ee1e0e Allineamento con common ver. 2.7h1 2025-08-20 14:40:41 +02:00
andrea.villa 8c31dbcf51 Prima versione funzionante aggregato BH. Da testare in macchina! 2025-07-24 08:55:08 +02:00
andrea.villa 321a91ae5e Merge remote-tracking branch 'origin/master' into ProbingWithTool 2025-07-23 12:29:53 +02:00
andrea.villa 4cc33e3b95 - Allineamento con common ver. 2.7g4
- Aggiunto parametro MaxBackClamp5
2025-07-23 12:25:52 +02:00
andrea.villa a4b6a9c93f Allineamento con common ver. 2.7g3 2025-07-22 11:22:06 +02:00
andrea.villa 449f03fb09 - IsToolCompatibleWithProbe spostata in MLDE
- in OnPostApplyMachining si salta risalita se tastatura e utensile già precaricato. NB: serve CAM5 2.7f3
2025-06-30 16:02:09 +02:00
andrea.villa 7c91df35fc - Spostate funzioni da MLPE a MLDE perchè servono anche a MLSE
- In MLSE su lavorazione tastatura, si seleziona utensile di default sul mandrino per calcoli ingombri per paratie
2025-06-27 16:38:57 +02:00
andrea.villa 0d99310258 Cambiati limiti feed massima pinze 2025-06-25 09:58:27 +02:00
andrea.villa 0b49335c8e Corretto calcolo accelerazioni massima/minima 2025-06-25 08:39:01 +02:00
andrea.villa 0d87a703ce Corretto nome file 2025-06-23 17:58:31 +02:00
andrea.villa 475b0a7ebf - Se si mantiene utensile vecchio, allora si ribadiscono i dati vecchi
- Aggiunta lista lavorazioni probing
2025-06-23 15:06:38 +02:00
andrea.villa c54ddd02e9 Disattivazione tastatura spostata prima della risalita a Z massima 2025-06-20 11:39:26 +02:00
andrea.villa fd9314ea5a Aggiunto aggregato BIG per motosega 2025-06-20 10:27:07 +02:00
andrea.villa d075af1a91 Corretta lettura posizione home testa 1 2025-06-18 18:20:59 +02:00
andrea.villa f229fae4d3 Corretto segni movimento pre e post tastatura 2025-06-18 16:58:20 +02:00
andrea.villa 5219330a4d Cambio versione per rilascio a Essetre 2025-06-18 15:26:14 +02:00
andrea.villa fd85570cfd Corretta disattivazione tastatura 2025-06-18 15:21:59 +02:00
andrea.villa 2adb157b28 - Corretto ingombro lavorazione in caso di tastatura
- Migliorie generazione
2025-06-17 18:20:13 +02:00
andrea.villa 5e6121703c - Se tastatura orizzontale, ci si alza sopra pezzo in sicurezza
- Prima versione scrittura macro tastatura
2025-06-17 12:14:34 +02:00
andrea.villa 5316abecf4 In generazione, si seleziona utensile compatibile per tastatura 2025-06-17 10:34:02 +02:00
andrea.villa f958dc8a0a Simulazione con movimenti corretti. 2025-06-16 10:45:48 +02:00
andrea.villa 4989ae5d99 Prima versione funzionante in simulazione 2025-06-13 16:50:55 +02:00
andrea.villa 9ac0aafea0 Aggiunta lavorazione e primi test 2025-06-11 17:30:59 +02:00
andrea.villa 1c047b1890 Aggiunto testa in TC e varie info 2025-06-11 12:37:59 +02:00
andrea.villa 7eea1439c4 Prima versione gestione Probe con utensile dedicato 2025-06-11 11:00:25 +02:00
andrea.villa 7b35cccaf5 Corretto indice faccia e legato al tipo di macchina, carico desto o sinistro. 2025-06-11 10:02:37 +02:00
andrea.villa da6d0bed2a Movimento tastatura aumentato a 20mm. Poi bisognerà metterlo a configurazione 2025-06-11 09:29:08 +02:00
andrea.villa 75ff61f3dc Cambio versione 2025-06-10 10:01:47 +02:00
andrea.villa dba8997045 Quando fa tastatura, si scrivono comandi di start del movimento 2025-06-10 10:01:06 +02:00
andrea.villa 263758a422 Dopo tastatura ci si sposta nel punto delle lavorazione o in Z sopra al pezzo 2025-06-06 12:36:14 +02:00
andrea.villa 1e6bc44019 Tastatore portato a 170 2025-06-06 10:25:09 +02:00
andrea.villa 0909656a6c Azzeramento tastatura con EF0 2025-06-06 10:23:08 +02:00
andrea.villa 23e17d9623 Prima della macro tastatura, si manda la testa nel punto dal quale azionare il tastatore. Per il momento si tasta sempre al centro della trave in altezza se facce verticali, o al centro in larghezza se faccia sopra. La posizione della trave invece è quella di lavorazione. 2025-06-06 09:17:32 +02:00
andrea.villa 7ba04b6e17 - Migliorata gestione presenza Probe
- Probe settato false per default
2025-06-04 15:55:16 +02:00
andrea.villa 67401b8799 Piccola correzione calcolo accelerazioni 2025-06-04 15:46:54 +02:00
andrea.villa 8b9a77cdaf - Allineamento con common ver. 2.7f1
- Gestione parametri accelerazioni pinze
2025-06-04 15:43:07 +02:00
andrea.villa 9662b22f03 Proma versione gestione PROBE 2025-06-04 11:48:35 +02:00
18 changed files with 1562 additions and 353 deletions
+13 -4
View File
@@ -42,6 +42,7 @@ local BeamData = {
DRILL_TOL = 0.2, -- tolleranza tra diametro foro e diametro punta DRILL_TOL = 0.2, -- tolleranza tra diametro foro e diametro punta
DRILL_VZ_MIN = - 0.51, -- componente limite in Z del versore di un foro DRILL_VZ_MIN = - 0.51, -- componente limite in Z del versore di un foro
DRILL_VX_MAX = 0.867, -- componente limite in X del versore di un foro sulle facce laterali DRILL_VX_MAX = 0.867, -- componente limite in X del versore di un foro sulle facce laterali
MAX_ANGLE_DRILL_CUT = 15, -- delta angolo massimo tra foro e taglio che lo attraversa
DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale
@@ -68,13 +69,16 @@ local BeamData = {
KIOTP = 5, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare KIOTP = 5, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare
MAXDIAM_POCK_CORNER = 31, -- diametro massimo utensile ammesso per tasche con angoli interni MAXDIAM_POCK_CORNER = 31, -- diametro massimo utensile ammesso per tasche con angoli interni
USE_LONGCUT = true, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut USE_LONGCUT = true, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa HEAD_DIM_FOR_BH = 125, -- dimensione di ingombro della testa per block haus
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda MAX_LEN_BH_FROM_BOTTOM = 210, -- massima lunghezza lavorabile da un lato di block haus da sotto
MAX_DIST_BH_FROM_BOTTOM = 600, -- massima distanza tra naso mandrino e sopra della trave senza collisione
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta
ADVANCE_TAIL_OFFS = 10, -- accorciamento taglio di coda avanzato (minimo 1) ADVANCE_TAIL_OFFS = 10, -- accorciamento taglio di coda avanzato (minimo 1)
DOUBLE_HEAD_DOVETAIL = false, -- flag abilitazione lavorazione mortase a coda di rondine in doppio DOUBLE_HEAD_DOVETAIL = false, -- flag abilitazione lavorazione mortase a coda di rondine in doppio
DOUBLE_HEAD_MORTISE = false, -- flag abilitazione lavorazione mortase in doppio DOUBLE_HEAD_MORTISE = false, -- flag abilitazione lavorazione mortase in doppio
DOUBLE_HEAD_DRILLING = false, -- flag abilitazione forature in doppio DOUBLE_HEAD_DRILLING = false, -- flag abilitazione forature in doppio
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
CLAMP5 = false -- presenza pinza speciale per pezzi piccoli CLAMP5 = false -- presenza pinza speciale per pezzi piccoli
} }
@@ -99,6 +103,8 @@ if EgtExistsFile( sData) then
if Machine.Offsets.DOUBLE_HEAD_DOVETAIL then BeamData.DOUBLE_HEAD_DOVETAIL = ( Machine.Offsets.DOUBLE_HEAD_DOVETAIL == 1) end if Machine.Offsets.DOUBLE_HEAD_DOVETAIL then BeamData.DOUBLE_HEAD_DOVETAIL = ( Machine.Offsets.DOUBLE_HEAD_DOVETAIL == 1) end
if Machine.Offsets.DOUBLE_HEAD_MORTISE then BeamData.DOUBLE_HEAD_MORTISE = ( Machine.Offsets.DOUBLE_HEAD_MORTISE == 1) end if Machine.Offsets.DOUBLE_HEAD_MORTISE then BeamData.DOUBLE_HEAD_MORTISE = ( Machine.Offsets.DOUBLE_HEAD_MORTISE == 1) end
if Machine.Offsets.DOUBLE_HEAD_DRILLING then BeamData.DOUBLE_HEAD_DRILLING = ( Machine.Offsets.DOUBLE_HEAD_DRILLING == 1) end if Machine.Offsets.DOUBLE_HEAD_DRILLING then BeamData.DOUBLE_HEAD_DRILLING = ( Machine.Offsets.DOUBLE_HEAD_DRILLING == 1) end
if Machine.Offsets.PRECUT_HEAD_DISABLE then BeamData.PRECUT_HEAD = ( Machine.Offsets.PRECUT_HEAD_DISABLE == 0) end
if Machine.Offsets.PRECUT_TAIL_DISABLE then BeamData.PRECUT_TAIL = ( Machine.Offsets.PRECUT_TAIL_DISABLE == 0) end
BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S) BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S)
BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L) BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L)
BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA
@@ -112,9 +118,11 @@ if EgtExistsFile( sData) then
BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
if Machine.Offsets.MAX_ANGLE_DRILL_CUT then BeamData.MAX_ANGLE_DRILL_CUT = EgtClamp( Machine.Offsets.MAX_ANGLE_DRILL_CUT, 1, 89) end
if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end
if Machine.Offsets.PRECUT_HEAD_DISABLE then BeamData.PRECUT_HEAD = ( Machine.Offsets.PRECUT_HEAD_DISABLE == 0) end if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.PRECUT_TAIL_DISABLE then BeamData.PRECUT_TAIL = ( Machine.Offsets.PRECUT_TAIL_DISABLE == 0) end if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = EgtClamp( Machine.Offsets.MIN_JOIN_S, 80, 150) end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = EgtClamp( Machine.Offsets.MIN_JOIN_L, 300, 450) end
end end
if Machine.Trave then if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
@@ -226,6 +234,7 @@ local function GetSetupInfo( sHead)
SetupInfo.bIsCSymmetrical = true SetupInfo.bIsCSymmetrical = true
SetupInfo.dCAxisEncumbrance = 180 SetupInfo.dCAxisEncumbrance = 180
SetupInfo.bToolOnAggregate = false SetupInfo.bToolOnAggregate = false
SetupInfo.Head = {}
-- testa 5 assi da sopra, dietro -- testa 5 assi da sopra, dietro
if sHead == 'H11' then if sHead == 'H11' then
+4
View File
@@ -37,6 +37,7 @@
23=SmallToolContour 23=SmallToolContour
24=AntiSplintMillCut 24=AntiSplintMillCut
25=Prof_end 25=Prof_end
26=SideMillAsBlade
[Pocketing] [Pocketing]
1=Pocket 1=Pocket
@@ -48,3 +49,6 @@
[Sawing] [Sawing]
1=Sawing 1=Sawing
[Probing]
1=DTMortise
+11
View File
@@ -0,0 +1,11 @@
-- Probingata.lua by Egaltech s.r.l. 20/06/2025
-- Gestione dati lavorazioni per Travi
-- Tabella per definizione modulo
local ProbingData = {
{ On = true, Name = 'Probing_H1', Type = 'DTMortise'},
{ On = true, Name = 'Probing_H2', Type = 'DTMortise'}
}
---------------------------------------------------------------------
return ProbingData
+583 -260
View File
File diff suppressed because it is too large Load Diff
+511 -57
View File
@@ -79,6 +79,14 @@ function OnSimulStart()
if vTools and vTools[1] and #(vTools[1]) > 0 then if vTools and vTools[1] and #(vTools[1]) > 0 then
EgtLoadTool( vTcPos[i], 1, vTools[1]) EgtLoadTool( vTcPos[i], 1, vTools[1])
ShowToolInTcPos( vTcPos[i], true) ShowToolInTcPos( vTcPos[i], true)
-- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL
if EgtTdbSetCurrTool(vTools[1]) then -- set utensile corrente
if EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_STD or EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_FLAT then -- controllo tipo utensile sega
local dCurrSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) * 0.9
-- se non definito o minore del valore precedente aggiorna la tolleranza
EMT.VMILLTOL = EgtIf( not EMT.VMILLTOL or dCurrSawLen < EMT.VMILLTOL, dCurrSawLen, EMT.VMILLTOL)
end
end
end end
end end
end end
@@ -88,6 +96,10 @@ function OnSimulStart()
if DefTcPos2 then if DefTcPos2 then
LoadFirstTool( 2, DefTcPos2) LoadFirstTool( 2, DefTcPos2)
end end
-- se presenti, nascondo i tastatori
DeactivateProbeTool()
ExecStartHome() ExecStartHome()
-- Se reset o home, esco -- Se reset o home, esco
if EMT.SIM1ST then return end if EMT.SIM1ST then return end
@@ -122,14 +134,15 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'}, { Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'}, { Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}, { Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}} { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM2'}}
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'}) table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'})
end end
-- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF -- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF
if Progress or Mortiser or EgtGetHeadId( 'H21') then if Progress or Mortiser or EgtGetHeadId( 'H21') or SecondToolChanger then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'}) table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'})
end end
-- gruppo MORTISER si attiva solo se PF con BIT mortiser attivo -- gruppo MORTISER si attiva solo se PF con BIT mortiser attivo
@@ -237,9 +250,9 @@ function OnSimulDispositionStart()
end end
end end
-- determino la risoluzione dello Zmap -- determino la risoluzione dello Zmap
local dTol = 4.00 local dTol = 4.71
if EmtGetVMillStep then if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.00) dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
else else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ() local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then if dArea < 0.075e6 then
@@ -256,6 +269,7 @@ function OnSimulDispositionStart()
dTol = 3.77 dTol = 3.77
end end
end end
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
-- creo lo Zmap -- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB) local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
if VMillId then if VMillId then
@@ -472,6 +486,7 @@ function OnSimulDispositionEnd()
EMT.UNLOADING = false EMT.UNLOADING = false
EMT.FALL = false EMT.FALL = false
EMT.TO_FALL = false EMT.TO_FALL = false
EMT.Y2DELTA = nil
end end
-- se disposizione intermedia -- se disposizione intermedia
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
@@ -503,9 +518,11 @@ function OnSimulToolSelect( dPosA)
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM) EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES) EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
local nSetHead = GetHeadSet( EMT.HEAD) local nSetHead = GetHeadSet( EMT.HEAD)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
EMT.ISPROBING = HeadIsProbe( EMT.HEAD)
-- se ho due teste, verifico che l'altra sia dalla parte opposta -- se ho due teste, verifico che l'altra sia dalla parte opposta
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
if nSetHead == 1 then if bIsFirstHead then
EgtSetAxisPos( 'X2', MinX2) EgtSetAxisPos( 'X2', MinX2)
else else
EgtSetAxisPos( 'X1', MaxX1) EgtSetAxisPos( 'X1', MaxX1)
@@ -513,10 +530,8 @@ function OnSimulToolSelect( dPosA)
end end
-- se sega a catena, imposto subito angolo scelto per asse virtuale A -- se sega a catena, imposto subito angolo scelto per asse virtuale A
if HeadIsChainSaw( EMT.HEAD) then if HeadIsChainSaw( EMT.HEAD) then
-- se non Progress, apro le paratie -- apro le paratie
if not Progress then ExecParkRoller( nil, nil, nil, nil, false, IsStartPhase( EMT.PHASE))
ExecParkRoller( nil, nil, nil, nil, false, IsStartPhase( EMT.PHASE))
end
-- valore dell'asse virtuale -- valore dell'asse virtuale
dPosA = dPosA or GetNextChainSawingVirtualAxis( EMT.MCHID) dPosA = dPosA or GetNextChainSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A -- imposto il valore di A
@@ -543,6 +558,75 @@ function OnSimulToolSelect( dPosA)
-- Imposto visualizzazione -- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD) EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end end
-- se tastatore
if HeadIsProbe( EMT.HEAD) then
local bChanged = true
if bIsFirstHead then
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H1, EMT.TOOL) then
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
EgtLoadTool( EMT.PROBENEXTHEAD_H1, 1, EMT.PROBENEXTTOOL_H1)
EMT.TCPOS = EMT.PROBENEXTTCPOS_H1
EMT.HEAD = EMT.PROBENEXTHEAD_H1
EMT.TOOL = EMT.PROBENEXTTOOL_H1
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H1, EMT.TOOL) then
bChanged = false
EMT.TCPOS = EMT.PREVTCPOS_H1
EMT.TOOL = EMT.PREVTOOL_H1
EMT.HEAD = EMT.PREVHEAD_H1
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos1
EMT.TOOL = GetToolNameFromTcPos( DefTcPos1)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
end
else
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H2, EMT.TOOL) then
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
EgtLoadTool( EMT.PROBENEXTHEAD_H2, 1, EMT.PROBENEXTTOOL_H2)
EMT.TCPOS = EMT.PROBENEXTTCPOS_H2
EMT.HEAD = EMT.PROBENEXTHEAD_H2
EMT.TOOL = EMT.PROBENEXTTOOL_H2
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H2, EMT.TOOL) then
bChanged = false
EMT.TCPOS = EMT.PREVTCPOS_H2
EMT.TOOL = EMT.PREVTOOL_H2
EMT.HEAD = EMT.PREVHEAD_H2
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos2
EMT.TOOL = GetToolNameFromTcPos( DefTcPos2)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
-- carico utensile, con breve pausa -- carico utensile, con breve pausa
EgtPause( 100) EgtPause( 100)
EgtOutText( '') EgtOutText( '')
@@ -611,10 +695,57 @@ function OnSimulToolDeselect( dPrevA)
LoadNextTool( 2, DefTcPos2) LoadNextTool( 2, DefTcPos2)
end end
end end
-- se presenti, nascondo i tastatori
DeactivateProbeTool()
local bSkipToolChange = false
-- se prossima lavorazione è tastatura, si controlla compatibilità con utensile successivo
if HeadIsProbe( EMT.NEXTHEAD) then
local idProbeMachining = EgtGetNextActiveOperation( EMT.MCHID)
local bFound = false
local nProbeHead = GetHeadSet( EMT.NEXTHEAD)
local idProbeNextMachining = EgtGetNextActiveOperation( idProbeMachining)
while not bFound do
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
local sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
if sToolNameNextProbe then
local sToolHeadNextProbe, sToolTcPosNextProbe = GetToolHead( sToolNameNextProbe)
local nToolHead = GetHeadSet( sToolHeadNextProbe)
-- se sono sulla stessa testa
if nToolHead == 1 and nProbeHead == 11 then
EMT.PROBENEXTTOOL_H1 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H1 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H1 = sToolTcPosNextProbe
bFound = true
elseif nToolHead == 2 and nProbeHead == 21 then
EMT.PROBENEXTTOOL_H2 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H2 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H2 = sToolTcPosNextProbe
bFound = true
end
end
else
break
end
idProbeNextMachining = EgtGetNextActiveOperation( idProbeNextMachining)
end
-- ripristino lavorazione corrente
EgtSetCurrMachining( EMT.MCHID)
if nProbeHead == 11 and not( IsToolCompatibleWithProbe( EMT.PREVTOOL_H1, EMT.TOOL)) then
;
elseif nProbeHead == 21 and not( IsToolCompatibleWithProbe( EMT.PREVTOOL_H2, EMT.TOOL)) then
;
else
bSkipToolChange = true
end
end
-- reset flag sega a catena già depositata -- reset flag sega a catena già depositata
EMT.CHSAW_OUT = nil EMT.CHSAW_OUT = nil
-- se utensile non cambia e non è sega a catena, esco -- se utensile non cambia e non è sega a catena, esco
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end if bSkipToolChange or ( ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD)) then return end
-- deposito utensile -- deposito utensile
EgtOutText( 'Tool change in progress...') EgtOutText( 'Tool change in progress...')
-- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa -- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa
@@ -623,7 +754,7 @@ function OnSimulToolDeselect( dPrevA)
-- se ci sono due teste -- se ci sono due teste
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
local nSetHead = GetHeadSet( EMT.NEXTHEAD) local nSetHead = GetHeadSet( EMT.NEXTHEAD)
if nSetHead == 1 then if nSetHead == 1 or nSetHead == 11 then
-- porto in home testa 1 -- porto in home testa 1
SimulMoveAxis( 'X1', MaxX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', MaxX1, MCH_SIM_STEP.RAPID)
-- deposito utensile fresa -- deposito utensile fresa
@@ -648,7 +779,7 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT) SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
-- deposito utensile lama -- deposito utensile lama
elseif EMT.PREVHEAD_H1 == 'H12' then elseif EMT.PREVHEAD_H1 == 'H12' or EMT.PREVHEAD_H1 == 'H17' then
-- simulo movimento -- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT) SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
@@ -679,7 +810,7 @@ function OnSimulToolDeselect( dPrevA)
if nSetHead == 1 and EMT.PREVHEAD_H1 then if nSetHead == 1 and EMT.PREVHEAD_H1 then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1) local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID)
elseif EMT.PREVHEAD_H2 then elseif nSetHead == 2 and EMT.PREVHEAD_H2 then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end end
end end
@@ -710,18 +841,18 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end end
-- per prossima testa gruppo 1 -- per prossima testa gruppo 1
else elseif nNextSetHead == 1 then
-- visualizzo utensile su TcPos -- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H1, true) ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
-- nascondo l'utensile sulla testa -- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN) EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
-- prendo utensile fresa o lama -- prendo utensile fresa o lama
if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' then if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' or EMT.NEXTHEAD == 'H17' then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1) local MyParkX1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
local MyParkB1 = ParkB1 local MyParkB1 = ParkB1
local MyParkC1 = ParkC1 local MyParkC1 = ParkC1
-- se ho due teste oppure è progress, significa che ho CU verticale -- se ho due teste oppure è progress, significa che ho CU verticale
if EgtGetHeadId('H21') or bProgress then if EgtGetHeadId('H21') or Progress or SecondToolChanger then
MyParkB1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkB1, ParkFrnB1) MyParkB1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkB1, ParkFrnB1)
MyParkC1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkC1, ParkFrnC1) MyParkC1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkC1, ParkFrnC1)
-- altrimenti su one CU speciale motosega-utensile lungo -- altrimenti su one CU speciale motosega-utensile lungo
@@ -772,6 +903,7 @@ function OnSimulMachiningStart()
EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and not EMT.MCHUSERNOTES:find( 'VMRS=0;', 1, true)) EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and not EMT.MCHUSERNOTES:find( 'VMRS=0;', 1, true))
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil) EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil) EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- recupero TASKID della feature lavorata -- recupero TASKID della feature lavorata
local vId = EgtGetMachiningGeometry() local vId = EgtGetMachiningGeometry()
if vId and #vId > 0 and #vId[1] > 0 then if vId and #vId > 0 and #vId[1] > 0 then
@@ -842,6 +974,7 @@ function OnSimulMachiningEnd()
EMT.DOU_TOOL = nil EMT.DOU_TOOL = nil
-- salvo dati utensile -- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD) local nSetHead = GetHeadSet( EMT.HEAD)
-- se non ho già tolto la sega a catena, aggiorno valori -- se non ho già tolto la sega a catena, aggiorno valori
if not EMT.CHSAW_OUT then if not EMT.CHSAW_OUT then
-- per gruppo testa 1 -- per gruppo testa 1
@@ -965,7 +1098,12 @@ function OnSimulMoveStart()
-- pinza 5 -- pinza 5
if EMT.W2DELTA then if EMT.W2DELTA then
EMT.A5n = 'W' EMT.A5n = 'W'
EMT.A5m = 'T' local dPosQW = EgtGetAxisPos( 'QW') or 0
if dPosQW < 1 then
EMT.A5m = nil
else
EMT.A5m = 'T'
end
EMT.A5 = EMT.L1 + EMT.W2DELTA - EMT.A4 EMT.A5 = EMT.L1 + EMT.W2DELTA - EMT.A4
VerifyWStroke( EMT.A5) VerifyWStroke( EMT.A5)
end end
@@ -1037,7 +1175,15 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end end
@@ -1053,9 +1199,9 @@ function OnSimulMoveStart()
end end
-- altrimenti sega a catena -- altrimenti sega a catena
else else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla -- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN) EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect() OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL) EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1084,13 +1230,13 @@ function OnSimulMoveStart()
else else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then
-- se movimento iniziale da Zmax con lama o fresa -- se movimento iniziale da Zmax con lama o fresa
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H17' then
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid') --EgtOutBox( 'Flag 2,1', 'Info Rapid')
local bMoveZbeforeX = false local bMoveZbeforeX = false
local dZref = EMT.L3 local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( -EMT.L2 < -LimX1RotSaw or EMT.R2 > 91) then if EMT.HEAD == 'H12' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100 dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo -- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
@@ -1106,7 +1252,15 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end end
@@ -1119,9 +1273,9 @@ function OnSimulMoveStart()
end end
-- altrimenti sega a catena (H13 o H15) -- altrimenti sega a catena (H13 o H15)
else else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla -- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN) EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect() OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL) EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1178,7 +1332,15 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H22' then if EMT.HEAD == 'H22' then
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT) -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end end
@@ -1195,9 +1357,9 @@ function OnSimulMoveStart()
end end
-- altrimenti sega a catena -- altrimenti sega a catena
else else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla -- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN) EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect() OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL) EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1343,7 +1505,7 @@ function OnSimulMoveEnd()
-- eventuale rimozione sfridi -- eventuale rimozione sfridi
ExecRemoveScraps() ExecRemoveScraps()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti -- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID) local sNextTool = GetNextTool( EMT.MCHID, true)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama -- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT ( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
@@ -1477,7 +1639,7 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT)) ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
elseif Cmd[1] == '11' then elseif Cmd[1] == '11' then
local bClose = Cmd[2] ~= '0' 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) ExecMovePY1( bClose)
elseif Cmd[1] == '12' then elseif Cmd[1] == '12' then
ExecMovePY2( Cmd[2] ~= '0') ExecMovePY2( Cmd[2] ~= '0')
@@ -1595,7 +1757,15 @@ function ExecMoveHome( bNearV, bMchSplit)
EMT.CHSAW_OUT = true EMT.CHSAW_OUT = true
end end
-- porto le teste in home -- porto le teste in home
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID, 'X2', ParkX2, MCH_SIM_STEP.RAPID) if EgtGetHeadId( 'H21') then
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID, 'X2', ParkX2, MCH_SIM_STEP.RAPID)
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'X1', ParkFrnX1, MCH_SIM_STEP.RAPID)
end
end
-- sistemo i rulli -- sistemo i rulli
ExecOpenRoller( 1) ExecOpenRoller( 1)
ExecOpenRoller( 2) ExecOpenRoller( 2)
@@ -1611,16 +1781,50 @@ function ExecMoveZmax( bMchSplit, btoXHome)
-- set della testa -- set della testa
local nSetHead = GetHeadSet( EMT.HEAD) local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 0 then return end if nSetHead == 0 then return end
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
if EMT.ISPROBING then
-- se lavorazione successiva con stessa testa non si va a Z massima
local sToolNameNextProbe
local idProbeNextMachining = EgtGetNextActiveOperation( EMT.MCHID)
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
EgtSetCurrMachining( EMT.MCHID)
end
local bMoveToZMax = true
if sToolNameNextProbe and bIsFirstHead and EMT.PREVTOOL_H1 == sToolNameNextProbe then
bMoveToZMax = false
elseif sToolNameNextProbe and not bIsFirstHead and EMT.PREVTOOL_H2 == sToolNameNextProbe then
bMoveToZMax = false
end
-- se non serve alzarsi
if not bMoveToZMax then
local vtE = Vector3d( EMT.EXTR)
local ProbePosZ
-- ci si riporta in posizione fuori ingombro pezzo
if AreSameVectorApprox( vtE, Y_AX()) or AreSameVectorApprox( vtE, -Y_AX()) then
ProbePosZ = EMT.TABORI1[3] + EMT.SB
if nSetHead == 1 then
SimulMoveAxis( 'Z1', ProbePosZ, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'Z2', ProbePosZ, MCH_SIM_STEP.RAPID)
end
end
return
end
end
-- posizioni correnti degli assi testa -- posizioni correnti degli assi testa
local CurrX = EgtGetAxisPos( EgtIf( nSetHead == 1, 'X1', 'X2')) local CurrX = EgtGetAxisPos( EgtIf( bIsFirstHead, 'X1', 'X2'))
local CurrZ = EgtGetAxisPos( EgtIf( nSetHead == 1, 'Z1', 'Z2')) local CurrZ = EgtGetAxisPos( EgtIf( bIsFirstHead, 'Z1', 'Z2'))
local CurrC = EgtGetAxisPos( EgtIf( nSetHead == 1, 'C1', 'C2')) local CurrC = EgtGetAxisPos( EgtIf( bIsFirstHead, 'C1', 'C2'))
local CurrB = EgtGetAxisPos( EgtIf( nSetHead == 1, 'B1', 'B2')) local CurrB = EgtGetAxisPos( EgtIf( bIsFirstHead, 'B1', 'B2'))
-- posizioni home degli assi testa -- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'X1', 'X2')) local HomeX = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'X1', 'X2'))
local HomeZ = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'Z1', 'Z2')) local HomeZ = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'Z1', 'Z2'))
local HomeC = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'C1', 'C2')) local HomeC = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'C1', 'C2'))
local HomeB = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'B1', 'B2')) local HomeB = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'B1', 'B2'))
-- verifico se necessario ruotare la testa -- verifico se necessario ruotare la testa
local bRot = ( abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1) local bRot = ( abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1)
-- se necessario ruotare la testa, allargo i carrelli -- se necessario ruotare la testa, allargo i carrelli
@@ -1631,7 +1835,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
ExecParkRoller( nil, nil, nil, nil, bMchSplit, bAgg) ExecParkRoller( nil, nil, nil, nil, bMchSplit, bAgg)
end end
-- se testa 1 -- se testa 1
if nSetHead == 1 then if bIsFirstHead then
-- se fresa o lama -- se fresa o lama
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
if not HeadIsChainSaw( EMT.HEAD) then if not HeadIsChainSaw( EMT.HEAD) then
@@ -1680,19 +1884,35 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB) 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) SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
if EMT.HEAD == 'H12' and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) or not( bProgress) then SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then if btoXHome then
EMT.XHOME = true EMT.XHOME = true
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X1', HomeX, MCH_SIM_STEP.RAPID)
end end
-- altrimenti sega a catena -- altrimenti sega a catena
else else
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN), 2) + pow( ChSawLen + MillOffs, 2))
if EMT.ADIR and EMT.TDIR then
-- direzione versore sega a catena X- (copre anche eventuali inclinazioni in Y)
if EMT.TDIR[1] <= 0 then
-- ingombro massimo di quota Z (senza pivot) + ingombro massimo sega + altezza pezzo + altezza sicurezza
local dEncumbranceTot = EMT.L3p + MillOffs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3p + ( DeltaTabZ - dEncumbranceTot)
-- se la nuova quota è minore della quota di parcheggio
if dZUp <= ParkCSawZ1 then
-- se B è oltre il punto di massimo ingombro (con l'inclinazione attuale non ha il massimo ingombro)
if asin( EMT.TDIR[3] / 1) > asin( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) / dChSawEncumbrance) and ( dEncumbranceTot < DeltaTabZ) then
SimulMoveAxis( 'Z1', dZUp, MCH_SIM_STEP.RAPID)
end
end
end
end
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT) SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.R3 and abs( EMT.R3) < 0.1 then if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
@@ -1700,9 +1920,8 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if btoXHome then if btoXHome then
EgtUnloadTool( EMT.HEAD, 1) EgtUnloadTool( EMT.HEAD, 1)
ShowToolInTcPos( EMT.TCPOS, true) ShowToolInTcPos( EMT.TCPOS, true)
EMT.PREVTOOL_H1 = nil -- nascondo l'utensile sulla testa
EMT.PREVHEAD_H1 = nil EgtSetMode( EgtGetHeadId( EMT.HEAD or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
EMT.PREVTCPOS_H1 = nil
EMT.CHSAW_OUT = true EMT.CHSAW_OUT = true
EMT.XHOME = true EMT.XHOME = true
end end
@@ -1730,6 +1949,24 @@ function ExecMoveZmax( bMchSplit, btoXHome)
end end
-- altrimenti sega a catena -- altrimenti sega a catena
else else
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN), 2) + pow( ChSawLen + Mill2Offs, 2))
if EMT.ADIR and EMT.TDIR then
-- direzione versore sega a catena X- (copre anche eventuali inclinazioni in Y)
if EMT.TDIR[1] <= 0 then
-- ingombro massimo di quota Z (senza pivot) + ingombro massimo sega + altezza pezzo + altezza sicurezza
local dEncumbranceTot = EMT.L3p + Mill2Offs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3p + ( DeltaTabZ - dEncumbranceTot)
-- se la nuova quota è minore della quota di parcheggio
if dZUp <= ParkCSawZ2 then
-- se B è oltre il punto di massimo ingombro (con l'inclinazione attuale non ha il massimo ingombro)
if asin( EMT.TDIR[3] / 1) > asin( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) / dChSawEncumbrance) and ( dEncumbranceTot < DeltaTabZ) then
SimulMoveAxis( 'Z2', dZUp, MCH_SIM_STEP.RAPID)
end
end
end
end
SimulMoveAxes( 'Z2', HomeZ, MCH_SIM_STEP.RAPID, 'B2', HomeB, MCH_SIM_STEP.COLLROT) SimulMoveAxes( 'Z2', HomeZ, MCH_SIM_STEP.RAPID, 'B2', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.R3 and abs( EMT.R3) < 0.1 then if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
@@ -1809,16 +2046,163 @@ function ExecUnloading()
end end
end end
---------------------------------------------------------------------
function CheckClamping( sClampName)
nIndexClamp = EgtGetAxisId( sClampName)
local idClampPath = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nIndexClamp, 'CLAMP_CHECK') or GDB_ID.NULL)
local b3ClampingArea = EgtGetBBoxGlob( idClampPath or GDB_ID.NULL, GDB_BB.STANDARD)
-- se non trovo percorso area di clamping, esco subito
if not idClampPath or not EMT.VMILL or not ClampingCoeffMin then
return
end
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
local idCurveList = {}
local vtIntersPlane
-- piano di interpolazione
if sIntersPlane == 'X' then
vtIntersPlane = X_AX()
elseif sIntersPlane == 'Y' then
vtIntersPlane = Y_AX()
elseif sIntersPlane == 'Z' then
vtIntersPlane = Z_AX()
end
for i = 1, #EMT.VMILL do
local b3VMill = EgtGetBBoxGlob( EMT.VMILL[i], GDB_BB.EXACT)
local ptPosIntersPlane
if sPosIntersPlane == 'MIN' then
ptPosIntersPlane = b3VMill:getMin() + dDepth * vtIntersPlane
elseif sPosIntersPlane == 'MAX' then
ptPosIntersPlane = b3VMill:getMax() - dDepth * vtIntersPlane
end
local idLoop, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
-- se c'è almeno una curva
if idLoop then
for j = 1, nLoopCnt do
local idLoopTemp = idLoop + j - 1
table.insert( idCurveList, idLoopTemp)
end
end
end
return idCurveList
end
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
-- test piano frontale
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
-- si copia curva intersezione e curva pinza in gruppo di confronto
local idFlatSurf, nFlatSurfCnt = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idCurveList)
local idClampSurf = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idClampPath)
if idFlatSurf then
local dTotalArea = 0
local dTotalXLenght = 0
for k = 1, nFlatSurfCnt do
local idTempSurf = idFlatSurf + k - 1
EgtSurfFrIntersect( idTempSurf, idClampSurf)
if idTempSurf then
dTotalArea = dTotalArea + ceil( EgtSurfArea( idTempSurf) or 0)
local b3BoxIntersectionBox = EgtGetBBoxGlob( idTempSurf, GDB_BB.STANDARD)
if b3BoxIntersectionBox then
dTotalXLenght = dTotalXLenght + ceil( b3BoxIntersectionBox:getDimX()) -- somma lunghezze (x) delle aree pinzate
end
end
end
return dTotalArea, dTotalXLenght
end
return 0
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
local MinJoin = BD.GetMinJoin( EMT.HB, EMT.SB, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinZClamping = min( b3ClampingArea:getDimZ() + DistZClampToTable, EMT.SB) - DistZClampToTable
-- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio
ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1)
local dMinClampingAreaWarn = ( MinJoin * MinZClamping) * ClampingCoeffMin
local dMinClampingAreaErr = ( MinJoin * MinZClamping) * ( ClampingCoeffMin / 3)
local bError = true
local sWrn, sErr
local bWriteWarnMessage = false
local bWriteErrMessage = false
-- controllo faccia frontale
local dArea, dXClampedLenght = CalculateIntersectionArea( 'MIN', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteErrMessage = true
end
end
-- WARNING: pinza meno del minimo richiesto
if dArea and dArea < dMinClampingAreaWarn and not bWriteErrMessage then
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteWarnMessage = true
end
EgtEmptyGroup( CLAMP_CHECK_GROUP)
EgtEmptyGroup( CLAMP_CHECK_INTERS)
-- controllo altro lato solo se non sono già in errore
if not bWriteErrMessage then
-- controllo faccia posteriore
dArea = CalculateIntersectionArea( 'MAX', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteErrMessage = true
end
end
-- WARNING: pinza meno del minimo richiesto
if dArea and dArea < dMinClampingAreaWarn and not bWriteWarnMessage and not bWriteErrMessage then
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteWarnMessage = true
end
EgtEmptyGroup( CLAMP_CHECK_GROUP)
EgtEmptyGroup( CLAMP_CHECK_INTERS)
end
if bWriteErrMessage then
EmtSetLastError( 1213, sErr, EgtGetEnableUI())
EgtOutBox( sErr, 'CLAMPING', 'ERROR', 'OK')
EmtSetSimulPause()
elseif bWriteWarnMessage then
EgtOutLog( sWrn)
EgtOutBox( sWrn, 'CLAMPING', 'WARNING', 'OK')
EmtSetSimulPause()
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function ExecMovePY1( bClose) function ExecMovePY1( bClose)
SimulMoveAxis( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID) SimulMoveAxis( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( bClose) SetPY1Light( bClose)
if bClose then
CheckClamping( 'PY1')
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function ExecMovePY2( bClose) function ExecMovePY2( bClose)
SimulMoveAxis( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID) SimulMoveAxis( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( bClose) SetPY2Light( bClose)
if bClose then
CheckClamping( 'PY2')
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2206,6 +2590,9 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetV1ToClose() function GetV1ToClose()
if EMT.MCHPRECUT or EMT.MCHCUT then
return false
end
--EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB)) --EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB))
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0)) --EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax) return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax)
@@ -2220,11 +2607,17 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function ShowToolInTcPos( sTcPos, bShow) function ShowToolInTcPos( sTcPos, bShow)
-- recupero identificativo della posizione sul TC
local TcPosId = EgtGetTcPosId( sTcPos or '')
if not TcPosId then return end
-- recupero il gruppo dell'utensile -- recupero il gruppo dell'utensile
local TcExitId = EgtGetFirstNameInGroup( EgtGetTcPosId( sTcPos or '') or GDB_ID.NULL, 'T1') local TcExitId = EgtGetFirstNameInGroup( TcPosId or GDB_ID.NULL, 'T1')
if not TcExitId then return end if not TcExitId then return end
-- imposto lo stato di visualizzazione -- imposto lo stato di visualizzazione
EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
-- 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 end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2245,7 +2638,7 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
if vTools and vTools[1] and #(vTools[1]) > 0 then if vTools and vTools[1] and #(vTools[1]) > 0 then
sTool = vTools[1] sTool = vTools[1]
sTcPos = sTcPosDef sTcPos = sTcPosDef
if Progress then if Progress or SecondToolChanger then
sHead = EgtIf( sTcPos == 'T11', 'H12', 'H11') sHead = EgtIf( sTcPos == 'T11', 'H12', 'H11')
elseif nHSet == 1 then elseif nHSet == 1 then
sHead = EgtIf( sTcPos == 'T1', 'H12', 'H11') sHead = EgtIf( sTcPos == 'T1', 'H12', 'H11')
@@ -2282,6 +2675,14 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
return sTool return sTool
end end
---------------------------------------------------------------------
function DeactivateProbeTool()
if Probe then
EgtSetMode( EgtGetHeadId( 'H19') or GDB_ID.NULL, GDB_MD.HIDDEN)
EgtSetMode( EgtGetHeadId( 'H29') or GDB_ID.NULL, GDB_MD.HIDDEN)
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** ESTIMATION T&L *** -- *** ESTIMATION T&L ***
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2302,6 +2703,9 @@ local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnEstimStart() function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 102000, 20000, 102000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2387,6 +2791,15 @@ function OnEstimDispositionEnd()
EMT.OPEISDISP = false EMT.OPEISDISP = false
end end
---------------------------------------------------------------------
function OnEstimRawMoveData()
-- se start del pezzo
if IsStartOrRestPhase( EMT.PHASE) then
EMT.SPLIT = false
end
OnRawMoveData()
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnEstimToolSelect() function OnEstimToolSelect()
-- reset indice utensile in tabella lunghezze -- reset indice utensile in tabella lunghezze
@@ -2443,6 +2856,12 @@ function OnEstimMachiningEnd()
EMT.TLE_NAME = nil EMT.TLE_NAME = nil
EMT.TLE_TIME = nil EMT.TLE_TIME = nil
end end
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
if EMT.MCHSPLIT then
EMT.SPLIT = true
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2568,11 +2987,11 @@ function OnEstimRapid()
EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen
-- calcolo tempo -- calcolo tempo
local dTime = RAPID_MIN_T local dTime = RAPID_MIN_T
local dT1 = abs( dL1) / RAPID_X_FEED * 60 local dT1 = CalcMoveTime( abs( dL1), RAPID_X_FEED, EMT.SPLIT)
if dT1 > dTime then dTime = dT1 end if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60 local dT2 = CalcMoveTime( abs( dL2), EMT.FMAXPINZE, EMT.SPLIT)
if dT2 > dTime then dTime = dT2 end if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60 local dT3 = CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT)
if dT3 > dTime then dTime = dT3 end if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60 local dT4 = abs( dR1) / RAPID_C_FEED * 60
if dT4 > dTime then dTime = dT4 end if dT4 > dTime then dTime = dT4 end
@@ -2594,7 +3013,7 @@ function OnEstimLinear()
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3) local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo -- calcolo tempo
local dTime = dLen / EMT.F * 60 local dTime = CalcMoveTime( dLen, EMT.F, EMT.SPLIT)
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5) EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti -- aggiorno valori come precedenti
@@ -2688,7 +3107,7 @@ function GetHeadSetFromTcPos( sTcPos)
local TCPOS_2A = {} local TCPOS_2A = {}
local TCPOS_2B = {} local TCPOS_2B = {}
if EgtGetHeadId( 'H21') then if EgtGetHeadId( 'H21') then
TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', '501'}
TCPOS_1B = { 'T101'} TCPOS_1B = { 'T101'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'} TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'}
TCPOS_2B = { 'T111'} TCPOS_2B = { 'T111'}
@@ -2696,7 +3115,7 @@ function GetHeadSetFromTcPos( sTcPos)
TCPOS_1A = { 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} TCPOS_1A = { 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'}
TCPOS_1B = { 'T101', 'T201'} TCPOS_1B = { 'T101', 'T201'}
TCPOS_1C = { 'T301'} TCPOS_1C = { 'T301'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'} TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20', '502'}
end end
for _, sVal in ipairs( TCPOS_1A) do for _, sVal in ipairs( TCPOS_1A) do
if sVal == sTcPos then return 1, 1 end if sVal == sTcPos then return 1, 1 end
@@ -2815,7 +3234,7 @@ function GetNextChainSawingVirtualAxis( MchId)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetNextTool( nMchId) function GetNextTool( nMchId, bResetOnStart)
-- inizializzo prossimo utensile -- inizializzo prossimo utensile
local sNextTool local sNextTool
-- recupero lavorazione successiva -- recupero lavorazione successiva
@@ -2823,7 +3242,7 @@ function GetNextTool( nMchId)
while nNextMchId do while nNextMchId do
-- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali -- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali
if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then
if IsStartOrRestPhase( EMT.PHASE+1) then if IsStartOrRestPhase( EMT.PHASE+1) and bResetOnStart then
return nil return nil
end end
else else
@@ -2848,10 +3267,10 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2) function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2)
if sHead == 'H11' or sHead == 'H12' or HeadIsChainSaw( sHead) then if sHead == 'H11' or sHead == 'H12' or sHead == 'H17' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1)) return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1) % 180.0 > 1))
elseif sHead == 'H21' or sHead == 'H22' or HeadIsChainSaw( sHead) then elseif sHead == 'H21' or sHead == 'H22' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1)) return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1) % 180.0 > 1))
end end
end end
@@ -2866,5 +3285,40 @@ function GetCmdAxMove( Cmd, sAx)
end end
end end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
local AccMaxPinze = EMT.MAXACC
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
local dAcc, _, _ = CalcDinamicaPinze( EMT.HB, EMT.SB, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
-- Caso 1: dFeed raggiunta
if dPathLen >= ( dFeedInSec ^ 2) / dAcc then
dTime = ( dFeedInSec / dAcc) + ( dPathLen / dFeedInSec)
-- Caso 2: dFeed non raggiunta
else
dTime = 2 * sqrt( dPathLen / dAcc)
end
return dTime
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** END GENERAL *** -- *** END GENERAL ***
+149 -8
View File
@@ -4,9 +4,74 @@
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- Carico libreria -- Carico libreria
local BD = require( 'BeamData') local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- *** Special GetPrevMachiningOffset ***
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
function OnSpecialGetPrevMachiningOffset()
-- Aggiorno posizione della testa della trave a seguito di movimenti delle pinze non previsti tra le fasi
local function TPosUpdate()
local nClId = EgtGetFirstNameInGroup( EMC.CURRMCHID, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
if not nPathId then
EMC.ERR = 12
EMC.MSG = ' Error : CL group path not found'
return
end
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
local dTRepos = nil
-- controlla ogni gruppo di movimenti ausiliari
for i = 1, dAuxMoveCount do
local aAuxMove = EgtGetInfo( nPathId, 'AS' .. tostring( i), 'vs') or {} -- array contenete i parametri di ogni gruppo
-- controlla solo i movimenti della testa trave e salva l'ultimo
if aAuxMove[1] == '2' or aAuxMove[1] == '3' then
for j = 2, #aAuxMove do
if aAuxMove[j] == 'T' then
dTRepos = aAuxMove[j+1]
break
end
end
end
end
return dTRepos
end
-- default
EMC.ERR = 0
EMC.PREVOFFSX = 0
-- se c'è cambio di fase tra le lavorazioni (quindi la precedente è l'ultima della sua fase e la corrente la prima)
if EMC.PREVPHASE ~= EMC.CURRPHASE then
-- se la fase corrente è di inizio lavorazione di nuova trave
if IsStartOrRestPhase( EMC.CURRPHASE) then
-- recupero la posizione finale della lavorazione precedente
local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID)
-- ricava se e quanto la trave viene spostata tra le due fasi dai movimenti ausiliari e corregge l'offset di fine fase
local dNewTPos = TPosUpdate()
-- se ci sono dei movimenti della testa trave tra le due fasi ricava il delta tra la vecchia e la nuova posizione
if dNewTPos then
EMC.PREVOFFSX = dNewTPos - vPrevAx[1]
-- oppure la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
else
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
end
end
---------------------- OnSpecialGetMaxZ ----------------------------- ---------------------- OnSpecialGetMaxZ -----------------------------
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function CalcExtraZ( vtTp, vtT, vMZ) local function CalcExtraZ( vtTp, vtT, vMZ)
@@ -72,7 +137,7 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}} local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ) EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 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 = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
@@ -173,7 +238,7 @@ function OnSpecialMoveZup()
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' then if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' then
; ;
-- se lama posizionata su CU prossimo a testa 1 -- se lama posizionata su CU prossimo a testa 1
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
-- se inclinata oltre 90 gradi e interferisce con la trave -- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ())) local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
@@ -208,6 +273,13 @@ function OnSpecialMoveZup()
EMC.MODIF = true EMC.MODIF = true
end end
end end
elseif HeadIsChainSaw( EMC.HEAD) then
EMC.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if EMC.TDIR[3] < -0.15 and EMC.L3 > - EMC.TTOTLEN then
EMC.L3 = EMC.TTOTLEN * EMC.TDIR[3]
-- dichiaro modificato
EMC.MODIF = true
end
end end
end end
@@ -223,7 +295,7 @@ local MIN_BACK_ENG_V = 115 -- ingombro asse Z a sinistra
local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza
local MIN_CLAMP_5 = 150 -- minima presa con la pinza speciale (pinza 5) local MIN_CLAMP_5 = 150 -- minima presa con la pinza speciale (pinza 5)
local SIC_CLAMP_5 = 50 -- sicurezza testa da pinza speciale local SIC_CLAMP_5 = 50 -- sicurezza testa da pinza speciale
local MAX_BACK_CLAMP_5 = 320 -- massima sporgenza posteriore del pezzo da pinza speciale local MAX_BACK_CLAMP_5 = EgtClamp( MaxBackClamp5 or 320, 200, 380) -- massima sporgenza posteriore del pezzo da pinza speciale
----------------------- Variabili ----------------------------------- ----------------------- Variabili -----------------------------------
local Test = false local Test = false
@@ -654,14 +726,72 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnPostApplyMachining() function OnPostApplyMachining()
-- Inizializzo codice di errore
EMC.ERR = 0
-- Verifico se ultima lavorazione della fase
local nNextOpeId = EgtGetNextActiveOperation( EMC.MCHID)
local bMchLast = ( not nNextOpeId or EgtGetOperationPhase( nNextOpeId) ~= EMC.PHASE) -- Agisco sui diversi percorsi della lavorazione
local nPathId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( EMC.MCHID, 'CL') or GDB_ID.NULL)
while nPathId do
-- recupero id del successivo
nPathId = EgtGetNext( nPathId)
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
end
end
---------------------------------------------------------------------
function OnSpecialApplyMachining()
EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID), 1) EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID), 1)
-- Inizializzo codice di errore -- Inizializzo codice di errore
EMC.ERR = 0 EMC.ERR = 0
-- Recupero la precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- Se esiste lavorazione precedente ed è una tastatura
if nPrevOpeId and EgtGetOperationType( nPrevOpeId) == MCH_OY.PROBING then
-- se stessa testa e montato già utensile corretto
-- recupero valori assi alla fine della lavorazione precedente e all'inizio della corrente
local vPrevAxes = EmtGetFinalAxesPos( nPrevOpeId, true)
local vCurrAxes = EmtGetInitialAxesPos( EMC.MCHID, true)
-- info lavorazione precedente
EgtSetCurrMachining( nPrevOpeId)
local sPrevTool = EgtGetMachiningParam( MCH_MP.TOOL)
local sPrevHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local nSetHead = GetHeadSet( sPrevHead)
local bPrevIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- info lavorazione corrente
EgtSetCurrMachining( EMC.MCHID)
local sCurrTool = EgtGetMachiningParam( MCH_MP.TOOL)
local sCurrHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
nSetHead = GetHeadSet( sCurrHead)
local bCurrIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- se utensile corrente è compatibile (significa che è già stato precaricato) se stessa testa e con stessa configurazioen assi rotanti, annullo risalita
if IsToolCompatibleWithProbe( sCurrTool, sPrevTool) and bPrevIsFirstHead == bCurrIsFirstHead and abs( vCurrAxes[4] - vPrevAxes[4]) < 1 and abs( vCurrAxes[5] - vPrevAxes[5]) < 1 then
-- in lavorazione precedente elimino eventuale retrazione a Zmax
EmtRemoveRise( nPrevOpeId)
-- in lavorazione corrente elimino eventuale approccio da Zmax
EmtRemoveClimb( EMC.MCHID)
-- prendo sempre la Z massima tra le due
local vClimbPoint
if vCurrAxes[3] - 1.0 < vPrevAxes[3] then
vClimbPoint = vCurrAxes
vCurrAxes[3] = vPrevAxes[3]
elseif vPrevAxes[3] - 1.0 < vCurrAxes[3] then
vClimbPoint = vPrevAxes
vPrevAxes[3] = vCurrAxes[3]
end
EmtAddClimb( EMC.MCHID, vClimbPoint, 4, 1, 0)
end
end
-- Recupero la posizione della trave e dei carrelli al termine della precedente operazione -- Recupero la posizione della trave e dei carrelli al termine della precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- se precedente operazione non esiste, errore -- se precedente operazione non esiste, errore
if not nPrevOpeId then if not nPrevOpeId then
EMC.ERR = 1 EMC.ERR = 1
@@ -761,7 +891,7 @@ function OnPostApplyMachining()
-- verifico se ultimo percorso di ultima lavorazione della fase -- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId)) local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home -- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end -- if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- salvo lo stato dei carrelli -- salvo lo stato dei carrelli
local OriTPos = EMC.TPOS local OriTPos = EMC.TPOS
local OriY1Delta = EMC.Y1DELTA local OriY1Delta = EMC.Y1DELTA
@@ -819,7 +949,6 @@ function OnPostApplyMachining()
local vAxes = EmtGetAxesPos( nLastEntId) local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end if #vAxes > 0 then EMC.TPOS = vAxes[1] end
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1097,6 +1226,17 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end end
-- Recupero testa -- Recupero testa
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sToolName = EgtTdbGetCurrToolParam( MCH_TP.NAME)
local nSetHead = GetHeadSet( sHead)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- se lavorazione di tastatura, si considera montato utensile di default
if HeadIsProbe( sHead) then
local sOtherToolName = GetToolNameFromTcPos( EgtIf( bIsFirstHead, DefTcPos1, DefTcPos2))
local sOtherHeadTool, _ = GetToolHead( sOtherToolName)
EgtLoadTool( sOtherHeadTool, 1, sOtherToolName)
end
-- Recupero valore assi macchina -- Recupero valore assi macchina
local nSecId = EgtGetNext( EgtGetFirstInGroup( nPathId)) local nSecId = EgtGetNext( EgtGetFirstInGroup( nPathId))
local vAxes = EmtGetAxesPos( nSecId) local vAxes = EmtGetAxesPos( nSecId)
@@ -1107,8 +1247,8 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end end
-- Calcolo dell'ingombro della testa rispetto allo Zero Macchina -- Calcolo dell'ingombro della testa rispetto allo Zero Macchina
local b3Enc local b3Enc
if sHead ~= 'H21' and sHead ~= 'H22' and sHead ~= 'H23' then if bIsFirstHead then
EgtSetAxisPos( 'C1', vAxes[4]) EgtSetAxisPos( 'C1', vAxes[4])
EgtSetAxisPos( 'B1', vAxes[5]) EgtSetAxisPos( 'B1', vAxes[5])
if sHead == 'H13' or sHead == 'H15' then if sHead == 'H13' or sHead == 'H15' then
@@ -1142,6 +1282,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
local dDistFront = - ptMax:getX() - LoadT - dHeadFront local dDistFront = - ptMax:getX() - LoadT - dHeadFront
local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack
EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3) EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3)
return dDistFront, dDistBack, dRollFront, dRollBack return dDistFront, dDistBack, dRollFront, dRollBack
end end
BIN
View File
Binary file not shown.
+14
View File
@@ -91,11 +91,13 @@ Language1=Italiano,Ita.txt
Language2=English,Eng.txt Language2=English,Eng.txt
[Tools] [Tools]
Probe=1
Drillbit=1 Drillbit=1
Sawblade=1 Sawblade=1
Mill=1 Mill=1
Mortise=1 Mortise=1
Chisel=0 Chisel=0
ProbeMaker=MakeProbe.lua
DrillMaker=MakeWoodDrill.lua DrillMaker=MakeWoodDrill.lua
SawbladeMaker=MakeSawblade.lua SawbladeMaker=MakeSawblade.lua
MillMaker=MakeWoodCylMill.lua MillMaker=MakeWoodCylMill.lua
@@ -108,11 +110,13 @@ H11.1=Standard.nge
H11.1:MILL_NOTIP=MillNoTip.nge H11.1:MILL_NOTIP=MillNoTip.nge
H12.1=Saw.nge H12.1=Saw.nge
H13.1=ChainSaw.nge H13.1=ChainSaw.nge
H17.1=AngTransmBH.nge
H21.1=Standard.nge H21.1=Standard.nge
H21.1:MILL_NOTIP=MillNoTip.nge H21.1:MILL_NOTIP=MillNoTip.nge
H22.1=Saw.nge H22.1=Saw.nge
[Machinings] [Machinings]
Probing=1
Drilling=1 Drilling=1
Sawing=1 Sawing=1
Milling=1 Milling=1
@@ -125,6 +129,8 @@ SawFinishing=0
[Machining] [Machining]
InitScript=InitMach.lua InitScript=InitMach.lua
ExitScript=ExitMach.lua ExitScript=ExitMach.lua
[Probing]
PrbScript1=StdProbe
[Disposition] [Disposition]
;InitScript=InitDisp.lua ;InitScript=InitDisp.lua
@@ -136,10 +142,16 @@ H11=6608
H12=6615 H12=6615
; Chainsaw ; Chainsaw
H13=6616 H13=6616
; Angular transmission
H17=6617
; Probe
H19=6618
; Second 5 axis head ; Second 5 axis head
H21=6620 H21=6620
; Second 5 axis saw ; Second 5 axis saw
H22=6623 H22=6623
; Probe
H29=6618
[SetUp] [SetUp]
Default=Standard Default=Standard
@@ -152,3 +164,5 @@ WinPlace=0,514,138,628,810
Enable=1 Enable=1
Save=0 Save=0
[ToolTrace]
Enable=1
+176 -17
View File
@@ -44,10 +44,10 @@
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
PP_VER = '2.7g3' PP_VER = '3.1f3'
PP_NVER = '2.7.7.3' PP_NVER = '3.1.6.3'
MIN_MACH_VER = '2.5k1' MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PFrl' MACH_NAME = EgtGetCurrMachineName()
-- Carico i dati globali -- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir() local sMachDir = EgtGetCurrMachineDir()
@@ -116,6 +116,7 @@ SawC2Offs = 0
SawB2Offs = 0 SawB2Offs = 0
MinX1 = 700 MinX1 = 700
MaxX1 = 2735 MaxX1 = 2735
Limit_T1_Presel_T2 = MinX1
MinZ1 = -1550 MinZ1 = -1550
MaxZ1 = 0 MaxZ1 = 0
MinC1 = -275 MinC1 = -275
@@ -140,6 +141,7 @@ ParkCSaw0C1 = 0
ParkCSawB1 = 0 ParkCSawB1 = 0
MinX2 = 0 MinX2 = 0
MaxX2 = 2035 MaxX2 = 2035
Limit_T2_Presel_T1 = MaxX2
MinZ2 = -1550 MinZ2 = -1550
MaxZ2 = 0 MaxZ2 = 0
MinC2 = -275 MinC2 = -275
@@ -155,6 +157,8 @@ ParkB2 = -90
MinDeltaX1X2 = 650 MinDeltaX1X2 = 650
MinDistToolX1X2 = 40 MinDistToolX1X2 = 40
LimX2RotSaw = 800 LimX2RotSaw = 800
AngTrBHOffs = 154.5
AngTrBHLen = 90
TurnerOffs = 120.0 TurnerOffs = 120.0
AggLoad = 50 AggLoad = 50
DeltaTabY = 1170.0 DeltaTabY = 1170.0
@@ -172,9 +176,14 @@ DefTcPos1 = 'T3'
DefTcPos2 = 'T13' DefTcPos2 = 'T13'
SecondSaw = false SecondSaw = false
AutomaticRotation = true AutomaticRotation = true
OptimizedLoadBeam = true
AutoRotMinLen = 0 AutoRotMinLen = 0
CoeffVM = 0.5 EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false ForceToCloseRollersGate = false
Probe = nil
AggreBlockHaus = false
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
-- Aggiornamento con dati da TechnoEssetre7 -- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PFrl.data" local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PFrl.data"
@@ -231,6 +240,8 @@ if EgtExistsFile( sData) then
if Machine.Offsets.MIN_V2 then MinV2 = Machine.Offsets.MIN_V2 end if Machine.Offsets.MIN_V2 then MinV2 = Machine.Offsets.MIN_V2 end
if Machine.Offsets.MAX_V2 then MaxV2 = Machine.Offsets.MAX_V2 end if Machine.Offsets.MAX_V2 then MaxV2 = Machine.Offsets.MAX_V2 end
if Machine.Offsets.CLAMP5 then Clamp5 = ( Machine.Offsets.CLAMP5 == 1) end if Machine.Offsets.CLAMP5 then Clamp5 = ( Machine.Offsets.CLAMP5 == 1) end
if Machine.Offsets.MIN_W then MinW = Machine.Offsets.MIN_W end
if Machine.Offsets.MAX_W then MaxW = Machine.Offsets.MAX_W end
if Machine.Offsets.MINWOPEN then MinWOpen = Machine.Offsets.MINWOPEN end if Machine.Offsets.MINWOPEN then MinWOpen = Machine.Offsets.MINWOPEN end
if Machine.Offsets.MAXWOPEN then MaxWOpen = Machine.Offsets.MAXWOPEN end if Machine.Offsets.MAXWOPEN then MaxWOpen = Machine.Offsets.MAXWOPEN end
if Machine.Offsets.MAXWHEIGHT then MaxWHeight = Machine.Offsets.MAXWHEIGHT end if Machine.Offsets.MAXWHEIGHT then MaxWHeight = Machine.Offsets.MAXWHEIGHT end
@@ -256,14 +267,24 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end
if Machine.Offsets.SAW2OFFSX then Saw2OffsX = Machine.Offsets.SAW2OFFSX end if Machine.Offsets.SAW2OFFSX then Saw2OffsX = Machine.Offsets.SAW2OFFSX end
if Machine.Offsets.SAW2OFFSZ then Saw2OffsZ = Machine.Offsets.SAW2OFFSZ end if Machine.Offsets.SAW2OFFSZ then Saw2OffsZ = Machine.Offsets.SAW2OFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.DEFTCPOS2 then DefTcPos2 = ( 'T' .. Machine.Offsets.DEFTCPOS2) end
if Machine.Offsets.LIMIT_T1_PRESEL_T2 then Limit_T1_Presel_T2 = Machine.Offsets.LIMIT_T1_PRESEL_T2 end
if Machine.Offsets.LIMIT_T2_PRESEL_T1 then Limit_T2_Presel_T1 = Machine.Offsets.LIMIT_T2_PRESEL_T1 end
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
if Machine.Offsets.DEFTCPOS2 then DefTcPos2 = ( 'T' .. Machine.Offsets.DEFTCPOS2) end if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
if Machine.Offsets.PROBE then Probe = Machine.Offsets.PROBE end -- Tastatore su entrembe le teste. 1 = solo testa 1, 2 = solo testa 2, 3 = entrambe le teste
if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
AngTrBHOffs = Machine.Offsets.OFFSETZ_RINV_BH or AngTrBHOffs
AngTrBHLen = Machine.Offsets.OFFSETX_RINV_BH or AngTrBHLen
if Machine.Offsets.MAX_BACK_CLAMP_5 then MaxBackClamp5 = Machine.Offsets.MAX_BACK_CLAMP_5 end
if Machine.Offsets.COEFF_CLAMP_CHECK then ClampingCoeffMin = Machine.Offsets.COEFF_CLAMP_CHECK end
-- aggiustamenti -- aggiustamenti
MinY1 = MinV1 + MinDeltaYV MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1 MaxY1 = MaxMchY1
@@ -335,6 +356,13 @@ EmtAxis {
Home = ParkC1, Home = ParkC1,
Geo = 'C1_AXIS/GEO', Geo = 'C1_AXIS/GEO',
Aux = {'C1_AXIS/SOLID', 'C1_AXIS/COLLISION'}} Aux = {'C1_AXIS/SOLID', 'C1_AXIS/COLLISION'}}
-- se tastatore presente
local sBAxisAuxGeom
if Probe == 1 or Probe == 3 then
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION', 'PROBE_B1/SOLID_PROBE', 'PROBE_B1/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}
end
EmtAxis { EmtAxis {
Name = 'B1', Name = 'B1',
Parent = 'C1', Parent = 'C1',
@@ -345,7 +373,7 @@ EmtAxis {
Stroke = {MinB1, MaxB1}, Stroke = {MinB1, MaxB1},
Home = ParkB1, Home = ParkB1,
Geo = 'B1_AXIS/GEO', Geo = 'B1_AXIS/GEO',
Aux = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}} Aux = sBAxisAuxGeom }
-- Frese -- Frese
local H11Id = EmtHead { local H11Id = EmtHead {
Name = 'H11', Name = 'H11',
@@ -373,6 +401,22 @@ local H12Id = EmtHead {
OthColl = {'B1/SOLID', 'C1/SOLID'}, OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H12_HEAD/GEO'} Geo = 'H12_HEAD/GEO'}
--EgtSetInfo( H12Id, 'ZMAXONROT', '1,190') --EgtSetInfo( H12Id, 'ZMAXONROT', '1,190')
-- Tastatore su testa 1
local H19Id
if Probe == 1 or Probe == 3 then
H19Id = EmtHead {
Name = 'H19',
Parent = 'B1',
HSet = 'H19',
Type = MCH_HT.STD,
Pos = Point3d( -60, -81, 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.2,
Rot2Stroke = { MinB1, MaxB1},
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H19_HEAD/GEO'}
end
-- Sega a catena -- Sega a catena
EmtAxis { EmtAxis {
Name = 'A', Name = 'A',
@@ -399,6 +443,24 @@ local H13Id = EmtHead {
Geo = 'H13_HEAD/GEO'} Geo = 'H13_HEAD/GEO'}
EgtSetInfo( H13Id, 'ZSAFEDELTA', '60') EgtSetInfo( H13Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H13Id, 'ZMAXONROT', '1,80') EgtSetInfo( H13Id, 'ZMAXONROT', '1,80')
-- Eventuale aggregato per lavorazioni BlockHaus
if AggreBlockHaus then
local H17Id = EmtHead {
Name = 'H17',
Parent = 'B1',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d( -AngTrBHLen, 0, -AngTrBHOffs),
TDir = X_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H17_HEAD/GEO',
Aux = {'H17_HEAD/SOLID', 'H17_HEAD/COLLISION'}}
end
-- *** Testa 2 *** -- *** Testa 2 ***
local X2Id = EmtAxis { local X2Id = EmtAxis {
Name = 'X2', Name = 'X2',
@@ -434,6 +496,12 @@ local C2Id = EmtAxis {
Home = ParkC2, Home = ParkC2,
Geo = 'C2_AXIS/GEO', Geo = 'C2_AXIS/GEO',
Aux = {'C2_AXIS/SOLID', 'C2_AXIS/COLLISION'}} Aux = {'C2_AXIS/SOLID', 'C2_AXIS/COLLISION'}}
-- se presente tastatore
if Probe == 2 or Probe == 3 then
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION', 'PROBE_B2/SOLID_PROBE', 'PROBE_B2/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}
end
local B2Id = EmtAxis { local B2Id = EmtAxis {
Name = 'B2', Name = 'B2',
Parent = 'C2', Parent = 'C2',
@@ -444,7 +512,7 @@ local B2Id = EmtAxis {
Stroke = {MinB2, MaxB2}, Stroke = {MinB2, MaxB2},
Home = ParkB2, Home = ParkB2,
Geo = 'B2_AXIS/GEO', Geo = 'B2_AXIS/GEO',
Aux = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}} Aux = sBAxisAuxGeom}
local vtMove2 = Vector3d( 0, Head2Y, Head2Z) local vtMove2 = Vector3d( 0, Head2Y, Head2Z)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
@@ -454,6 +522,10 @@ EgtMove( EgtGetFirstNameInGroup( C2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( C2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
if Probe == 2 or Probe == 3 then
EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID_PROBE'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION_PROBE'), vtMove2, GDB_RT.GLOB)
end
-- Frese -- Frese
local H21Id = EmtHead { local H21Id = EmtHead {
Name = 'H21', Name = 'H21',
@@ -482,6 +554,22 @@ if SecondSaw then
Geo = 'H22_HEAD/GEO'} Geo = 'H22_HEAD/GEO'}
--EgtSetInfo( H22Id, 'ZMAXONROT', '1,190') --EgtSetInfo( H22Id, 'ZMAXONROT', '1,190')
end end
-- Tastatore su testa 2
local H29Id
if Probe == 2 or Probe == 3 then
H29Id = EmtHead {
Name = 'H29',
Parent = 'B2',
HSet = 'H29',
Type = MCH_HT.STD,
Pos = Point3d( Head2X - 60, Head2Y - 81, Head2Z + 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.2,
Rot2Stroke = { MinB2, MaxB2},
OthColl = {'B2/SOLID', 'C2/SOLID'},
Geo = 'H29_HEAD/GEO'}
end
-- *** Carrelli *** -- *** Carrelli ***
-- Morse -- Morse
local Y1Id = EmtAxis { local Y1Id = EmtAxis {
@@ -503,7 +591,7 @@ local PY1Id = EmtAxis {
Stroke = {0, MaxHoOpen}, Stroke = {0, MaxHoOpen},
Home = MaxHoOpen, Home = MaxHoOpen,
Geo = 'PY1_AXIS/GEO', Geo = 'PY1_AXIS/GEO',
Aux = 'PY1_AXIS/SOLID'} Aux = {'PY1_AXIS/SOLID', 'PY1_AXIS/CLAMP_CHECK'}}
local Y2Id = EmtAxis { local Y2Id = EmtAxis {
Name = 'Y2', Name = 'Y2',
Parent = 'Base', Parent = 'Base',
@@ -523,7 +611,7 @@ local PY2Id = EmtAxis {
Stroke = {0, MaxHoOpen}, Stroke = {0, MaxHoOpen},
Home = MaxHoOpen, Home = MaxHoOpen,
Geo = 'PY2_AXIS/GEO', Geo = 'PY2_AXIS/GEO',
Aux = 'PY2_AXIS/SOLID'} Aux = {'PY2_AXIS/SOLID', 'PY2_AXIS/CLAMP_CHECK'}}
-- Rulli -- Rulli
local V1Id = EmtAxis { local V1Id = EmtAxis {
Name = 'V1', Name = 'V1',
@@ -634,6 +722,7 @@ EmtTable {
Parent = 'T', Parent = 'T',
Type = MCH_TT.FLAT, Type = MCH_TT.FLAT,
Ref1 = Point3d( -DimTabX, DeltaTabY, DeltaTabZ), Ref1 = Point3d( -DimTabX, DeltaTabY, DeltaTabZ),
Coll = 'Base/BELT',
Geo = 'TABLE/GEO', Geo = 'TABLE/GEO',
Aux = 'TABLE/SOLID'} Aux = 'TABLE/SOLID'}
-- *** ToolChanger *** -- *** ToolChanger ***
@@ -688,13 +777,24 @@ EmtTcPos {
TDir = -Y_AX(), TDir = -Y_AX(),
ADir = -X_AX(), ADir = -X_AX(),
Geo = 'BASE/T8'} Geo = 'BASE/T8'}
EmtTcPos { if AggreBlockHaus then
local TcpSsId = EmtTcPos {
Name = 'T9',
Parent = 'Base',
Pos = ptTc1 + 8 * vtDt1 + Vector3d( -AngTrBHLen, AngTrBHOffs, 0),
TDir = X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T9_BH',
Aux = 'BASE/T9_HS'}
else
EmtTcPos {
Name = 'T9', Name = 'T9',
Parent = 'Base', Parent = 'Base',
Pos = ptTc1 + 8 * vtDt1, Pos = ptTc1 + 8 * vtDt1,
TDir = -Y_AX(), TDir = -Y_AX(),
ADir = -X_AX(), ADir = -X_AX(),
Geo = 'BASE/T9'} Geo = 'BASE/T9'}
end
EmtTcPos { EmtTcPos {
Name = 'T10', Name = 'T10',
Parent = 'Base', Parent = 'Base',
@@ -804,6 +904,10 @@ EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC3') or GDB_ID.NULL, vtMovB, GDB_RT.G
if Mortiser then if Mortiser then
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC4') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC4') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end end
-- sposto geometria aggiuntiva agrgegato BlockHaus
if AggreBlockHaus then
EgtMove( EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( BaseId, 'T9'), 'T9_HS') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end
EgtMove( EgtGetFirstNameInGroup( X1Id, 'SOLID'), vtMovB, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X1Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X1Id, 'COLLISION'), vtMovB, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X1Id, 'COLLISION'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMovB, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
@@ -814,8 +918,10 @@ local vtMove = Vector3d( 0, ( DeltaTabY - 1170.0), ( DeltaTabZ + 1010.0))
EgtMove( EgtGetFirstNameInGroup( BaseId, 'CONVOYER'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( BaseId, 'CONVOYER'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y1Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( Y1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( PY1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y2Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( Y2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( PY2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( V1Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( V1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PV1Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( PV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( QV1Id, 'SOLID'), vtMove, GDB_RT.GLOB) EgtMove( EgtGetFirstNameInGroup( QV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
@@ -851,7 +957,7 @@ function OnSetHead()
EmtModifyAxisHome( 'B1', ParkB1) EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', X_AX()) EmtModifyAxisDirection( 'B1', X_AX())
-- se testa H12 (lama) -- se testa H12 (lama)
elseif EMC.HEAD == 'H12' then elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H17' then
EmtModifyAxisHome( 'X1', ParkX1) EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1) EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisHome( 'C1', ParkC1) EmtModifyAxisHome( 'C1', ParkC1)
@@ -892,11 +998,16 @@ function OnSetHead()
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-------------------------- Testa utilizzata -------------------------
function GetHeadSet( sHead) function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' then if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
return 1 return 1
elseif sHead == 'H21' or sHead == 'H22' then elseif sHead == 'H19' then
return 11
elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then
return 2 return 2
elseif sHead == 'H29' then
return 21
else else
return 0 return 0
end end
@@ -907,7 +1018,7 @@ end
function GetHeadTCSet( sHead, sTcPos) function GetHeadTCSet( sHead, sTcPos)
local nPos = tonumber( string.sub( sTcPos, 2)) or 0 local nPos = tonumber( string.sub( sTcPos, 2)) or 0
-- testa 1 -- testa 1
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
-- testa 1 su CU prossimo a testa 2 -- testa 1 su CU prossimo a testa 2
if nPos > 10 then if nPos > 10 then
return 'Head1_TC2' return 'Head1_TC2'
@@ -944,6 +1055,54 @@ function HeadIsChainSaw( sHead)
return ( sHead == 'H13') return ( sHead == 'H13')
end end
---------------------------------------------------------------------
-- Funzione che riconosce testa per tastatore
function HeadIsProbe( sHead)
return ( sHead == 'H19' or sHead == 'H29')
end
---------------------------------------------------------------------
function IsToolCompatibleWithProbe( sToolName, sCurrTool)
local bToolIsCompatible = false
if sToolName then
EgtTdbSetCurrTool( sToolName)
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
local dToolLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if dToolDiam < 100 and dToolLen < 160 then
bToolIsCompatible = true
end
EgtTdbSetCurrTool( sCurrTool)
end
return bToolIsCompatible
end
---------------------------------------------------------------------
function GetToolNameFromTcPos( sTcPos)
local sToolName
-- Carico gli utensili sulle barre portautensili
local vTcPos = EgtGetAllTcPosNames()
if vTcPos then
for i = 1, #vTcPos do
if vTcPos[i] == sTcPos then
local sToolsName = EgtGetToolsInCurrSetupPos( vTcPos[i])
sToolName = sToolsName[1]
end
end
end
return sToolName
end
---------------------------------------------------------------------
function GetToolHead( sToolName)
local sHead
local sCurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
EgtTdbSetCurrTool( sToolName)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
EgtTdbSetCurrTool( sCurrTool)
return sHead, sTcPos
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale -- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
function GetChainSawZHomeFromVirtualAxis( dPosA) function GetChainSawZHomeFromVirtualAxis( dPosA)
@@ -971,7 +1130,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione che ritorna ZExtra partendo dalla testa e dall'angolo verticale -- Funzione che ritorna ZExtra partendo dalla testa e dall'angolo verticale
function GetZExtra( sHead, dAngV) function GetZExtra( sHead, dAngV)
if sHead == 'H11' or sHead == 'H21' then if sHead == 'H11' or sHead == 'H21' or sHead == 'H17' then
if abs( dAngV) < 30.1 then if abs( dAngV) < 30.1 then
return 400 return 400
elseif abs( dAngV) < 45.1 then elseif abs( dAngV) < 45.1 then
@@ -998,6 +1157,7 @@ function GetZExtra( sHead, dAngV)
return 0 return 0
end end
end end
return 0
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1038,7 +1198,6 @@ function GetPY2Light()
return ( EgtGetInfo( PY2LightId, 'On') == '1') return ( EgtGetInfo( PY2LightId, 'On') == '1')
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina -- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine() function OnResetMachine()
+7
View File
@@ -2,6 +2,9 @@
;Index = Type, Description, Default Value ;Index = Type, Description, Default Value
; Type : b=boolean, d=double, l=lenght, s=string ; Type : b=boolean, d=double, l=lenght, s=string
[Probing]
0=s,Type,Head
[Drilling] [Drilling]
[Sawing] [Sawing]
@@ -13,6 +16,9 @@
3=d,TrimExt,0 3=d,TrimExt,0
4=s,VtFaceUse,0,0,0 4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0 5=s,EdgesFaceUse,0
6=b,PROBE,0
7=b,START-PROBE,0
8=b,END-PROBE,0
[Pocketing] [Pocketing]
0=l,MaxElev,0 0=l,MaxElev,0
@@ -20,6 +26,7 @@
2=d,OpenMinSafe,0 2=d,OpenMinSafe,0
3=d,OpenOutRaw,0 3=d,OpenOutRaw,0
4=l,MaxOptSize,0 4=l,MaxOptSize,0
5=b,AdjustFeed,1
[Mortising] [Mortising]
0=d,MaxElev,0 0=d,MaxElev,0
+15 -2
View File
@@ -30,6 +30,9 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2) -- Configurazione posizioni (con o senza TC2)
local PositionTable = {} local PositionTable = {}
local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil) local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil)
local AggreBH = ( EgtGetHeadId( 'H17') ~= nil)
local ProbeFirstHead = ( EgtGetHeadId( 'H19') ~= nil)
local ProbeSecondHead = ( EgtGetHeadId( 'H29') ~= nil)
if SecondSaw then if SecondSaw then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"}, PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"}, {Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
@@ -38,7 +41,7 @@ if SecondSaw then
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"}, {Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"}, {Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"}, {Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"}, {Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"}, {Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H22", Group = "G3"}, {Pos = "Pos10", TcPos = "T11", Head = "H22", Group = "G3"},
{Pos = "Pos11", TcPos = "T13", Head = "H21", Group = "G3"}, {Pos = "Pos11", TcPos = "T13", Head = "H21", Group = "G3"},
@@ -61,7 +64,7 @@ else
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"}, {Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"}, {Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"}, {Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"}, {Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"}, {Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H21", Group = "G3"}, {Pos = "Pos10", TcPos = "T11", Head = "H21", Group = "G3"},
{Pos = "Pos11", TcPos = "T12", Head = "H21", Group = "G3"}, {Pos = "Pos11", TcPos = "T12", Head = "H21", Group = "G3"},
@@ -78,6 +81,16 @@ else
table.insert( PositionTable, {Pos = "Pos21", TcPos = "T201", Head = "H13", Group = "G2"}) table.insert( PositionTable, {Pos = "Pos21", TcPos = "T201", Head = "H13", Group = "G2"})
end end
end end
-- aggiunta tastatori
if ProbeFirstHead then
local sIndex = EgtNumToString( #PositionTable + 1)
table.insert( PositionTable, {Pos = "Pos"..sIndex, TcPos = "T501", Head = "H19", Group = "G4"})
end
if ProbeSecondHead then
local sIndex = EgtNumToString( #PositionTable + 1)
table.insert( PositionTable, {Pos = "Pos"..sIndex, TcPos = "T502", Head = "H29", Group = "G4"})
end
local UsePositionHead = true local UsePositionHead = true
local function IsInGeomSet( ToolHead, PosHead) local function IsInGeomSet( ToolHead, PosHead)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -3
View File
@@ -36,6 +36,7 @@
4=s,DOUBLE 4=s,DOUBLE
[MORTISE_STD] [MORTISE_STD]
0=b,MORTISE 0=th,TH,
1=d,STEP 1=b,MORTISE
2=d,SIDESTEP 2=d,STEP
3=d,SIDESTEP
+73
View File
@@ -1,5 +1,78 @@
==== Common_ONE-PF Update Log ==== ==== Common_ONE-PF Update Log ====
Versione 3.1f3 (08/06/2026)
- (GEN) M77 viene ora eseguita, prima era commentata.
Versione 3.1f2 (05/06/2026)
- (MLDE-GEN) Aggiunti parametri di limite asse X per decidere se fare preselezione su altra testa. Serve modifica MLDE
Versione 3.1f1 (03/06/2026)
- (NGE-MLDE-GEN-SIM) Versione unificata con predisposizione per gestione tastatori. Serve modificare anche la macchina, per ora gestione completa solo su PFrl.
Versione 3.1c2 (17/03/2026)
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
Versione 3.1c1 (04/03/2026)
- (GEN) Corretta chiamata di una variabile insesistente in caso di ONE
- (SIM) Allineata simulazione a generazione
Versione 3.1b1 (20/02/2026)
- (GEN) Aggiunta funzione ToolPreSelection() per la preselezione utensile. Ticket#2789
- (GEN) Funzione rinominata in ToolPreSelectionSingleHead(), ora utilizza funzione in MLDE per capire se è motosega
Versione 3.1a1 (16/01/2026)
- (SIM-GEN) Aggiunto controllo che evita collisioni durante lo svincolo in Z della sega a catena nelle funzioni ExecMoveZMax() e EmitZMax(). Ticket#2767
- (SIM-GEN) Piccola correzione modifiche fatte in precedenza
Versione 2.7l1 (18/12/2025)
- (SIM-GEN) Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset(). Ticket#2727
- (SIM-GEN) Divisione movimento B in approccio se > 90°. Ticket#2754
- (SIM) Aggiunta funzione CheckClamping
Versione 2.7k3 (28/11/2025)
- (GEN) Prima di andare allo scarico, si aggiunge movimento intermedio dove si aspetta che rulli scarico siano arrivati in posizione. Ticket#2716
Versione 2.7k2 (20/11/2025)
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
Versione 2.7k1 (05/11/2025)
- (SIM-GEN) Corretto calcolo per decidere se serve aprire i rulli
- (GEN) Aggiunta tolleranza in creazione piano di lavoro inclinato
- (SIM) Allo scarico si resetta Y2DELTA. Ticket#2687
Versione 2.7j3 (23/10/2025)
- (SIM) Corretta posizione parcheggio in caso di testa 1 su magazzino 2. Ticket#2660
Versione 2.7j2 (21/10/2025)
- (GEN) Se SPLIT con pinza 5, corretto salvataggio posizione pinza 2. Ticket#2654
Versione 2.7j1 (08/10/2025)
- (GEN) Salvataggio posizione Z su lavorazione precedente, sbagliava in caso di separazione. Ticket#2637
Versione 2.7i1 (10/09/2025)
- (SIM-GEN) Piccole correzioni per gestire secondo TC su ONE. Ticket#2563
- (SIM-GEN) Gestione aggregato BH completato. Ticket#2482
- (EST) Stima tempi considerando accelerazioni
- (SIM-GEN) Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto
- (GEN) Piccola correzione risalita ZMAX dopo RELOAD del pezzo. Generazione allineata a simulazione.
Versione 2.7h2 (28/08/2025)
- (GEN) Migliorata gestione spegnimento utensile e disattivazione piano
- (SIM-GEN) Corretto nome variabile e altre piccole modifiche per Progress
Versione 2.7h1 (20/08/2025)
- (SIM-GEN) Non si chiudono i rulli se tagli o pretagli di testa e coda
- (SIM) Corretto movimento pinza 5 in caso di riposizionamento pinza 1
- (GEN) Corretta quota assoluta posizione testa trave in caso di pinza 5 e testa rimasta bassa
- (GEN) Se ultima lavorazione pezzo precedente ha stesso utensile della prima lavorazione pezzo successivo, la speed resta accesa
Versione 2.7g4 (23/07/2025)
- (SIM-GEN) Aggiunto parametro configurabile da TS3 per massima sporgenza trave in coda per pinza 5. Ticket#2538
Versione 2.7g3 (22/07/2025)
- (SIM) Corretto lettura angolo di presa della motosega
Versione 2.7g2 (08/07/2025) Versione 2.7g2 (08/07/2025)
- (SIM) Corretto movimento a parcheggio sega a catena. Ticket#2517 - (SIM) Corretto movimento a parcheggio sega a catena. Ticket#2517
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = { local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.7g2', -- versione script VERSION = '3.1f3', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
} }
return InfoCommon_STD_PP return InfoCommon_STD_PP