Compare commits

..

11 Commits

Author SHA1 Message Date
andrea.villa 5a0344dc5d Merge remote-tracking branch 'origin/main' into NewLink 2025-11-19 08:22:19 +01:00
andrea.villa 9ee74ac85d Aggiunto presenza lama su TC1 2025-11-18 16:47:25 +01:00
andrea.villa e531a137bd Quota home per testa 1 settata al massimo della Z. 2025-09-08 12:40:14 +02:00
andrea.villa b0de62890f Merge remote-tracking branch 'origin/main' into NewLink 2025-09-08 10:46:20 +02:00
andrea.villa 7e926f00bf Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto 2025-08-26 08:33:34 +02:00
andrea.villa c9d73227a3 Merge remote-tracking branch 'origin/main' into NewLink 2025-08-21 18:00:47 +02:00
andrea.villa c323605e9e Gestione accelerazioni in calcolo tempi 2025-08-21 17:53:09 +02:00
andrea.villa 236480d2d8 Merge remote-tracking branch 'origin/main' into NewLink 2025-08-20 16:50:00 +02:00
andrea.villa 94c0729630 Tavola portata a 34m 2025-08-20 16:48:17 +02:00
andrea.villa b96009933a - La funzione MoveToZMax non è più chiamata
- Se chiusura rulli, si prepara la tabella per poi chiamare la OnSpecialLink
2025-07-24 12:49:37 +02:00
andrea.villa 689fab0c05 Prima versione nuovi link di collegamento per lavorazioni 2025-07-16 12:26:53 +02:00
11 changed files with 736 additions and 1092 deletions
-2
View File
@@ -42,7 +42,6 @@ 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
@@ -114,7 +113,6 @@ 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
BeamData.MAX_ANGLE_DRILL_CUT = Machine.Offsets.MAX_ANGLE_DRILL_CUT or BeamData.MAX_ANGLE_DRILL_CUT
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
end
+1
View File
@@ -50,6 +50,7 @@
33=AntiSplintMillCut_H2
34=SideMillAsBlade
35=SideMillAsBlade_H2
36=Prof_end
[Pocketing]
1=Pocket
+326 -597
View File
File diff suppressed because it is too large Load Diff
+73 -235
View File
@@ -79,14 +79,6 @@ 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)
@@ -257,7 +249,7 @@ function OnSimulDispositionStart()
-- determino la risoluzione dello Zmap
local dTol = 4.71
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.71)
else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then
@@ -274,7 +266,6 @@ 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
@@ -881,7 +872,9 @@ function OnSimulMachiningStart()
end
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
if not IsNewLinkHead( EMT.HEAD) then
EMT.MCHFIRST = true
end
end
---------------------------------------------------------------------
@@ -946,7 +939,7 @@ function OnSimulPathEnd()
EMT.Y1DELTA = nil
ExecMovePY1( false)
end
ExecMoveZmax( EMT.MCHSPLIT)
-- ExecMoveZmax( EMT.MCHSPLIT)
EMT.TO_ZMAX = nil
end
end
@@ -969,7 +962,7 @@ function OnSimulPathEndAux()
ExecAuxCmd( EMT.AUX, false)
-- se ultimo comando e richiesta risalita a Zmax
if EMT.AUXIND == EMT.AUXTOT and EMT.TO_ZMAX then
ExecMoveZmax( EMT.MCHSPLIT)
-- ExecMoveZmax( EMT.MCHSPLIT)
EMT.TO_ZMAX = nil
end
end
@@ -977,6 +970,8 @@ end
---------------------------------------------------------------------
function OnSimulMoveStart()
if EMT.MCHFIRST then EgtOutText( '') end
-- recupero eventuali flag da Info del movimento
local bSplit = EgtGetInfo( EMT.MOVEID, 'Split', 'b')
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
-- Posizioni correnti
@@ -993,7 +988,7 @@ function OnSimulMoveStart()
EMT.A1 = EMT.L1 + EMT.Y1DELTA
else
EMT.A1m = nil
EMT.A1 = EgtIf( EMT.Y1SPEC, EgtGetAxisPos( 'Y1'), ParkY1)
EMT.A1 = EgtIf( EMT.Y1SPEC or Y1Pos > ParkY1, Y1Pos, ParkY1)
end
EMT.A2n = 'Y2'
if EMT.Y2DELTA then
@@ -1003,8 +998,9 @@ function OnSimulMoveStart()
EMT.A2m = nil
EMT.A2 = ParkY2
end
-- Controllo scorrimento pinze chiuse Y1 e Y2
if EMT.Y1DELTA then
if EMT.Y1DELTA and ( EMT.MOVE ~= 0 or ( EMT.MASK & 1) == 1) then
local dY1DeltaP = Y1Pos - EMT.L1p
if abs( EMT.Y1DELTA - dY1DeltaP) > 0.1 then
EMT.ERR = 2
@@ -1012,7 +1008,7 @@ function OnSimulMoveStart()
EmtSetLastError( 1202, sErr)
end
end
if EMT.Y2DELTA then
if EMT.Y2DELTA and ( EMT.MOVE ~= 0 or ( EMT.MASK & 1) == 1) then
local dY2DeltaP = Y2Pos - EMT.L1p
if abs( EMT.Y2DELTA - dY2DeltaP) > 0.1 then
EMT.ERR = 2
@@ -1020,13 +1016,14 @@ function OnSimulMoveStart()
EmtSetLastError( 1202, sErr)
end
end
-- rulli
EMT.A3n = 'V1'
EMT.A3 = EgtIf( GetV1ToClose(), EMT.V1NEXTPOS, ParkV1)
EMT.A4n = 'V2'
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
local bParkV = false
if EMT.MCHFIRST then
if EMT.MCHFIRST or ( EMT.MOVE == 0 and IsNewLinkHead( EMT.HEAD)) then
-- se rulli più chiusi del richiesto o cambio direzione utensile (tranne solo asse B con C0 o equivalenti) devo mettere i rulli in parcheggio
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) then
bParkV = true
@@ -1034,6 +1031,12 @@ function OnSimulMoveStart()
EMT.A4 = ParkV2
end
end
local bNlhParkV = ( EMT.MOVE == 0 and IsNewLinkHead( EMT.HEAD) and ( EMT.FLAG2 == 1 or EMT.FLAG2 == 2))
if bNlhParkV then
bParkV = ( EMT.FLAG == 2 and bParkV) or ( not EMT.MCHSPLIT or bSplit)
EMT.A3 = ParkV1
EMT.A4 = ParkV2
end
-- Controllo corse assi ausiliari
VerifyY1Stroke( EMT.A1)
VerifyY2Stroke( EMT.A2)
@@ -1042,186 +1045,17 @@ function OnSimulMoveStart()
-- se devo subito parcheggiare i rulli
local nRes = 0
if bParkV then
local bMchSplit = ( bNlhParkV and EMT.MCHSPLIT and bSplit)
local bAgg = EgtExistsInfo( EMT.PATHID, 'CNT')
nRes = ExecParkRoller( Y1Pos, Y2Pos, V1Pos, V2Pos, false, bAgg)
end
-- se movimento in rapido
if EMT.MOVE == 0 then
-- se testa 1
if nSetHead == 1 then
-- Dati
local B1Pos = EgtGetAxisPos( 'B1')
local B1Home = EgtGetAxisHomePos( 'B1')
local C1Pos = EgtGetAxisPos( 'C1')
local C1Home = EgtGetAxisHomePos( 'C1')
local Z1Pos = EgtGetAxisPos( 'Z1')
local Z1Home = EgtGetAxisHomePos( 'Z1')
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- se fresa o lama
if EMT.HEAD ~= 'H13' then
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local bXSpec = EgtIf( BD.RIGHT_LOAD, EMT.L2 < DeltaTabY, EMT.L2 > DeltaTabY)
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( C1Pos - EMT.R1) > 1 or abs( B1Pos - EMT.R2) > 1) and ( abs( C1Home - EMT.R1) > 30.1 or abs( B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
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)
-- 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
if WriteAllCoordsOnFirstM101 then
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
end
-- se ero in posizione speciale, prima ruoto poi scendo
if bXSpec then
local dZPos = max( Z1Home, EMT.L3)
SimulMoveAxis( 'Z1', dZPos, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
if abs( dZPos - EMT.L3) > 1 then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
else
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
end
-- altrimenti sega a catena
else
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
-- Porto la Z alla giusta quota
if Z1Pos > dSafeZ1 + 1 and abs( B1Pos) > 89.9 then
SimulMoveAxis( 'X1', EMT.L2, 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
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)
end
end
end
-- se altrimenti testa 2
elseif nSetHead == 2 then
local B2Home = EgtGetAxisHomePos( 'B2')
local C2Home = EgtGetAxisHomePos( 'C2')
local Z2Home = EgtGetAxisHomePos( 'Z2')
local X2Home = EgtGetAxisHomePos( 'X2')
local X2Pos = EgtGetAxisPos( 'X2')
local B2Pos = EgtGetAxisPos( 'B2')
local C2Pos = EgtGetAxisPos( 'C2')
-- calcolo posizione reale
EMT.TCPOSREAL = 'T' .. AdjustTcPos( false, EMT.TCPOS, EMT.R3)
-- se utensile cambiato (controllo il reale perchè per aggregato dipende come è stato caricato)
if EMT.PREVTCPOSREAL_H2 ~= EMT.TCPOSREAL then
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
if EMT.HEAD == 'H22' then
SimulMoveAxes( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID, 'B2', 0, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
X2Pos = ParkSawX2
else
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
X2Pos = SafeX2
end
else
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
X2Pos = ParkSawX2
else
SimulMoveAxis( 'X2', SafeX2, MCH_SIM_STEP.RAPID)
X2Pos = SafeX2
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
-- Porto la X alla giusta quota
if X2Pos > SafeX2RotAxis and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', SafeX2RotAxis, MCH_SIM_STEP.RAPID)
end
end
else
-- solo se è macchina a 3 teste con gruppo truciolatore 4 assi, devo andare prima in Z0
if EgtGetHeadId( 'H39') then
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
end
-- Porto la X alla giusta quota
if EMT.ZMAX and X2Pos > SafeX2RotAxis and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', SafeX2RotAxis, MCH_SIM_STEP.RAPID)
end
end
if EMT.HEAD == 'H22' then
SimulMoveAxes( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- se ero a ZMAX, mi sposto in posizione a Z home. Ultimo movimento muove in Z
if EMT.ZMAX then
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- altrimenti testa 3
else
-- testa 4 assi dedicata truciolatore
if EgtGetHeadId( 'H39') then
if EMT.ZMAX then
local MaxZ3 = EgtGetAxisMax( 'Z3')
SimulMoveAxes( 'X3', EMT.L2, MCH_SIM_STEP.RAPID, 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
-- testa 5 assi dedicata lama
elseif EgtGetHeadId( 'H38') then
if EMT.ZMAX then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
if ( EMT.L3 - SafeZ3RotAxis) > 100 * GEO.EPS_SMALL then
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'X3', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
-- si muovono tutti gli assi assieme
-- altre configurazioni
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
nRes = ExecParkRoller( Y1Pos, Y2Pos, V1Pos, V2Pos, bMchSplit, bAgg)
end
-- se lavorazione split, muovo per riaggancio del carro Y1
if EMT.SPLIT_Y1DELTA then
if EMT.SPLIT_Y1DELTA and ( not IsNewLinkHead( EMT.HEAD) or IsL1Enabled( EMT.MASK)) then
EMT.Y1DELTA = EMT.SPLIT_Y1DELTA
EMT.A1 = EMT.L1 + EMT.Y1DELTA
end
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
if EMT.MOVE == 0 and EMT.FLAG == 3 and not IsNewLinkHead( EMT.HEAD) then
-- demando movimento completo a MoveEnd
EMT.EnabAxes = false
EMT.ShowAxes = true
@@ -1302,16 +1136,10 @@ 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 ...
if EMT.MCHFIRST and EMT.EnabAxes ~= false then
if ( EMT.MCHFIRST or ( EMT.MOVE == 0 and IsNewLinkHead( EMT.HEAD))) and EMT.EnabAxes ~= false then
if nSetHead == 1 then
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID,
'Z1', EMT.L3, MCH_SIM_STEP.RAPID,
@@ -1328,20 +1156,19 @@ function OnSimulMoveStart()
'Z2', EMT.L3, MCH_SIM_STEP.RAPID,
'C2', EMT.R1, MCH_SIM_STEP.COLLROT,
'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
else
elseif not IsNewLinkHead( EMT.HEAD) or ( bParkV and not bNlhParkV) then
SimulMoveAxes( 'X3', EMT.L2, MCH_SIM_STEP.RAPID,
'Z3', EMT.L3, MCH_SIM_STEP.RAPID,
'C3', EMT.R1, MCH_SIM_STEP.COLLROT,
'B3', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
if nRes ~= 0 then
if nRes ~= 0 and not bNlhParkV then
EMT.A3 = EgtIf( GetV1ToClose(), EMT.V1NEXTPOS, ParkV1)
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
end
EMT.ZMAX = nil
EMT.TO_ZMAX = nil
-- se aggregato flottante su inizio attacco va compresso
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
-- recupero lunghezza
@@ -1364,7 +1191,7 @@ function OnSimulMoveEnd()
ExecRemoveScraps()
end
-- se primo rapido della lavorazione
if EMT.MCHFIRST and EMT.MOVE == 0 then
if EMT.MOVE == 0 and ( EMT.MCHFIRST or ( IsNewLinkHead( EMT.HEAD) and IsL1Enabled( EMT.MASK))) then
-- se lavorazione split, dichiaro carro Y1 riagganciato
if EMT.SPLIT_Y1DELTA then
EMT.SPLIT_Y1DELTA = nil
@@ -1400,18 +1227,17 @@ function OnSimulMoveEnd()
end
end
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
if EMT.MOVE == 0 and EMT.FLAG == 3 and not IsNewLinkHead( EMT.HEAD) then
-- eventuale rimozione sfridi
ExecRemoveScraps()
-- ricavo prossimo utensile
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) or EMT.HEAD == 'H38' or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
--ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
EMT.TO_ZMAX = nil
end
-- se utensile flottante e movimento di compressione
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
@@ -1615,8 +1441,8 @@ end
---------------------------------------------------------------------
function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit, true)
-- se testa sotto e macchina a 3 teste
-- ExecMoveZmax( bMchSplit, true)
-- se testa sotto e macchina a 3 teste e gruppo truciolatore a 4 assi
if GetHeadSet( EMT.HEAD) == 2 and IsHeadExisting( 3) then
if not SimulMoveAxis( 'X2', EgtIf( EMT.HEAD == 'H22', SafeX2, ParkX2), MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
@@ -1624,7 +1450,7 @@ function ExecMoveHome( bNearV, bMchSplit)
-- se gruppo truciolatore a 4 assi
if EgtGetHeadId( 'H39') then
if not SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : Z2')
EgtOutLog( 'Error on MoveHome : Z2')
end
end
end
@@ -1756,7 +1582,7 @@ function ExecUnloading()
-- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 1600, -1600), 0)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 1900, -1900), 0)
if EMT.FALL then vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 3200, -2600), -1150) end
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
@@ -1803,25 +1629,23 @@ function CheckClamping( sClampName)
return
end
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, vtOffset)
local idCurveList = {}
local vtIntersPlane
-- piano di interpolazione
if sIntersPlane == 'X' then
vtIntersPlane = X_AX()
elseif sIntersPlane == 'Y' then
if 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 b3VMill = EgtGetBBoxGlob( EMT.VMILL[i], GDB_BB.STANDARD)
local ptPosIntersPlane
if sPosIntersPlane == 'MIN' then
ptPosIntersPlane = b3VMill:getMin() + dDepth * vtIntersPlane
ptPosIntersPlane = b3VMill:getMin() + vtOffset
elseif sPosIntersPlane == 'MAX' then
ptPosIntersPlane = b3VMill:getMax() - dDepth * vtIntersPlane
ptPosIntersPlane = b3VMill:getMax() + vtOffset
end
local idLoop, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
@@ -1836,36 +1660,31 @@ function CheckClamping( sClampName)
return idCurveList
end
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, vtOffset)
-- test piano frontale
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, vtOffset)
-- 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, dTotalXLenght
return dTotalArea
end
return 0
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
local MinJoin = BD.GetMinJoin( EMT.HB, EMT.SB, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinJoin = BD.GetMinJoin( EMT.SB, EMT.HB, 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)
@@ -1877,12 +1696,15 @@ function CheckClamping( sClampName)
local bWriteWarnMessage = false
local bWriteErrMessage = false
-- controllo faccia frontale
local dArea, dXClampedLenght = CalculateIntersectionArea( 'MIN', 'Y', 3)
local dArea = CalculateIntersectionArea( 'MIN', 'Y', Vector3d( 0, 1, 0))
-- 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
-- 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
end
-- pinzaggio non fattibile, errore
if bError then
@@ -1901,13 +1723,16 @@ function CheckClamping( sClampName)
-- controllo altro lato solo se non sono già in errore
if not bWriteErrMessage then
-- controllo faccia posteriore
dArea = CalculateIntersectionArea( 'MAX', 'Y', 3)
dArea = CalculateIntersectionArea( 'MAX', 'Y', Vector3d( 0, -1, 0))
-- 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
-- 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
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
@@ -2001,6 +1826,8 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
EMT.ERR = 2
EmtSetLastError( 1202, 'Error on MoveAxes in ParkRoller (12A)')
end
EMT.Y1DELTA = nil
EMT.Y1SPEC = true
return 32
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EMT.ERR = 2
@@ -2382,6 +2209,17 @@ function LoadFirstTool( nHSet, sTcPosDef)
return sTool
end
---------------------------------------------------------------------
function IsNewLinkHead( sHead)
--return ( sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H14' or sHead == 'H16' or sHead == 'H38')
return true
end
---------------------------------------------------------------------
function IsL1Enabled( nMask)
return ( ( nMask & 1) ~= 0)
end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
+309 -209
View File
@@ -1,4 +1,4 @@
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/04/09
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2025/08/25
-- Intestazioni
require( 'EmtGenerator')
@@ -17,33 +17,6 @@ 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
@@ -53,208 +26,273 @@ function OnSpecialGetPrevMachiningOffset()
if IsStartOrRestPhase( EMC.CURRPHASE) then
-- recupero la posizione finale della lavorazione precedente
local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID)
-- 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
-- la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
end
---------------------------------------------------------------------
-- *** Special Z moves ***
-- *** Special Link moves ***
---------------------------------------------------------------------
---------------------- OnSpecialGetMaxZ -----------------------------
local function CalcExtraZ( vtTp, vtT, vMZ)
-- la tabella deve esistere ed essere non vuota
if not vMZ or #vMZ == 0 then return 0 end
-- componente Z di riferimento è la minima
local vtTz = min( vtTp:getZ(), vtT:getZ())
-- se oltre il massimo
if vtTz > vMZ[1].Tz then return vMZ[1].Ez end
-- interpolo
for i = 2, #vMZ do
if vtTz > vMZ[i].Tz then
local dCoeff = ( vtTz - vMZ[i-1].Tz) / ( vMZ[i].Tz - vMZ[i-1].Tz)
return (( 1 - dCoeff) * vMZ[i-1].Ez + dCoeff * vMZ[i].Ez)
end
-----------------------------------------------------------------------------------------
local function IsPrevSplit()
local sPrevUserNotes = ''
if EMC.LINKTYPE == 2 then
sPrevUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
elseif EMC.LINKTYPE == 3 then
EgtSetCurrMachining( EMC.PREVMCHID)
sPrevUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
EgtSetCurrMachining( EMC.NEXTMCHID)
end
-- sotto il minimo
return 0
return ( sPrevUserNotes:find( 'Split;', 1, true) ~= nil)
end
---------------------------------------------------------------------
function OnSpecialGetMaxZ()
-- Inizializzazioni
EMC.ERR = 0
-- Gestione speciale per sega a catena
if EMC.HEAD == 'H13' then
EMC.MAXZ = EgtGetAxisHomePos( 'Z1')
return
end
-- Sistemazione dati di input
local vtTp = Vector3d( EMC.TDIRp)
local bFromZmax = false
-- recupero il gruppo
local nSetHead = GetHeadSet( EMC.HEAD)
if vtTp:isSmall() then
vtTp = X_AX()
bFromZmax = true
if nSetHead == 1 then
EMC.R1p = ParkC1
EMC.R2p = ParkB1
elseif nSetHead == 2 then
EMC.R1p = ParkC2
EMC.R2p = ParkB2
elseif nSetHead == 3 then
EMC.R1p = ParkC3
EMC.R2p = ParkB3
-----------------------------------------------------------------------------------------
local function GetActiveRawBBox()
local b3Raw = BBox3d()
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtVerifyRawPartPhase( nRawId, EMC.PHASE) then
b3Raw = EgtGetRawPartBBox( nRawId)
break
end
nRawId = EgtGetNextRawPart( nRawId)
end
local vtT = Vector3d( EMC.TDIR)
local vtTpZm = EgtIf( bFromZmax, vtT, vtTp)
local bBSameSign = (( EMC.R2p < 10 and EMC.R2 < 10) or ( EMC.R2p > -10 and EMC.R2 > -10))
return b3Raw
end
-- Calcolo in funzione della testa e dei parametri
-----------------------------------------------------------------------------------------
function OnSpecialLink()
-- se fresa su testa 1
if EMC.HEAD == 'H11' then
if bBSameSign and vtTp:getX() > -0.1 and vtT:getX() > -0.1 then
EMC.MAXZ = MaxZ1
else
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
elseif vtTp:getZ() > 0.5 or vtT:getZ() > 0.5 then
EMC.MAXZ = ParkZ1 + 100
else
EMC.MAXZ = ParkZ1 + 1
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
elseif bBSameSign and EMC.R1p > 29.9 and EMC.R1p < 180.1 and EMC.R1 > 29.9 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and EMC.R1p > -0.1 and EMC.R1p < 180.1 and EMC.R1 > -0.1 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
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=60}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H16' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
elseif vtTp:getZ() > 0.5 or vtT:getZ() > 0.5 then
EMC.MAXZ = ParkZ1 + 100
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1)
else
EMC.MAXZ = ParkZ1 + 1
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2)
end
elseif bBSameSign and EMC.R1p > 29.9 and EMC.R1p < 180.1 and EMC.R1 > 29.9 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and EMC.R1p > -0.1 and EMC.R1p < 180.1 and EMC.R1 > -0.1 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
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)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1, 'LastRapid=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
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)
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, MaxZ1, EMC.R1p, 0}, 30, 3, 1)
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, MaxZ1, EMC.R1, 0}, 30, 2, 1)
end
end
elseif EMC.HEAD == 'H21' then
if bBSameSign and vtTp:getX() > -0.1 and vtT:getX() > -0.1 then
EMC.MAXZ = MaxZ2
else
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}}
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H38' then
EMC.MAXZ = SafeZ3RotAxis
end
end
---------------------- OnSpecialMoveZup -----------------------------
function OnSpecialMoveZup()
--EgtOutLog( 'OnSpecialMoveZup : ' .. EMC.HEAD .. '.' .. tostring( EMC.EXIT))
-- Inizializzazioni
EMC.ERR = 0
EMC.MODIF = false
-- Direzione utensile
local vtT = Vector3d( EMC.TDIR)
-- recupero Z1 home
local nHeadSet = GetHeadSet( EMC.HEAD)
local dZmax = EgtGetAxisHomePos( EgtIf( nHeadSet ~= 2, 'Z1', 'Z2'))
-- se fresa su testa1 o testa 2
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' or EMC.HEAD == 'H22' then
;
-- se lama
-- se lama su rinvio standard o opposto di testa 1
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H16' then
-- riporto i valori tra -179 e + 180
local dCheckAxR1 = EMC.R1
if dCheckAxR1 < -180 then
dCheckAxR1 = dCheckAxR1 + 360
elseif dCheckAxR1 > 180 then
dCheckAxR1 = dCheckAxR1 - 360
end
-- se lama su testa1
if EMC.HEAD == 'H12' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( dCheckAxR1 < 15.0 or dCheckAxR1 > 180.0)) or ( EMC.R2 < -87.9 and ( dCheckAxR1 > -15.0 and dCheckAxR1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- se troppo in alto
if EMC.L3 > dZref + 1 then
---- sistemo asse rotante
--EMC.R2 = EgtIf( ( EMC.R2 > 0), 90, -90)
---- ricalcolo versore utensile
--EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2)
---- porto alla giusta quota
--EMC.L3 = dZmax
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- recupero se split da note utente di lavorazione precedente
local bSplit = IsPrevSplit()
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
-- se seconda lama su testa1
elseif EMC.HEAD == 'H16' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( dCheckAxR1 < 15.0 or dCheckAxR1 > 180.0)) or ( EMC.R2 < -87.9 and ( dCheckAxR1 > -15.0 and dCheckAxR1< 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- se troppo in alto
if EMC.L3 > dZref + 1 then
---- sistemo asse rotante
--EMC.R2 = EgtIf( ( EMC.R2 > 0), 90, -90)
---- ricalcolo versore utensile
--EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2)
---- porto alla giusta quota
--EMC.L3 = dZmax
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1)
else
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
end
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1, 'LastRapid=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 1, EgtIf( bSplit, 'Split=1;', ''))
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, MaxZ1Blade, EMC.R1, 0}, 30, 2, 1)
end
end
-- se sega a catena su testa 1
elseif EMC.HEAD == 'H13' then
-- recupero se split da note utente di lavorazione precedente
local bSplit = IsPrevSplit()
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkCSawZ1, EMC.R1p, EMC.R2p, EMC.R3p}, 30, 2, 1)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3p}, 30, 2, 0)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3p}, 30, 2, 0)
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2, EMC.R3p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkCSawZ1, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 1, 'LastRapid=1;')
end
-- se aggregato foratore multiplo su testa 1
elseif EMC.HEAD == 'H14' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0, EMC.R3}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0, EMC.R3}, 30, 3, 2)
end
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 30, 3, 1, 'LastRapid=1;')
end
-- se fresa su testa 2
elseif EMC.HEAD == 'H21' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, ParkC2, ParkB2}, 30, 2, 1)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, EMC.R1, EMC.R2}, 30, 2, 2)
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, EMC.R1p, EMC.R2p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, ParkC2, ParkB2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, ParkX2, ParkZ2, ParkC2, ParkB2}, 30, 3, 1, 'LastRapid=1;')
end
-- se lama su testa 2
elseif EMC.HEAD == 'H22' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, ParkC2, ParkB2}, 30, 2, 1)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, EMC.R1, EMC.R2}, 30, 2, 2)
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, EMC.R1p, EMC.R2p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, ParkC2, ParkB2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, SafeX2, ParkZ2, ParkC2, ParkB2}, 30, 3, 1, 'LastRapid=1;')
end
-- se lama su testa 3
elseif EMC.HEAD == 'H38' then
EMC.L3 = SafeZ3RotAxis
-- dichiaro modificato
EMC.MODIF = true
else
; -- non si fa nulla
-- sicurezza aggiuntiva
local SAFE_DIST = 50
local dExtraDist = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) / 2 + SAFE_DIST
-- recupero se split da note utente di lavorazione precedente
local bSplit = IsPrevSplit()
-- recupero ingombro del primo grezzo in lavoro
local b3Raw = GetActiveRawBBox()
local dMinRawX3 = b3Raw:getMin():getY() - Head3Y
local dMaxRawX3 = b3Raw:getMax():getY() - Head3Y
local dMidRawX3 = ( dMinRawX3 + dMaxRawX3) / 2
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
local dSafeX3 = EgtIf( EMC.L2 < dMidRawX3, dMinRawX3 - dExtraDist, dMaxRawX3 + dExtraDist)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, dSafeX3, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, dSafeX3, SafeZ3RotAxis, EMC.R1p, EMC.R2p}, 30, 2, 2)
-- deve muoversi anche la trave (la lama non è abbastanza alta in Z) quindi Mask = 31
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, dSafeX3, SafeZ3RotAxis, EMC.R1, EMC.R2}, 31, 2, 2)
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
local dSafeX3 = EgtIf( EMC.L2p < dMidRawX3, dMinRawX3 - dExtraDist, dMaxRawX3 + dExtraDist)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, dSafeX3, SafeZ3RotAxis, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, dSafeX3, SafeZ3RotAxis, EMC.R1, EMC.R2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, dSafeX3, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1)
end
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1, 'LastRapid=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > SafeZ3RotAxis + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, SafeZ3RotAxis, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, SafeZ3RotAxis, EMC.R1p, 0}, 30, 3, 2, 'LastRapid=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, SafeZ3RotAxis, EMC.R1, 0}, 30, 2, 2)
-- se non split deve muoversi anche la trave (la lama non è abbastanza alta in Z) quindi Mask = 31
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, SafeZ3RotAxis, EMC.R1, EMC.R2}, EgtIf( bSplit, 30, 31), 2, 2)
end
end
-- testa con truciolatore su testa 3
elseif EMC.HEAD == 'H39' then
;
end
EMC.ERR = 0
end
---------------------------------------------------------------------
@@ -405,6 +443,57 @@ local function EmitComment( vCmd, sOut)
end
end
-----------------------------------------------------------------------
local function CallSpecialLink()
-- cerco la lavorazione attiva precedente
local nPrevMchId = EgtGetPrevActiveOperation( EMC.MCHID)
while nPrevMchId and EgtGetOperationType( nPrevMchId) == MCH_OY.DISP do
nPrevMchId = EgtGetPrevActiveOperation( nPrevMchId)
end
-- se non esiste lavorazione precedente, non devo fare alcunché
if not nPrevMchId then return end
-- salvo nome utensile corrente
local sTool = EgtGetMachiningParam( MCH_MP.TOOL)
-- recupero utensile, testa, uscita e TcPos della lavorazione precedente
EgtSetCurrMachining( nPrevMchId)
local sPrevTool = EgtGetMachiningParam( MCH_MP.TOOL)
-- se utensili cambiati, non devo fare alcunché
if sTool ~= sPrevTool then
EgtSetCurrMachining( EMC.MCHID)
return
end
-- recupero altri dati lavorazione precedente
EgtTdbSetCurrTool( sPrevTool)
local sPrevHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sPrevExit = EgtTdbGetCurrToolParam( MCH_TP.EXIT)
local _, sPrevTcPos = EgtFindToolInCurrSetup( sPrevTool)
local nPrevPhase = EgtGetOperationPhase( nPrevMchId)
local vPrevAxIni = EmtGetFinalAxesPos( nPrevMchId)
local vPrevAxFin = EmtGetCurrAxesHomePos()
-- lancio risalita al termine della lavorazione precedente
local OrigEMC = EMC
EMC = { TOOL = sPrevTool, HEAD = sPrevHead, EXIT = sPrevExit, TCPOS = sPrevTcPos, PREVMCHID = nPrevMchId, PREVPHASE = nPrevPhase, LINKTYPE = 2,
L1p = vPrevAxIni[1], L2p = vPrevAxIni[2], L3p = vPrevAxIni[3], R1p = vPrevAxIni[4], R2p = vPrevAxIni[5], R3p = vPrevAxIni[6],
L1 = vPrevAxFin[1], L2 = vPrevAxFin[2], L3 = vPrevAxFin[3], R1 = vPrevAxFin[4], R2 = vPrevAxFin[5], R3 = vPrevAxFin[6]}
OnSpecialLink()
EMC = OrigEMC
-- recupero dati lavorazione corrente
EgtSetCurrMachining( EMC.MCHID)
EgtTdbSetCurrTool( sTool)
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sExit = EgtTdbGetCurrToolParam( MCH_TP.EXIT)
local _, sTcPos = EgtFindToolInCurrSetup( sTool)
local vAxIni = EmtGetCurrAxesHomePos()
local vAxFin = EmtGetInitialAxesPos( EMC.MCHID)
-- lancio discesa all'inizio della lavorazione corrente
OrigEMC = EMC
EMC = { TOOL = sTool, HEAD = sHead, EXIT = sExit, TCPOS = sTcPos, NEXTMCHID = OrigEMC.MCHID, NEXTPHASE = OrigEMC.PHASE, LINKTYPE = 1,
L1p = vAxIni[1], L2p = vAxIni[2], L3p = vAxIni[3], R1p = vAxIni[4], R2p = vAxIni[5], R3p = vAxIni[6],
L1 = vAxFin[1], L2 = vAxFin[2], L3 = vAxFin[3], R1 = vAxFin[4], R2 = vAxFin[5], R3 = vAxFin[6]}
OnSpecialLink()
EMC = OrigEMC
end
---------------------------------------------------------------------
function OnSpecialApplyDisposition()
@@ -582,6 +671,8 @@ function OnPostApplyMachining()
-- Inizializzo codice di errore
EMC.ERR = 0
EMC.ZMAX = false
-- Recupero la posizione della trave e dei carrelli al termine della precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- se precedente operazione non esiste, errore
@@ -632,13 +723,14 @@ function OnPostApplyMachining()
-- aggiornamento posizioni
local nLastPathId = EgtGetLastInGroup( EgtGetFirstNameInGroup( nPrevOpeId, 'CL') or GDB_ID.NULL)
local nLastEntId = EgtGetLastInGroup( nLastPathId)
local bAtZMax = ( EgtGetClEntMove( nLastEntId) == 0 and EgtGetClEntFlag( nLastEntId) == 3)
local nFlag, nFlag2 = EgtGetClEntFlag( nLastEntId)
local bVParked = ( EgtGetClEntMove( nLastEntId) == 0 and ( nFlag == 3 or nFlag2 == 1 or nFlag2 == 2))
local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
EMC.Y1DELTA = EgtGetInfo( nLastPathId, 'Y1DELTA', 'd')
EMC.Y2DELTA = EgtGetInfo( nLastPathId, 'Y2DELTA', 'd')
EMC.V1POS = EgtIf( bAtZMax, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1)
EMC.V2POS = EgtIf( bAtZMax, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2)
EMC.V1POS = EgtIf( bVParked, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1)
EMC.V2POS = EgtIf( bVParked, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2)
EMC.CNT = SpecGetCNT( EMC.MCHID)
end
@@ -725,6 +817,11 @@ function OnPostApplyMachining()
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
end
-- Se richiesto movimento preliminare della testa a Zmax
if EMC.ZMAX then
CallSpecialLink()
end
end
---------------------------------------------------------------------
@@ -1168,7 +1265,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 + EMC.LT)
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
@@ -2524,6 +2621,9 @@ function SpecOutputCmds( vCmd, bEnd)
elseif Cmd[1] == 4 then
local sInfo = '4,'..EgtNumToString( Cmd[2],0)
EgtSetInfo( EMC.PATHID, sKey, sInfo)
if not bEnd and Cmd[2] == 1 then
EMC.ZMAX = true
end
-- apertura/chiusura morsa Y
elseif Cmd[1] == 11 then
local sInfo = '11,'..EgtNumToString( Cmd[2],0)
+24 -22
View File
@@ -3,12 +3,12 @@
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
EgtEnableDebug( true)
PP_VER = '3.1a2'
PP_NVER = '3.1.1.2'
PP_VER = '2.7k1_DEV1'
PP_NVER = '2.7.11.1'
MIN_MACH_VER = '2.7d2'
MACH_NAME = EgtGetCurrMachineName()
MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -93,7 +93,7 @@ ParkTc1X1 = 800
ParkZ1 = -525
ParkC1 = -90
ParkB1 = -90
ParkCSawX1 = 2500
ParkCSawX1 = 1700
ParkCSawZ1 = -100
ParkCSaw0Z1 = -400
ParkCSawC1 = -90
@@ -129,9 +129,9 @@ ParkX3 = 0
ParkZ3 = -200
ParkC3 = -90
ParkB3 = -75
SafeX3RotAxis = 1600
SafeX3RotAxis = 1550
SafeZ3RotAxis = -655
MinX2 = -3060
MinX2 = -3800
MaxX2 = 0
MinZ2 = 0
MaxZ2 = 1450
@@ -142,7 +142,7 @@ MaxB2 = 127
MinB2b = -119
MaxB2b = 119
ParkX2 = -100
SafeX2 = -400
SafeX2 = -200
SafeX2RotAxis = -1000
ParkZ2 = 0
ParkInLavZ2 = 200
@@ -188,9 +188,6 @@ 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"
@@ -293,7 +290,6 @@ 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
@@ -332,7 +328,7 @@ EmtGeneral {
ExitMaxAdjust = 300,
ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 80,
LinkAxesMoveOrder = MCH_LKAMO.HEAD_BEFORE_IF_SAME_ANG,
NewLinkMgr = 1,
Special = 'Common_PF1250.mlse',
Processor = 'Common_PF1250.mlpe'}
-- in base alla corsa macchina, si carica la rulliera di carico/scarico appropriata
@@ -679,7 +675,7 @@ local PY1Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY1_AXIS/GEO',
Aux = {'PY1_AXIS/SOLID', 'PY1_AXIS/CLAMP_CHECK'}}
Aux = 'PY1_AXIS/SOLID'}
local Y2Id = EmtAxis {
Name = 'Y2',
Parent = 'Base',
@@ -699,7 +695,7 @@ local PY2Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY2_AXIS/GEO',
Aux = {'PY2_AXIS/SOLID', 'PY2_AXIS/CLAMP_CHECK'}}
Aux = 'PY2_AXIS/SOLID'}
-- Rulli
local V1Id = EmtAxis {
Name = 'V1',
@@ -1108,10 +1104,8 @@ 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)
@@ -1138,13 +1132,13 @@ function OnSetHead()
if EMC.HEAD == 'H11' then
local nTc = GetTcForTopHeadTool( EMC.TCPOS)
if nTc ~= 2 then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'X1', ParkTc1X1)
else
EmtModifyAxisHome( 'X1', ParkTc2X1)
end
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1})
if EMC.TOTLEN and EMC.TOTLEN < LongTool then
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisHome( 'Z1', MaxZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
@@ -1163,8 +1157,8 @@ function OnSetHead()
-- se testa H12 (lama)
elseif EMC.HEAD == 'H12' then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1Blade})
EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
@@ -1192,8 +1186,8 @@ function OnSetHead()
-- recupero il valore dell'asse virtuale bloccato A
local MultiDrillPosA = GetCurrMultiDrillVirtualAxis()
EmtModifyAxisHome( 'X1', ParkMultiDrillX1)
EmtModifyAxisHome( 'Z1', ParkMultiDrillZ1)
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1})
EmtModifyAxisHome( 'Z1', ParkMultiDrillZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', GetMultiDrillCHomeFromVirtualAxis( MultiDrillPosA, EMC.TOTLEN))
EmtModifyAxisHome( 'B1', EgtIf( EMC.TOTLEN < MinLengthLongCSaw, ParkCSawB1, ParkLongCSawB1))
@@ -1201,8 +1195,8 @@ function OnSetHead()
-- se testa H16 ( seconda lama)
elseif EMC.HEAD == 'H16' then
EmtModifyAxisHome( 'X1', ParkTc2X1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1Blade})
EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
@@ -1213,6 +1207,14 @@ function OnSetHead()
else
EmtModifyAxisStroke( 'B2', {MinB2, MaxB2})
end
EmtModifyAxisHome( 'C2', ParkC2)
EmtModifyAxisDirection( 'B2', X_AX())
elseif EMC.HEAD == 'H22' then
-- recupero valore asse A2 bloccato
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A2=0'
local SawUnderPosA2 = tonumber( sVal:sub( 4) or '') or 0
EmtModifyAxisHome( 'C2', GetSawCHomeFromVirtualAxis( SawUnderPosA2))
EmtModifyAxisDirection( 'B2', Vector3d( cos( SawUnderC2Offs), -sin( SawUnderC2Offs), 0))
elseif EMC.HEAD == 'H38' then
EmtModifyAxisDirection( 'B3', Vector3d( cos( SawC3Offs), -sin( SawC3Offs), 0))
Binary file not shown.
+1
View File
@@ -30,6 +30,7 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2)
local PositionTable = {}
local bTc2Active = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2') ~= nil)
local FirstSaw = ( EgtGetHeadId( 'H12') ~= nil)
local SecondSaw = ( EgtGetHeadId( 'H16') ~= nil)
local SecondChain = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC4') ~= nil)
local TcSpecialTools = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC5') ~= nil)
Binary file not shown.
-25
View File
@@ -1,30 +1,5 @@
==== Common_PF1250 Update Log ====
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
Versione 2.7k1 (19/11/2025)
- (GEN) Preselzione testa 1 spostata prima della selezione testa 3. Ticket#2513
- (SIM-GEN) Corretto calcolo per decidere se serve aprire i rulli
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '3.1a2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.7k1' -- versione minima kernel
VERSION = '2.7k1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}
return InfoCommon_STD_PP