Compare commits

...

19 Commits

Author SHA1 Message Date
andrea.villa 5552757b03 Allineamento con common ver. 3.1e1 2026-05-12 16:04:32 +02:00
daniele.nicoli 801a563b48 Aggiunto Clamp di sicurezza per lettura dei parametri MinJoin da Ts3Data 2026-04-23 14:32:55 +02:00
daniele.nicoli cd4e2f3d6b Merge remote-tracking branch 'origin/main' into develop 2026-04-23 14:32:16 +02:00
andrea.villa 3fdfdd062e Merge remote-tracking branch 'origin/develop' 2026-03-12 16:26:46 +01:00
andrea.villa 54767e5439 Allineamento con common ver. 3.1c1 2026-03-12 16:26:27 +01:00
daniele.nicoli 8d9f324e89 Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 09:34:00 +01:00
daniele.nicoli 438e04ad33 Aggiunti parametri letti da TS3Data.lua: MIN_JOIN_S, MIN_JOIN_L e MAX_ANGLE_DRILL_CUT 2026-03-05 15:15:33 +01:00
daniele.nicoli 78135ac67b Merge remote-tracking branch 'origin/main' into develop 2026-03-05 15:14:16 +01:00
andrea.villa e663013ac7 Allineamento con common ver. 3.1b1 2026-02-17 10:29:14 +01:00
andrea.villa c4cfe3c0ca Allineamento con common ver. 3.1b1 2026-02-17 09:55:08 +01:00
andrea.villa bec82b4b5d Allineamento con common ver.3.1a2 2026-01-30 13:14:02 +01:00
andrea.villa 69256cf430 Allineamento con common ver. 3.1a1 2026-01-16 16:02:03 +01:00
andrea.villa fc2608def7 - Allineamento a common ver. 2.7l1
- Aggiunto parametro MAX_ANGLE_DRILL_CUT a BeamData
- Recupero nome macchina da funzione EGT
2025-12-18 12:33:32 +01:00
andrea.villa eb95ddc906 Corretto disegno porta utensile 2025-12-11 09:26:59 +01:00
andrea.villa 7c3e24362a Merge branch 'develop' 2025-11-27 09:44:52 +01:00
andrea.villa 1520bfee1d Aggiunto nuovo ToolHolder
Cambio versione per pubblicazione versione a cliente
2025-11-27 09:44:39 +01:00
daniele.nicoli 3265bc8f8c - Aggiornamento a Common 2.7k5
- mlde, aggiunti import CLAMP_CHECK
- mlde, inizializzato valore default di ClampingCoeffMin = nil
- Aggiornamento versione MACH_KERNEL minima necessaria per Common 2.7k4
2025-11-26 10:29:57 +01:00
daniele.nicoli c1fef81e2a Merge branch 'New3d' into develop 2025-11-26 10:22:11 +01:00
andrea.villa c0f5ad297c Merge branch 'main' into develop 2025-11-21 10:01:31 +01:00
10 changed files with 294 additions and 79 deletions
+4
View File
@@ -42,6 +42,7 @@ local BeamData = {
DRILL_TOL = 0.2, -- tolleranza tra diametro foro e diametro punta
DRILL_VZ_MIN = - 0.51, -- componente limite in Z del versore di un foro
DRILL_VX_MAX = 0.867, -- componente limite in X del versore di un foro sulle facce laterali
MAX_ANGLE_DRILL_CUT = 15, -- delta angolo massimo tra foro e taglio che lo attraversa
DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale
@@ -113,8 +114,11 @@ if EgtExistsFile( sDataBeam) then
BeamData.ADVANCE_TAIL_OFFS = Machine.Offsets.ADVANCE_TAIL_OFFS or BeamData.ADVANCE_TAIL_OFFS
BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
if Machine.Offsets.MAX_ANGLE_DRILL_CUT then BeamData.MAX_ANGLE_DRILL_CUT = EgtClamp( Machine.Offsets.MAX_ANGLE_DRILL_CUT, 1, 89) end
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = EgtClamp( Machine.Offsets.MIN_JOIN_S, 80, 150) end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = EgtClamp( Machine.Offsets.MIN_JOIN_L, 300, 450) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
+56 -9
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
@@ -770,7 +789,15 @@ function OnRapid()
EmitMoveDataHead( 1, { 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})
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
EmitMoveDataHead( 1, { Z=EMT.L3, B=dBref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
-- caso standard
else
-- se bisogna scrivere tutti gli assi
@@ -1084,7 +1111,15 @@ function OnRapid()
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})
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
EmitMoveDataHead( 1, { Z=EMT.L3, B=dBref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
else
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
-- caso standard
else
-- se ero in posizione speciale, prima ruoto poi scendo
@@ -1105,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})
@@ -2048,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
@@ -2199,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))
@@ -2686,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
+114 -53
View File
@@ -79,6 +79,14 @@ function OnSimulStart()
for j = 1, #( vTools or {}) do
if vTools[j] ~= '' then
EgtLoadTool( vTcPos[i], j, vTools[j])
-- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL
if EgtTdbSetCurrTool(vTools[j]) then -- set utensile corrente
if EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_STD or EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_FLAT then -- controllo tipo utensile sega
local dCurrSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) * 0.9
-- se non definito o minore del valore precedente aggiorna la tolleranza
EMT.VMILLTOL = EgtIf( not EMT.VMILLTOL or dCurrSawLen < EMT.VMILLTOL, dCurrSawLen, EMT.VMILLTOL)
end
end
end
end
ShowToolInTcPos( vTcPos[i], true)
@@ -152,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
@@ -249,7 +257,7 @@ function OnSimulDispositionStart()
-- determino la risoluzione dello Zmap
local dTol = 4.71
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.71)
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then
@@ -266,6 +274,7 @@ function OnSimulDispositionStart()
dTol = 3.77
end
end
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
-- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
if VMillId then
@@ -343,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
@@ -475,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)
@@ -566,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
@@ -727,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)
@@ -737,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')
@@ -745,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
@@ -787,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
@@ -812,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)
@@ -831,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'
@@ -852,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
@@ -924,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
---------------------------------------------------------------------
@@ -1059,7 +1089,15 @@ function OnSimulMoveStart()
SimulMoveAxes( 'Z1', MyMaxZ1, 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)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
-- caso standard
else
-- se bisogna scrivere tutti gli assi
@@ -1085,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)
@@ -1275,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 ...
@@ -1412,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
@@ -1445,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,
@@ -1770,23 +1827,25 @@ function CheckClamping( sClampName)
return
end
function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, vtOffset)
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
local idCurveList = {}
local vtIntersPlane
-- piano di interpolazione
if sIntersPlane == 'Y' then
if sIntersPlane == 'X' then
vtIntersPlane = X_AX()
elseif sIntersPlane == 'Y' then
vtIntersPlane = Y_AX()
elseif sIntersPlane == 'Z' then
vtIntersPlane = Z_AX()
end
for i = 1, #EMT.VMILL do
local b3VMill = EgtGetBBoxGlob( EMT.VMILL[i], GDB_BB.STANDARD)
local b3VMill = EgtGetBBoxGlob( EMT.VMILL[i], GDB_BB.EXACT)
local ptPosIntersPlane
if sPosIntersPlane == 'MIN' then
ptPosIntersPlane = b3VMill:getMin() + vtOffset
ptPosIntersPlane = b3VMill:getMin() + dDepth * vtIntersPlane
elseif sPosIntersPlane == 'MAX' then
ptPosIntersPlane = b3VMill:getMax() + vtOffset
ptPosIntersPlane = b3VMill:getMax() - dDepth * vtIntersPlane
end
local idLoop, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
@@ -1801,31 +1860,36 @@ function CheckClamping( sClampName)
return idCurveList
end
function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, vtOffset)
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
-- test piano frontale
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, vtOffset)
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
-- si copia curva intersezione e curva pinza in gruppo di confronto
local idFlatSurf, nFlatSurfCnt = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idCurveList)
local idClampSurf = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idClampPath)
if idFlatSurf then
local dTotalArea = 0
local dTotalXLenght = 0
for k = 1, nFlatSurfCnt do
local idTempSurf = idFlatSurf + k - 1
EgtSurfFrIntersect( idTempSurf, idClampSurf)
if idTempSurf then
dTotalArea = dTotalArea + ceil( EgtSurfArea( idTempSurf) or 0)
local b3BoxIntersectionBox = EgtGetBBoxGlob( idTempSurf, GDB_BB.STANDARD)
if b3BoxIntersectionBox then
dTotalXLenght = dTotalXLenght + ceil( b3BoxIntersectionBox:getDimX()) -- somma lunghezze (x) delle aree pinzate
end
end
end
return dTotalArea
return dTotalArea, dTotalXLenght
end
return 0
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
local MinJoin = BD.GetMinJoin( EMT.SB, EMT.HB, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinJoin = BD.GetMinJoin( EMT.HB, EMT.SB, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinZClamping = min( b3ClampingArea:getDimZ() + DistZClampToTable, EMT.SB) - DistZClampToTable
-- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio
ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1)
@@ -1837,15 +1901,12 @@ function CheckClamping( sClampName)
local bWriteWarnMessage = false
local bWriteErrMessage = false
-- controllo faccia frontale
local dArea = CalculateIntersectionArea( 'MIN', 'Y', Vector3d( 0, 1, 0))
local dArea, dXClampedLenght = CalculateIntersectionArea( 'MIN', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, si prova un altro slice 5mm più all'interno, se aumenta al doppio non c'è errore (probabilmente siamo in presenza di un displuvio)
if dArea > 1000 then
local dNewArea = CalculateIntersectionArea( 'MIN', 'Y', Vector3d( 0, 5, 0))
if dNewArea > dArea * 2 then
bError = false
end
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
@@ -1864,16 +1925,13 @@ function CheckClamping( sClampName)
-- controllo altro lato solo se non sono già in errore
if not bWriteErrMessage then
-- controllo faccia posteriore
dArea = CalculateIntersectionArea( 'MAX', 'Y', Vector3d( 0, -1, 0))
dArea = CalculateIntersectionArea( 'MAX', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, si prova un altro slice 5mm più all'interno, se aumenta al doppio non c'è errore (probabilmente siamo in presenza di un displuvio)
if dArea > 1000 then
local dNewArea = CalculateIntersectionArea( 'MAX', 'Y', Vector3d( 0, -5, 0))
if dNewArea > dArea * 2 then
bError = false
end
end
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
@@ -2033,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,
@@ -2267,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)
+71 -10
View File
@@ -17,17 +17,52 @@ require( 'EmtGenMachining')
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
function OnSpecialGetPrevMachiningOffset()
-- Aggiorno posizione della testa della trave a seguito di movimenti delle pinze non previsti tra le fasi
local function TPosUpdate()
local nClId = EgtGetFirstNameInGroup( EMC.CURRMCHID, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
if not nPathId then
EMC.ERR = 12
EMC.MSG = ' Error : CL group path not found'
return
end
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
local dTRepos = nil
-- controlla ogni gruppo di movimenti ausiliari
for i = 1, dAuxMoveCount do
local aAuxMove = EgtGetInfo( nPathId, 'AS' .. tostring( i), 'vs') or {} -- array contenete i parametri di ogni gruppo
-- controlla solo i movimenti della testa trave e salva l'ultimo
if aAuxMove[1] == '2' or aAuxMove[1] == '3' then
for j = 2, #aAuxMove do
if aAuxMove[j] == 'T' then
dTRepos = aAuxMove[j+1]
break
end
end
end
end
return dTRepos
end
-- default
EMC.ERR = 0
EMC.PREVOFFSX = 0
-- se c'è cambio di fase tra le lavorazioni (quindi la precedente è l'ultima della sua fase e la corrente la prima)
if EMC.PREVPHASE ~= EMC.CURRPHASE then
-- se la fase corrente è di inizio lavorazione di nuova trave
if IsStartOrRestPhase( EMC.CURRPHASE) then
-- recupero la posizione finale della lavorazione precedente
local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID)
-- la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
-- ricava se e quanto la trave viene spostata tra le due fasi dai movimenti ausiliari e corregge l'offset di fine fase
local dNewTPos = TPosUpdate()
-- se ci sono dei movimenti della testa trave tra le due fasi ricava il delta tra la vecchia e la nuova posizione
if dNewTPos then
EMC.PREVOFFSX = dNewTPos - vPrevAx[1]
-- oppure la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
else
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
end
end
@@ -113,7 +148,7 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
else
local vMZ = {{ Tz=0.85, Ez=400}, { Tz=0.7, Ez=300}, { Tz=0.5, Ez=195}, { Tz=0.15, Ez=70}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
local vMZ = {{ Tz=0.85, Ez=400}, { Tz=0.7, Ez=300}, { Tz=0.5, Ez=195}, { Tz=0.15, Ez=60}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H16' then
@@ -133,7 +168,7 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
else
local vMZ = {{ Tz=0.85, Ez=400}, { Tz=0.7, Ez=300}, { Tz=0.5, Ez=195}, { Tz=0.15, Ez=70}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
local vMZ = {{ Tz=0.85, Ez=400}, { Tz=0.7, Ez=300}, { Tz=0.5, Ez=195}, { Tz=0.15, Ez=60}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H21' then
@@ -542,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) .. ')')
@@ -634,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
@@ -833,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)
@@ -1134,7 +1193,7 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
-- 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)
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF + EMC.LT)
end
end
@@ -1167,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
@@ -1345,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})
@@ -2475,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
+11 -5
View File
@@ -5,10 +5,10 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.7k2'
PP_NVER = '2.7.11.2'
PP_VER = '3.1e1'
PP_NVER = '3.1.5.1'
MIN_MACH_VER = '2.7d2'
MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio
MACH_NAME = EgtGetCurrMachineName()
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -188,6 +188,9 @@ WriteAllCoordsOnFirstM101 = true
ForceToCloseRollersGate = false
Motors23KW = true
EstimationRapidMultiplier = 1
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
ClampingCoeffMin = nil
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1500MAXrl-3T.data"
@@ -290,6 +293,7 @@ if EgtExistsFile( sDataBeam) then
if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
if Machine.Offsets.MOTORS23KW then Motors23KW = Machine.Offsets.MOTORS23KW == 1 end
if Machine.Offsets.COEFF_CLAMP_CHECK then ClampingCoeffMin = Machine.Offsets.COEFF_CLAMP_CHECK end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
@@ -675,7 +679,7 @@ local PY1Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY1_AXIS/GEO',
Aux = 'PY1_AXIS/SOLID'}
Aux = {'PY1_AXIS/SOLID', 'PY1_AXIS/CLAMP_CHECK'}}
local Y2Id = EmtAxis {
Name = 'Y2',
Parent = 'Base',
@@ -695,7 +699,7 @@ local PY2Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY2_AXIS/GEO',
Aux = 'PY2_AXIS/SOLID'}
Aux = {'PY2_AXIS/SOLID', 'PY2_AXIS/CLAMP_CHECK'}}
-- Rulli
local V1Id = EmtAxis {
Name = 'V1',
@@ -1104,8 +1108,10 @@ local vtMove = Vector3d( 0, ( DeltaTabY - 2065.5), ( DeltaTabZ + 1321.0))
EgtMove( EgtGetFirstNameInGroup( BaseId, 'CONVOYER'..sGeomConvoyer), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( V1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( V1Id, 'COLLISION'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
Binary file not shown.
+1
View File
@@ -20,6 +20,7 @@
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=l,MaxOptSize,0
5=b,AdjustFeed,1
[Mortising]
0=d,MaxElev,0
Binary file not shown.
+35
View File
@@ -1,5 +1,40 @@
==== 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
- (SIM-GEN) Divisione movimento B in approccio se > 90°.
Versione 2.7k5 (26/11/2025)
- (SIM) Migliorata funzione CheckClamping, ora il controllo di warning si basa sulla somma delle lunghezze delle aree pinzate
Versione 2.7k4 (25/11/2025)
- (SIM) Migliorata funzione CheckClamping, ora la sezione rientra di 3 mm
Versione 2.7k3 (21/11/2025)
- (SIM-GEN) Corretto problema riposizionamento carrelli. Ticket#2704
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
Versione 2.7k2 (19/11/2025)
- (SIM-GEN) Con testa H38 si va in home quando testa viene comandata a Zmassima. Ticket#2703_b
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.7k2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
VERSION = '3.1e1', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
}
return InfoCommon_STD_PP