Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c4270df480 | |||
| 096d04f640 | |||
| 2d8d5a38a6 | |||
| 4fcf50951b | |||
| 4b2827f2cd | |||
| 29dddf0d52 | |||
| 45148ee0c5 | |||
| bc7fa48823 | |||
| 05ebbc9221 | |||
| ae772c6f74 | |||
| 164ad6fca4 | |||
| a97c8673f4 | |||
| a909f2460c | |||
| ff8044959a | |||
| bbfff9f9c2 | |||
| 12ffc06055 |
@@ -609,6 +609,9 @@ function OnRapid()
|
||||
MyBackupAxes()
|
||||
-- se primo movimento della lavorazione, gestione speciale
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- decido se muovere prima testa o carrelli (standard prima testa)
|
||||
local bHeadFirst = true
|
||||
local sLateG101
|
||||
@@ -641,9 +644,6 @@ function OnRapid()
|
||||
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
|
||||
local sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
|
||||
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
|
||||
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
|
||||
|
||||
@@ -657,6 +657,9 @@ function OnRapid()
|
||||
MyBackupAxes()
|
||||
-- se primo movimento della lavorazione, gestione speciale
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- decido se muovere prima testa o carrelli (standard prima testa)
|
||||
local bHeadFirst = true
|
||||
local sLateG101
|
||||
@@ -713,9 +716,6 @@ function OnRapid()
|
||||
|
||||
local sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
|
||||
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
|
||||
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
|
||||
|
||||
+217
-14
@@ -148,6 +148,30 @@ function OnSimulStart()
|
||||
end
|
||||
-- Preparo lista collisioni vuota
|
||||
EMT.COLLIDE = {}
|
||||
|
||||
-- si crea gruppo temporaneo appoggio controllo clamping
|
||||
CLAMP_CHECK_GROUP = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'CLAMP_CHECK')
|
||||
CLAMP_CHECK_INTERS = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'CLAMP_INTERS')
|
||||
|
||||
if CLAMP_CHECK_GROUP then
|
||||
EgtEmptyGroup( CLAMP_CHECK_GROUP)
|
||||
else
|
||||
local frClampCheckGroup = Frame3d( ORIG(), GDB_FR.FRONT)
|
||||
CLAMP_CHECK_GROUP = EgtGroup( GDB_ID.ROOT, frClampCheckGroup)
|
||||
EgtSetName( CLAMP_CHECK_GROUP, 'CLAMP_CHECK')
|
||||
EgtSetLevel( CLAMP_CHECK_GROUP, GDB_LV.TEMP)
|
||||
EgtSetStatus( CLAMP_CHECK_GROUP, GDB_ST.OFF)
|
||||
end
|
||||
|
||||
if CLAMP_CHECK_INTERS then
|
||||
EgtEmptyGroup( CLAMP_CHECK_INTERS)
|
||||
else
|
||||
CLAMP_CHECK_INTERS = EgtGroup( GDB_ID.ROOT)
|
||||
EgtSetName( CLAMP_CHECK_INTERS, 'CLAMP_INTERS')
|
||||
EgtSetLevel( CLAMP_CHECK_INTERS, GDB_LV.TEMP)
|
||||
EgtSetStatus( CLAMP_CHECK_INTERS, GDB_ST.OFF)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -296,18 +320,24 @@ function OnSimulDispositionStart()
|
||||
local nOrd = GetPhaseOrd( EMT.PHASE)
|
||||
local nScrapOrd = GetPhaseOrd( EgtGetPhaseCount()) + 1
|
||||
local b3Raw = BBox3d()
|
||||
local b3Bar = BBox3d()
|
||||
local b3Part = BBox3d()
|
||||
local nPartRawId, nScrapRawId
|
||||
local nRawId = EgtGetFirstRawPart()
|
||||
while nRawId do
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then
|
||||
EmtLinkRawPartToGroup( nRawId, 'Tab')
|
||||
local b3Tmp = EgtGetRawPartBBox( nRawId)
|
||||
b3Bar:Add( b3Tmp)
|
||||
local nRawOrd = EgtGetInfo( nRawId, 'ORD', 'i')
|
||||
if nRawOrd == nOrd then
|
||||
b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
--b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
b3Raw:Add( b3Tmp)
|
||||
b3Part:Add( b3Tmp)
|
||||
nPartRawId = nRawId
|
||||
elseif nRawOrd == nOrd + 1 and nRawOrd == nScrapOrd then
|
||||
local b3Tmp = EgtGetRawPartBBox( nRawId) or BBox3d()
|
||||
--local b3Tmp = EgtGetRawPartBBox( nRawId) or BBox3d()
|
||||
b3Raw:Add( b3Tmp)
|
||||
nScrapRawId = nRawId
|
||||
end
|
||||
@@ -321,6 +351,9 @@ function OnSimulDispositionStart()
|
||||
else
|
||||
EMT.SCRAP = nil
|
||||
end
|
||||
EMT.LB = b3Bar:getDimX()
|
||||
EMT.LR = b3Raw:getDimX()
|
||||
EMT.LT = b3Part:getDimX()
|
||||
-- recupero CutId del pezzo in lavorazione
|
||||
EMT.CUTID = EgtGetInfo( EgtGetFirstPartInRawPart( nPartRawId or GDB_ID.NULL) or GDB_ID.NULL, 'CUTID', 'i') or 0
|
||||
EMT.YSPEC = nil
|
||||
@@ -392,6 +425,7 @@ function OnSimulDispositionStart()
|
||||
if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then
|
||||
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd then
|
||||
EmtLinkRawPartToGroup( nRawId, 'Tab')
|
||||
b3Bar = EgtGetRawPartBBox( nRawId)
|
||||
else
|
||||
EgtMove( nRawId, vtMove, GDB_RT.GLOB)
|
||||
EgtSetStatus( nRawId, GDB_ST.OFF)
|
||||
@@ -399,6 +433,8 @@ function OnSimulDispositionStart()
|
||||
end
|
||||
nRawId = nNextRawId
|
||||
end
|
||||
EMT.LB = b3Bar:getDimX()
|
||||
|
||||
-- altrimenti fase finale, aggancio primo grezzo alla tavola e gli altri in posizione carico al carro Y
|
||||
else
|
||||
-- verifico posizione di carico
|
||||
@@ -416,12 +452,14 @@ function OnSimulDispositionStart()
|
||||
nRawId = EgtGetNextRawPart( nRawId)
|
||||
end
|
||||
-- eseguo
|
||||
local b3Bar = BBox3d()
|
||||
nRawId = EgtGetFirstRawPart()
|
||||
while nRawId do
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then
|
||||
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd then
|
||||
EmtLinkRawPartToGroup( nRawId, 'Tab')
|
||||
b3Bar = EgtGetRawPartBBox( nRawId)
|
||||
else
|
||||
EgtMove( nRawId, vtMove, GDB_RT.GLOB)
|
||||
EmtLinkRawPartToGroup( nRawId, 'Y')
|
||||
@@ -429,6 +467,7 @@ function OnSimulDispositionStart()
|
||||
end
|
||||
nRawId = nNextRawId
|
||||
end
|
||||
EMT.LB = b3Bar:getDimX()
|
||||
end
|
||||
-- Indicazione angolo rotazione pezzo
|
||||
EMT.ROT = EgtGetInfo( EMT.DISPID, 'ROT', 'i') or 0
|
||||
@@ -460,6 +499,7 @@ function OnSimulDispositionEnd()
|
||||
EMT.POSTROT = true
|
||||
end
|
||||
end
|
||||
EMT.SPLIT = false
|
||||
EMT.OPEISDISP = false
|
||||
end
|
||||
|
||||
@@ -714,6 +754,7 @@ function OnSimulMachiningEnd()
|
||||
EMT.UNLOADING = false
|
||||
EMT.FALL = false
|
||||
end
|
||||
EMT.SPLIT = nil
|
||||
EMT.PREVHEAD = EMT.HEAD
|
||||
EMT.PREVTOOL = EMT.TOOL
|
||||
EMT.PREVEXIT = EMT.EXIT
|
||||
@@ -902,6 +943,8 @@ function ExecAuxCmd( sCmd)
|
||||
if Cmd[1] == '0' then
|
||||
if Cmd[2] == 'Unloading' then
|
||||
EMT.UNLOADING = true
|
||||
elseif Cmd[2] == 'Split' then
|
||||
EMT.SPLIT = true
|
||||
elseif Cmd[2] == 'Fall' then
|
||||
EMT.FALL = true
|
||||
end
|
||||
@@ -943,19 +986,9 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '11' then
|
||||
local dPY = MaxOpen
|
||||
if Cmd[2] ~= '0' then
|
||||
dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
|
||||
end
|
||||
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
|
||||
SetPYLight( Cmd[2] ~= '0')
|
||||
ExecMovePY( Cmd[2] ~= '0')
|
||||
elseif Cmd[1] == '12' then
|
||||
local dPV = MaxOpen
|
||||
if Cmd[2] ~= '0' then
|
||||
dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
|
||||
end
|
||||
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
|
||||
SetPVLight( Cmd[2] ~= '0')
|
||||
ExecMovePV( Cmd[2] ~= '0')
|
||||
elseif Cmd[1] == '21' then
|
||||
local nYDelta = tonumber( Cmd[2])
|
||||
local nVDelta = tonumber( Cmd[3])
|
||||
@@ -1064,6 +1097,176 @@ function ExecUnloading()
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function CheckClamping( sClampName)
|
||||
|
||||
local nClampId = EgtGetAxisId( sClampName) or GDB_ID.NULL
|
||||
local nClampPathId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nClampId, 'CLAMP_CHECK') or GDB_ID.NULL)
|
||||
local b3ClampingArea = EgtGetBBoxGlob( nClampPathId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- se non trovo percorso area di clamping, esco subito
|
||||
if not nClampPathId or not EMT.VMILL or not ClampingCoeffMin then
|
||||
return
|
||||
end
|
||||
|
||||
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
|
||||
local vCurveListId = {}
|
||||
local vtIntersPlane
|
||||
-- piano di interpolazione
|
||||
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.EXACT)
|
||||
local ptPosIntersPlane
|
||||
if sPosIntersPlane == 'MIN' then
|
||||
ptPosIntersPlane = b3VMill:getMin() + dDepth * vtIntersPlane
|
||||
elseif sPosIntersPlane == 'MAX' then
|
||||
ptPosIntersPlane = b3VMill:getMax() - dDepth * vtIntersPlane
|
||||
end
|
||||
local nLoopId, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
|
||||
vCurveListId = EgtTableAdd( vCurveListId, nLoopId, nLoopCnt)
|
||||
end
|
||||
|
||||
return vCurveListId
|
||||
end
|
||||
|
||||
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
|
||||
-- test piano frontale
|
||||
local vCurveListId = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
|
||||
-- si copia curva intersezione e curva pinza in gruppo di confronto
|
||||
local nFlatSurfId, nFlatSurfCnt = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, vCurveListId)
|
||||
local vFlatSurfId = EgtTableFill( nFlatSurfId, nFlatSurfCnt) or {}
|
||||
local nClampSurfId = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, nClampPathId)
|
||||
|
||||
local dTotalArea = 0
|
||||
local dTotalXLenght = 0
|
||||
for i = 1, #vFlatSurfId do
|
||||
local nTempSurfId = vFlatSurfId[i]
|
||||
EgtSurfFrIntersect( nTempSurfId, nClampSurfId)
|
||||
if nTempSurfId then
|
||||
dTotalArea = dTotalArea + ceil( EgtSurfArea( nTempSurfId) or 0)
|
||||
local b3BoxIntersectionBox = EgtGetBBoxGlob( nTempSurfId, GDB_BB.STANDARD)
|
||||
if b3BoxIntersectionBox then
|
||||
dTotalXLenght = dTotalXLenght + ceil( b3BoxIntersectionBox:getDimX()) -- somma lunghezze (x) delle aree pinzate
|
||||
end
|
||||
end
|
||||
end
|
||||
return dTotalArea, dTotalXLenght
|
||||
end
|
||||
|
||||
-- minima area considerata per un corretto pinzaggio
|
||||
DistZClampToTable = DistZClampToTable or 0
|
||||
--local MinJoin = BD.GetMinJoin( EMT.ST, EMT.HT, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
|
||||
UpdateMinJoinDeltaTol( EMT.ST, EMT.HT, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
|
||||
local MinZClamping = min( b3ClampingArea:getDimZ() + DistZClampToTable, EMT.HT) - DistZClampToTable
|
||||
local dMinClamping = ( MinJoin * MinZClamping)
|
||||
-- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio
|
||||
ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1)
|
||||
if MinZClamping > 116 then
|
||||
dMinClamping = MinJoin * 116 + ( pow( MinJoin, 2) / 2)
|
||||
if MinJoin > 280 then
|
||||
dMinClamping = MinJoin * 116 + ( pow( 280, 2) / 2) + ( pow( MinJoin - 280, 2))
|
||||
end
|
||||
end
|
||||
|
||||
local dMinClampingAreaWarn = dMinClamping * ClampingCoeffMin
|
||||
local dMinClampingAreaErr = dMinClamping * ( ClampingCoeffMin / 3)
|
||||
|
||||
local bError = true
|
||||
local sWrn, sErr
|
||||
local bWriteWarnMessage = false
|
||||
local bWriteErrMessage = false
|
||||
-- controllo faccia frontale
|
||||
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, 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)'
|
||||
bWriteErrMessage = true
|
||||
end
|
||||
end
|
||||
-- WARNING: pinza meno del minimo richiesto
|
||||
if dArea and dArea < dMinClampingAreaWarn and not bWriteErrMessage then
|
||||
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
|
||||
bWriteWarnMessage = true
|
||||
end
|
||||
EgtEmptyGroup( CLAMP_CHECK_GROUP)
|
||||
EgtEmptyGroup( CLAMP_CHECK_INTERS)
|
||||
|
||||
-- controllo altro lato solo se non sono già in errore
|
||||
if not bWriteErrMessage then
|
||||
-- controllo faccia posteriore
|
||||
dArea, dXClampedLenght = 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, 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)'
|
||||
bWriteErrMessage = true
|
||||
end
|
||||
end
|
||||
-- WARNING: pinza meno del minimo richiesto
|
||||
if dArea and dArea < dMinClampingAreaWarn and not bWriteWarnMessage and not bWriteErrMessage then
|
||||
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
|
||||
bWriteWarnMessage = true
|
||||
end
|
||||
EgtEmptyGroup( CLAMP_CHECK_GROUP)
|
||||
EgtEmptyGroup( CLAMP_CHECK_INTERS)
|
||||
end
|
||||
|
||||
if bWriteErrMessage then
|
||||
EmtSetLastError( 1213, sErr, EgtGetEnableUI())
|
||||
EgtOutBox( sErr, 'CLAMPING', 'ERROR', 'OK')
|
||||
EmtSetSimulPause()
|
||||
elseif bWriteWarnMessage then
|
||||
EgtOutLog( sWrn)
|
||||
EgtOutBox( sWrn, 'CLAMPING', 'WARNING', 'OK')
|
||||
EmtSetSimulPause()
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY( bClose)
|
||||
--SimulMoveAxes( 'PY', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
local dPY = MaxOpen
|
||||
if bClose then
|
||||
dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
|
||||
end
|
||||
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
|
||||
SetPYLight( bClose)
|
||||
if bClose then
|
||||
CheckClamping( 'PY')
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePV( bClose)
|
||||
--EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
local dPV = MaxOpen
|
||||
if bClose then
|
||||
dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
|
||||
end
|
||||
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
|
||||
SetPVLight( bClose)
|
||||
if bClose then
|
||||
CheckClamping( 'PV')
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyYSlide( sName1, dVal1, sName2, dVal2)
|
||||
-- Se movimento trave agganciata con carrello Y
|
||||
|
||||
+2
-60
@@ -31,20 +31,9 @@ end
|
||||
|
||||
---------- OnSpecialApplyDisposition & OnPostApplyMachining ---------
|
||||
----------------------- Costanti ------------------------------------
|
||||
local DELTA_TOL_V = 110
|
||||
local DELTA_TOL_S = 210
|
||||
local DELTA_TOL_L = 410
|
||||
local DELTA_TOL_FIXED = 50
|
||||
local DeltaTol = DELTA_TOL_S
|
||||
local DELTA_SIC = 1
|
||||
local AGG_LOAD = 50
|
||||
local MIN_JOIN_VV = EgtClamp( MinJoinVV or 75, 60, 150)
|
||||
local MIN_JOIN_SS = EgtClamp( MinJoinSS or 100, 80, 275)
|
||||
local MIN_JOIN_LS = EgtClamp( MinJoinLS or 290, 250, 400)
|
||||
local MIN_JOIN_SL = EgtClamp( MinJoinSL or 100, 80, 400)
|
||||
local MIN_JOIN_LL = EgtClamp( MinJoinLL or 400, 300, 600)
|
||||
local MinJoin = MIN_JOIN_SS
|
||||
local MinOther = abs( MinY) + abs( MaxV) + MinJoin
|
||||
|
||||
----------------------- Variabili -----------------------------------
|
||||
local Test = false
|
||||
@@ -153,53 +142,6 @@ local function IsFirstMachiningAfterRotation( nMchId)
|
||||
return ( nRot ~= nPrevRot)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function UpdateMinJoinDeltaTol()
|
||||
local L_SMALL = 800
|
||||
local H_V = 90
|
||||
local H_S = 200
|
||||
local H_L = 400
|
||||
local W_V = 90
|
||||
local W_S = 150
|
||||
local W_L = 250
|
||||
if EMC.SB <= W_V and EMC.HB <= H_V then
|
||||
MinJoin = MIN_JOIN_VV
|
||||
DeltaTol = DELTA_TOL_V
|
||||
elseif EMC.LB <= L_SMALL then
|
||||
MinJoin = MIN_JOIN_SS
|
||||
DeltaTol = DELTA_TOL_S
|
||||
else
|
||||
local dMinJoinS
|
||||
local dMinJoinL
|
||||
if EMC.SB <= W_S then
|
||||
dMinJoinS = MIN_JOIN_SS
|
||||
dMinJoinL = MIN_JOIN_LS
|
||||
elseif EMC.SB <= W_L then
|
||||
local Coeff = ( EMC.SB - W_S) / ( W_L - W_S)
|
||||
dMinJoinS = ( 1 - Coeff) * MIN_JOIN_SS + Coeff * MIN_JOIN_SL
|
||||
dMinJoinL = ( 1 - Coeff) * MIN_JOIN_LS + Coeff * MIN_JOIN_LL
|
||||
else
|
||||
dMinJoinS = MIN_JOIN_SL
|
||||
dMinJoinL = MIN_JOIN_LL
|
||||
end
|
||||
if EMC.HB <= H_S then
|
||||
MinJoin = dMinJoinS
|
||||
DeltaTol = DELTA_TOL_S
|
||||
elseif EMC.HB <= H_L then
|
||||
local Coeff = ( EMC.HB - H_S) / ( H_L - H_S)
|
||||
MinJoin = ( 1 - Coeff) * dMinJoinS + Coeff * dMinJoinL
|
||||
DeltaTol = ( 1 - Coeff) * DELTA_TOL_S + Coeff * DELTA_TOL_L
|
||||
else
|
||||
MinJoin = dMinJoinL
|
||||
DeltaTol = DELTA_TOL_L
|
||||
end
|
||||
if EMC.SB < W_V then
|
||||
DeltaTol = DELTA_TOL_V
|
||||
end
|
||||
end
|
||||
MinOther = abs( MinY) + abs( MaxV) + MinJoin
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetCUTID()
|
||||
-- recupero CUTID del pezzo in lavoro
|
||||
@@ -367,7 +309,7 @@ function OnSpecialApplyDisposition()
|
||||
EMC.ZMIN = b3Raw:getMin():getZ()
|
||||
|
||||
-- Aggiorno limiti di presa e tolleranza
|
||||
UpdateMinJoinDeltaTol()
|
||||
UpdateMinJoinDeltaTol( EMC.SB, EMC.HB, EMC.LB)
|
||||
|
||||
-- Assegno sovramateriale di testa e ingombro tagli di testa e di coda
|
||||
EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0
|
||||
@@ -656,7 +598,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
|
||||
EMC.ZMIN = b3Raw:getMin():getZ()
|
||||
|
||||
-- Aggiorno limiti di presa e tolleranza
|
||||
UpdateMinJoinDeltaTol()
|
||||
UpdateMinJoinDeltaTol( EMC.SB, EMC.HB, EMC.LB)
|
||||
|
||||
-- Recupero sovramateriale di testa e ingombro tagli di testa e di coda
|
||||
EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0
|
||||
|
||||
+74
-10
@@ -24,10 +24,10 @@
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.7l3'
|
||||
PP_NVER = '2.7.12.3'
|
||||
PP_VER = '3.1a2'
|
||||
PP_NVER = '3.1.1.2'
|
||||
MIN_MACH_VER = '2.7j1'
|
||||
MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio
|
||||
MACH_NAME = EgtGetCurrMachineName()
|
||||
|
||||
-- Carico i dati globali
|
||||
local sMachDir = EgtGetCurrMachineDir()
|
||||
@@ -92,6 +92,13 @@ SafeXRotAxes = 150
|
||||
AggreBlockHaus = false
|
||||
SecondToolChanger = false
|
||||
EstimationRapidMultiplier = 1
|
||||
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
|
||||
ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
|
||||
MinJoinVV = 75
|
||||
MinJoinSS = 100
|
||||
MinJoinLS = 290
|
||||
MinJoinSL = 100
|
||||
MinJoinLL = 400
|
||||
|
||||
-- costanti dimensioni utensili
|
||||
LONG_TOOL_MINLEN = 221
|
||||
@@ -157,11 +164,11 @@ if EgtExistsFile( sData) then
|
||||
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
|
||||
if Machine.Offsets.DEFTCPOS then DefTcPos = ( 'T' .. Machine.Offsets.DEFTCPOS) end
|
||||
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
|
||||
if Machine.Offsets.MIN_JOIN_VV then MinJoinVV = Machine.Offsets.MIN_JOIN_VV end
|
||||
if Machine.Offsets.MIN_JOIN_SS then MinJoinSS = Machine.Offsets.MIN_JOIN_SS end
|
||||
if Machine.Offsets.MIN_JOIN_LS then MinJoinLS = Machine.Offsets.MIN_JOIN_LS end
|
||||
if Machine.Offsets.MIN_JOIN_SL then MinJoinSL = Machine.Offsets.MIN_JOIN_SL end
|
||||
if Machine.Offsets.MIN_JOIN_LL then MinJoinLL = Machine.Offsets.MIN_JOIN_LL end
|
||||
if Machine.Offsets.MIN_JOIN_VV then MinJoinVV = EgtClamp( Machine.Offsets.MIN_JOIN_VV, 60, 150) end
|
||||
if Machine.Offsets.MIN_JOIN_SS then MinJoinSS = EgtClamp( Machine.Offsets.MIN_JOIN_SS, 80, 275) end
|
||||
if Machine.Offsets.MIN_JOIN_LS then MinJoinLS = EgtClamp( Machine.Offsets.MIN_JOIN_LS, 250, 400) end
|
||||
if Machine.Offsets.MIN_JOIN_SL then MinJoinSL = EgtClamp( Machine.Offsets.MIN_JOIN_SL, 80, 400) end
|
||||
if Machine.Offsets.MIN_JOIN_LL then MinJoinLL = EgtClamp( Machine.Offsets.MIN_JOIN_LL, 300, 600) end
|
||||
if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
|
||||
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
|
||||
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end
|
||||
@@ -170,10 +177,15 @@ if EgtExistsFile( sData) then
|
||||
if Machine.Offsets.SEC_TC then SecondToolChanger = ( Machine.Offsets.SEC_TC == 1) end
|
||||
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
|
||||
if Machine.Offsets.MAX_HEIGHT_ROT_B_ABOVE then BeamHeightForFixRot = Machine.Offsets.MAX_HEIGHT_ROT_B_ABOVE end
|
||||
if Machine.Offsets.COEFF_CLAMP_CHECK then ClampingCoeffMin = Machine.Offsets.COEFF_CLAMP_CHECK end
|
||||
end
|
||||
end
|
||||
end
|
||||
if SpecialBH then SecondSupport = 0 end
|
||||
-- Aggiorno valori MinJoin
|
||||
MinJoin = MinJoinSS
|
||||
MinOther = abs( MinY) + abs( MaxV) + MinJoin
|
||||
DeltaTol = 210
|
||||
|
||||
-- compongo i gruppi appartenenti alla base
|
||||
local sBaseAux = {'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}
|
||||
@@ -378,7 +390,7 @@ local PYId = EmtAxis {
|
||||
Stroke = { 0, MaxOpen},
|
||||
Home = MaxOpen,
|
||||
Geo = 'PY_AXIS/GEO',
|
||||
Aux = {'PY_AXIS/SOLID', 'PY_AXIS/COLLISION'}}
|
||||
Aux = {'PY_AXIS/SOLID', 'PY_AXIS/COLLISION', 'PY_AXIS/CLAMP_CHECK'}}
|
||||
local VId = EmtAxis {
|
||||
Name = 'V',
|
||||
Parent = 'Base',
|
||||
@@ -398,7 +410,7 @@ local PVId = EmtAxis {
|
||||
Stroke = { 0, MaxOpen},
|
||||
Home = MaxOpen,
|
||||
Geo = 'PV_AXIS/GEO',
|
||||
Aux = {'PV_AXIS/SOLID', 'PV_AXIS/COLLISION'}}
|
||||
Aux = {'PV_AXIS/SOLID', 'PV_AXIS/COLLISION', 'PV_AXIS/CLAMP_CHECK'}}
|
||||
EmtAxis {
|
||||
Name = 'T',
|
||||
Parent = 'Base',
|
||||
@@ -648,10 +660,12 @@ EgtMove( EgtGetFirstNameInGroup( YId, 'SOLID'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( YId, 'COLLISION'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( PYId, 'SOLID'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( PYId, 'COLLISION'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( PYId, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( VId, 'SOLID'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( VId, 'COLLISION'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( PVId, 'SOLID'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( PVId, 'COLLISION'), vtMove, GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( PVId, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
|
||||
EgtMove( EgtGetFirstNameInGroup( XId, 'SOLID'), vtMoveX, GDB_RT.GLOB)
|
||||
|
||||
-- Assegno identificativi alle spie delle morse
|
||||
@@ -797,3 +811,53 @@ function OnResetMachine()
|
||||
end
|
||||
EgtSetStatus( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill') or GDB_ID.NULL, GDB_ST.OFF)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function UpdateMinJoinDeltaTol( SB, HB, LB)
|
||||
local L_SMALL = 800
|
||||
local H_V = 90
|
||||
local H_S = 200
|
||||
local H_L = 400
|
||||
local W_V = 90
|
||||
local W_S = 150
|
||||
local W_L = 250
|
||||
local DELTA_TOL_S = 210
|
||||
local DELTA_TOL_V = 110
|
||||
local DELTA_TOL_L = 410
|
||||
if SB <= W_V and HB <= H_V then
|
||||
MinJoin = MinJoinVV
|
||||
DeltaTol = DELTA_TOL_V
|
||||
elseif LB <= L_SMALL then
|
||||
MinJoin = MinJoinSS
|
||||
DeltaTol = DELTA_TOL_S
|
||||
else
|
||||
local dMinJoinS
|
||||
local dMinJoinL
|
||||
if SB <= W_S then
|
||||
dMinJoinS = MinJoinSS
|
||||
dMinJoinL = MinJoinLS
|
||||
elseif SB <= W_L then
|
||||
local Coeff = ( SB - W_S) / ( W_L - W_S)
|
||||
dMinJoinS = ( 1 - Coeff) * MinJoinSS + Coeff * MinJoinSL
|
||||
dMinJoinL = ( 1 - Coeff) * MinJoinLS + Coeff * MinJoinLL
|
||||
else
|
||||
dMinJoinS = MinJoinSL
|
||||
dMinJoinL = MinJoinLL
|
||||
end
|
||||
if HB <= H_S then
|
||||
MinJoin = dMinJoinS
|
||||
DeltaTol = DELTA_TOL_S
|
||||
elseif HB <= H_L then
|
||||
local Coeff = ( HB - H_S) / ( H_L - H_S)
|
||||
MinJoin = ( 1 - Coeff) * dMinJoinS + Coeff * dMinJoinL
|
||||
DeltaTol = ( 1 - Coeff) * DELTA_TOL_S + Coeff * DELTA_TOL_L
|
||||
else
|
||||
MinJoin = dMinJoinL
|
||||
DeltaTol = DELTA_TOL_L
|
||||
end
|
||||
if SB < W_V then
|
||||
DeltaTol = DELTA_TOL_V
|
||||
end
|
||||
end
|
||||
MinOther = abs( MinY) + abs( MaxV) + MinJoin
|
||||
end
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,20 @@
|
||||
==== Common_FAST Update Log ====
|
||||
|
||||
Versione 3.1a2 (26/01/2026)
|
||||
- (GEN) Nella G101 il parametro EE era sempre a 4 perchè la variabile veniva settata dopo. Ticket#2796
|
||||
|
||||
Versione 3.1a1 (08/01/2026)
|
||||
- (SIM) Ottimizzata scrittura funzione ClampCheck post aggiornamento dll
|
||||
- (SIM) Corretto problema della funzione OnSimulDispositionStart in caso di fase finale.
|
||||
- (MLDE-SIM-GEN) Variabile DeltaTol deve essere spostata in MLDE
|
||||
|
||||
Versione 2.7l3 (22/12/2025)
|
||||
- (SIM) Eliminata MinJoin, utilizzata al suo posto funzione già esistente UpdateMinJoin nell'mlde
|
||||
- (SIM) Modificata formula calcolo Area minima
|
||||
|
||||
Versione 2.7l2 (18/12/2025)
|
||||
- (SIM) Aggiunta funzione CheckClamping
|
||||
|
||||
Versione 2.7l1 (10/12/2025)
|
||||
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
|
||||
- (EST) Modifiche a calcolo stima tempi, da verificare.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_FAST', -- nome script PP standard
|
||||
VERSION = '2.7l1', -- versione script
|
||||
VERSION = '3.1a2', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user