Compare commits

...

8 Commits

Author SHA1 Message Date
andrea.villa 827e9e3c03 - Allineamento con common ver. 2.6h2 2024-08-07 10:12:12 +02:00
andrea.villa f8c217a85d - Allineamento con common ver. 2.6h1 2024-08-01 12:57:16 +02:00
andrea.villa e029dfa64b Tolto stato finale paratia carico 2024-07-31 17:18:21 +02:00
andrea.villa e925500b5f Piccola correzione segni quote parcheggio 2024-07-31 15:23:57 +02:00
andrea.villa cf04020f10 Merge remote-tracking branch 'origin/develop' 2024-07-31 11:05:48 +02:00
andrea.villa f06bfab111 - Allineamento con common ver. 2.6g5 2024-07-31 11:05:37 +02:00
andrea.villa d344027033 Merge branch 'AdjustClampAfterRotation' into develop 2024-07-31 11:04:33 +02:00
andrea.villa c082727044 Alla linea con EA75 e EA76 si scrive ET1 2024-07-25 15:36:53 +02:00
6 changed files with 260 additions and 58 deletions
+175 -31
View File
@@ -798,6 +798,12 @@ function OnRapid()
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
local PrevR2 = EMT.R2p or EMT.R2pp or HomeR2
EmtResetPrev()
-- gestione speciale per pezzi molto alti. Se il movimento successivo è più alto del precedente, allora prendo il successivo
if EMT.L3s then
if EMT.L3s > EMT.L3 then
EMT.L3 = EMT.L3s
end
end
-- se prima lavorazione
if EMT.LOAD then
EMT.V2POS = ParkV2
@@ -840,26 +846,41 @@ function OnRapid()
local HomeB1 = EgtGetAxisHomePos( 'B1')
local HomeC1 = EgtGetAxisHomePos( 'C1')
local dTRad, dTLen = GetToolRadLen()
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
end
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { X=-ParkX1, Z=MyMaxZ1, B=ParkB1, C=ParkC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false
local dZref = EMT.L3
-- se carico destro e ho due teste, altrimenti in caso abbia una testa , tipo ONE, il controlo è invertito
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
elseif not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
else
EmitMoveDataHead( 1, { X=-ParkX1, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
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, { X=dXref, Z=MyMaxZ1, B=0, C=ParkC1, S=Speed})
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- caso standard
else
EmitMoveDataHead( 1, { X=dXref, Z=dZref, B=ParkB1, C=ParkC1, S=Speed})
@@ -907,29 +928,43 @@ function OnRapid()
-- allontanamento o eventuale preselezione successiva testa 1
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- movimento testa
local dSafeZ1 = EgtGetAxisHomePos( 'Z21')
local dSafeZ1 = EgtGetAxisHomePos( 'Z1')
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
local HomeC1 = EgtGetAxisHomePos( 'C1')
local HomeB1 = EgtGetAxisHomePos( 'B1')
local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=EMT.L2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { X=-ParkX2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=EMT.L2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, S=Speed})
else
EmitMoveDataHead( 1, { X=-ParkX2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
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, { X=EMT.L2, Z=MyMaxZ1, B=0, C=HomeC1, S=Speed})
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=dZref, B=HomeB1, C=HomeC1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
end
@@ -968,22 +1003,37 @@ function OnRapid()
local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 2, { X=-ParkX2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false
local dZref = EMT.L3
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)
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, S=Speed})
else
EmitMoveDataHead( 2, { X=-ParkX2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, S=Speed})
end
-- 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
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=0, C=HomeC2, S=Speed})
EmitMoveDataHead( 2, { B=0, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { X=EMT.L2, Z=dZref, B=HomeB2, C=HomeC2, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
end
@@ -1070,6 +1120,7 @@ function OnRapid()
EMT.ZMAX = true
EMT.TO_ZMAX = nil
EMT.TO_XHOME = nil
EMT.L1pp = nil
EMT.L3pp = nil
PrevR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
PrevR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2'))
@@ -1118,6 +1169,7 @@ function OnRapid()
end
EMT.TO_XHOME = nil
EMT.L1pp = nil
EMT.L3pp = nil
PrevR1 = HomeR1
PrevR2 = HomeR2
@@ -1139,7 +1191,7 @@ function OnRapid()
EmitMoveDataChars( EMT.MDCHAR[i])
end
if #EMT.MDCHAR > 0 then
local nMoveType = EgtIf( EMT.RELOAD, 1, 3)
local nMoveType = EgtIf( EMT.POSTROT or EMT.RELOAD, 1, 3)
EmitMoveStartChars( nMoveType)
EmitMoveWaitChars( nMoveType)
end
@@ -1162,23 +1214,39 @@ function OnRapid()
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
local CurrX1 = EMT.L1pp or ( -LimX1RotSaw)
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
end
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
elseif not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
else
EmitMoveDataHead( 1, { X=CurrX1, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
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, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
@@ -1236,20 +1304,36 @@ function OnRapid()
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
local CurrX1 = EMT.L1pp or ( -LimX1RotSaw)
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
EmitMoveDataHead( 1, { X=EMT.L2, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=EMT.L2, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
else
EmitMoveDataHead( 1, { X=CurrX1, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
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, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
-- altrimenti caso standard
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
@@ -1284,19 +1368,35 @@ function OnRapid()
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
local CurrX2 = EMT.L1pp or ( -LimX1RotSaw)
local CurrZ2 = EMT.L3pp or MyMaxZ2
local CurrB2 = PrevR2
local CurrC2 = PrevR1
EmitMoveDataHead( 2, { X=EMT.L2, Z=CurrZ2, B=CurrB2, C=CurrC2, TRad=dTRad, TLen=dTLen, S=Speed})
local bMoveZbeforeX = false
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( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2)
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 2, { X=EMT.L2, Z=CurrZ2, B=CurrB2, C=CurrC2, TRad=dTRad, TLen=dTLen, S=Speed})
else
EmitMoveDataHead( 2, { X=CurrX2, Z=CurrZ2, B=CurrB2, C=CurrC2, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- 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
EmitMoveDataHead( 2, { B=0, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
@@ -1570,6 +1670,44 @@ end
---------------------------------------------------------------------
function OnArc()
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- salvo posizione attuale
local OldL1 = EMT.L1
local OldL2 = EMT.L2
local OldL3 = EMT.L3
-- imposto posizione precedente (non contiene l'offset in X per sovramateriale di testa EMT.X_OFF)
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
-- aggiorno precedenti
local nOriginalMove = EMT.MOVE
EMT.MOVE = 0
EmtUpdatePrev()
EMT.MOVE = nOriginalMove
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
end
-- non modale su archi
EmtResetPrevLinear()
-- aggiustamento valori
@@ -2087,7 +2225,10 @@ function PreparePreRotation( sCmd, nInd)
if Cmd[2] ~= 'Z' then
local MDChar
if EMT.PREROT then
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, IniStatY2=1, BeamVise=0}
-- parcheggio per sicurezza morsa e paratia lato scarico
MDChar = { Y2=ParkY2, V2=ParkV2, IniStatY2=1, FinStatY2=1, BeamVise=0}
table.insert( EMT.MDCHAR, MDChar)
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, BeamVise=0}
elseif EMT.SPECSPLIT 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}
EMT.V1POS = MDChar.V1
@@ -2178,20 +2319,19 @@ function PreparePostRotation( sCmd, nInd)
-- se dichiarazione inizio riposizionamento carrelli
if Cmd[2] == 'CARR_MOVE' then
EMT.POSTROT = false
table.insert( EMT.MDCHAR, { Start=3})
table.insert( EMT.MDCHAR, { Wait=3})
table.insert( EMT.MDCHAR, { Start=1})
table.insert( EMT.MDCHAR, { Wait=1})
end
elseif Cmd[1] == '1' then
-- non interessa
elseif Cmd[1] == '2' then
if Cmd[2] == 'Y1' then
-- tolgo eventuale sovramateriale presente sul pezzo in posizione iniziale (la misura laser è ora col finito)
local MDChar = { Y1=tonumber(Cmd[3])-EMT.HOVM, IniStatY1=75, V1=ParkV1, V2=ParkV2, FinStatY1=-1, FinStatV1=-1, BeamVise=0, Aux=' (E80058=0)', MovType=3}
local MDChar = { Y1=tonumber(Cmd[3])-EMT.HOVM, IniStatY1=75, V1=ParkV1, FinStatY1=-1, BeamVise=0, Aux=' (E80058=0)', MovType=1}
table.insert( EMT.MDCHAR, MDChar)
EMT.V1POS = ParkV1
EMT.V2POS = ParkV2
elseif Cmd[2] == 'T' then
local MDChar = { Y1=tonumber(Cmd[3]), IniStatY1=76, FinStatY1=EMT.FSY1, BeamVise=0, MovType=3}
local MDChar = { Y1=tonumber(Cmd[3]), IniStatY1=76, FinStatY1=EMT.FSY1, BeamVise=0, MovType=1}
table.insert( EMT.MDCHAR, MDChar)
EMT.TPOS = tonumber(Cmd[3])
end
@@ -2217,7 +2357,7 @@ function PreparePostRotation( sCmd, nInd)
EMT.Y2DELTA = nY2Delta
end
if not FindReadHeadWithLaser( EMT.MDCHAR) then
local MDChar = { Y1=LoadT, IniStatY1=76, FinStatY1=EMT.FSY1, BeamVise=0, MovType=3}
local MDChar = { Y1=LoadT, IniStatY1=76, FinStatY1=EMT.FSY1, BeamVise=0, MovType=1}
table.insert( EMT.MDCHAR, MDChar)
EMT.TPOS = LoadT
end
@@ -2779,10 +2919,14 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
if bSplitCut then
if DiffY1 > 0.1 then
MDChar.Y1 = dPosY1 + DiffY1
else
MDChar.Y1 = dPosY1
end
if DiffY2 < -0.1 then
MDChar.Y2 = dPosY2 + DiffY2
dPosT = dPosT + DiffY2
else
MDChar.Y2 = dPosY2
end
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EmtSetLastError( 1201, 'Error Collision in ParkRoller')
+49 -7
View File
@@ -965,6 +965,12 @@ function OnSimulMoveStart()
end
-- se movimento in rapido ad inizio lavorazione
if EMT.MOVE == 0 and EMT.MOVEIND <= 3 then
-- gestione speciale per pezzi molto alti. Se il movimento successivo è più alto del precedente, allora prendo il successivo
if EMT.L3s then
if EMT.L3s > EMT.L3 then
EMT.L3 = EMT.L3s
end
end
-- Dati
local B1Pos = EgtGetAxisPos( 'B1')
local B1Home = EgtGetAxisHomePos( 'B1')
@@ -979,20 +985,35 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
local dXref = EMT.L2
if EMT.HEAD == 'H12' and -EMT.L2 < -LimX1PlRotSaw then
dXref = LimX1PlRotSaw
end
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
local dXref = EMT.L2
if EMT.HEAD == 'H12' and -EMT.L2 < -LimX1PlRotSaw then
dXref = LimX1PlRotSaw
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
elseif not bMoveZbeforeX then
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X1', LimX1RotSaw, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
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( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
@@ -1036,16 +1057,27 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( -EMT.L2 < -LimX1RotSaw or EMT.R2 > 91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 400")
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( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
@@ -1095,16 +1127,26 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then
dZref = Z2Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
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
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
end
-- 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
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
+20 -17
View File
@@ -824,6 +824,13 @@ end
---------------------------------------------------------------------
function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreRotMch)
-- mi salvo info lavorazione su una lista
local AuxInfoMach = {}
AuxInfoMach.bPreSplit = bPreSplit
AuxInfoMach.bSplitting = bSplitting
AuxInfoMach.bPreCut = bPreCut
AuxInfoMach.bCutting = bCutting
AuxInfoMach.bUnload = bUnload
-- Assegno flag di pezzo separato dal resto del grezzo
SPLIT = IsEndPhase( EMC.PHASE) or IsMid2Phase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
@@ -921,7 +928,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
local dPosT = LoadT
if IsFirstMachiningAfterRotation( EMC.MCHID) then dPosT = dPosT + TurnerOffs end
local vCmd = SpecCalcLoad( dPosT, dDistFront, max( dDistBack, MinJoin + EgtIf( SPLIT, EMC.TCING, 0), EMC.LB - ( MaxY1 - MinY1) + 6))
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
if bSplitting and EMC.ERR == 18 then
table.insert( vCmd, { 22, dRollBack, -dRollFront})
end
@@ -934,7 +941,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
-- Se altrimenti carri entrambi diponibili, eseguo calcoli per carrelli
elseif not IsEndPhase( EMC.PHASE) then
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
-- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller
if SpecTestOnlyRemarkInCmds( vCmd) then
table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)})
@@ -1262,7 +1269,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
end -- SpecAdjustLoad [L]
---------------------------------------------------------------------
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
local MinFrontJoin = MinJoin + EMC.HCING + EMC.HOVM
local MyMinOther = MinOther + EgtIf( EMC.CNT == 1, AggLoad, 0)
@@ -1301,13 +1308,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- aggiuntivo per non avere problemi con pezzi a caduta
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 4 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 2.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 2 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + BD.CHAR_EXTRA_DIST
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
@@ -1346,13 +1351,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- aggiuntivo per minimizzare scambi carrelli
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 4 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 2.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 2 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + BD.CHAR_EXTRA_DIST
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
+5 -1
View File
@@ -64,12 +64,16 @@
-- 2024/07/17 ver 2.6g3 Allineamento con common ver. 2.6g3
-- 2024/07/22 ver 2.6g4 Gestione pezzi fino a 30 metri
-- Allineamento con common ver. 2.6g4
-- 2024/07/31 ver 2.6g5 Allineamento con common ver. 2.6g5
-- Aggiunta file note tool e machining
-- 2024/08/01 ver 2.6h1 Allineamento con common ver. 2.6h1
-- 2024/08/07 ver 2.6h2 Allineamento con common ver. 2.6h2
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6g4_DEV'
PP_VER = '2.6h2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PF'
+10 -1
View File
@@ -1,7 +1,16 @@
==== Common_ONE-PF Update Log ====
Versione 2.6-- (--/--/2024)
Versione 2.6h2 (07/08/2024)
- (SIM) Allineata simulazione a generazione in primo movimento rapido approccio al pezzo.
Versione 2.6h1 (01/08/2024)
- (GEN) Corretto segno posizione X di sicurezza per rotazione assi rotanti.
Versione 2.6g5 (31/07/2024)
- (SIM-GEN) Se motosega allineata ad asse B per tagli di fianco, corretto movimento che manda testa a parcheggio. Pezzi più alti di 650 va solo in Zmax. Ticket#1943
- (SIM-GEN) Gestione movimenti speciali per pezzi molto alti. Se HomeZ < primo punto lavorazione, allora vado al punto Z lavorazione prima di approcciare il pezzo in X. Ticket#1943
- (GEN) Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. Ticket#1891
- (SIM-GEN) Modifica limite inferirore intervallo di pinzaggio per garantire, se possibile, il passaggio pezzo a pinza 2. Da Common-PF1250.
- (GEN) Corretta scrittura ISO per parcheggiare morsa 3 dopo ribaltamento. Ticket#1922,#1733
Versione 2.6g4 (19/07/2024)
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6--DEV', -- versione script
VERSION = '2.6h2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}