Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f26b2c480 | |||
| a631561a7a | |||
| 435112f30a | |||
| 38ea5b2381 | |||
| 2fbcb05548 | |||
| f9269882cc | |||
| c4456d6703 | |||
| 55f70a181f | |||
| ef11694758 |
+33
-31
@@ -1,4 +1,4 @@
|
||||
-- Processore macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
|
||||
-- Processore macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Con controllo numerico TPA
|
||||
|
||||
-- Variabili di modulo
|
||||
@@ -29,7 +29,6 @@ function OnStart()
|
||||
--EMT.St = 'S' -- token per speed
|
||||
EMT.FMAXPINZE = 116000 -- feed massima pinze
|
||||
SetToParkLine() -- si inizia con linee da parcheggiare su stack
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -536,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
|
||||
@@ -710,17 +711,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=ParkCSawZ1, 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
|
||||
@@ -816,10 +823,6 @@ function OnRapid()
|
||||
-- aspetto esecuzione movimento testa 3
|
||||
EmitMoveWaitHead( 3)
|
||||
end
|
||||
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
|
||||
if not EMT.Y1DELTA then
|
||||
EMT.V1NEXTPOS = ParkV1
|
||||
end
|
||||
-- dati aggancio a trave
|
||||
local BhData = { T=EMT.L1, SetHead=0}
|
||||
if EMT.Y1DELTA then
|
||||
@@ -899,10 +902,6 @@ function OnRapid()
|
||||
EmitMoveWaitChars( nMoveType)
|
||||
end
|
||||
EMT.MDCHAR = {}
|
||||
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
|
||||
if not EMT.Y1DELTA then
|
||||
EMT.V1NEXTPOS = ParkV1
|
||||
end
|
||||
-- se necessario allargo le cabine
|
||||
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
|
||||
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
|
||||
@@ -948,7 +947,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})
|
||||
@@ -962,7 +961,7 @@ 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})
|
||||
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=ParkCSawZ1, 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
|
||||
@@ -980,11 +979,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})
|
||||
@@ -1005,9 +1005,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
|
||||
@@ -1030,11 +1031,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})
|
||||
@@ -1183,11 +1185,11 @@ function OnRapid()
|
||||
local sAxes = EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
if #sAxes > 0 then
|
||||
if EmitRapidInG0 then
|
||||
MyOutput( 'G0' .. sAxes)
|
||||
else
|
||||
if EmitRapidInG1 then
|
||||
local sFeed = ' F30000'
|
||||
MyOutput( 'G1' .. sAxes .. sFeed)
|
||||
else
|
||||
MyOutput( 'G0' .. sAxes)
|
||||
end
|
||||
end
|
||||
-- se altrimenti risalita a Z max a fine lavorazione
|
||||
@@ -1246,13 +1248,13 @@ function OnLinear()
|
||||
-- emissione movimento
|
||||
EMT.R1p = nil
|
||||
EMT.R2p = nil
|
||||
if EmitRapidInG0 then
|
||||
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
else
|
||||
if EmitRapidInG1 then
|
||||
local sFeed = ' F30000'
|
||||
sOut = 'G1'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')..sFeed
|
||||
else
|
||||
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
end
|
||||
|
||||
MyOutput( sOut)
|
||||
@@ -1939,7 +1941,7 @@ end
|
||||
function GetV1ToCloseTPA()
|
||||
local dMaxHeadPos = EMT.MAXMAX[1] + ( EMT.HOVM or 0) - ( EMT.X_OFF or 0)
|
||||
local dMinTailPos = EMT.MAXMIN[1] + EMT.LB + EgtIf( IsStartOrMidPhase( EMT.PHASE), 0, ( EMT.HOVM or 0)) - ( EMT.X_OFF or 0)
|
||||
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0)))
|
||||
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f V1NextPos=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0), EMT.V1NEXTPOS))
|
||||
return ( dMaxHeadPos <= EMT.V1NEXTPOS + RollCageMin and dMinTailPos >= EMT.V1NEXTPOS + RollCageMax)
|
||||
end
|
||||
|
||||
@@ -2264,7 +2266,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})
|
||||
|
||||
+65
-41
@@ -1,4 +1,4 @@
|
||||
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2023/12/14
|
||||
-- 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
|
||||
@@ -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
|
||||
@@ -736,7 +741,7 @@ function OnSimulPathEnd()
|
||||
if EMT.MCHSPLIT and not EMT.TO_FALL then
|
||||
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
|
||||
EMT.Y1DELTA = nil
|
||||
SetPY1Light( false)
|
||||
ExecMovePY1( false)
|
||||
end
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
EMT.TO_ZMAX = nil
|
||||
@@ -746,19 +751,19 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathStartAux()
|
||||
-- eseguo il comando
|
||||
ExecAuxCmd( EMT.AUX)
|
||||
ExecAuxCmd( EMT.AUX, true)
|
||||
-- se ultimo comando e lavorazione di split, sgancio il carro Y1
|
||||
if EMT.AUXIND == EMT.AUXTOT and EMT.MCHSPLIT and not EMT.TO_FALL then
|
||||
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
|
||||
EMT.Y1DELTA = nil
|
||||
SetPY1Light( false)
|
||||
ExecMovePY1( false)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathEndAux()
|
||||
-- eseguo il comando
|
||||
ExecAuxCmd( EMT.AUX)
|
||||
ExecAuxCmd( EMT.AUX, false)
|
||||
-- se ultimo comando e richiesta risalita a Zmax
|
||||
if EMT.AUXIND == EMT.AUXTOT and EMT.TO_ZMAX then
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
@@ -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,7 @@ 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)
|
||||
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
end
|
||||
-- se altrimenti testa 2
|
||||
@@ -1018,7 +1024,7 @@ function OnSimulMoveEnd()
|
||||
-- se lavorazione split, dichiaro carro Y1 riagganciato
|
||||
if EMT.SPLIT_Y1DELTA then
|
||||
EMT.SPLIT_Y1DELTA = nil
|
||||
SetPY1Light( true)
|
||||
ExecMovePY1( true)
|
||||
end
|
||||
-- chiusura o apertura rulli V1
|
||||
if GetV1ToClose() then
|
||||
@@ -1081,7 +1087,7 @@ function OnSimulCollision()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecAuxCmd( sCmd)
|
||||
function ExecAuxCmd( sCmd, bPathStart)
|
||||
-- analizzo il comando
|
||||
local Cmd = EgtSplitString( sCmd)
|
||||
if Cmd[1] == '0' then
|
||||
@@ -1094,29 +1100,31 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
EgtOutText( Cmd[2])
|
||||
elseif Cmd[1] == '1' then
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
sV1, MoveV1, MCH_SIM_STEP.RAPID,
|
||||
sV2, MoveV2, MCH_SIM_STEP.RAPID)
|
||||
if not bOk then
|
||||
if not bOk1 then
|
||||
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
|
||||
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
|
||||
if Cmd[2] ~= 'Z' then
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
sV1, MoveV1, MCH_SIM_STEP.RAPID,
|
||||
sV2, MoveV2, MCH_SIM_STEP.RAPID)
|
||||
if not bOk then
|
||||
if not bOk1 then
|
||||
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
|
||||
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
|
||||
end
|
||||
elseif not bOk2 then
|
||||
VerifyV1V2Stroke( sV1, MoveV1)
|
||||
elseif not bOk3 then
|
||||
VerifyV1V2Stroke( sV2, MoveV2)
|
||||
end
|
||||
elseif not bOk2 then
|
||||
VerifyV1V2Stroke( sV1, MoveV1)
|
||||
elseif not bOk3 then
|
||||
VerifyV1V2Stroke( sV2, MoveV2)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '2' then
|
||||
-- Verifico movimento carrello con trave agganciata
|
||||
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
|
||||
-- Eseguo i movimenti necessari
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3, bOk4 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
|
||||
@@ -1138,8 +1146,8 @@ function ExecAuxCmd( sCmd)
|
||||
-- Verifico movimento carrelli con trave agganciata
|
||||
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
|
||||
-- Eseguo i movimenti necessari
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3, bOk4, bOk5 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
|
||||
@@ -1159,13 +1167,13 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '4' then
|
||||
ExecMoveHome( Cmd[2] == '1', EMT.MCHSPLIT)
|
||||
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
|
||||
elseif Cmd[1] == '11' then
|
||||
SimulMoveAxes( 'PY1', EgtIf( Cmd[2] == '0', MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY1Light( Cmd[2] ~= '0')
|
||||
local bClose = Cmd[2] ~= '0'
|
||||
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
|
||||
ExecMovePY1( bClose)
|
||||
elseif Cmd[1] == '12' then
|
||||
SimulMoveAxes( 'PY2', EgtIf( Cmd[2] == '0', MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY2Light( Cmd[2] ~= '0')
|
||||
ExecMovePY2( Cmd[2] ~= '0')
|
||||
elseif Cmd[1] == '21' then
|
||||
local nY1Delta = tonumber( Cmd[2])
|
||||
local nY2Delta = tonumber( Cmd[3])
|
||||
@@ -1231,6 +1239,7 @@ end
|
||||
function ExecMoveHome( bNearV, bMchSplit)
|
||||
-- risalita a Zmax
|
||||
ExecMoveZmax( bMchSplit)
|
||||
EMT.TO_ZMAX = nil
|
||||
-- se testa sotto
|
||||
if GetHeadSet( EMT.HEAD) == 2 then
|
||||
if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then
|
||||
@@ -1368,6 +1377,18 @@ function ExecUnloading()
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY1( bClose)
|
||||
SimulMoveAxes( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY1Light( bClose)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY2( bClose)
|
||||
SimulMoveAxes( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY2Light( bClose)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function LinkRemainingPartsToY1()
|
||||
local nCurrOrd = GetPhaseOrd( EMT.PHASE)
|
||||
@@ -1397,6 +1418,9 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
-- Parcheggi pinze
|
||||
local MyParkY1 = ParkY1 + EgtIf( bAgg, AggLoad, 0)
|
||||
local MyParkY2 = ParkY2
|
||||
-- Apro i rulli, se necessario
|
||||
if abs( ParkV1 - PosV1) > 0.1 then ExecOpenRoller( 1) end
|
||||
if abs( ParkV2 - PosV2) > 0.1 then ExecOpenRoller( 2) end
|
||||
-- Eseguo spostamenti
|
||||
if EMT.Y1DELTA and EMT.Y2DELTA then
|
||||
local DiffY1 = MyParkY1 - PosY1
|
||||
@@ -1450,7 +1474,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
|
||||
@@ -1480,8 +1504,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,
|
||||
@@ -1523,7 +1547,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
|
||||
@@ -1716,14 +1740,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
|
||||
|
||||
|
||||
+23
-6
@@ -1,4 +1,4 @@
|
||||
-- Special Operations macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
|
||||
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Intestazioni
|
||||
|
||||
require( 'EmtGenerator')
|
||||
@@ -253,6 +253,22 @@ local function GetNextStartOrRestPhase( nPhase)
|
||||
return nNextPhase
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsFirstMachiningOfStart( nMchId)
|
||||
-- se non è fase inizio di pezzo, ritorno risultato negativo
|
||||
if not IsStartOrRestPhase( EMC.PHASE) then
|
||||
return false
|
||||
end
|
||||
-- recupero la precedente operazione attiva
|
||||
local nPrevOperId = EgtGetPrevActiveOperation( nMchId)
|
||||
-- se non esiste o non è una disposizione, ritorno risultato negativo
|
||||
if not nPrevOperId or EgtGetOperationType( nPrevOperId) ~= MCH_OY.DISP then
|
||||
return false
|
||||
end
|
||||
-- è la prima
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function UpdateMinJoin()
|
||||
MinJoin = BD.GetMinJoin( EMC.SB, EMC.HB, EMC.LB)
|
||||
@@ -669,6 +685,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
|
||||
EMC.SB = b3Tot:getDimY()
|
||||
EMC.HB = b3Tot:getDimZ()
|
||||
EMC.LT = b3Raw:getDimX()
|
||||
EgtOutLog( ' BarLen='..EgtNumToString( EMC.LB, 1), 3)
|
||||
|
||||
-- Aggiorno limiti di presa
|
||||
UpdateMinJoin()
|
||||
@@ -1061,8 +1078,8 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
|
||||
return {}
|
||||
end
|
||||
|
||||
-- al carico si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
|
||||
if EMC.LOAD then EMC.HCING = 0 end
|
||||
-- al carico o con prima lavorazione di un pezzo si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
|
||||
if EMC.LOAD or IsFirstMachiningOfStart( EMC.MCHID) then EMC.HCING = 0 end
|
||||
|
||||
return SpecAdjustCarriages( WorkTab)
|
||||
|
||||
@@ -2126,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)
|
||||
@@ -2198,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)
|
||||
@@ -2259,7 +2276,7 @@ function SpecAdjustCarrC( WorkTab)
|
||||
WorkTab.dY1DeltaMaxF = EMC.LB - ( MinJoin + MyTCING)
|
||||
-- se Y1 deve accentrarsi
|
||||
if WorkTab.dY1DeltaI > WorkTab.dY1DeltaMaxF then
|
||||
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin + MyTCING
|
||||
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin - MyTCING
|
||||
end
|
||||
end
|
||||
-- posizioni obiettivo dei carrelli al centro dei rispettivi intervalli di validità
|
||||
|
||||
@@ -13,3 +13,18 @@ Versione 2.6a2 (19/01/2024)
|
||||
- (SIM-GEN) Tolta gestione rotazione pezzo (di derivazione PF), in macchina non è previsto ribaltamento
|
||||
- (GEN) Migliorata gestione preselezione utensile
|
||||
- (MLDE-GEN) Aggiunto flag 'EmitRapidInG0' per decidere se scrivere G0 anziché G1. Se flag a nil, scrive i rapidi in G1
|
||||
|
||||
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
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
-- Version.lua by EgalWare s.r.l. 2023/11/28
|
||||
-- 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.6a2', -- versione script
|
||||
VERSION = '2.6a5', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user