Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e255118351 | |||
| 9673b21d05 | |||
| 20274fcfcd | |||
| c3c099db63 | |||
| 7214e4bd7d | |||
| 41bdfa5394 | |||
| b098b3620e | |||
| 8d116f7987 |
+28
-1
@@ -177,6 +177,33 @@ local function GetMinUnloadableRaw( dW, dH)
|
||||
end
|
||||
BeamData.GetMinUnloadableRaw = GetMinUnloadableRaw
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetBlockedAxis( sHead, nToolType, sBlockedAxis)
|
||||
-- lama
|
||||
if nToolType == MCH_TY.SAW_STD or nToolType == MCH_TY.SAW_FLAT then
|
||||
return ''
|
||||
-- sega a catena
|
||||
elseif nToolType == MCH_TY.MORTISE_STD then
|
||||
if sHead == 'H13' then
|
||||
if sBlockedAxis == 'parallel' then
|
||||
return 'A1=0'
|
||||
elseif sBlockedAxis == 'perpendicular' then
|
||||
return 'A1=90'
|
||||
end
|
||||
else
|
||||
return ''
|
||||
end
|
||||
-- fresa
|
||||
elseif nToolType == MCH_TY.MILL_STD or nToolType == MCH_TY.MILL_NOTIP then
|
||||
return ''
|
||||
-- punta
|
||||
elseif nToolType == MCH_TY.DRILL_STD or nToolType == MCH_TY.DRILL_LONG then
|
||||
return ''
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
BeamData.GetBlockedAxis = GetBlockedAxis
|
||||
---------------------------------------------------------------------
|
||||
|
||||
return BeamData
|
||||
|
||||
+41
-20
@@ -1,4 +1,4 @@
|
||||
-- Processore macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/19
|
||||
-- Processore macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Con controllo numerico TPA
|
||||
|
||||
-- Variabili di modulo
|
||||
@@ -397,7 +397,7 @@ function OnMachiningStart()
|
||||
-- valore dell'asse virtuale
|
||||
dPosA = GetCurrChainSawingVirtualAxis()
|
||||
-- imposto home dell'asse C1 (A=0 -> T101, A=90 -> T104)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
|
||||
EmtModifyAxisHome( 'C1', MyParkCSawC1)
|
||||
-- se lama su aggregato testa sotto, aggiusto subito angolo scelto per asse virtuale A
|
||||
elseif EMT.HEAD == 'H22' then
|
||||
@@ -535,9 +535,11 @@ function OnPathStart()
|
||||
--MyOutput( 'CNT='.. tostring( EMT.CNT or 0))
|
||||
-- se utensile non cambiato, salvo eventuali precedenti rotanti
|
||||
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
|
||||
EMT.L3pp = EMT.L3op
|
||||
EMT.R1pp = EMT.R1p
|
||||
EMT.R2pp = EMT.R2p
|
||||
else
|
||||
EMT.L3pp = nil
|
||||
EMT.R1pp = nil
|
||||
EMT.R2pp = nil
|
||||
end
|
||||
@@ -651,6 +653,7 @@ function OnRapid()
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
local HomeZ1 = EgtGetAxisHomePos( 'Z1')
|
||||
local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
|
||||
local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2'))
|
||||
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
|
||||
@@ -709,17 +712,23 @@ function OnRapid()
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
-- se sega a catena
|
||||
if EMT.HEAD == 'H15' then
|
||||
EmitMoveDataHead( 1, { X=ParkCSawX1, Z=ParkCSawZ1, B=HomeB1, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
if EMT.HEAD == 'H13' then
|
||||
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=HomeZ1, B=HomeR2, C=HomeR1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
-- utensili standard
|
||||
else
|
||||
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=EMT.L3, B=ParkB1, C=ParkC1, S=Speed})
|
||||
end
|
||||
end
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
|
||||
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
if EMT.HEAD ~= 'H13' then
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
|
||||
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
else
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
end
|
||||
end
|
||||
EmitMoveStartHead( 1)
|
||||
-- se lavorazione in doppio
|
||||
@@ -939,7 +948,7 @@ function OnRapid()
|
||||
if not WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), S=Speed})
|
||||
end
|
||||
EmitMoveDataHead( 1, { B=0, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=MyMaxZ1, B=0, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
|
||||
@@ -953,14 +962,19 @@ function OnRapid()
|
||||
else
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 1, { X=ParkCSawX1, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
|
||||
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=dSafeZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
end
|
||||
-- Porto la Z alla giusta quota
|
||||
if EMT.L3 > HomeZ1 + 1 and abs( EMT.R2) > 89.9 then
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=HomeZ1, S=Speed})
|
||||
end
|
||||
EmitMoveDataHead( 1, { Z=HomeZ1, B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
|
||||
-- se motosega molto lunga, ruoto prima di muovermi in X
|
||||
if EMT.TTOTLEN >= MinLengthLongCSaw then
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
end
|
||||
end
|
||||
end
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
|
||||
@@ -971,11 +985,12 @@ function OnRapid()
|
||||
local dB2 = EMT.R2
|
||||
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
|
||||
local dSafeZ2 = EgtGetAxisHomePos( 'Z2')
|
||||
local dSafeX2 = EgtGetAxisHomePos( 'X2')
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 2, { X=SafeX2, Z=MinZ2, B=ParkB2, C=ParkC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
EmitMoveDataHead( 2, { X=dSafeX2, Z=MinZ2, B=ParkB2, C=ParkC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
else
|
||||
EmitMoveDataHead( 2, { X=SafeX2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
EmitMoveDataHead( 2, { X=dSafeX2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
end
|
||||
|
||||
EmitMoveDataHead( 2, { Z=-dSafeZ2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
@@ -996,9 +1011,10 @@ function OnRapid()
|
||||
local dB2 = EMT.R2
|
||||
if EMT.ZMAX then
|
||||
local dSafeZ2 = EgtGetAxisHomePos( 'Z2')
|
||||
local dSafeX2 = EgtGetAxisHomePos( 'X2')
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 2, { X=SafeX2, Z=-dSafeZ2, B=ParkB2, C=ParkC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
EmitMoveDataHead( 2, { X=dSafeX2, Z=-dSafeZ2, B=ParkB2, C=ParkC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
else
|
||||
EmitMoveDataHead( 2, { Z=-dSafeZ2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
|
||||
end
|
||||
@@ -1021,11 +1037,12 @@ function OnRapid()
|
||||
local CurrB2 = PrevR2
|
||||
local CurrC2 = PrevR1
|
||||
local dSafeZ2 = EgtGetAxisHomePos( 'Z2')
|
||||
local dSafeX2 = EgtGetAxisHomePos( 'X2')
|
||||
local Speed = EMT.S
|
||||
if EMT.ZMAX then
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 2, { X=SafeX2, Z=CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
|
||||
EmitMoveDataHead( 2, { X=dSafeX2, Z=CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
|
||||
end
|
||||
EmitMoveDataHead( 2, { Z=-dSafeZ2, S=Speed})
|
||||
EmitMoveDataHead( 2, { X=EMT.L2, S=Speed})
|
||||
@@ -1615,7 +1632,10 @@ function PrepareMoveChar( sCmd, nInd)
|
||||
elseif Cmd[1] == '11' then
|
||||
EMT.ISY1 = CalcCharStatusN( Cmd[2])
|
||||
EMT.FSY1 = EMT.ISY1
|
||||
EMT.BV = EgtIf( Cmd[2] ~= '0', 1, 2)
|
||||
-- se pinza due in presa, non attivo la 1
|
||||
if EMT.BV ~= 2 then
|
||||
EMT.BV = EgtIf( Cmd[2] ~= '0', 1, 2)
|
||||
end
|
||||
if #EMT.MDCHAR > 0 then EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = EMT.FSY1 end
|
||||
elseif Cmd[1] == '12' then
|
||||
EMT.ISY2 = CalcCharStatusN( Cmd[2])
|
||||
@@ -2201,8 +2221,9 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
|
||||
EmitMoveWaitHead( 1)
|
||||
-- altrimenti sega a catena
|
||||
else
|
||||
-- salzo in Z sicurezza raddrizzando la B
|
||||
EmitMoveDataHead( 1, { Z=ParkCSawZ1, B=dHomeB1, Fmt=1})
|
||||
-- salgo in Z sicurezza raddrizzando la B
|
||||
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
|
||||
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dHomeB1, Fmt=1})
|
||||
EmitMoveDataHead( 1, { X=-dHomeX1, C=dHomeC1, Fmt=1})
|
||||
if bTopGoHome then
|
||||
-- !!! da verificare bene (come PF) !!!
|
||||
@@ -2255,7 +2276,7 @@ function EmitDouZMax( nDouType)
|
||||
local dHomeC2 = EgtGetAxisHomePos( 'C2')
|
||||
-- se lavorazione in doppio in Y (prima mi allontano in Y)
|
||||
if nDouType == 2 then
|
||||
EmitMoveDataHead( 2, { X=SafeX2, TPos=EMT.DOU_TPOS, Fmt=1})
|
||||
EmitMoveDataHead( 2, { X=dHomeX2, TPos=EMT.DOU_TPOS, Fmt=1})
|
||||
end
|
||||
-- scendo in Z, sistemo B e C porto X in home
|
||||
EmitMoveDataHead( 2, { Z=-dHomeZ2, TPos=EMT.DOU_TPOS, Fmt=1})
|
||||
@@ -2496,7 +2517,7 @@ function PreselectNextDiffHead( nMchId, sHead)
|
||||
elseif sNextHead == 'H13' then
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local dPosA = GetCurrChainSawingVirtualAxis()
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
|
||||
local bXSpec = EgtIf( BD.RIGHT_LOAD, ( dNextX > -DeltaTabY), ( dNextX < -DeltaTabY))
|
||||
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, dNextX), B=ParkCSawB1, C=MyParkCSawC1, TPos=AdjustTcPos( false, sNextTcPos, dPosA), Fmt=2})
|
||||
EmitMoveStartHead( 1)
|
||||
|
||||
+36
-31
@@ -1,4 +1,4 @@
|
||||
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2024/01/19
|
||||
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2024/01/22
|
||||
|
||||
-- Funzioni generiche indipendenti dal controllo
|
||||
|
||||
@@ -81,6 +81,11 @@ function OnSimulStart()
|
||||
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL1'},
|
||||
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'CHAIN'},
|
||||
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL2'}}
|
||||
|
||||
if EgtGetHeadId('H31') then
|
||||
table.insert( McdData, { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'})
|
||||
table.insert( McdData, { Grp = 'X3', Sub = 'COLLISION', Name = 'STM'})
|
||||
end
|
||||
|
||||
-- inserisco gruppi opzionali
|
||||
if SecondChain then table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW2'}) end
|
||||
@@ -259,8 +264,8 @@ function OnSimulDispositionStart()
|
||||
EMT.SCRAP = nil
|
||||
end
|
||||
EMT.LB = b3Bar:getDimX()
|
||||
EMT.LT = b3Raw:getDimX()
|
||||
EMT.LP = b3Part:getDimX()
|
||||
EMT.LR = b3Raw:getDimX()
|
||||
EMT.LT = b3Part:getDimX()
|
||||
EMT.CUTID = EgtGetInfo( EgtGetFirstPartInRawPart( nPartRawId or GDB_ID.NULL) or GDB_ID.NULL, 'CUTID', 'i') or 0
|
||||
EMT.Y1SPEC = nil
|
||||
-- se vero inizio, assegno solidi per verifica collisione
|
||||
@@ -421,7 +426,7 @@ function OnSimulToolSelect( dPosA)
|
||||
-- imposto il valore di A
|
||||
EgtSetAxisPos( 'A1', dPosA)
|
||||
-- imposto home dell'asse C1 (A1=0 -> T101, A1=90 -> T104)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
|
||||
EmtModifyAxisHome( 'C1', MyParkCSawC1)
|
||||
EgtSetAxisPos( 'C1', MyParkCSawC1)
|
||||
-- Imposto visualizzazione
|
||||
@@ -474,7 +479,7 @@ function OnSimulToolDeselect( dPrevA)
|
||||
-- recupero il gruppo
|
||||
local nSetHead = GetHeadSet( EMT.NEXTHEAD)
|
||||
-- per testa gruppo 2
|
||||
if nSetHead == 2 then
|
||||
if nSetHead == 2 and EMT.PREVTCPOS_H2 then
|
||||
-- deposito lama su aggregato testa sotto
|
||||
if EMT.PREVHEAD_H2 == 'H22' then
|
||||
-- simulo movimento
|
||||
@@ -492,7 +497,7 @@ function OnSimulToolDeselect( dPrevA)
|
||||
-- nascondo l'utensile sulla testa
|
||||
EgtSetStatus( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_ST.OFF)
|
||||
-- se testa gruppo 1
|
||||
else
|
||||
elseif nSetHead == 1 and EMT.PREVTCPOS_H1 then
|
||||
-- deposito utensile fresa
|
||||
if EMT.PREVHEAD_H1 == 'H11' then
|
||||
-- simulo movimento
|
||||
@@ -522,7 +527,7 @@ function OnSimulToolDeselect( dPrevA)
|
||||
-- simulo movimento
|
||||
local ParkC1 = EgtGetAxisHomePos( 'C1')
|
||||
if dPrevA then
|
||||
ParkC1 = GetChainSawCHomeFromVirtualAxis( dPrevA)
|
||||
ParkC1 = GetChainSawCHomeFromVirtualAxis( dPrevA, EMT.TTOTLEN)
|
||||
end
|
||||
SimulMoveAxes( 'B1', ParkCSawB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
|
||||
SimulMoveAxis( 'X1', ParkCSawX1, MCH_SIM_STEP.RAPID)
|
||||
@@ -856,7 +861,7 @@ function OnSimulMoveStart()
|
||||
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
|
||||
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( C1Pos - EMT.R1) > 1 or abs( B1Pos - EMT.R2) > 1) and ( abs( C1Home - EMT.R1) > 30.1 or abs( B1Home - EMT.R2) > 30.1) then
|
||||
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
|
||||
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
|
||||
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
|
||||
@@ -882,6 +887,10 @@ function OnSimulMoveStart()
|
||||
-- se movimento iniziale da Zmax
|
||||
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
|
||||
SimulMoveAxes( 'Z1', Z1Home, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
|
||||
-- se motosega molto lunga, ruoto prima di muovermi in X
|
||||
if EMT.TTOTLEN >= MinLengthLongCSaw then
|
||||
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se altrimenti testa 2
|
||||
@@ -889,10 +898,11 @@ function OnSimulMoveStart()
|
||||
local B2Home = EgtGetAxisHomePos( 'B2')
|
||||
local C2Home = EgtGetAxisHomePos( 'C2')
|
||||
local Z2Home = EgtGetAxisHomePos( 'Z2')
|
||||
local X2Home = EgtGetAxisHomePos( 'X2')
|
||||
if EMT.ZMAX then
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'X2', X2Home, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
|
||||
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
|
||||
@@ -1164,7 +1174,7 @@ function ExecAuxCmd( sCmd, bPathStart)
|
||||
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
|
||||
elseif Cmd[1] == '11' then
|
||||
local bClose = Cmd[2] ~= '0'
|
||||
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and EMT.AUXIND >= 8 then bClose = false end
|
||||
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
|
||||
ExecMovePY1( bClose)
|
||||
elseif Cmd[1] == '12' then
|
||||
ExecMovePY2( Cmd[2] ~= '0')
|
||||
@@ -1219,7 +1229,7 @@ end
|
||||
function ExecStartHome()
|
||||
-- Testa 1
|
||||
EgtResetAxisPos( 'X1')
|
||||
EgtSetAxisPos( 'Z1', MaxZ1)
|
||||
EgtResetAxisPos( 'Z1')
|
||||
EgtResetAxisPos( 'C1')
|
||||
EgtResetAxisPos( 'B1')
|
||||
-- Testa 2
|
||||
@@ -1293,8 +1303,9 @@ function ExecMoveZmax( bMchSplit)
|
||||
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
|
||||
-- altrimenti sega a catena
|
||||
else
|
||||
-- salzo in Z sicurezza raddrizzando la B
|
||||
SimulMoveAxes( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
|
||||
-- salgo in Z sicurezza raddrizzando la B
|
||||
local SafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
|
||||
SimulMoveAxes( 'Z1', SafeZ1, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
@@ -1468,7 +1479,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
local MoveV1 = ParkV1 - PosV1
|
||||
local DiffY1 = MyParkY1 - PosY1
|
||||
local MoveY1 = EgtIf( DiffY1 > 0.1, MoveV1, 0)
|
||||
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LP, 0)
|
||||
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0)
|
||||
if ( PosT > ParkV2 - ExtraParkV and PosT < ParkV1 and PosY1 + TryMoveY1 < MaxY1) then MoveY1 = max( MoveY1, TryMoveY1) end
|
||||
-- se appena eseguito taglio di separazione
|
||||
if bSpliCut then
|
||||
@@ -1498,8 +1509,8 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
local MoveV2 = ParkV2 - PosV2
|
||||
local DiffY2 = MyParkY2 - PosY2
|
||||
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
|
||||
local TryMoveY2 = ParkV2 - PosT - EMT.LP
|
||||
if ( PosT + EMT.LP < ParkV1 + ExtraParkV and PosT + EMT.LP > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
|
||||
local TryMoveY2 = ParkV2 - PosT - EMT.LT
|
||||
if ( PosT + EMT.LT < ParkV1 + ExtraParkV and PosT + EMT.LT > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
|
||||
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
|
||||
'V1', ParkV1, MCH_SIM_STEP.RAPID,
|
||||
'V2', ParkV2, MCH_SIM_STEP.RAPID,
|
||||
@@ -1541,7 +1552,7 @@ function RemoveScraps()
|
||||
local nPart = EgtVolZmapPartCount( vMillId)
|
||||
if nPart > 1 then
|
||||
-- ricerca del pezzo con massimo volume
|
||||
local dTCenX = -EgtGetAxisPos( 'T') - EMT.LP / 2
|
||||
local dTCenX = -EgtGetAxisPos( 'T') - EMT.LT / 2
|
||||
local nPartMax = 0
|
||||
local dVolMax = 0
|
||||
for i = 1, nPart do
|
||||
@@ -1734,14 +1745,14 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function GetV1ToClose()
|
||||
--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.LP 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)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetV2ToClose()
|
||||
--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.LP or 0))
|
||||
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
|
||||
return ( EMT.MAXMAX[1] <= EMT.V2NEXTPOS - RollCageMax and EMT.MAXMIN[1] + EMT.LB >= EMT.V2NEXTPOS - RollCageMin)
|
||||
end
|
||||
|
||||
@@ -1759,7 +1770,7 @@ function LoadFirstTool( nHSet, sTcPosDef)
|
||||
if nHSet ~= 1 and nHSet ~= 2 then return end
|
||||
EgtUnloadTool( EgtIf( nHSet == 1, 'H11', 'H21'), 1)
|
||||
if GetHeadSetFromTcPos( sTcPosDef) ~= nHSet then return end
|
||||
local sTool, sHead, sTcPos = FindFirstToolOnHeadSet( nHSet)
|
||||
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis = FindFirstToolOnHeadSet( nHSet)
|
||||
if not sTool then
|
||||
local vTools = EgtGetToolsInCurrSetupPos( sTcPosDef)
|
||||
if vTools and vTools[1] then
|
||||
@@ -1771,7 +1782,7 @@ function LoadFirstTool( nHSet, sTcPosDef)
|
||||
if sTool then
|
||||
-- imposto correttamente i dati di testa
|
||||
local OrigEMC = EMC
|
||||
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = 0}
|
||||
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = sTTotLen, BLOCKEDAXIS = sBlockedAxis}
|
||||
OnSetHead()
|
||||
EMC = OrigEMC
|
||||
-- carico l'utensile
|
||||
@@ -2190,7 +2201,7 @@ function FindFirstToolOnHeadSet( nHSet)
|
||||
local CurrMachId = EgtGetCurrMachining()
|
||||
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
-- cerco lavorazione con utensile su gruppo testa indicato
|
||||
local sTool, sHead, sTcPos
|
||||
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
|
||||
local OpId = EgtGetFirstActiveOperation()
|
||||
while OpId do
|
||||
local nType = EgtGetOperationType( OpId)
|
||||
@@ -2202,6 +2213,8 @@ function FindFirstToolOnHeadSet( nHSet)
|
||||
if GetHeadSet( sHead) == nHSet then
|
||||
sTool = sTest
|
||||
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
sTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
sBlockedAxis = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -2213,7 +2226,7 @@ function FindFirstToolOnHeadSet( nHSet)
|
||||
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
|
||||
EgtTdbSetCurrTool( CurrTool or '')
|
||||
-- restituisco risultato
|
||||
return sTool, sHead, sTcPos
|
||||
return sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -2231,14 +2244,6 @@ function GetToolTcPos( sTool)
|
||||
return sTcPos
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetCurrChainSawingVirtualAxis()
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A1=0'
|
||||
local dPosA = tonumber( sVal:sub( 4)) or 0
|
||||
return dPosA
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetNextChainSawingVirtualAxis( MchId)
|
||||
-- recupero la lavorazione successiva
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/18
|
||||
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Intestazioni
|
||||
|
||||
require( 'EmtGenerator')
|
||||
@@ -2143,8 +2143,8 @@ function SpecAdjustCarrB1( WorkTab)
|
||||
if not SpecTestSomeMoveInCmds( vCmd) then
|
||||
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
|
||||
end
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
-- imposto i nuovi parametri di aggancio
|
||||
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
|
||||
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
|
||||
@@ -2215,8 +2215,8 @@ function SpecAdjustCarrB2( WorkTab)
|
||||
if not SpecTestSomeMoveInCmds( vCmd) then
|
||||
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
|
||||
end
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
-- imposto i nuovi parametri di aggancio
|
||||
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
|
||||
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
|
||||
|
||||
+50
-13
@@ -1,4 +1,4 @@
|
||||
-- Descrizione macchina Essetre-PF1250 by EgalTech s.r.l. 2024/01/18
|
||||
-- Descrizione macchina Essetre-PF1250 by Egalware s.r.l. 2024/02/07
|
||||
-- 2021/08/03 ver 2.3h1 Prima versione.
|
||||
-- 2021/09/14 ver 2.3i9 Estesa gestione sega a catena.
|
||||
-- 2021/09/15 ver 2.3i10 Correzione gestione posizione rimanenza.
|
||||
@@ -40,12 +40,17 @@
|
||||
-- 2024/01/22 ver 2.6a2 Modificato solido collisionee asse Z
|
||||
-- Prima versione post common PF1250
|
||||
-- Allineamento con common ver. 2.6a3
|
||||
-- 2024/01/25 ver 2.6a3 Allineamento con common ver. 2.6a4
|
||||
-- 2024/02/07 ver 2.6b1 Allineamento con common ver. 2.6b1
|
||||
-- 2024/02/07 ver 2.6b2 Gestione motosega lunga in MLDE e nuova funzione calcolo asse A per nuovi script
|
||||
-- 2024/02/09 ver 2.6b3 In BeamData aggiunta funzione GetBlockedAxis che sostituisce la GetChainSawBlockedAxis.
|
||||
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.6a2'
|
||||
PP_VER = '2.6b3'
|
||||
MIN_MACH_VER = '2.5k1'
|
||||
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
@@ -122,6 +127,10 @@ ParkCSaw0Z1 = -400
|
||||
ParkCSawC1 = -90
|
||||
ParkCSaw0C1 = 0
|
||||
ParkCSawB1 = 0
|
||||
MinLengthLongCSaw = 580 -- gestione speciale per motosega molto lunga. Lunghezza al di sopra della quale è considerata motosega lunga
|
||||
ParkLongCSawZ1 = -50 -- gestione speciale per motosega molto lunga. Parcheggio asse Z
|
||||
ParkLongCSawC1 = 0 -- gestione speciale per motosega molto lunga. Parcheggio asse C
|
||||
ParkLongCSawB1 = -90 -- gestione speciale per motosega molto lunga. Parcheggio asse B
|
||||
LongTool = 400
|
||||
ParkLongTc1C1 = 0
|
||||
ParkLongTc2C1 = -180
|
||||
@@ -847,6 +856,7 @@ function OnSetHead()
|
||||
elseif EMC.HEAD == 'H13' then
|
||||
-- aggiustamenti per distanza
|
||||
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
|
||||
EMC.EXIT = EMC.EXIT or 1
|
||||
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -dDist))
|
||||
local vtMove = Point3d( 0, 0, -dDist) - Point3d( EMC.EXITPOS)
|
||||
local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT))
|
||||
@@ -854,10 +864,10 @@ function OnSetHead()
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local CSawPosA = GetCurrChainSawingVirtualAxis()
|
||||
EmtModifyAxisHome( 'X1', ParkCSawX1)
|
||||
EmtModifyAxisHome( 'Z1', GetChainSawZHomeFromVirtualAxis( CSawPosA))
|
||||
EmtModifyAxisHome( 'Z1', GetChainSawZHomeFromVirtualAxis( CSawPosA, EMC.TOTLEN))
|
||||
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
|
||||
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( CSawPosA))
|
||||
EmtModifyAxisHome( 'B1', ParkCSawB1)
|
||||
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( CSawPosA, EMC.TOTLEN))
|
||||
EmtModifyAxisHome( 'B1', EgtIf( EMC.TOTLEN < MinLengthLongCSaw, ParkCSawB1, ParkLongCSawB1))
|
||||
EmtModifyAxisDirection( 'B1', X_AX())
|
||||
-- se testa H16 ( seconda lama)
|
||||
elseif EMC.HEAD == 'H16' then
|
||||
@@ -947,27 +957,54 @@ function HeadIsChainSaw( sHead)
|
||||
return ( sHead == 'H13' or sHead == 'H15')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetCurrChainSawingVirtualAxis()
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
|
||||
if not sVal or sVal == '' then
|
||||
if EMC then
|
||||
sVal = EMC.BLOCKEDAXIS or 'A1=0'
|
||||
else
|
||||
sVal = 'A1=0'
|
||||
end
|
||||
end
|
||||
local dPosA = tonumber( sVal:sub( 4)) or 0
|
||||
return dPosA
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
|
||||
function GetChainSawZHomeFromVirtualAxis( dPosA)
|
||||
-- se A1=0 -> T101 -> HomeZ = -400
|
||||
function GetChainSawZHomeFromVirtualAxis( dPosA, dCSawLength)
|
||||
-- se A=0 -> T101 -> HomeZ = -400
|
||||
if abs( dPosA) < 0.1 then
|
||||
if dCSawLength >= MinLengthLongCSaw then
|
||||
EmtSetLastError( 1200, 'ChainSaw too long: orientation forbidden')
|
||||
end
|
||||
return ParkCSaw0Z1
|
||||
-- altrimenti A1=-90 -> T102 o A=90 -> T104 -> HomeZ = -100
|
||||
-- altrimenti A=-90 -> T102 o A=90 -> T104 -> HomeZ = -100
|
||||
else
|
||||
return ParkCSawZ1
|
||||
if dCSawLength >= MinLengthLongCSaw then
|
||||
return ParkLongCSawZ1
|
||||
else
|
||||
return ParkCSawZ1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione che calcola l'angolo Home di C per la sega a catena dal valore dell'asse virtuale
|
||||
function GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
-- se A1=0 -> T101 -> HomeC = 0
|
||||
---------------------------------------------------------------------
|
||||
function GetChainSawCHomeFromVirtualAxis( dPosA, dCSawLength)
|
||||
-- se A=0 -> T101 -> HomeC = 0
|
||||
if abs( dPosA) < 0.1 then
|
||||
return ParkCSaw0C1
|
||||
-- altrimenti A1=90 -> T104 -> HomeC = -90
|
||||
-- altrimenti A=90 -> T104 -> HomeC = -90
|
||||
else
|
||||
return ParkCSawC1
|
||||
if dCSawLength >= MinLengthLongCSaw then
|
||||
return ParkLongCSawC1
|
||||
else
|
||||
return ParkCSawC1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -18,3 +18,17 @@ Versione 2.6a3 (22/01/2024)
|
||||
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale
|
||||
- (GEN) Modificato flag 'EmitRapidInG0' in 'EmitRapidInG1' per decidere se scrivere G1 anziché G0. Se flag a nil, scrive i rapidi in G0
|
||||
- (SIM) Correzione movimenti pinze prima di separazione
|
||||
|
||||
Versione 2.6a4 (25/01/2024)
|
||||
- (SIM-GEN) Corretto movimento in caso di cambio assi rotanti tra due lavorazioni
|
||||
- (GEN) Corretta emissione coordinate assi in caso di 'WriteAllCoordsOnFirstM101'
|
||||
|
||||
Versione 2.6a5 (31/01/2024)
|
||||
- (SIM) Migliorata simulazione apertura/chiusura morse in caso di separazione
|
||||
- (SIM-GEN) Migliorata gestione movimenti con motosega e adeguato simulazione
|
||||
- (GEN) Corretta scrittura assi in caso di 'WriteAllCoordsOnFirstM101' per testa 2
|
||||
- (ALL) Caricamento BeamData come local
|
||||
|
||||
Versione 2.6b1 (07/02/2024)
|
||||
- (MLDE-SIM-GEN) Inserito parametro 'MinLengthLongCSaw' per gestione motosega molto lunga
|
||||
- (MLDE) funzione 'GetCurrChainSawingVirtualAxis' spostata in MLDE
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
-- Version.lua by EgalWare s.r.l. 2024/01/19
|
||||
-- Version.lua by EgalWare s.r.l. 2024/01/22
|
||||
-- Gestione della versione dei file comuni post-processori macchine PF1250 e PF1500 di Essetre
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_PF1250', -- nome script PP standard
|
||||
VERSION = '2.6a3', -- versione script
|
||||
VERSION = '2.6b1', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user