Compare commits

...

34 Commits

Author SHA1 Message Date
andrea.villa c7a867746c Merge remote-tracking branch 'origin/develop' 2024-04-09 11:48:48 +02:00
andrea.villa e795838473 - Corretto posizionamento assi in home se primo utensile punta lunga 2024-04-09 11:48:36 +02:00
andrea.villa 8d8d06022a - Corretto impostazione piano G24
- Corretta posizione prelievo/parcheggio se lama su aggregato da sotto
- Aggiunta variabile 'ForceToCloseRollersGate' per forzare chiusura paratie rulli
- Corretta scrittura lista utensili iniziale M992
-  Corretto movimento punte lunghe
- Corretto adeguamento speed aggregato lama da sotto
- Aumentato numero riposizionamenti possibili a 10
2024-04-09 09:58:09 +02:00
andrea.villa 3dc67b0861 Merge branch 'main' into develop 2024-03-26 13:28:18 +01:00
andrea.villa b291bc488b Merge branch 'develop' 2024-03-26 13:28:03 +01:00
andrea.villa c65aff1bed - Modificate collisioni traversa. Ora non comprende carro X1, il quale ha il proprio oggetto di collisione
- Aggiornati log per versione
2024-03-26 13:27:54 +01:00
andrea.villa 5f0f2a5961 Aggiunta gestione parametro "SECDIST" 2024-03-26 08:54:27 +01:00
andrea.villa d75d1ca9ea Corretto primo movimento in rapido della lavorazione per testa sotto 2024-03-21 11:42:50 +01:00
andrea.villa 2b23501bf6 Merge branch 'main' into develop 2024-03-14 09:09:58 +01:00
andrea.villa f0dcfb4b92 Merge branch 'develop' 2024-03-14 09:09:40 +01:00
andrea.villa 05f0d95c87 Migliorata preselezione utensile 2024-03-14 09:09:26 +01:00
andrea.villa b00c0e1213 Miglioramento visualizzazione spigoli VMILL alla fine della simulazione 2024-03-12 14:50:53 +01:00
andrea.villa 8084c2843e Merge branch 'main' into develop 2024-03-12 12:51:40 +01:00
andrea.villa 33b6c92e9a Merge branch 'develop' 2024-03-12 12:51:30 +01:00
andrea.villa 4f6d50c76b Migliorata gestione movimenti con lama su aggregato su testa sotto 2024-03-12 12:51:23 +01:00
andrea.villa c028617d57 Merge branch 'main' into develop 2024-03-04 10:32:35 +01:00
andrea.villa 7333279f58 Merge branch 'develop' 2024-03-04 10:32:26 +01:00
andrea.villa ce9e336daa Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina 2024-03-04 10:32:15 +01:00
andrea.villa af7d6de48f I commenti iniziali si scrivono con MyOutput 2024-03-01 09:47:26 +01:00
andrea.villa 3e45bba873 Merge branch 'main' into develop 2024-02-29 09:57:50 +01:00
andrea.villa 572a844f6e Merge branch 'develop' 2024-02-29 09:57:42 +01:00
andrea.villa ba2c903ae5 Gestione rimozione VMILL per tagli a cubetti Zig-Zag 2024-02-29 09:57:29 +01:00
luca.mazzoleni 1e4a0dd3f0 Merge remote-tracking branch 'origin/main' into develop 2024-02-26 15:50:48 +01:00
luca.mazzoleni 0f60084102 Merge branch 'develop' 2024-02-26 15:50:37 +01:00
luca.mazzoleni 75ee50fae9 corretta versione 2024-02-26 15:50:17 +01:00
luca.mazzoleni 01ef6584b2 Merge branch 'main' into develop 2024-02-23 18:19:45 +01:00
luca.mazzoleni 8fdffd50f0 update version 2024-02-23 18:19:36 +01:00
luca.mazzoleni c6442df294 Merge branch 'develop' 2024-02-23 18:14:42 +01:00
luca.mazzoleni 1531d48ed6 - EgtAddToPackagePath spostato in mlde
- sistemato updatelog
- rimosse chiamate a EgtGetSourceDir e sostituite con EgtGetCurrMachineDir
2024-02-23 17:40:46 +01:00
andrea.villa cda8257fd5 Merge branch 'main' into develop 2024-02-20 11:42:56 +01:00
andrea.villa a1af282000 Merge branch 'develop' 2024-02-20 11:42:30 +01:00
andrea.villa a9125ae137 - Aggiunta funzioni "OnSimulInit" e "OnSimulExit"
- "BeamData" caricato come libreria con 'require'
2024-02-20 11:42:02 +01:00
andrea.villa 58cb4b6e9f Merge branch 'main' into develop 2024-02-15 15:41:44 +01:00
andrea.villa de7e8d9c5a Merge branch 'main' into develop 2024-02-15 15:27:20 +01:00
5 changed files with 366 additions and 170 deletions
+124 -64
View File
@@ -1,11 +1,12 @@
-- Processore macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
-- Con controllo numerico TPA
-- Variabili di modulo
local MLE_INFO = 'Essetre-PF1250.TPA.mlpe ver.'..PP_VER..' by EgalTech s.r.l.'
-- Carico libreria
local BD = require( 'BeamData')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -41,12 +42,13 @@ end
function OnProgramStart()
-- Intestazioni
if EMT.INFO then
EmitRemark( EMT.INFO)
MyOutput( '('..EMT.INFO..')')
else
EmitRemark( 'Program Start')
MyOutput( '(Program Start)')
end
EmitRemark( CSP_INFO)
EmitRemark( MACHINE_INFO)
MyOutput( '('.. CSP_INFO..')')
MyOutput( '('.. MACHINE_INFO..')')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
MyOutput( 'M199')
@@ -104,8 +106,20 @@ end
---------------------------------------------------------------------
function OnToolData()
-- emissione dati utensile (esclusa sega a catena)
if EMT.HEAD ~= 'H13' then
-- emissione dati utensile
-- lama su aggregato da sotto
if EMT.HEAD == 'H22' then
-- recupero posizione lama
local dPosBase = tonumber( AdjustTcPos( false, EMT.TCPOS, 0))
dAddLen = SawUnderOffsZ
local sData = ' P2=' .. EmtLenToString( dAddLen + EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( dAddLen + EMT.TTOTLEN, 3)
MyOutput( 'M992 P1='..tostring( dPosBase).. sData)
MyOutput( 'M992 P1='..tostring( dPosBase+1).. sData)
MyOutput( 'M992 P1='..tostring( dPosBase+2).. sData)
MyOutput( 'M992 P1='..tostring( dPosBase+3).. sData)
-- altri utensili tranne sega a catena
elseif EMT.HEAD ~= 'H13' then
local dAddLen = 0
if EMT.HEAD == 'H12' then
dAddLen = -SawOffsZ
@@ -117,13 +131,15 @@ function OnToolData()
MyOutput( sOut)
-- emissione dati sega a catena
else
-- recupero posizione motosega
local dPosBase = tonumber( AdjustTcPos( false, EMT.TCPOS, 0))
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
MyOutput( 'M992 P1=101' .. sData)
MyOutput( 'M992 P1=102' .. sData)
MyOutput( 'M992 P1=103' .. sData)
MyOutput( 'M992 P1=104' .. sData)
MyOutput( 'M992 P1='..tostring( dPosBase).. sData)
MyOutput( 'M992 P1='..tostring( dPosBase+1).. sData)
MyOutput( 'M992 P1='..tostring( dPosBase+2).. sData)
MyOutput( 'M992 P1='..tostring( dPosBase+3).. sData)
end
end
@@ -366,20 +382,6 @@ function OnToolSelect()
if MCH_TP.DIST then EMT.TDIST = EgtTdbGetCurrToolParam( MCH_TP.DIST) end
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
@@ -520,6 +522,22 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = EMT.DOU_TYPE end
EMT.DOU_TYPE = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
--EMT.PREVTCPOSREAL_H1 = EMT.TCPOSREAL
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
--EMT.PREVTCPOSREAL_H2 = EMT.TCPOSREAL
end
end
---------------------------------------------------------------------
@@ -664,7 +682,7 @@ function OnRapid()
EMT.V2POS = ParkV2
-- primo posizionamento
local Speed = EMT.S
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' then Speed = 1.65 * EMT.S end
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' or EMT.HEAD == 'H22' then Speed = 1.65 * EMT.S end
local bOnlyCharY = true
for i = 1, #EMT.AUXCMD do
ProcessPathStartAux( EMT.AUXCMD[i], i)
@@ -695,8 +713,8 @@ function OnRapid()
EmitParkRoller( dPosT, bSplitCut)
end
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
local bXSpec = EgtIf( BD.RIGHT_LOAD, ( EMT.L2 > -DeltaTabY), ( EMT.L2 < -DeltaTabY))
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( PrevR1 - EMT.R1) > 1 or abs( PrevR2 - EMT.R2) > 1) and ( abs( HomeR1 - EMT.R1) > 30.1 or abs( HomeR2 - EMT.R2) > 30.1) then
local bXSpec = EgtIf( BD.RIGHT_LOAD, ( EMT.L2 > -DeltaTabY), ( EMT.L2 < -DeltaTabY))
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MaxZ1, B=ParkB1, C=ParkC1, S=Speed})
@@ -716,7 +734,12 @@ function OnRapid()
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=HomeZ1, B=HomeR2, C=HomeR1, TRad=dTRad, TLen=dTLen, S=Speed})
-- utensili standard
else
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=EMT.L3, B=ParkB1, C=ParkC1, S=Speed})
-- utensili lunghi
if EMT.TTOTLEN > LongTool then
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=EMT.L3, B=ParkLongB1, C=ParkLongTc1C1, S=Speed})
else
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=EMT.L3, B=ParkB1, C=ParkC1, S=Speed})
end
end
end
if EMT.HEAD ~= 'H13' then
@@ -775,7 +798,11 @@ function OnRapid()
-- selezione testa (non posso muovere X)
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 2, { X=ParkX2, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=MinX2, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
else
EmitMoveDataHead( 2, { X=ParkX2, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
end
else
EmitMoveDataHead( 2, { X=ParkX2, S=Speed})
end
@@ -1035,16 +1062,40 @@ function OnRapid()
local CurrB2 = PrevR2
local CurrC2 = PrevR1
local dSafeZ2 = EgtGetAxisHomePos( 'Z2')
local Speed = EMT.S
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 2, { X=SafeX2, Z=CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H22', 1, 1.65)
-- 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
EmitMoveDataHead( 2, { X=MinX2, Z=-CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
else
EmitMoveDataHead( 2, { X=SafeX2, Z=-CurrZ2, B=CurrB2, C=CurrC2, S=Speed})
end
end
EmitMoveDataHead( 2, { Z=-dSafeZ2, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, S=Speed})
else
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.HEAD == 'H22' and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=EMT.L2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
end
-- se stesso utensile vado già alla X di lavoro
else
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.HEAD == 'H22' and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=EMT.L2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
EmitMoveDataHead( 2, { Z=-dSafeZ2, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, S=Speed})
end
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.HEAD == 'H22' and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { B=EMT.R2, C=EMT.R1, S=Speed})
end
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 2)
-- eventuale preselezione successiva testa 1
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
@@ -1129,7 +1180,7 @@ function OnRapid()
EMT.L2 = -EMT.L2
-- emetto movimenti in Zero macchina
local Speed = EMT.S
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' then Speed = 1.65 * EMT.S end
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' or EMT.HEAD == 'H22' then Speed = 1.65 * EMT.S end
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 1)
local dX2 = Delta2TabY + EMT.DOU_TLEN - ( -DeltaTabY - EMT.L2 + EMT.TLEN + EgtIf( BD.RIGHT_LOAD, -EMT.HB, EMT.HB))
@@ -1149,7 +1200,7 @@ function OnRapid()
EMT.L2 = -EMT.L2
-- emetto movimenti in Zero macchina
local Speed = EMT.S
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' then Speed = 1.65 * EMT.S end
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' or EMT.HEAD == 'H22' then Speed = 1.65 * EMT.S end
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 1)
local dX2 = -Head2Y - EMT.L2
@@ -1203,9 +1254,9 @@ function OnRapid()
EmtAdjustRotaryAxes()
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
-- se lavorazione successiva sopra con testa diversa, porto in home la testa corrente
-- porto in home la testa corrente se lavorazione successiva sopra con testa diversa oppure se punta lunga
local nNextTopHSet = GetNextTopHSet( EMT.MCHID)
local bTopGoHome = ( nHSet ~= 2 and nNextTopHSet ~= 0 and nHSet ~= nNextTopHSet)
local bTopGoHome = ( nHSet ~= 2 and nNextTopHSet ~= 0 and nHSet ~= nNextTopHSet) or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
EmitZmax( true, true, EMT.R1p, EMT.R2p, bSplitCut, bTopGoHome)
-- aggiorno quota finale trave dopo Zmax
EMT.L1o = EMT.TPOS
@@ -1988,7 +2039,7 @@ function MyAdjustLinearAxes()
elseif nHSet == 2 then
local dAddLen = 0
if EMT.HEAD == 'H22' then
dAddLen = -Saw2OffsZ
dAddLen = SawUnderOffsZ
end
local Len = EMT.TLEN + dAddLen + Mill2Offs
local LenRef = Mill2Offs
@@ -2080,7 +2131,6 @@ function AdjustTcPos( bLen3, sTcPos, dAxR3)
EmtSetLastError( 1210, 'Saw orientation not allowed')
end
end
return sPos
end
@@ -2115,7 +2165,8 @@ function CalcInterpPlane()
local vtX = EMT.IPLGLFR:getVersX()
local vtY = EMT.IPLGLFR:getVersY()
local vtZ = EMT.IPLGLFR:getVersZ()
if EMT.HEAD ~= 'H21' then
local nHSet = GetHeadSet( EMT.HEAD)
if nHSet ~= 2 then
EMT.IPLGLSTR = ' X0 Y' .. EmtLenToString( xS, EMT.DECNUM) .. ' Z0' ..
' A' .. EgtNumToString( -vtX:getY(), 6) .. ' B' .. EgtNumToString( vtX:getX(), 6) .. ' C' .. EgtNumToString( vtX:getZ(), 6) ..
' I' .. EgtNumToString( -vtY:getY(), 6) .. ' J' .. EgtNumToString( vtY:getX(), 6) .. ' K' .. EgtNumToString( vtY:getZ(), 6) ..
@@ -2222,16 +2273,11 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dHomeB1, Fmt=1})
EmitMoveDataHead( 1, { X=-dHomeX1, C=dHomeC1, Fmt=1})
if bTopGoHome then
-- !!! da verificare bene (come PF) !!!
EmitMoveDataHead( 1, { X=-ParkX1, TPos=50, Fmt=1})
end
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
-- se altrimenti testa 2
elseif nSetHead == 2 then
-- posizioni sicure
local dHomeX2 = EgtGetAxisHomePos( 'X2')
local dHomeZ2 = EgtGetAxisHomePos( 'Z2')
@@ -2245,7 +2291,11 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
-- eseguo la discesa a Z2max
EmitMoveDataHead( 2, { Z=-dHomeZ2, Fmt=1})
EmitMoveDataHead( 2, { B=dHomeB2, C=dHomeC2, Fmt=1})
EmitMoveDataHead( 2, { X=dHomeX2, Fmt=1})
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=SafeX2, Fmt=1})
else
EmitMoveDataHead( 2, { X=dHomeX2, Fmt=1})
end
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
-- altrimenti testa 3
@@ -2437,8 +2487,8 @@ function PreselectNextDiffHead( nMchId, sHead)
-- se la Z di lavoro è più bassa del cambio della minima Z
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
-- verifico quota del TC
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 400) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + 400) then return end
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + 200) then return end
end
-- se preselezione testa 3
else
@@ -2457,14 +2507,14 @@ function PreselectNextDiffHead( nMchId, sHead)
-- altrimenti se operazione su stesso TC
else
-- TC su montante destro oppure non so cosa c'è montato
if nNextTc == 1 or nPrevTc ~= 0 then
if BD.RIGHT_LOAD and EMT.MAXMIN[2] < ( Delta2TabY - 400) then return end
if not BD.RIGHT_LOAD and EMT.MAXMIN[2] < ( Delta2TabY - MaxHoOpen - 400) then return end
if nNextTc == 1 or nPrevTc == 0 then
if BD.RIGHT_LOAD and EMT.MAXMIN[2] < ( Delta2TabY - 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMIN[2] < ( Delta2TabY - MaxHoOpen - 200) then return end
end
-- TC su montante sinistro oppure non so cosa c'è montato
if nNextTc == 2 or nPrevTc ~= 0 then
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( Delta2TabY + MaxHoOpen + 400) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( Delta2TabY + 400) then return end
if nNextTc == 2 or nPrevTc == 0 then
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( Delta2TabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( Delta2TabY + 200) then return end
end
end
end
@@ -2480,7 +2530,7 @@ function PreselectNextDiffHead( nMchId, sHead)
if nPrevTc == 1 then return
-- TC su montante sinistro
else
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 400) then return end
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
end
-- se preselezione testa 2
@@ -2489,7 +2539,7 @@ function PreselectNextDiffHead( nMchId, sHead)
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then return end
-- se la Z di lavoro è più bassa del cambio utensili, verifico quota X (la nostra Y)
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 400) then return end
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
end
end
@@ -2598,8 +2648,18 @@ end
---------------------------------------------------------------------
function EmitMoveDataHead( nHead, MoData)
local sOut = 'M101'
if nHead == 2 then
local sRealTcPos
if EMT.TCPOS then
sRealTcPos = AdjustTcPos( false)
end
if nHead == 1 then
sOut = 'M101'
EMT.PREVTCPOSREAL_H1 = 'T' .. sRealTcPos
elseif nHead == 2 then
sOut = 'M102'
EMT.PREVTCPOSREAL_H2 = 'T' .. sRealTcPos
elseif nHead == 3 then
sOut = 'M103'
end
@@ -2608,7 +2668,7 @@ function EmitMoveDataHead( nHead, MoData)
if MoData.Z then sOut = sOut .. ' P3=' .. EmtLenToString( MoData.Z, 3) end
if MoData.B then sOut = sOut .. ' P4=' .. EmtLenToString( MoData.B, 3) end
if MoData.C then sOut = sOut .. ' P5=' .. EmtLenToString( MoData.C, 3) end
if MoData.TPos then sOut = sOut .. ' P6=' .. MoData.TPos elseif EMT.TCPOS then sOut = sOut .. ' P6=' .. AdjustTcPos( false) end
if MoData.TPos then sOut = sOut .. ' P6=' .. MoData.TPos elseif EMT.TCPOS then sOut = sOut .. ' P6=' .. sRealTcPos end
if MoData.S then sOut = sOut .. ' P7=' .. EgtNumToString( MoData.S, 0) end
if not MoData.Fmt then
if MoData.F then sOut = sOut .. ' P8=' .. EmtLenToString( MoData.F, 0) else sOut = sOut .. ' P8=0' end
+140 -62
View File
@@ -6,14 +6,17 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Carico libreria
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** GENERATION ***
---------------------------------------------------------------------
local sBaseDir = EgtGetSourceDir()
local sBaseDir = EgtGetCurrMachineDir()
if NumericalControl == 'NUM' then
error( 'Numerical Control error : NUM not yet managed')
elseif NumericalControl == 'TPA' then
dofile( sBaseDir .. 'Common-PF1250.TPA.mlpe')
dofile( sBaseDir .. '\\Common-PF1250.TPA.mlpe')
else
error( 'Numerical Control error : unkwnown type')
end
@@ -23,6 +26,45 @@ end
---------------------------------------------------------------------
local COLL_SAFE_DIST = 3
---------------------------------------------------------------------
function OnSimulInit()
-- se macchina con carico destro, imposto offset direzioni di vista standard
if BD.RIGHT_LOAD then
local nOrigViewOffs = EgtGetViewOrizzOffsStep()
local dOrigViewAngV, dOrigViewAngH = EgtGetGenericView()
if nOrigViewOffs ~= 2 then
EgtSetViewOrizzOffsStep( 2)
if dOrigViewAngV < 0.1 then
EgtSetView( SCE_VD.TOP, false)
elseif dOrigViewAngV > 179.9 then
EgtSetView( SCE_VD.BOTTOM, false)
else
local dViewAngH = dOrigViewAngH + EgtIf( dOrigViewAngH > 180, 2 * 90, 0)
EgtSetGenericView( dOrigViewAngV, dViewAngH, false)
end
end
end
end
---------------------------------------------------------------------
function OnSimulExit()
-- se macchina con carico destro, annullo offset direzioni di vista standard
if BD.RIGHT_LOAD then
local nOrigViewOffs = EgtGetViewOrizzOffsStep()
local dOrigViewAngV, dOrigViewAngH = EgtGetGenericView()
if nOrigViewOffs == 2 then
EgtSetViewOrizzOffsStep( 0)
if dOrigViewAngV < 0.1 then
EgtSetView( SCE_VD.TOP, false)
elseif dOrigViewAngV > 179.9 then
EgtSetView( SCE_VD.BOTTOM, false)
else
EgtSetGenericView( dOrigViewAngV, dOrigViewAngH - 2 * 90, false)
end
end
end
end
---------------------------------------------------------------------
function OnSimulStart()
-- controllo versione programma
@@ -80,10 +122,10 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'},
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL1'},
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'CHAIN'},
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL2'}}
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}}
if EgtGetHeadId('H31') then
table.insert( McdData, { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'})
table.insert( McdData, { Grp = 'X3', Sub = 'COLLISION', Name = 'STM'})
end
@@ -434,16 +476,18 @@ function OnSimulToolSelect( dPosA)
end
-- se lama su aggregato da sotto, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H22' then
-- valore dell'asse virtuale
dPosA = dPosA or GetNextSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A
EgtSetAxisPos( 'A2', dPosA)
-- imposto home dell'asse C1 (A2=0 -> T101, A2=90 -> T104)
local MyParkSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkSawC2)
EgtSetAxisPos( 'C2', MyParkSawC2)
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
if dPosA then
-- valore dell'asse virtuale
dPosA = dPosA or GetNextSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A
EgtSetAxisPos( 'A2', dPosA)
-- imposto home dell'asse C1 (A2=0 -> T101, A2=90 -> T104)
local MyParkSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkSawC2)
EgtSetAxisPos( 'C2', MyParkSawC2)
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end
end
-- carico utensile, con breve pausa
EgtPause( 100)
@@ -472,8 +516,8 @@ end
---------------------------------------------------------------------
function OnSimulToolDeselect( dPrevA)
-- se prossimo utensile non cambia e non è sega a catena, esco
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and EMT.NEXTHEAD ~= 'H13' and EMT.NEXTHEAD ~= 'H22' then return end
-- se prossimo utensile non cambia e non è sega a catena o lama su rinvio da sotto, esco
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and EMT.NEXTHEAD ~= 'H13' and ( EMT.NEXTHEAD ~= 'H22' or not dPrevA) then return end
-- deposito utensile
EgtOutText( 'Tool change in progress...')
-- recupero il gruppo
@@ -487,6 +531,7 @@ function OnSimulToolDeselect( dPrevA)
if dPrevA then
ParkC2 = GetSawCHomeFromVirtualAxis( dPrevA)
end
SimulMoveAxis( 'Z2', MinZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkSawB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
end
@@ -508,11 +553,11 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
else
if nPrevTc ~= 2 then
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc1C1, MCH_SIM_STEP.RAPROT)
SimulMoveAxes( 'B1', ParkLongB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc1C1, MCH_SIM_STEP.RAPROT)
local dPosX = ParkX1
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc2C1, MCH_SIM_STEP.RAPROT)
SimulMoveAxes( 'B1', ParkLongB1, MCH_SIM_STEP.RAPROT, 'C1', ParkLongTc2C1, MCH_SIM_STEP.RAPROT)
local dPosX = ParkTc2X1
SimulMoveAxis( 'X1', dPosX, MCH_SIM_STEP.RAPID)
end
@@ -621,27 +666,6 @@ function OnSimulMachiningStart()
OnSimulToolSelect( dPosA)
end
end
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
EMT.PREVTTOTLEN_H1 = EMT.TTOTLEN
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
EMT.PREVTTOTLEN_H2 = EMT.TTOTLEN
-- per gruppo testa 3 (resetto dati testa 1)
else
EMT.PREVTOOL_H3 = nil
EMT.PREVHEAD_H3 = nil
EMT.PREVTCPOS_H3 = nil
EMT.PREVTTOTLEN_H3 = nil
end
-- recupero alcuni dati della lavorazione
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
@@ -702,6 +726,7 @@ function OnSimulMachiningStart()
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
EMT.DOU_TO_ZMAX = nil
end
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
end
@@ -719,6 +744,29 @@ function OnSimulMachiningEnd()
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = EMT.DOU_TYPE end
EMT.DOU_TYPE = nil
EMT.DOU_TOOL = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
EMT.PREVTTOTLEN_H1 = EMT.TTOTLEN
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
EMT.PREVTTOTLEN_H2 = EMT.TTOTLEN
-- per gruppo testa 3 (resetto dati testa 1)
else
EMT.PREVTOOL_H3 = nil
EMT.PREVHEAD_H3 = nil
EMT.PREVTCPOS_H3 = nil
EMT.PREVTTOTLEN_H3 = nil
end
end
---------------------------------------------------------------------
@@ -735,7 +783,7 @@ end
---------------------------------------------------------------------
function OnSimulPathEnd()
-- rimozione sfridi
RemoveScraps()
ExecRemoveScraps()
-- se non ci sono comandi ausiliari associati e richiesta risalita a Zmax
if EMT.AUXTOT == 0 and EMT.TO_ZMAX then
if EMT.MCHSPLIT and not EMT.TO_FALL then
@@ -899,13 +947,30 @@ function OnSimulMoveStart()
local C2Home = EgtGetAxisHomePos( 'C2')
local Z2Home = EgtGetAxisHomePos( 'Z2')
local X2Home = EgtGetAxisHomePos( 'X2')
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
if EMT.TOOL ~= EMT.PREVTOOL_H2 then
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
if EMT.HEAD == 'H22' and EMT.PREVHEAD_H2 ~= EMT.HEAD then
SimulMoveAxes( 'X2', MinX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
else
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
else
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', EMT.L2, 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
-- altrimenti testa 3
else
@@ -1019,10 +1084,15 @@ function OnSimulMoveStart()
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
end
EMT.ZMAX = nil
EMT.TO_ZMAX = nil
end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- rimozione eventuali sfridi
if EMT.FLAG == 301 then
ExecRemoveScraps()
end
-- se primo rapido della lavorazione
if EMT.MCHFIRST and EMT.MOVE == 0 then
-- se lavorazione split, dichiaro carro Y1 riagganciato
@@ -1062,7 +1132,7 @@ function OnSimulMoveEnd()
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
-- eventuale rimozione sfridi
RemoveScraps()
ExecRemoveScraps()
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT)
EMT.TO_ZMAX = nil
@@ -1229,11 +1299,11 @@ end
function ExecStartHome()
-- Testa 1
EgtResetAxisPos( 'X1')
EgtResetAxisPos( 'Z1')
EgtSetAxisPos( 'Z1', MaxZ1)
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
-- Testa 2
EgtResetAxisPos( 'X2')
EgtSetAxisPos( 'X2', SafeX2)
EgtSetAxisPos( 'Z2', MinZ2)
EgtResetAxisPos( 'C2')
EgtResetAxisPos( 'B2')
@@ -1244,12 +1314,6 @@ function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit)
EMT.TO_ZMAX = nil
-- se testa sotto
if GetHeadSet( EMT.HEAD) == 2 then
if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
end
end
-- se richiesto, avvicino i rulli
if bNearV then
ExecOpenRoller( 1)
@@ -1325,7 +1389,11 @@ function ExecMoveZmax( bMchSplit)
elseif nSetHead == 2 then
SimulMoveAxis( 'Z2', ParkZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', SafeX2, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- altrimenti testa 3
else
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
@@ -1354,10 +1422,14 @@ function ExecUnloading()
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
@@ -1545,7 +1617,7 @@ function ExecOpenRoller( nInd)
end
---------------------------------------------------------------------
function RemoveScraps()
function ExecRemoveScraps()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
local vMillId = EMT.VMILL[1]
@@ -1576,7 +1648,6 @@ function RemoveScraps()
end
EMT.VMRS = false
end
end
---------------------------------------------------------------------
@@ -1785,6 +1856,13 @@ function LoadFirstTool( nHSet, sTcPosDef)
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = sTTotLen, BLOCKEDAXIS = sBlockedAxis}
OnSetHead()
EMC = OrigEMC
if sBlockedAxis then
local dPosA = tonumber( sBlockedAxis:sub( 4) or '') or 0
if dPosA ~= 0 then
-- imposto il valore di A
EgtSetAxisPos( EgtIf( nHSet == 1 , 'A1', 'A2'), dPosA)
end
end
-- carico l'utensile
EgtLoadTool( sHead, 1, sTool)
ShowToolInTcPos( sTcPos, false)
+36 -16
View File
@@ -1,12 +1,11 @@
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/04/09
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Carico i dati globali
local sBaseDir = EgtGetSourceDir()
BD = dofile( sBaseDir .. 'Beam\\BeamData.lua')
-- Carico libreria
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Special Z moves ***
@@ -889,10 +888,14 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
EgtSetAxisPos( 'B3', vAxMid[5])
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C3'), GDB_BB.ONLY_VISIBLE)
end
-- Forzo la distanza di sicurezza da utensile
local nSecRollerDist = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES), 'SECDIST', 'i') or SIC_V
local dMinFrontEng = EgtIf( nSetHead ~= 2, MIN_ENG_RACK_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dRollFront = max( b3Enc:getMax():getX(), dMinFrontEng) + SIC_V
local dRollFront = max( b3Enc:getMax():getX(), dMinFrontEng) + nSecRollerDist
local dMinBackEng = EgtIf( nSetHead ~= 2, MIN_ENG_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dRollBack = max( -b3Enc:getMin():getX(), dMinBackEng) + SIC_V
local dRollBack = max( -b3Enc:getMin():getX(), dMinBackEng) + nSecRollerDist
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip
@@ -1281,21 +1284,30 @@ end
---------------------------------------------------------------------
local function ChangedTool( nMchId)
local bChanged = false
local nChanged = 0
-- Salvo lavorazione e utensile correnti, per ripristinarli alla fine
local nOrigMchId = EgtGetCurrMachining()
local sOrigTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
local sOrigBlockedAx = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
-- Recupero l'utensile della lavorazione precedente
local nPrevMchId = EgtGetPrevActiveOperation( nMchId or GDB_ID.NULL)
if nPrevMchId and EgtGetOperationType( nPrevMchId) ~= MCH_OY.DISP then
EgtSetCurrMachining( nPrevMchId)
local sTool = EgtGetMachiningParam( MCH_MP.TOOL)
bChanged = ( sTool ~= sOrigTool)
nChanged = EgtIf( sTool ~= sOrigTool, 1 , 0)
local sBlockedAx = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
-- se stesso utensile, ma modo caricamento diverso, è come se fosse un cambio utensile. Vale solo se aggregato su lama da sotto.
if sTool == sOrigTool then
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if sHead == 'H22' and sOrigBlockedAx ~= sBlockedAx then
nChanged = 2
end
end
end
-- Ripristino lavorazione e utensile correnti
if nOrigMchId then EgtSetCurrMachining( nOrigMchId) end
if sOrigTool then EgtTdbSetCurrTool( sOrigTool) end
return bChanged
return nChanged
end
--------------------------------------------------------------------------------------------------------
@@ -1304,9 +1316,9 @@ end
function SpecAdjustCarriages( WorkTab)
--EgtOutLog( ' --->>> CNT=' .. EgtIf( EMC.CNT, '1', '_'))
local bChangedTool = ChangedTool( EMC.MCHID)
-- Aggiorno la posizione dei rulli per eventuale cambio utensile
if ChangedTool( EMC.MCHID) then
if bChangedTool ~= 0 then
WorkTab.dV1PosI = ParkV1
WorkTab.dV2PosI = ParkV2
end
@@ -1315,15 +1327,24 @@ function SpecAdjustCarriages( WorkTab)
if WorkTab.dY1DeltaI then
local dY1DeltaLim = MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EMC.HCING + EMC.HOVM + EgtIf( EMC.CNT == 1, AggLoad, 0)
if WorkTab.dY1DeltaI <= dY1DeltaLim or ( WorkTab.dY1DeltaMaxF and WorkTab.dY1DeltaMaxF <= dY1DeltaLim) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaI then
local dY2DeltaLim = MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V
if EMC.LB - WorkTab.dY2DeltaI <= dY2DeltaLim or ( WorkTab.dY2DeltaMinF and EMC.LB - WorkTab.dY2DeltaMinF <= dY2DeltaLim) then
bCloseV = true
bCloseV = true
end
end
-- se ho cambiato modo di prendere utensile, forzo chiusura
if bChangedTool == 2 then
bCloseV = true
end
-- se i pezzi del cliente sono molto storti, si forza la chiusura per evitare che vada a sbattere. Se parametro non presente, si chiude solo se necessario
if ForceToCloseRollersGate then
bCloseV = true
end
WorkTab.bCloseV = bCloseV
-- |POSIZIONO Y1| **[A]**
@@ -1836,7 +1857,7 @@ local function PosY1Y2B( TabI, vCmd)
end
end
nCnt = nCnt + 1
if nCnt > 5 then return end
if nCnt > 10 then return end
until ( not bXW)
-- chiusura/parcheggio dei trascinatori in funzioni chiamanti
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
@@ -1900,7 +1921,6 @@ local function PosY2Y1A( TabI, vCmd)
MaxDispl( TabI, vCmd, 'M1')
end
end
until ( not bXW)
-- chiusura/parcheggio dei trascinatori in funzioni chiamanti
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
@@ -1975,7 +1995,7 @@ local function PosY2Y1B( TabI, vCmd)
end
end
nCnt = nCnt + 1
if nCnt > 5 then return end
if nCnt > 10 then return end
until ( not bXW)
-- la chiusura delle morse è fatta sopra
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
+65 -27
View File
@@ -1,11 +1,64 @@
==== Common_PF1250 Update Log ====
Versione 2.6a1 (09/01/2024)
- Prima versione post-proc comune tra macchine PF1250 e PF1500
- (SIM-GEN) Corretto movimento testa 2 in ToolDesel e movimento controllo collisione
- (GEN) Tolta testa H14 per utensili speciali. Si utilizza H11 per frese standard
- (MLDE-GEN) Costanti 'MinForzaPinze' e 'MaxForzaPinze' portati in mlde/Ts3data (erano hardcoded)
- (MLDE-SIM-GEN) Aggiunto parametro 'WriteAllCoordsOnFirstM101' per decidere se stampare tutti gli assi sulla prima M101
Versione 2.6d1 (09/04/2024)
- (GEN) Corretto impostazione piano G24 con testa da sotto con aggregato
- (SIM-GEN) Corretta posizione prelievo/parcheggio se lama su aggregato da sotto
- (MLDE-SIM-GEN) Aggiunta variabile FACOLTATIVA 'ForceToCloseRollersGate' ( che legge la variabile da TS3 'CHIUDI_RULLI_SCAMBIO') in mlde per forzare chiusura paratie rulli
durante scambio pinze per facilitare passaggio pezzi molto storti. Se non presente chiude solo se necessario.
- (GEN) Corretta scrittura lista utensili iniziale M992 per doppia motosega e aggregato lama sotto
- (SIM-GEN) Corretto movimento punte lunghe
- (GEN) Corretto adeguamento speed per aggregato lama da sotto con coefficiente moltiplicativo
- (SIM-GEN) Aumentato numero riposizionamenti possibili a 10 ( per pezzi molto lunghi non bastava il valore precedente: 5)
- (GEN) Corretto posizionamento assi in home se primo utensile punta lunga
Versione 2.6c5 (26/03/2024)
- (SIM) Corretto primo movimento in rapido della lavorazione per testa sotto. Ora allineata a generazione
- (SIM-GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile
- (MLDE-SIM) Modificate collisioni traversa. Ora non comprende carro X1, il quale ha il proprio oggetto di collisione
Versione 2.6c4 (14/03/2024)
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. N.B.= serve CAM5 2.6c2 NON OBBLIGATORIO
- (GEN) Modifica controlli a preselezione utensile. Margine ridotto da 400m a 200mm.
- (GEN) Corretto controllo preselezione testa H1 quando H2 in lavoro
Versione 2.6c3 (12/03/2024)
- (SIM-GEN) Migliorata gestione movimenti con lama su aggregato su testa sotto
Versione 2.6c2 (04/03/2024)
- (GEN) I commenti iniziali si scrivono in modo standard, per poterli commentare nella macchina di test
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
Versione 2.6c1 (29/02/2024)
- (SIM) Gestione rimozione VMILL per tagli a cubetti Zig-Zag
Versione 2.6b4 (23/02/2024)
- (MLDE-SIM-GEN) EgtAddToPackagePath spostato in mlde
Versione 2.6b3 (20/02/2024)
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4 NON OBBLIGATORIO
- (SIM-GEN) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
Versione 2.6b2 (15/02/2024)
- (SIM-GEN) Primo movimento in X per testa 2 a SafeX2 anziché a ParkX2
Versione 2.6b1 (07/02/2024)
- (MLDE-SIM-GEN) Inserito parametro 'MinLengthLongCSaw' per gestione motosega molto lunga
- (MLDE) funzione 'GetCurrChainSawingVirtualAxis' spostata in MLDE
Versione 2.6a5 (31/01/2024)
- (SIM) Migliorata simulazione apertura/chiusura morse in caso di separazione
- (SIM-GEN) Migliorata gestione movimenti con motosega e adeguato simulazione
- (GEN) Corretta scrittura assi in caso di 'WriteAllCoordsOnFirstM101' per testa 2
- (SIM-GEN) Caricamento BeamData come local
Versione 2.6a4 (25/01/2024)
- (SIM-GEN) Corretto movimento in caso di cambio assi rotanti tra due lavorazioni
- (GEN) Corretta emissione coordinate assi in caso di 'WriteAllCoordsOnFirstM101'
Versione 2.6a3 (22/01/2024)
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale
- (GEN) Modificato flag 'EmitRapidInG0' in 'EmitRapidInG1' per decidere se scrivere G1 anziché G0. Se flag a nil, scrive i rapidi in G0
- (SIM) Correzione movimenti pinze prima di separazione
Versione 2.6a2 (19/01/2024)
- (GEN) Corretta inversione coordinata X per Lama su aggregato da sotto
@@ -14,24 +67,9 @@ Versione 2.6a2 (19/01/2024)
- (GEN) Migliorata gestione preselezione utensile
- (MLDE-GEN) Aggiunto flag 'EmitRapidInG0' per decidere se scrivere G0 anziché G1. Se flag a nil, scrive i rapidi in G1
Versione 2.6a3 (22/01/2024)
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale
- (GEN) Modificato flag 'EmitRapidInG0' in 'EmitRapidInG1' per decidere se scrivere G1 anziché G0. Se flag a nil, scrive i rapidi in G0
- (SIM) Correzione movimenti pinze prima di separazione
Versione 2.6a4 (25/01/2024)
- (SIM-GEN) Corretto movimento in caso di cambio assi rotanti tra due lavorazioni
- (GEN) Corretta emissione coordinate assi in caso di 'WriteAllCoordsOnFirstM101'
Versione 2.6a5 (31/01/2024)
- (SIM) Migliorata simulazione apertura/chiusura morse in caso di separazione
- (SIM-GEN) Migliorata gestione movimenti con motosega e adeguato simulazione
- (GEN) Corretta scrittura assi in caso di 'WriteAllCoordsOnFirstM101' per testa 2
- (ALL) Caricamento BeamData come local
Versione 2.6b1 (07/02/2024)
- (MLDE-SIM-GEN) Inserito parametro 'MinLengthLongCSaw' per gestione motosega molto lunga
- (MLDE) funzione 'GetCurrChainSawingVirtualAxis' spostata in MLDE
Versione 2.6b2 (15/02/2024)
- (SIM-GEN) Primo movimento in X per testa 2 a SafeX2 anziché a ParkX2
Versione 2.6a1 (09/01/2024)
- Prima versione post-proc comune tra macchine PF1250 e PF1500
- (SIM-GEN) Corretto movimento testa 2 in ToolDesel e movimento controllo collisione
- (GEN) Tolta testa H14 per utensili speciali. Si utilizza H11 per frese standard
- (MLDE-GEN) Costanti 'MinForzaPinze' e 'MaxForzaPinze' portati in mlde/Ts3data (erano hardcoded)
- (MLDE-SIM-GEN) Aggiunto parametro 'WriteAllCoordsOnFirstM101' per decidere se stampare tutti gli assi sulla prima M101
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6b2', -- versione script
VERSION = '2.6d1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}