Compare commits

...

23 Commits

Author SHA1 Message Date
andrea.villa 97ec5d29c6 Merge branch 'develop' 2026-05-12 15:50:24 +02:00
andrea.villa 293dc97749 Cambio versione per rilascio a cliente 2026-05-12 15:50:14 +02:00
daniele.nicoli 1fa5c7de64 Sistemata gestione di pezzi lunghi che necessitano lo scarico manuale :
- Simulazione (muoveva Y2 a MaxY2 senza aprire pinza).
- Generazione (non chiudeva rulliere e dava extracorsa e non generava P7=-85).
2026-05-12 13:14:47 +02:00
daniele.nicoli 61fe9ba362 Merge remote-tracking branch 'origin/main' into develop 2026-05-12 13:00:11 +02:00
andrea.villa 300eead9d1 Merge branch 'develop' 2026-03-12 16:12:37 +01:00
andrea.villa caf3739c3f Cambio versione per rilascio a cliente 2026-03-12 16:12:04 +01:00
daniele.nicoli bd04fcb4ab Solo se dY1DeltaMaxSP > WorkTab.dY1DeltaMinF lo prende in considerazione per il valore di WorkTab.dY1DeltaMaxF 2026-03-12 15:55:01 +01:00
andrea.villa 021e841126 - Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente
2026-03-12 15:22:46 +01:00
andrea.villa 87f7aad2f0 - Revert modifica fatta al ParkRoller
- Ora calcola la lunghezza del pezzo sulla lavorazioen di  precut con DELTA_LT
2026-03-12 15:14:30 +01:00
daniele.nicoli 5e4ec03149 Merge branch 'Test_Ticket2832' into develop 2026-02-26 16:27:10 +01:00
andrea.villa 8cd863c4b7 Corretto caricamento geometrie di collisioni. Modificato indice di collisione per una migliore gestione 2026-02-26 11:38:19 +01:00
daniele.nicoli 67a45afd0d Corretto calcolo rimanenza durante ParkRoller 2026-02-25 10:18:23 +01:00
daniele.nicoli 66a0e4f2e8 Merge remote-tracking branch 'origin/main' into develop 2026-02-25 10:13:45 +01:00
andrea.villa dba3a45080 Migliorata gestione aggiornamento valori 2026-02-17 10:23:50 +01:00
andrea.villa 7631f4f86c In OnPathStart, la L3o viene salvata sulla L3pp solo se non è nil. Altrimenti si tiene valore vecchio 2026-02-17 09:49:34 +01:00
andrea.villa 34a5cb79b6 Merge remote-tracking branch 'origin/develop' 2026-01-30 13:06:22 +01:00
andrea.villa 6c81d8c21d - Simulazione non allineata a generazione. Mancava reset flag di pezzo a caduta
- Cambio versione per rilascio a cliente
2026-01-30 13:06:11 +01:00
daniele.nicoli 12445313c6 Allineato approccio in simulazione a generazione in caso di lavorazione in doppio verticale 2026-01-19 13:28:37 +01:00
andrea.villa 1164be0cb6 Merge remote-tracking branch 'origin/main' into develop 2026-01-16 15:54:55 +01:00
andrea.villa 651ab27194 Merge commit 'c385253e0bebdd6c5a69dbaacf2a4b639395869f' 2026-01-16 15:54:34 +01:00
andrea.villa c385253e0b Commit per rilascio versione 2026-01-16 15:54:20 +01:00
daniele.nicoli 93701378db Corretto movimento di approccio con sega a catena e allineati Simulazione e Generazione 2026-01-13 11:59:22 +01:00
daniele.nicoli 367fcdce2e Merge branch 'main' into develop 2026-01-13 10:25:13 +01:00
5 changed files with 161 additions and 40 deletions
+38 -7
View File
@@ -358,6 +358,7 @@ function OnRawMoveData()
EMT.HT = b3Part:getDimY()
EMT.ST = b3Part:getDimZ()
EMT.HOVM = EgtGetInfo( EMT.RAWID, 'HOVM', 'd') or 0
EMT.XMINT = b3Part:getMin():getX()
EMT.PARTTYPE = 0
local sMaterial = EgtGetInfo( PartId, 'MATERIAL')
if sMaterial and sMaterial:find( 'CLT-', 1, true) == 1 then
@@ -405,6 +406,7 @@ function OnMachiningStart()
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- se sega a catena, aggiusto subito angolo scelto per asse virtuale A
@@ -538,6 +540,7 @@ function OnMachiningEnd()
local sEnd= 'M113 P1='..tostring( EMT.PRODID)..' P2='..tostring( EMT.PATTID)..' P3='..tostring( EMT.CUTID)..' P4=2'
MyOutput( sEnd)
end
EMT.FALL = nil
elseif not EMT.PREROT then
MyOutput( 'M77')
end
@@ -573,12 +576,25 @@ end
---------------------------------------------------------------------
function OnPathStart()
if EMT.OPEISDISP then
return
end
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
EMT.MCHFIRSTFEED = true
-- primo posizionamento sempre in globale
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- se taglio di precut verifico quanto è più lungo il grezzo rispetto al pezzo (non tiene conto dell'ultimo cubetto)
EMT.DELTA_LT = 0
if EMT.MCHPRECUT then
local dCosA = sqrt( max( 1 - EMT.EXTR[1] * EMT.EXTR[1], 0))
EMT.DELTA_LT = max( EMT.XMINT - Point3d( EMT.MMAX):getX() - dCosA * EMT.TDIAM / 2, 0)
end
-- leggo se ancora presa iniziale carrello
--EMT.CNT = EgtGetInfo( EMT.PATHID, 'CNT', 'i')
--MyOutput( 'CNT='.. tostring( EMT.CNT or 0))
@@ -602,6 +618,9 @@ end
---------------------------------------------------------------------
function OnPathEnd()
if EMT.OPEISDISP then
return
end
if not EMT.ZMAX then
EmitResetMachining()
end
@@ -1121,16 +1140,24 @@ function OnRapid()
-- altrimenti sega a catena
else
-- se bisogna scrivere tutti gli assi
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
if WriteAllCoordsOnFirstM101 then
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
if EMT.L3 > dSafeZ1 + 1 and abs( EMT.R2) > 89.9 then
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
EmitMoveDataHead( 1, { Z=HomeZ1, S=Speed})
EmitMoveDataHead( 1, { Z=dSafeZ1, S=Speed})
end
local dChSawEncumbrance = EMT.L3 + MillOffs - ( ( ChSawLen + MillOffs) * EMT.ADIR[3]) - ( EMT.TTOTLEN * EMT.TDIR[3])
local dBeamQuote = DeltaTabZ + EMT.SB + 30
if dChSawEncumbrance < dBeamQuote then
EmitMoveDataHead( 1, { Z=dSafeZ1, B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
else
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
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})
@@ -2064,7 +2091,8 @@ function PrepareUnload( sCmd, nInd)
if Cmd[4] == 'Y2' then
-- se non è ultima fase c'è una barra sulla pinza Y1
local bBarOnY = ( EMT.PHASE < EgtGetPhaseCount() and not IsEnd2Phase( EMT.PHASE))
local MDChar = { Y2=tonumber(Cmd[5]), IniStatY1=EgtIf( bBarOnY, -1, 1), FinStatY1=EgtIf( bBarOnY, -1, 1), IniStatY2=-1, FinStatY2=1, IniStatV2=1, BeamVise=2, MovType=EgtIf( EMT.CHY_ON, 3, 2)}
local bManualUnl = ( Cmd[4] and Cmd[4] == 'Manual Unloading')
local MDChar = { Y2=tonumber(Cmd[3]), V2=EgtIf( bManualUnl, MaxV2, ParkV2), IniStatY2=1, FinStatY2=EgtIf( bManualUnl, -85, -84), BeamVise=EgtIf( bBarOnY, 1, 0), MovType=EgtIf( EMT.CHY_ON, 3, 2)}
table.insert( EMT.MDCHAR, MDChar)
end
elseif Cmd[1] == '3' then
@@ -2215,6 +2243,9 @@ end
---------------------------------------------------------------------
function GetV1ToCloseTPA()
if EMT.MCHPRECUT or EMT.MCHCUT then
return false
end
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 V1NextPos=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0), EMT.V1NEXTPOS))
@@ -2702,8 +2733,8 @@ function EmitParkRoller( dPosT, bSplitCut)
local dPosY2 = dPosT + EMT.Y2DELTA
local DiffY2 = MyParkY2 - dPosY2
local dMoveY2 = EgtIf( DiffY2 < -0.1, dMoveV2, 0)
local dTryMoveY2 = max( ParkV2 - dPosT - EMT.LT - EMT.HOVM, MinY2 - dPosY2 + 10)
if ( dPosT + EMT.LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
local dTryMoveY2 = max( ParkV2 - dPosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM, MinY2 - dPosY2 + 10)
if ( dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
--MyOutput( string.format( 'PosT=%.3f LT=%.3f PosY2=%.3f V2POS=%.3f', dPosT, EMT.LT, dPosY2, EMT.V2POS))
MDChar.Y2 = dPosY2 + dMoveY2
MDChar.MovType = 2
+69 -26
View File
@@ -160,10 +160,10 @@ function OnSimulStart()
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId, McdData[i].Sub), McdData[i].Name)
if nId then
table.insert( EMT.MCODET, nId)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
EgtOutLog( ' Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
EgtOutLog( ' Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
end
end
if nMcdNullCnt > 0 then
@@ -352,6 +352,10 @@ function OnSimulDispositionStart()
EMT.LB = b3Bar:getDimX()
EMT.LR = b3Raw:getDimX()
EMT.LT = b3Part:getDimX()
if b3Part:getMin() then
EMT.XMINT = b3Part:getMin():getX() + ( EgtGetAxisPos( 'T') - EgtGetAxisHomePos( 'T'))
end
EMT.HOVM = EgtGetInfo( nPartRawId or GDB_ID.NULL, 'HOVM', 'd') or 0
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
@@ -484,10 +488,12 @@ end
---------------------------------------------------------------------
function OnSimulToolSelect( dPosA)
EgtOutLog( '===> ToolSelect : Reset CollisionObj', 4)
-- se utensile non definito, è disposizione ed esco
if EMT.TOOL == '' then return end
-- recupero dati utensile
EMT.TOOLTYPE = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
@@ -575,9 +581,9 @@ function OnSimulToolSelect( dPosA)
-- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then
local nInd = EgtIf( nSetHead ~= 2, 1001, 1011)
local nInd = 1000 + tonumber( string.sub( EMT.HEAD, 2))
AddToolToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, nInd, true)
AddToolHolderToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, nInd + 1)
AddToolHolderToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, nInd + 100)
for i, Coll in ipairs( EMT.COLLOBJ or {}) do
EmtAddCollisionObjEx( i, Coll.Fr, Coll.Ty, Coll.Mv, Coll.P1, Coll.P2, Coll.P3)
end
@@ -736,8 +742,9 @@ function OnSimulToolDeselect( dPrevA)
-- prendo utensile lama su aggregato
elseif EMT.NEXTHEAD == 'H22' then
-- aggiungo utensile per verifica collisione
AddToolToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, 1011, false)
AddToolHolderToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, 1011 + 1)
local nInd = 1000 + tonumber( string.sub( EMT.NEXTHEAD, 2))
AddToolToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, nInd, false)
AddToolHolderToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, nInd + 100)
-- simulo movimento
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkSawB2, MCH_SIM_STEP.COLLROT, 'C2', ParkSawC2, MCH_SIM_STEP.COLLROT)
@@ -746,6 +753,7 @@ end
---------------------------------------------------------------------
function OnSimulMachiningStart()
EgtOutLog( '===> Start Machining : ' .. EgtGetName( EMT.MCHID), 4)
-- se lavorazione è con gruppo a forare, abilito le altre punte alla lavorazione del VMILL
if EMT.HEAD == 'H14' then
local OtherTools = EgtGetToolsInCurrSetupPos( 'T121')
@@ -754,7 +762,7 @@ function OnSimulMachiningStart()
if OtherTools[i] ~= '' and OtherTools[i] ~= EMT.TOOL then
EmtAddToolForVmill( OtherTools[i], 'H14', i, EMT.VMILL)
-- dichiaro utensile per verifica collisioni
local nInd = 1011
local nInd = 1000 + tonumber( string.sub( 'H14', 2))
AddToolToCollisionObj( OtherTools[i], 'H14', i, nInd, true)
end
end
@@ -796,6 +804,8 @@ function OnSimulMachiningStart()
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
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.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- recupero TASKID e CUTID della feature lavorata (CUTID va recuperato qui per le pareti)
local vId = EgtGetMachiningGeometry()
if vId and #vId > 0 and #vId[1] > 0 then
@@ -821,9 +831,9 @@ function OnSimulMachiningStart()
-- dichiaro utensile per Vmill
EmtAddToolForVmill( sDouTool, sDouHead, nDouExit, EMT.VMILL)
-- dichiaro utensile per verifica collisioni
local nInd = 1011
local nInd = 1000 + tonumber( string.sub( sDouHead, 2))
AddToolToCollisionObj( sDouTool, sDouHead, nDouExit, nInd, true)
AddToolHolderToCollisionObj( sDouTool, sDouHead, nDouExit, nInd + 1)
AddToolHolderToCollisionObj( sDouTool, sDouHead, nDouExit, nInd + 100)
-- salvo dati
EMT.DOU_TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
EMT.DOU_TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
@@ -840,19 +850,17 @@ function OnSimulMachiningStart()
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead ~= 1 and ( EMT.PREVTOOL_H1 and EMT.PREVHEAD_H1) then
local nPrevExit_H1 = 1
local nInd_H1 = 1001
local nInd_H1 = 1000 + tonumber( string.sub( EMT.PREVHEAD_H1, 2))
AddToolToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1, true)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1 + 1)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1 + 100)
end
if nSetHead ~= 2 and ( EMT.PREVTOOL_H2 and EMT.PREVHEAD_H2) then
local nPrevExit_H2 = 1
local nInd_H2 = 1011
local nInd_H2 = 1000 + tonumber( string.sub( EMT.PREVHEAD_H2, 2))
AddToolToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2, true)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2 + 1)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2 + 100)
end
if nSetHead ~= 3 and IsHeadExisting( 3) then
local nPrevExit_H3 = 1
local nInd_H3 = 1001
local sHeadName
if EgtGetHeadId( 'H39') then
sHeadName = 'H39'
@@ -861,8 +869,10 @@ function OnSimulMachiningStart()
else
EmtSetLastError( 1212, "HEAD not managed")
end
AddToolToCollisionObj( nil, sHeadName, nPrevExit_H3, 1001)
AddToolHolderToCollisionObj( nil, sHeadName, nPrevExit_H3, 1002)
local nPrevExit_H3 = 1
local nInd_H3 = 1000 + tonumber( string.sub( sHeadName, 2))
AddToolToCollisionObj( nil, sHeadName, nPrevExit_H3, nInd_H3)
AddToolHolderToCollisionObj( nil, sHeadName, nPrevExit_H3, nInd_H3 + 100)
end
end
-- se precedente in doppio ma ora solo testa 1 e non in sicurezza
@@ -933,6 +943,17 @@ function OnSimulPathStart()
EMT.TO_FALL = true
end
end
-- dump oggetti di collisione
if DumpCollisionObj then
DumpCollisionObj( ' ==> CollisionObj :', 4)
end
-- se taglio di precut verifico quanto è più lungo il grezzo rispetto al pezzo (non tiene conto dell'ultimo cubetto)
EMT.DELTA_LT = 0
if EMT.MCHPRECUT then
local dCosA = sqrt( max( 1 - EMT.EXTR[1] * EMT.EXTR[1], 0))
EMT.DELTA_LT = max( EMT.XMINT - Point3d( EMT.MMAX):getX() - dCosA * EMT.TDIAM / 2, 0)
EgtOutLog( 'PreCutDeltaLT='..EgtNumToString( EMT.DELTA_LT, 3), 5)
end
end
---------------------------------------------------------------------
@@ -1102,14 +1123,24 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
-- Porto la Z alla giusta quota
if Z1Pos > Z1Home + 1 and abs( B1Pos) > 89.9 then
if Z1Pos > dSafeZ1 + 1 and abs( B1Pos) > 89.9 then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', Z1Home, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', dSafeZ1, MCH_SIM_STEP.RAPID)
end
-- 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)
local dChSawEncumbrance = EMT.L3 + MillOffs - ( ( ChSawLen + MillOffs) * EMT.ADIR[3]) - ( EMT.TTOTLEN * EMT.TDIR[3])
local dBeamQuote = DeltaTabZ + EMT.SB + 30
if dChSawEncumbrance < dBeamQuote then
SimulMoveAxes( 'Z1', dSafeZ1, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
-- se motosega molto lunga, ruoto prima di muovermi in X
if EMT.TTOTLEN >= MinLengthLongCSaw then
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
@@ -1292,6 +1323,12 @@ function OnSimulMoveStart()
local sErr = 'Z1 Z2 tools in collision (distance=' .. EgtNumToString( dDistToolZ1Z2, 1) .. ')'
EmtSetLastError( 1208, sErr)
end
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local B2Home = EgtGetAxisHomePos( 'B2')
local C2Home = EgtGetAxisHomePos( 'C2')
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'C2', C2Home, MCH_SIM_STEP.RAPROT, 'B2', B2Home, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X2', X2, MCH_SIM_STEP.RAPID)
end
end
end
-- se necessario ...
@@ -1429,10 +1466,10 @@ function OnSimulCollision()
return
end
local Class = ''
if EMT.SIMCOBIND == 1001 or EMT.SIMCOBIND == 1011 then
Class = 'T_'..EMT.HEAD
elseif EMT.SIMCOBIND == 1002 or EMT.SIMCOBIND == 1012 then
Class = 'TH_'..EMT.HEAD
if EMT.SIMCOBIND > 1000 and EMT.SIMCOBIND < 1099 then
Class = 'T_H'.. tostring( EMT.SIMCOBIND - 1000)
elseif EMT.SIMCOBIND > 1100 and EMT.SIMCOBIND < 1199 then
Class = 'TH_H'..tostring( EMT.SIMCOBIND - 1100)
else
Class = EMT.COLLOBJ[EMT.SIMCOBIND].Cl
end
@@ -1462,6 +1499,9 @@ function ExecAuxCmd( sCmd, bPathStart)
if Cmd[2] ~= 'Z' then
ExecOpenRoller( 1)
ExecOpenRoller( 2)
if Cmd[4] and Cmd[4] == 'Manual Unloading' then
ExecMovePY2( false)
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,
@@ -2051,8 +2091,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 = max( ParkV2 - PosT - EMT.LT, MinY2 - PosY2 + 10)
if ( PosT + EMT.LT < ParkV1 + ExtraParkV and PosT + EMT.LT > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
local TryMoveY2 = max( ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM, MinY2 - PosY2 + 10)
if ( PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > 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,
@@ -2285,6 +2325,9 @@ end
---------------------------------------------------------------------
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( '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)
+32 -5
View File
@@ -47,6 +47,7 @@ function OnSpecialGetPrevMachiningOffset()
-- 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
@@ -576,6 +577,24 @@ end
---------------------------------------------------------------------
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) .. ' (' .. tostring( EMC.MCHID) .. ')')
@@ -668,7 +687,7 @@ function OnPostApplyMachining()
-- 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
-- if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- salvo lo stato dei carrelli
local OriTPos = EMC.TPOS
local OriY1Delta = EMC.Y1DELTA
@@ -867,6 +886,12 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
if not EMC.Y2DELTA then
EgtOutLog( ' Warning SPLITTING -> separazione con caduta pezzo')
SpecOutputCNT()
-- non funziona ma servirebbe un controllo simile, di modo che non possa avvenire la presenza di un pezzo "FALL" più grande di LEN_VERY_SHORT_PART
--if EMC.LT > LEN_VERY_SHORT_PART then
-- EMC.ERR = 19
-- EMC.MSG = ' Error SPLIT : Y1 or Y2 not clamped'
-- return false
--end
if IsEndPhase( EMC.PHASE + 1) then
EgtSetInfo( NextDispId, 'SKIP', '1')
local NextOpeId = EgtGetNextOperation( NextDispId)
@@ -1201,7 +1226,9 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dY1DeltaMaxF = min( EMC.LB - MinJoin, MaxY1 + dDistFront + dRollFront + AGG_V)
WorkTab.dY2DeltaMinF = max( MinJoin + EMC.HCING + EMC.HOVM, EMC.LB + MinY2 - dMyDistBack - AGG_V - dRollBack)
WorkTab.dY2DeltaMaxF = min( dDistFront, EMC.LB - MyMinOther) -- - EMC.TCING
if dY1DeltaMaxSP then WorkTab.dY1DeltaMaxF = min( WorkTab.dY1DeltaMaxF, dY1DeltaMaxSP) end
if dY1DeltaMaxSP and dY1DeltaMaxSP > WorkTab.dY1DeltaMinF then
WorkTab.dY1DeltaMaxF = min( WorkTab.dY1DeltaMaxF, dY1DeltaMaxSP)
end
if dY2DeltaMinUL then WorkTab.dY2DeltaMinF = max( WorkTab.dY2DeltaMinF, dY2DeltaMinUL) end
WorkTab.dV1PosF = dRollBack
WorkTab.bV1CloseF = false
@@ -1379,7 +1406,7 @@ function SpecCalcUnload()
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
else
table.insert( vCmd, { 1, 'Y2', MaxY2})
table.insert( vCmd, { 1, 'Y2', MaxY2, 'Manual Unloading'})
end
-- apro la morsa
table.insert( vCmd, { 12, 0})
@@ -2509,11 +2536,11 @@ function SpecOutputCmds( vCmd, bEnd)
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- movimento di 1 asse
elseif Cmd[1] == 1 then
local sInfo = '1,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..EgtIf( Cmd[4], ',*', '')
local sInfo = '1,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..EgtIf( Cmd[4], ','..tostring(Cmd[4]), '')
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- movimento di 2 assi
elseif Cmd[1] == 2 then
local sInfo = '2,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..','..Cmd[4]..','..EgtNumToString( Cmd[5],3)..EgtIf( Cmd[6], ',*', '')
local sInfo = '2,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..','..Cmd[4]..','..EgtNumToString( Cmd[5],3)..EgtIf( Cmd[6], ','..tostring(Cmd[6]), '')
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- movimento di 3 assi
elseif Cmd[1] == 3 then
+20
View File
@@ -1,5 +1,25 @@
==== Common_PF1250 Update Log ====
Versione 3.1e1 (12/05/2026)
- (SIM-GEN) Corretta SIM (muoveva Y2 a MaxY2 senza aprire pinza) e GEN (non chiudeva rulliere e dava extracorsa e non generava P7=-85) di pezzi lunghi che necessitano lo scarico manuale. Ticket#2971
Versione 3.1c1
- (SIM-GEN) Corretto calcolo rimanenza durante ParkRoller. Ticket#2832
- (SIM) Corretto caricamento geometrie di collisioni. Modificato indice di collisione per una migliore gestione. ATT: MIN_MACH -> 3.1b2
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. Ticket#2798
- (SIM-GEN) Solo se dY1DeltaMaxSP > WorkTab.dY1DeltaMinF lo prende in considerazione per il valore di WorkTab.dY1DeltaMaxF Ticket#2798
Versione 3.1b1 (17/02/2026)
- (GEN) Generazione non allineata a simulazione. Ticket#2819
Versione 3.1a2 (30/01/2026)
- (SIM) Allineato approccio simulazione a generazione in caso di lavorazione in doppio verticale. Ticket#2781
- (GEN) Simulazione non allineata a generazione. Mancava reset flag di pezzo a caduta. Ticket#2798
Versione 3.1a1 (16/01/2026)
- (SIM-GEN) Corretto movimento di approccio con sega a catena e allineati Simulazione e Generazione. Ticket#2771
Versione 2.7l1 (18/12/2025)
- (SIM-GEN) Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset() come su ONE-PF. Ticket#2727
- (SIM-GEN) Cambiato delta di correzione Z per lama con inclinazione >= 81° da 70 a 60 mm. Risoluzione Ticket#2210
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.7l1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.7k1' -- versione minima kernel
VERSION = '3.1e1', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
}
return InfoCommon_STD_PP