Compare commits

..

48 Commits

Author SHA1 Message Date
daniele.nicoli caeed11218 Aggiunto Clamp di sicurezza per lettura dei parametri MinJoin da Ts3Data 2026-04-23 12:25:31 +02:00
daniele.nicoli 9beb1ecb41 Merge branch 'master' into develop 2026-04-23 12:24:08 +02:00
andrea.villa 3092966bff Merge remote-tracking branch 'origin/develop' 2026-03-17 15:16:56 +01:00
andrea.villa e5715f3808 Allineamento a common ver. 3.1c2 2026-03-17 15:16:43 +01:00
daniele.nicoli bd02e140d2 Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 08:29:05 +01:00
daniele.nicoli 777bda68ff Aggiunti parametri di lettura da TS3Data.lua: MIN_JOIN_S, MIN_JOIN_L e MAX_ANGLE_DRILL_CUT 2026-03-05 14:44:08 +01:00
daniele.nicoli fe6f9d4523 Merge remote-tracking branch 'origin/HEAD' into develop 2026-03-05 14:42:32 +01:00
andrea.villa 5fa0594754 Allineamento con common ver. 3.1c1 2026-03-04 10:32:16 +01:00
andrea.villa 8bc06dbb15 Merge remote-tracking branch 'origin/develop' 2026-02-20 09:00:35 +01:00
andrea.villa d9308f4c7e Allineamento con common ver. 3.1b1 2026-02-20 09:00:19 +01:00
daniele.nicoli 0262c1241f Aggiunta la lettura da TS3Data.lua delle corse dell'asse W (MIN_W e MAX_W) 2026-02-03 10:48:53 +01:00
daniele.nicoli dac8bb129d Merge branch 'master' into develop 2026-02-03 10:47:24 +01:00
andrea.villa 3a67314ccd Allineamento con common ver. 3.1a1 2026-01-16 15:40:06 +01:00
andrea.villa b2ce5e69a0 Merge remote-tracking branch 'origin/develop' 2025-12-18 16:05:13 +01:00
andrea.villa 6a9b2b5f58 - Allineamento a common ver. 2.7l1
- Aggiunto parametro MAX_ANGLE_DRILL_CUT a BeamData
- Recupero nome macchina da funzione EGT
2025-12-18 16:05:00 +01:00
andrea.villa ed4a3db13b Merge remote-tracking branch 'origin/TestCheckPinzaggioVMILL' into develop 2025-12-18 16:02:25 +01:00
daniele.nicoli 0825eb8227 Modificata versione in 2.7l1_DEV1 2025-12-15 09:50:42 +01:00
daniele.nicoli 51a27d960b Versione con aggiornamento di test a Common.mlpe:
- mlpe, aggiunta funzione ClampCheck
- nge, aggiunta geometria
- mlde, aggiunte variabili, geometria e spostamento. Il coefficente è impostato a nil e modificabile da TS3Data.
2025-12-15 09:49:07 +01:00
daniele.nicoli 5c27dca65c Merge branch 'master' into develop 2025-12-15 09:00:04 +01:00
andrea.villa 8df0b7b47e Corretto disegno porta utensile 2025-12-11 09:20:57 +01:00
andrea.villa 7d0f491909 - Nuovo ToolHolder
- Allineamento con common ver. 2.7k3
2025-11-28 15:40:49 +01:00
andrea.villa 4165843cf9 Merge remote-tracking branch 'origin/develop' 2025-11-20 16:58:22 +01:00
andrea.villa 61bb0aa701 - Allineamento a common ver. 2.7k2
- Cambio versione per rilascio a cliente
2025-11-20 16:58:00 +01:00
daniele.nicoli f3f9f38c84 Aggiunta gestione CUT_SIC impostabile da TS3Data.lua 2025-11-13 11:23:32 +01:00
daniele.nicoli 4b12300100 Merge branch 'master' into develop 2025-11-13 10:55:48 +01:00
andrea.villa 1f93f2f45a Allineamento con common ver. 2.7k1 2025-11-05 13:22:45 +01:00
andrea.villa 718d2ceee3 Allineamento con common ver. 2.7j3 2025-10-23 07:48:09 +02:00
andrea.villa d85a6e3ba3 #critical# Allineamento con common ver. 2.7j2 2025-10-21 10:47:03 +02:00
andrea.villa 605400d40c Allineamento con common ver. 2.7j1 2025-10-08 13:12:51 +02:00
andrea.villa 3576c6ac11 Allineamento con common ver. 2.7i1, HOTFIX 2025-09-10 12:10:26 +02:00
andrea.villa dc43388def - Allineamento common ver. 2.71
- Aggiunto solido collisione per tappeto
2025-09-10 10:35:22 +02:00
andrea.villa 3102d381ed Piccole correzioni per gestire secondo TC su ONE 2025-08-29 16:52:09 +02:00
andrea.villa 3e80505457 - Sistemato script per setup
- Rimosso frame copiato per sbaglio
2025-08-28 14:50:25 +02:00
andrea.villa 7d1749c9ab - Allinemento con common ver. 2.7h2
- Aggiunto secondo cambio utensile
2025-08-28 13:06:28 +02:00
andrea.villa 900cc65fb0 Merge remote-tracking branch 'origin/develop' 2025-08-20 14:31:12 +02:00
andrea.villa 7850144992 Allineamento con common ver. 2.7h1 2025-08-20 14:30:55 +02:00
andrea.villa d6c384d159 Merge remote-tracking branch 'origin/V1OpenOnTailCut' into develop 2025-08-20 14:28:59 +02:00
luca.mazzoleni b314c701fb V1OpenOnTailCut 2025-08-06 10:30:40 +02:00
luca.mazzoleni 1c731d2f51 Merge branch 'master' into develop 2025-08-06 10:21:17 +02:00
andrea.villa 9da267149a - Allineamento con common ver. 2.7g4
- Aggiunto parametro MaxBackClamp5
2025-07-23 12:15:47 +02:00
andrea.villa ee7db694e6 Allineamento con common ver. 2.7g3 2025-07-22 11:17:55 +02:00
andrea.villa b66f238ca5 Alineamento con common ver. 2.7g1 2025-07-01 10:07:32 +02:00
andrea.villa edd07a5bc5 - Allineamento con Common ver. 2.7e1
- Aggiornamento versione
2025-05-28 12:39:28 +02:00
andrea.villa 5825c0f292 Merge commit '8307af3165c0a7129705f4c27387d0bfac7a1190' 2025-05-21 08:33:03 +02:00
andrea.villa 7e5738ffa9 Cambio versione 2025-04-28 13:38:47 +02:00
andrea.villa 947a2c27ae - Allineamento con common ver. 2.7d1
- Aggiornamento MachNotes
- Lettura PRECUT per automatismo
2025-04-16 13:43:07 +02:00
andrea.villa b6f4304daa #critical# Allineamento con common 2.7c3 2025-03-26 07:59:49 +01:00
andrea.villa 4cb36a2899 Allineamento con common ver. 2.7c2 2025-03-12 08:30:20 +01:00
12 changed files with 911 additions and 183 deletions
+16
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
@@ -67,6 +68,8 @@ local BeamData = {
KIOTP = 6, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare KIOTP = 6, -- 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 = false, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut USE_LONGCUT = false, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
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 = 1, -- accorciamento taglio di coda avanzato (minimo 1) ADVANCE_TAIL_OFFS = 1, -- accorciamento taglio di coda avanzato (minimo 1)
CLAMP5 = false -- presenza pinza speciale per pezzi piccoli CLAMP5 = false -- presenza pinza speciale per pezzi piccoli
@@ -96,6 +99,19 @@ if EgtExistsFile( sData) then
BeamData.DIM_STRIP_SMALL = Machine.Offsets.DIM_STRIP_SMALL or BeamData.DIM_STRIP_SMALL BeamData.DIM_STRIP_SMALL = Machine.Offsets.DIM_STRIP_SMALL or BeamData.DIM_STRIP_SMALL
BeamData.DIM_TO_CENTER_STRIP = Machine.Offsets.DIM_TO_CENTER_STRIP or BeamData.DIM_TO_CENTER_STRIP BeamData.DIM_TO_CENTER_STRIP = Machine.Offsets.DIM_TO_CENTER_STRIP or BeamData.DIM_TO_CENTER_STRIP
BeamData.MAXDIAM_POCK_CORNER = Machine.Offsets.MAXDIAM_POCK_CORNER or BeamData.MAXDIAM_POCK_CORNER BeamData.MAXDIAM_POCK_CORNER = Machine.Offsets.MAXDIAM_POCK_CORNER or BeamData.MAXDIAM_POCK_CORNER
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.LONGCUT_ENDLEN = Machine.Offsets.LONGCUT_ENDLEN or BeamData.LONGCUT_ENDLEN
BeamData.LONGCUT_MAXLEN = Machine.Offsets.LONGCUT_MAXLEN or BeamData.LONGCUT_MAXLEN
BeamData.ADVANCE_TAIL_OFFS = Machine.Offsets.ADVANCE_TAIL_OFFS or BeamData.ADVANCE_TAIL_OFFS
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.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.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) 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
+2
View File
@@ -28,6 +28,8 @@
17=ProfTCone 17=ProfTCone
18=SmallToolContour 18=SmallToolContour
19=AntiSplintMillCut 19=AntiSplintMillCut
20=SideMillAsBlade
21=Prof_end
[Pocketing] [Pocketing]
1=Pocket 1=Pocket
+230 -72
View File
@@ -27,7 +27,10 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee --EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed --EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed --EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 102000 -- feed massima pinze 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
-- utensili default -- utensili default
EMT.PREVTCPOS_H1 = DefTcPos1 EMT.PREVTCPOS_H1 = DefTcPos1
EMT.PREVTCPOS_H2 = DefTcPos2 EMT.PREVTCPOS_H2 = DefTcPos2
@@ -56,6 +59,7 @@ function OnProgramStart()
end end
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')') EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n') EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
EmtOutput( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente) -- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then if TEST_USE then
EmitTestProgramStart() EmitTestProgramStart()
@@ -103,6 +107,7 @@ function OnProgramEnd()
EMT.SPECSPLIT = nil EMT.SPECSPLIT = nil
EMT.RELOAD = nil EMT.RELOAD = nil
EMT.RELOAD2 = nil EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma -- Se modalità test, termino il programma
if TEST_USE then if TEST_USE then
EmtOutput( 'M02') EmtOutput( 'M02')
@@ -124,6 +129,11 @@ function OnToolData()
local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( EMT.TDIST or ChSawLen, 1) local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( EMT.TDIST or ChSawLen, 1)
sOut = sOut .. EgtIf( EMT.TCPOS == 'T111', ' G76H9998.2N411N414', ' G76H9998.2N511N514') sOut = sOut .. EgtIf( EMT.TCPOS == 'T111', ' G76H9998.2N411N414', ' G76H9998.2N511N514')
EmtOutput( '('..sOut..')') EmtOutput( '('..sOut..')')
-- emissione dati aggregato BlockHaus
elseif EMT.HEAD == 'H17' then
sPos = EgtIf( #EMT.TCPOS == 2, EMT.TCPOS:gsub( 'T', 'N30'), EMT.TCPOS:gsub( 'T', 'N3'))
local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( ( AngTrBHOffs), 1)..' G76H9998.2'..sPos..sPos
EmtOutput( '('..sOut..')')
-- emissione dati utensile (esclusa sega a catena) -- emissione dati utensile (esclusa sega a catena)
else else
-- output info -- output info
@@ -137,7 +147,6 @@ function OnToolData()
if EMT.TCPOS == 'T201' then if EMT.TCPOS == 'T201' then
sPos = 'N411' sPos = 'N411'
else else
sPos = EgtIf( #EMT.TCPOS == 2, EMT.TCPOS:gsub( 'T', 'N30'), EMT.TCPOS:gsub( 'T', 'N3')) sPos = EgtIf( #EMT.TCPOS == 2, EMT.TCPOS:gsub( 'T', 'N30'), EMT.TCPOS:gsub( 'T', 'N3'))
end end
local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( dAddLen + EMT.TTOTLEN, 1)..' G76H9998.2'..sPos..sPos local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( dAddLen + EMT.TTOTLEN, 1)..' G76H9998.2'..sPos..sPos
@@ -305,8 +314,12 @@ function OnDispositionEnd()
else else
if #EMT.MDCHAR > 0 then if #EMT.MDCHAR > 0 then
MyOutputNoNum( '(PART UNLOAD)') MyOutputNoNum( '(PART UNLOAD)')
-- movimento intermedio di apertura pinza-rulli per evitare di trovare delle collisioni
EmitParkRoller( EMT.TPOS, false, false)
for i = 1, #EMT.MDCHAR do for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i]) EmitMoveDataChars( EMT.MDCHAR[i])
if EMT.MDCHAR[i].V1 then EMT.V1POS = EMT.MDCHAR[i].V1 end
if EMT.MDCHAR[i].V2 then EMT.V2POS = EMT.MDCHAR[i].V2 end
end end
EmitMoveStartChars( 2) EmitMoveStartChars( 2)
-- se dopo c'è scarico spezzone devo mettere attesa termine esecuzione -- se dopo c'è scarico spezzone devo mettere attesa termine esecuzione
@@ -322,7 +335,8 @@ function OnDispositionEnd()
end end
elseif EMT.SPECUNLOADING then elseif EMT.SPECUNLOADING then
EmtOutput( '(PART SPEC UNLOADING)') EmtOutput( '(PART SPEC UNLOADING)')
EmitBeamHeadData( { T=EMT.L1, Pz5=2}) local dAbsHeadPos = EMT.L1pp or EMT.L1
EmitBeamHeadData( { T=dAbsHeadPos, Pz5=2})
EMT.SPECUNLOADING = nil EMT.SPECUNLOADING = nil
EMT.W2DELTA = nil EMT.W2DELTA = nil
-- emissione conclusione pezzo precedente -- emissione conclusione pezzo precedente
@@ -603,6 +617,7 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD EMT.PREVHEAD = EMT.HEAD
EMT.PREVTCPOS = EMT.TCPOS EMT.PREVTCPOS = EMT.TCPOS
-- se taglio finale, aggiorno lunghezza barra -- se taglio finale, aggiorno lunghezza barra
if EMT.MCHCUT then if EMT.MCHCUT then
EMT.LB = EMT.LT + ( EMT.X_OFF or 0) EMT.LB = EMT.LT + ( EMT.X_OFF or 0)
@@ -667,9 +682,9 @@ function OnPathStart()
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
EMT.L1pp = EMT.L1op EMT.L1pp = EMT.L1op
EMT.L2pp = EMT.L2op EMT.L2pp = EMT.L2op
EMT.L3pp = EMT.L3op EMT.L3pp = EMT.L3op or EMT.L3pp
EMT.R1pp = EMT.R1p EMT.R1pp = EMT.R1p or EMT.R1pp
EMT.R2pp = EMT.R2p EMT.R2pp = EMT.R2p or EMT.R2pp
else else
EMT.L1pp = nil EMT.L1pp = nil
EMT.L2pp = nil EMT.L2pp = nil
@@ -896,7 +911,16 @@ function OnRapid()
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) -- 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)
EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
end
if bMoveZbeforeX then if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end end
@@ -957,7 +981,7 @@ function OnRapid()
local dTRad, dTLen = GetToolRadLen() local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama -- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=-ParkX2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed}) EmitMoveDataHead( 1, { X=-ParkFrnX1, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1) EmitMoveStartHead( 1)
EmitMoveWaitHead( 1) EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3)) EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
@@ -980,7 +1004,15 @@ function OnRapid()
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) -- 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)
EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
end
if bMoveZbeforeX then if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end end
@@ -1031,7 +1063,7 @@ function OnRapid()
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3)) EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false local bMoveZbeforeX = false
local dZref = EMT.L3 local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2) dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2)
end end
@@ -1046,18 +1078,31 @@ function OnRapid()
end end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379") -- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then if abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then
EmitMoveDataHead( 2, { B=0, S=Speed}) if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed}) EmitMoveDataHead( 2, { B=0, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed}) EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
if bMoveZbeforeX then -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed}) -- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
EmitMoveDataHead( 2, { Z=dZref, B=dBref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
end
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
end end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
end end
-- altrimenti sega a catena -- altrimenti sega a catena
else else
@@ -1131,7 +1176,7 @@ function OnRapid()
else else
--EmtOutput( string.format( 'V1Pos=%.3f V2Pos=%.3f', EMT.V1POS, EMT.V2POS)) --EmtOutput( string.format( 'V1Pos=%.3f V2Pos=%.3f', EMT.V1POS, EMT.V2POS))
local bToPresel = true local bToPresel = true
if not EMT.RELOAD and not EMT.ZMAX and #EMT.AUXCMD > 0 and EMT.TO_ZMAX then if not EMT.ZMAX and #EMT.AUXCMD > 0 and EMT.TO_ZMAX then
-- allontanamento o eventuale preselezione successiva testa differente -- allontanamento o eventuale preselezione successiva testa differente
if not EMT.DOU_TYPE then if not EMT.DOU_TYPE then
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD) PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
@@ -1265,7 +1310,15 @@ function OnRapid()
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) -- 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)
EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
end
if bMoveZbeforeX then if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end end
@@ -1354,7 +1407,15 @@ function OnRapid()
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) -- 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)
EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
end
if bMoveZbeforeX then if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end end
@@ -1400,7 +1461,7 @@ function OnRapid()
local bMoveZbeforeX = false local bMoveZbeforeX = false
local dZref = EMT.L3 local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 > -LimX2RotSaw, EMT.L2 < -LimX2RotSaw) or EMT.R2 < -91) then if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 > -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2) dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2)
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
@@ -1415,18 +1476,31 @@ function OnRapid()
end end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379") -- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then if abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then
EmitMoveDataHead( 2, { B=0, S=Speed}) if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed}) EmitMoveDataHead( 2, { B=0, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed}) EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
if bMoveZbeforeX then -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed}) -- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
EmitMoveDataHead( 2, { Z=dZref, B=dBref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
end
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
end end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
end end
-- altrimenti sega a catena -- altrimenti sega a catena
else else
@@ -1502,6 +1576,7 @@ function OnRapid()
end end
EMT.REFLOC = 0 EMT.REFLOC = 0
EMT.MCHFIRST = false EMT.MCHFIRST = false
EMT.PLANEACTIVE = true
EMT.ZMAX = false EMT.ZMAX = false
-- se standard -- se standard
elseif EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then elseif EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then
@@ -1531,6 +1606,7 @@ function OnRapid()
EmtOutput( 'M175') EmtOutput( 'M175')
end end
EMT.MCHFIRST = false EMT.MCHFIRST = false
EMT.PLANEACTIVE = true
end end
-- se necessario, impostazione riferimento locale -- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then if EMT.REFLOC == 0 then
@@ -1587,7 +1663,7 @@ function OnRapid()
MyAdjustLinearAxes() MyAdjustLinearAxes()
EmtAdjustRotaryAxes() EmtAdjustRotaryAxes()
-- 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
@@ -1598,6 +1674,7 @@ function OnRapid()
-- aggiorno quota finale trave dopo Zmax -- aggiorno quota finale trave dopo Zmax
EMT.L1o = EMT.TPOS EMT.L1o = EMT.TPOS
EMT.ZMAX = true EMT.ZMAX = true
ToolPreSelectionSingleHead( EMT.MCHID)
-- se altrimenti movimento in Home -- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then elseif EMT.FLAG == 4 then
-- non previsto -- non previsto
@@ -1635,6 +1712,7 @@ function OnLinear()
EMT.L3p = nil EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '') local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp()) EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
EMT.PLANEACTIVE = true
-- emissione movimento -- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3').. local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1') EmtGetAxis('R2')..EmtGetAxis('R1')
@@ -1718,6 +1796,7 @@ function OnArc()
EMT.L3p = nil EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '') local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp()) EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
EMT.PLANEACTIVE = true
-- emissione movimento -- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3').. local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1') EmtGetAxis('R2')..EmtGetAxis('R1')
@@ -1765,28 +1844,6 @@ function OnArc()
EmtUpdatePrev() EmtUpdatePrev()
end end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
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)
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc)
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function CalcCharStatusN( sCmd) function CalcCharStatusN( sCmd)
-- aperto -- aperto
@@ -2265,7 +2322,7 @@ function PreparePreRotation( sCmd, nInd)
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, BeamVise=0} MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, BeamVise=0}
elseif EMT.SPECSPLIT or EMT.SPLITROT then elseif EMT.SPECSPLIT or EMT.SPLITROT then
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), V1=ParkV1, IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV1=3, BeamVise=EMT.BV} MDChar = { [Cmd[2]]=tonumber(Cmd[3]), V1=ParkV1, IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV1=3, BeamVise=EMT.BV}
EMT.V1POS = MDChar.V1 EMT.V1NEXTPOS = MDChar.V1
else else
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV} MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
end end
@@ -2403,6 +2460,9 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetV1ToCloseNum( UseCurrV1) function GetV1ToCloseNum( UseCurrV1)
if EMT.MCHPRECUT or EMT.MCHCUT then
return false
end
--EmtOutput( string.format( 'L1m=%.3f L1M=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1])) --EmtOutput( string.format( 'L1m=%.3f L1M=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1]))
--EmtOutput( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT)) --EmtOutput( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT))
local dV1Pos local dV1Pos
@@ -2495,10 +2555,15 @@ function MyAdjustLinearAxes()
local Len = ( EMT.TDIST or ChSawLen) + Mill2Offs local Len = ( EMT.TDIST or ChSawLen) + Mill2Offs
local LenRef = Mill2Offs local LenRef = Mill2Offs
vtE = Vector3d( EMT.ADIR) * Len - Z_AX() * LenRef vtE = Vector3d( EMT.ADIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H17' then
local LenAux = AngTrBHOffs + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
else else
EmtSetLastError( 1211, 'Head not defined ' .. ( EMT.HEAD or '')) EmtSetLastError( 1211, 'Head not defined ' .. ( EMT.HEAD or ''))
end end
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H13' or EMT.HEAD == 'H15' then if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H13' or EMT.HEAD == 'H15' or sHead == 'H17' then
EMT.L1 = EMT.L1 - vtE:getX() EMT.L1 = EMT.L1 - vtE:getX()
EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY() EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY()
EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ() EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ()
@@ -2611,6 +2676,9 @@ function GetToolRadLen()
-- se sega a catena -- se sega a catena
elseif HeadIsChainSaw( EMT.HEAD) then elseif HeadIsChainSaw( EMT.HEAD) then
return EMT.TLEN, ( EMT.TDIST or ChSawLen) return EMT.TLEN, ( EMT.TDIST or ChSawLen)
-- se aggregato BlockHaus
elseif EMT.HEAD == 'H17' then
return EMT.TDIAM / 2, AngTrBHOffs
end end
end end
@@ -2632,7 +2700,7 @@ function CalcInterpPlane()
local _, dAngV, dAngO = SphericalFromVector( vtE) local _, dAngV, dAngO = SphericalFromVector( vtE)
local dAngO2 = EmtGetAngO2( EMT.IPLGLFR:getVersZ(), EMT.IPLGLFR:getVersX(), dAngV, dAngO) local dAngO2 = EmtGetAngO2( EMT.IPLGLFR:getVersZ(), EMT.IPLGLFR:getVersX(), dAngV, dAngO)
dAngO = dAngO + 90 dAngO = dAngO + 90
while dAngO >= 360 do while dAngO + 100 * GEO.EPS_SMALL > 360 do
dAngO = dAngO - 360 dAngO = dAngO - 360
end end
EMT.IPLGLSTR = ' EX0 EY'..EmtLenToString( xS)..' EZ0'.. EMT.IPLGLSTR = ' EX0 EY'..EmtLenToString( xS)..' EZ0'..
@@ -2784,9 +2852,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
local MovH = { Z = EgtIf( dZref > EMT.L3o, dZref, EMT.L3o)} local MovH = { Z = EgtIf( dZref > EMT.L3o, dZref, EMT.L3o)}
MovH.X = -dXPos ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ; MovH.X = -dXPos ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
EmitMoveDataHead( 1, MovH) EmitMoveDataHead( 1, MovH)
if EMT.HEAD == 'H12' and ( abs( dSafeC1 - PrevR1) > 30.1 or abs( dSafeB1 - PrevR2) > 30.1) or not( bProgress) then EmitMoveDataHead( 1, { Z=dMaxZ1, B=0})
EmitMoveDataHead( 1, { Z=dMaxZ1, B=0})
end
EmitMoveDataHead( 1, { C=dSafeC1}) EmitMoveDataHead( 1, { C=dSafeC1})
EmitMoveDataHead( 1, { B=dSafeB1}) EmitMoveDataHead( 1, { B=dSafeB1})
EmitMoveDataHead( 1, { Z=dMaxZ1}) EmitMoveDataHead( 1, { Z=dMaxZ1})
@@ -2806,6 +2872,24 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori -- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1} local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1}
EmitMoveDataHead( 1, MovH) EmitMoveDataHead( 1, MovH)
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EMT.TTOTLEN, 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.L3o + MillOffs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3o + ( 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
EmitMoveDataHead( 1, { Z=dZUp})
end
end
end
end
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dSafeB1}) EmitMoveDataHead( 1, { Z=dSafeZ1, B=dSafeB1})
if EMT.R3 and abs( EMT.R3) < 0.1 then if EMT.R3 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { Z=ParkCSawZ1}) EmitMoveDataHead( 1, { Z=ParkCSawZ1})
@@ -2863,6 +2947,24 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori -- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1} local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1}
EmitMoveDataHead( 2, MovH) EmitMoveDataHead( 2, MovH)
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EMT.TTOTLEN, 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.L3o + Mill2Offs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3o + ( 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
EmitMoveDataHead( 2, { Z=dZUp})
end
end
end
end
EmitMoveDataHead( 2, { Z=dSafeZ2, B=dSafeB2}) EmitMoveDataHead( 2, { Z=dSafeZ2, B=dSafeB2})
if EMT.R3 and abs( EMT.R3) < 0.1 then if EMT.R3 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 2, { Z=ParkCSawZ2}) EmitMoveDataHead( 2, { Z=ParkCSawZ2})
@@ -2937,14 +3039,19 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function EmitResetMachining() function EmitResetMachining()
if ( EMT.TOOL ~= GetNextTool( EMT.MCHID) and IsLastPath( EMT.PATHID)) or GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID) then if EMT.PLANEACTIVE then
-- se da MLDE parametro non settato, o settato a true, scrivo il comando arresto mandrino -- se non sono a Z massima e operatore deve entrare in cabina spango sempre
if WriteM05Command == nil or WriteM05Command then if not EMT.ZMAX and ( GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID)) then
EmtOutput( 'M05')
-- altrimenti spegnimento dipende da parametro
elseif ( EMT.TOOL ~= GetNextTool( EMT.MCHID, false) and IsLastPath( EMT.PATHID)) or GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID) then
EmtOutput( 'M05') EmtOutput( 'M05')
end end
local sOut = 'G157 EA1'
EmtOutput( sOut)
-- piano non più attivo
EMT.PLANEACTIVE = false
end end
local sOut = 'G157 EA1'
EmtOutput( sOut)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -3049,6 +3156,57 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
EMT.TPOS = dPosT EMT.TPOS = dPosT
end end
---------------------------------------------------------------------
-- Se la lavorazione segue una disposizione ha un utensile diverso da quello attuale lo cambia durante la disposizione
function ToolPreSelectionSingleHead( nMchId)
-- Se non sono nell'ultima lavorazione della fase o se è una macchina a doppia testa ritorna senza fare nulla
local bIsPhaseEnd = ( EgtGetNextActiveOperation( nMchId) and EgtGetInfo( EgtGetNextActiveOperation( nMchId), 'TYPE') == 'END')
if not bIsPhaseEnd or EgtGetHeadId( 'H21') then
return
end
-- nome utensile
local sToolChange
local sToolChangePos
local sToolChangeHead
-- recupero lavorazione successiva e se contiene un utensile diverso salva utensile e posizione utensile
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
if EgtSetCurrMachining( nNextMchId) then
local sNextTool = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sNextTool) then
if EMT.TOOL ~= sNextTool then
local sNextHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if not HeadIsChainSaw( sNextHead) then
sToolChange = sNextTool
sToolChangePos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
sToolChangeHead = sNextHead
end
end
break
end
end
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
end
-- ripristino stato corrente
EgtSetCurrMachining( EMT.MCHID)
EgtTdbSetCurrTool( EMT.TOOL)
-- controlla se l'operazione successiva e quella ancora dopo esistono e sono disposizioni
local bNextOpIsDisp = ( EgtGetNextActiveOperation( nMchId)
and ( EgtGetOperationType( EgtGetNextActiveOperation( nMchId)) == MCH_OY.DISP)
and ( EgtGetNextActiveOperation( EgtGetNextActiveOperation( nMchId)))
and ( EgtGetOperationType( EgtGetNextActiveOperation( EgtGetNextActiveOperation( nMchId))) == MCH_OY.DISP))
-- emetto preselezione utensile
if bIsPhaseEnd and bNextOpIsDisp then
if ( EMT.TOOL and sToolChangePos and sToolChange and sToolChangeHead) and EMT.TOOL ~= sToolChangePos and not HeadIsChainSaw( sToolChangeHead) then
local MyParkX1 = EgtIf( GetHeadTCSet( sToolChangeHead, sToolChangePos) == 'Head1_TC2', ParkFrnX1, ParkX1)
EmitMoveDataHead( 1, { X=-MyParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sToolChangePos)})
EmitMoveStartHead( 1)
end
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function PreselectNextDiffHead( nMchId, sHead) function PreselectNextDiffHead( nMchId, sHead)
-- se non ho due teste, esco subito -- se non ho due teste, esco subito
@@ -3095,7 +3253,7 @@ function PreselectNextDiffHead( nMchId, sHead)
EmitMoveStartHead( 1) EmitMoveStartHead( 1)
EmitMoveWaitHead( 1) EmitMoveWaitHead( 1)
end end
-- Emetto preselezione (non ammessa per sega a catena H13 e H23) -- Emetto preselezione (non ammessa per sega a catena H13 e H23 e aggregato BlockHaus H17)
if sNextHead == 'H11' then if sNextHead == 'H11' then
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sNextTcPos)}) EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sNextTcPos)})
EmitMoveStartHead( 1) EmitMoveStartHead( 1)
@@ -3174,7 +3332,7 @@ function EmitTestProgramStart()
EmtOutput( 'M12 $START PER SVINCOLO TESTE') EmtOutput( 'M12 $START PER SVINCOLO TESTE')
EmtOutput( '(SVINCOLO TESTA 1)') EmtOutput( '(SVINCOLO TESTA 1)')
EmitMoveDataHead( 1, {Z=ParkZ1-100, TPos=0}) EmitMoveDataHead( 1, {Z=ParkZ1-100, TPos=0})
if Progress then if Progress or SecondToolChanger then
EmtOutput( 'IF E80001<=10 THEN') EmtOutput( 'IF E80001<=10 THEN')
EmitMoveDataHead( 1, {C=ParkC1, TPos=0}) EmitMoveDataHead( 1, {C=ParkC1, TPos=0})
EmitMoveDataHead( 1, {Z=-150, B=ParkB1, TPos=0}) EmitMoveDataHead( 1, {Z=-150, B=ParkB1, TPos=0})
+365 -63
View File
@@ -24,7 +24,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** SIMULATION *** -- *** SIMULATION ***
--------------------------------------------------------------------- ---------------------------------------------------------------------
local COLL_SAFE_DIST = 4 local COLL_SAFE_DIST = 3
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnSimulInit() function OnSimulInit()
@@ -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
@@ -129,7 +137,7 @@ function OnSimulStart()
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,19 +245,26 @@ function OnSimulDispositionStart()
end end
end end
-- determino la risoluzione dello Zmap -- determino la risoluzione dello Zmap
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ() local dTol = 4.71
local dTol = 4.51 if EmtGetVMillStep then
if dArea < CoeffVM * 0.5e6 then dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
dTol = 1.01 else
elseif dArea < CoeffVM * 1.2e6 then local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
dTol = 1.51 if dArea < 0.075e6 then
elseif dArea < CoeffVM * 2.5e6 then dTol = 0.71
dTol = 1.97 elseif dArea < 0.15e6 then
elseif dArea < CoeffVM * 5.0e6 then dTol = 1.01
dTol = 2.81 elseif dArea < 0.3e6 then
elseif dArea < CoeffVM * 10.0e6 then dTol = 1.51
dTol = 3.77 elseif dArea < 0.6e6 then
dTol = 1.97
elseif dArea < 1.2e6 then
dTol = 2.81
elseif dArea < 2.4e6 then
dTol = 3.77
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
@@ -466,6 +481,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
@@ -507,10 +523,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
@@ -642,7 +656,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)
@@ -710,12 +724,12 @@ function OnSimulToolDeselect( dPrevA)
-- 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
@@ -766,6 +780,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
@@ -959,7 +974,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
@@ -1031,7 +1051,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
@@ -1047,9 +1075,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)
@@ -1078,13 +1106,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
@@ -1100,7 +1128,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
@@ -1113,9 +1149,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)
@@ -1155,9 +1191,9 @@ function OnSimulMoveStart()
--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 == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = Z2Home + GetZExtra( EMT.HEAD, EMT.R2) - 100 dZref = Z2Home + 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
if EMT.L3 > dZref then if EMT.L3 > dZref then
bMoveZbeforeX = true bMoveZbeforeX = true
@@ -1168,25 +1204,38 @@ function OnSimulMoveStart()
SimulMoveAxis( 'X2', LimX2RotSaw, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X2', LimX2RotSaw, MCH_SIM_STEP.RAPID)
end end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379") -- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( C2Pos - EMT.R1) > 1 and ( abs( C2Home - EMT.R1) > 30.1 or abs(B2Home - EMT.R2) > 30.1) then if abs( C2Pos - EMT.R1) > 1 and ( abs( C2Home - EMT.R1) > 30.1 or abs( B2Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT) if EMT.HEAD == 'H22' then
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID) -- 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
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
end end
-- caso standard
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end end
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)
@@ -1332,7 +1381,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
@@ -1466,7 +1515,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')
@@ -1584,7 +1633,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)
@@ -1664,24 +1721,40 @@ function ExecMoveZmax( bMchSplit, btoXHome)
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT) SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end end
else else
-- se sega a catena -- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then if not HeadIsChainSaw( EMT.HEAD) then
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)
@@ -1689,6 +1762,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)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.HEAD or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
EMT.PREVTOOL_H1 = nil EMT.PREVTOOL_H1 = nil
EMT.PREVHEAD_H1 = nil EMT.PREVHEAD_H1 = nil
EMT.PREVTCPOS_H1 = nil EMT.PREVTCPOS_H1 = nil
@@ -1717,13 +1792,31 @@ function ExecMoveZmax( bMchSplit, btoXHome)
EMT.XHOME = true EMT.XHOME = true
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X2', ParkX2, 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 + 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)
end end
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT) SimulMoveAxes( 'X2', ParkCSawX2, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
end end
end end
EMT.ZMAX = true EMT.ZMAX = true
@@ -1798,16 +1891,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
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2195,6 +2435,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)
@@ -2209,11 +2452,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
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2234,7 +2483,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')
@@ -2291,6 +2540,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
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2376,6 +2628,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
@@ -2432,6 +2693,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
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2557,11 +2824,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
@@ -2583,7 +2850,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
@@ -2804,7 +3071,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
@@ -2812,7 +3079,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
@@ -2837,10 +3104,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
@@ -2855,5 +3122,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 ***
+102 -11
View File
@@ -7,6 +7,65 @@ EgtEnableDebug( false)
-- 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 +131,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 +232,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()))
@@ -223,7 +282,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,6 +713,24 @@ 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)
@@ -761,7 +838,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
@@ -1423,7 +1500,14 @@ function SpecCalcSplit( dLenRaw, dMaxLenLeft)
local vCmd = {} local vCmd = {}
EgtOutLog( ' *[S]', 1) EgtOutLog( ' *[S]', 1)
local bSplit = ( EMC.Y2DELTA ~= nil or EMC.W2DELTA ~= nil) local bSplit = ( EMC.Y2DELTA ~= nil or EMC.W2DELTA ~= nil)
local ParkT = EgtIf( bSplit and dMaxLenLeft > ParkV1 - 50, LoadT, ParkV1) local ParkT = ParkV1
if bSplit then
if dMaxLenLeft + 100 > LoadT then
ParkT = dMaxLenLeft + 300
elseif dMaxLenLeft + 100 > ParkV1 then
ParkT = LoadT
end
end
local sType = EgtIf( EMC.Y2DELTA, 'Split', EgtIf( EMC.W2DELTA, 'SpecSplit', 'Fall')) local sType = EgtIf( EMC.Y2DELTA, 'Split', EgtIf( EMC.W2DELTA, 'SpecSplit', 'Fall'))
table.insert( vCmd, { 0, sType}) table.insert( vCmd, { 0, sType})
if not bSplit then EnsureZmax( false, vCmd) end if not bSplit then EnsureZmax( false, vCmd) end
@@ -1546,8 +1630,11 @@ function SpecCalcUnload()
EgtOutLog( ' *[U1]', 1) EgtOutLog( ' *[U1]', 1)
end end
local vCmd = {} local vCmd = {}
-- Tipo di scarico
local bStdUl = ( not MaxUnloadLen or MaxUnloadLen < 1 or EMC.LB - EMC.HOVM < MaxUnloadLen + 1)
-- Commento -- Commento
table.insert( vCmd, { 0, 'Unloading'}) table.insert( vCmd, { 0, 'Unloading', EgtIf( bStdUl, 'Unloading', 'Manual Unloading')})
-- posizionamento sicuro teste e rulli (non serve ?) -- posizionamento sicuro teste e rulli (non serve ?)
--table.insert( vCmd, { 4, 0}) --table.insert( vCmd, { 4, 0})
-- Se pinza Y chiusa, la apro -- Se pinza Y chiusa, la apro
@@ -1555,11 +1642,15 @@ function SpecCalcUnload()
table.insert( vCmd, { 11, 0}) table.insert( vCmd, { 11, 0})
EMC.CNT = nil EMC.CNT = nil
end end
-- Sposto il pezzo in posizione di scarico -- Se non supero la lunghezza massima di scarico, sposto il pezzo in posizione di scarico
local dFinT = UnloadT - EMC.LB if bStdUl then
local dFinY2 = dFinT + EMC.Y2DELTA local dFinT = UnloadT - EMC.LB
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2}) local dFinY2 = dFinT + EMC.Y2DELTA
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1) table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
else
table.insert( vCmd, { 1, 'Y2', MaxY2})
end
-- apro la morsa -- apro la morsa
table.insert( vCmd, { 12, 0}) table.insert( vCmd, { 12, 0})
-- riporto il carrello in home -- riporto il carrello in home
+52 -15
View File
@@ -32,10 +32,10 @@
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
PP_VER = '2.7c1_DEV1' PP_VER = '3.1c2'
PP_NVER = '2.7.3.1' PP_NVER = '3.1.3.2'
MIN_MACH_VER = '2.5k1' MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-ONE' MACH_NAME = EgtGetCurrMachineName()
-- Carico i dati globali -- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir() local sMachDir = EgtGetCurrMachineDir()
@@ -135,9 +135,11 @@ DimTabX = 30000
AutomaticRotation = true AutomaticRotation = true
AutoRotMinLen = 0 AutoRotMinLen = 0
DefTcPos1 = 'T3' DefTcPos1 = 'T3'
CoeffVM = 0.5
EstimationRapidMultiplier = 1 EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false ForceToCloseRollersGate = false
SecondToolChanger = 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-ONE.data" local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-ONE.data"
@@ -182,6 +184,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
@@ -202,9 +206,17 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAWOFFSX then SawOffsX = Machine.Offsets.SAWOFFSX end if Machine.Offsets.SAWOFFSX then SawOffsX = Machine.Offsets.SAWOFFSX end
if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
if Machine.Offsets.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.MAX_BACK_CLAMP_5 then MaxBackClamp5 = Machine.Offsets.MAX_BACK_CLAMP_5 end
if Machine.Offsets.SEC_TC then SecondToolChanger = ( Machine.Offsets.SEC_TC == 1) 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
@@ -218,6 +230,7 @@ if EgtExistsFile( sData) then
ParkCSawZ1 = min( ParkCSawZ1, MaxZ1) ParkCSawZ1 = min( ParkCSawZ1, MaxZ1)
ParkCSaw0Z1 = min( ParkCSaw0Z1, MaxZ1) ParkCSaw0Z1 = min( ParkCSaw0Z1, MaxZ1)
Mortiser = ( Mortiser and not Progress) Mortiser = ( Mortiser and not Progress)
SecondToolChanger = ( SecondToolChanger and not Progress)
end end
end end
end end
@@ -237,6 +250,10 @@ if Progress then
table.insert( sBaseAux, 'BASE/TC1S') table.insert( sBaseAux, 'BASE/TC1S')
table.insert( sBaseAux, 'BASE/TC2') table.insert( sBaseAux, 'BASE/TC2')
table.insert( sBaseAux, 'BASE/TC3') table.insert( sBaseAux, 'BASE/TC3')
elseif SecondToolChanger then
table.insert( sBaseAux, 'BASE/TC2')
table.insert( sBaseAux, 'BASE/TC2S')
table.insert( sBaseAux, 'BASE/TC3')
else else
table.insert( sBaseAux, 'BASE/MTC') table.insert( sBaseAux, 'BASE/MTC')
if Mortiser then table.insert( sBaseAux, 'BASE/TC3') end if Mortiser then table.insert( sBaseAux, 'BASE/TC3') end
@@ -330,7 +347,7 @@ EmtAxis {
Home = 0, Home = 0,
Geo = 'A1_AXIS/GEO'} Geo = 'A1_AXIS/GEO'}
local H13Id local H13Id
if Progress then if Progress or SecondToolChanger then
H13Id = EmtHead { H13Id = EmtHead {
Name = 'H13', Name = 'H13',
Parent = 'A', Parent = 'A',
@@ -361,9 +378,9 @@ else
end end
EgtSetInfo( H13Id, 'ZSAFEDELTA', '60') EgtSetInfo( H13Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H13Id, 'ZMAXONROT', '1,80') EgtSetInfo( H13Id, 'ZMAXONROT', '1,80')
-- Mortasatrice sotto la traversa (solo per One) -- Mortasatrice sotto la traversa (solo per One base con un solo cambio utensile)
local H15Id local H15Id
if not Progress and Mortiser then if not Progress and Mortiser and not SecondToolChanger then
H15Id = EmtHead { H15Id = EmtHead {
Name = 'H15', Name = 'H15',
Parent = 'A', Parent = 'A',
@@ -401,7 +418,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',
@@ -421,7 +438,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',
@@ -532,6 +549,7 @@ EmtTable {
Parent = 'T', Parent = 'T',
Type = MCH_TT.FLAT, Type = MCH_TT.FLAT,
Ref1 = Point3d( - DimTabX, DeltaTabY - DimTabY, DeltaTabZ), Ref1 = Point3d( - DimTabX, DeltaTabY - DimTabY, DeltaTabZ),
Coll = 'Base/BELT',
Geo = 'TABLE/GEO', Geo = 'TABLE/GEO',
Aux = 'TABLE/SOLID'} Aux = 'TABLE/SOLID'}
-- *** ToolChanger *** -- *** ToolChanger ***
@@ -617,16 +635,33 @@ EmtTcPos {
TDir = -Y_AX(), TDir = -Y_AX(),
ADir = -X_AX(), ADir = -X_AX(),
Geo = 'BASE/T10'} Geo = 'BASE/T10'}
if Progress then if Progress or SecondToolChanger then
local ptTc2 = Point3d( 150, -170, -217 + ( DeltaTabZ + DeltaRulliTraveZ + 29)) local ptTc2 = Point3d( 150, -170, -217 + ( DeltaTabZ + DeltaRulliTraveZ + 29))
local vtDt2 = Vector3d( 0, 0, - 102.5) local vtDt2 = Vector3d( 0, 0, - 102.5)
if SecondToolChanger then
EmtTcPos { EmtTcPos {
Name = 'T11', Name = 'T11',
Parent = 'Base', Parent = 'Base',
Pos = ptTc2 + Vector3d( SawOffsX, SawOffsZ, 0), Pos = ptTc2,
TDir = Y_AX(), TDir = Y_AX(),
ADir = -X_AX(), ADir = -X_AX(),
Geo = 'BASE/T11'} Geo = 'BASE/T11b'}
EmtTcPos {
Name = 'T12',
Parent = 'Base',
Pos = ptTc2 + 1 * vtDt1,
TDir = Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T12'}
else
EmtTcPos {
Name = 'T11',
Parent = 'Base',
Pos = ptTc2 + Vector3d( SawOffsX, SawOffsZ, 0),
TDir = Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T11'}
end
EmtTcPos { EmtTcPos {
Name = 'T13', Name = 'T13',
Parent = 'Base', Parent = 'Base',
@@ -701,9 +736,9 @@ else
ADir = X_AX(), ADir = X_AX(),
Geo = 'BASE/T201'} Geo = 'BASE/T201'}
end end
if Progress or Mortiser then if Progress or Mortiser or SecondToolChanger then
local ptTc3 = Point3d( 480, 506.1, -200.8 + ( DeltaTabZ + DeltaRulliTraveZ + 29)) local ptTc3 = Point3d( 480, 506.1, -200.8 + ( DeltaTabZ + DeltaRulliTraveZ + 29))
local sName = EgtIf( Progress, 'T101', 'T301') local sName = EgtIf( Progress or SecondToolChanger, 'T101', 'T301')
EmtTcPos { EmtTcPos {
Name = sName, Name = sName,
Parent = 'Base', Parent = 'Base',
@@ -731,8 +766,10 @@ local vtMove = Vector3d( 0, ( DeltaTabY - 1550.0), ( DeltaTabZ + 1060.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)
@@ -777,7 +814,7 @@ function OnSetHead()
else else
local MyHomeB1, MyHomeC1 local MyHomeB1, MyHomeC1
-- se cambio utensile verticale -- se cambio utensile verticale
if EgtGetHeadId('H21') or bProgress then if EgtGetHeadId( 'H21') or Progress or SecondToolChanger then
MyHomeB1 = ParkFrnB1 MyHomeB1 = ParkFrnB1
MyHomeC1 = ParkFrnC1 MyHomeC1 = ParkFrnC1
-- altrimenti su one CU speciale motosega-utensile lungo -- altrimenti su one CU speciale motosega-utensile lungo
BIN
View File
Binary file not shown.
+28 -19
View File
@@ -7,18 +7,20 @@
[Sawing] [Sawing]
[Milling] [Milling]
0=d,MaxElev,0 0=l,MaxElev,0
1=d,OutRaw,0 1=d,OutRaw,0
2=d,SideElev,0 2=l,SideElev,0
3=d,TrimExt,0 3=d,TrimExt,0
4=sr,VtFaceUse,0,0,0 4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0
[Pocketing] [Pocketing]
0=d,MaxElev,0 0=l,MaxElev,0
1=b,Open,0 1=b,Open,0
2=d,OpenMinSave,0 2=d,OpenMinSafe,0
3=d,OpenOutRaw,0 3=d,OpenOutRaw,0
4=d,MaxOptSize,0 4=l,MaxOptSize,0
5=b,AdjustFeed,1
[Mortising] [Mortising]
0=d,MaxElev,0 0=d,MaxElev,0
@@ -30,21 +32,28 @@
[SawFinishing] [SawFinishing]
[GenMachining] [GenMachining]
0=l,LinTol,0.1
1=l,MaxLen,2
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=l,OffsProj,0
6=l,LiTang,0
7=l,LiOrth,0
8=l,LiElev,0
9=l,LoTang,0
10=l,LoOrth,0
11=l,LoElev,0
12=b,DirFromGuide,1
[SurfRoughing] [SurfRoughing]
0=l,MaxElev,1000
1=b,PlaneZ,0
[SurfFinishing] [SurfFinishing]
0=b,SkipMaxDown,1 0=b,SkipMaxDown,1
[5AxMilling]
0=l,LinTol,0.01
1=l,MaxLen,10
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=d,AngIni,-90
6=d,AngFin,90
7=l,LiTang,0
8=l,LiOrth,0
9=l,LiElev,0
10=l,LoTang,0
11=l,LoOrth,0
12=l,LoElev,0
13=b,DirFromGuide,0
14=b,SurfAvoid,0
+23 -1
View File
@@ -29,8 +29,30 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2) -- Configurazione posizioni (con o senza TC2)
local PositionTable = {} local PositionTable = {}
-- se secondo toolchanger
if EgtGetTcPosId( 'T12') then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
{Pos = "Pos3", TcPos = "T4", Head = "H11", Group = "G1"},
{Pos = "Pos4", TcPos = "T5", Head = "H11", Group = "G1"},
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H11", Group = "G2"},
{Pos = "Pos11", TcPos = "T12", Head = "H11", Group = "G2"},
{Pos = "Pos12", TcPos = "T13", Head = "H11", Group = "G2"},
{Pos = "Pos13", TcPos = "T14", Head = "H11", Group = "G2"},
{Pos = "Pos14", TcPos = "T15", Head = "H11", Group = "G2"},
{Pos = "Pos15", TcPos = "T16", Head = "H11", Group = "G2"},
{Pos = "Pos16", TcPos = "T17", Head = "H11", Group = "G2"},
{Pos = "Pos17", TcPos = "T18", Head = "H11", Group = "G2"},
{Pos = "Pos18", TcPos = "T19", Head = "H11", Group = "G2"},
{Pos = "Pos19", TcPos = "T20", Head = "H11", Group = "G2"},
{Pos = "Pos20", TcPos = "T101", Head = "H13", Group = "G3"}}
-- se Progress -- se Progress
if EgtGetTcPosId( 'T11') then elseif EgtGetTcPosId( 'T11') then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H11", Group = "G1"}, PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H11", Group = "G1"},
{Pos = "Pos2", TcPos = "T2", Head = "H11", Group = "G1"}, {Pos = "Pos2", TcPos = "T2", Head = "H11", Group = "G1"},
{Pos = "Pos3", TcPos = "T3", Head = "H11", Group = "G1"}, {Pos = "Pos3", TcPos = "T3", Head = "H11", Group = "G1"},
Binary file not shown.
+91
View File
@@ -1,5 +1,96 @@
==== Common_ONE-PF Update Log ==== ==== Common_ONE-PF Update Log ====
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)
- (SIM) Corretto movimento a parcheggio sega a catena. Ticket#2517
Versione 2.7g1 (01/07/2025)
- (GEN) Rimossa gestione PROBE inserita per sbaglio
- (GEN) Corretto gestione accelerazioni
- (SIM-GEN) Aggiunta gestione massima lunghezza scarico
Versione 2.7f1 (04/06/2025)
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'.
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7e1 (28/05/2025)
- (SIM-GEN) Alla separazione si spostano i carrelli di 30mm aprendo il taglio. Ticket#2259,Ticket#2328
Versione 2.7d1 (16/04/2025)
- (SIM) Distanza di collisione portata a 3mm, qualità VMILL ridotta a 4mm. Ticket#2395
Versione 2.7c3 (25/03/2025)
- (GEN) Corretto movimento approccio alla lavorazione se utensile lama montata su magazzino 2. Ticket#2361
Versione 2.7c2 (12/03/2025)
- (SIM-GEN) Migliorato calcolo posizione barra dopo split. Tiene in considerazione ingombro lavorazioni pezzo. Ticket#2321
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
- (SIm-GEN) Migliorato movimento approccio al pezzo con lama. Allineamento simulazione-generazione che facevano due movimenti leggermente diversi. Ticket#2335
Versione 2.7c1 (05/03/2025) Versione 2.7c1 (05/03/2025)
- (GEN) Corretto movimento in home utensile precedente. Ticket#2324 - (GEN) Corretto movimento in home utensile precedente. Ticket#2324
+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.7c1', -- versione script VERSION = '3.1c2', -- 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