Compare commits

...

78 Commits

Author SHA1 Message Date
andrea.villa 7ec4bfd76e Corretta versione 2024-05-28 09:57:43 +02:00
andrea.villa 2d97e2cb51 Merge branch 'develop' 2024-05-28 09:56:55 +02:00
andrea.villa d66abca2e7 - Ripristinato controllo extra-corsa per testa 2
- Corretto movimento testa sotto su prima lavorazione
2024-05-28 09:56:44 +02:00
andrea.villa b65e6f805d Aggiunta possibilità di scrivere nome utensile doppio anche in lavorazione con parametro "TOOLDOUBLE". Note sulla lavorazione hanno precedenza su note utensile. 2024-05-24 11:43:39 +02:00
andrea.villa e18023d094 Merge branch 'main' into develop 2024-05-23 14:44:05 +02:00
andrea.villa bd96eb55e2 Merge branch 'develop' 2024-05-23 14:43:57 +02:00
andrea.villa 73cdbd2df5 Se lavorazione con testa 2 e stesso utensile, piccola correzione che manda a parcheggio se cambiano assi rotanti solo se si trova a ZMAX 2024-05-23 14:43:47 +02:00
andrea.villa b28c999198 Corretta lettura e salvataggio coordinala asse L2 con coordinate rispetto origine. Prima erano locali e sbagliava alcuni calcoli 2024-05-16 15:09:21 +02:00
andrea.villa 44def6c43e Controllo extra-corsa per testa 2 in caso di lavorazioni in doppio in Y 2024-05-15 16:19:03 +02:00
andrea.villa d20c149686 Merge branch 'main' into develop 2024-05-15 13:13:28 +02:00
andrea.villa e6033e1f8d Miglioramento gestione lama su aggregato da sotto 2024-05-15 13:13:08 +02:00
andrea.villa f8974da04c Merge remote-tracking branch 'origin/main' into develop 2024-05-09 12:41:43 +02:00
andrea.villa dcb80bec7c Corretto prelievo lama 2 (H16). Prima di visualizzare utensile, si sposta la Z alla quota massima. 2024-05-09 12:41:32 +02:00
andrea.villa fde0489fe7 Merge branch 'main' into develop 2024-05-06 10:08:11 +02:00
andrea.villa d7f4fb0ef3 In parcheggio paratie/pinze, viene considerato sovramateriale di testa 2024-05-06 10:07:58 +02:00
andrea.villa efa56704d7 Merge branch 'main' into develop 2024-04-30 10:47:14 +02:00
andrea.villa 1f388d6b36 Merge branch 'develop' 2024-04-30 10:46:56 +02:00
andrea.villa c3a31403ce Modifica file log 2024-04-30 10:46:46 +02:00
andrea.villa 40cdb9ec93 Gestione parametro WoodDensity (WOOD_DENSITY in Ts3) 2024-04-30 10:37:32 +02:00
andrea.villa 33cb7da920 per macchina a 3 teste, ripristinato posizionamento testa 2 tramite parametro ParkInLavZ2 2024-04-23 16:40:16 +02:00
andrea.villa 0c8b706f9a Merge branch 'main' into develop 2024-04-23 15:49:03 +02:00
andrea.villa 6736907045 Merge branch 'develop' 2024-04-23 15:48:43 +02:00
andrea.villa 3d4e235a23 - Aggiunto parametro MaxZ1Blade per differenziare Z massima aggregato lama e altri utensili.
- Aggiunto controllo con solido di collisione per verificare di non salire oltre il massimo
- Corretta simulazione scambio testa 3 -> testa 1
2024-04-23 15:48:27 +02:00
andrea.villa 557bfcbe74 Ripristinato movimento iniziale testa sopra assieme alle pinze. 2024-04-22 10:25:39 +02:00
andrea.villa 6ac8ad5bfd - Modificato movimenti testa sotto. Prima si muove in quota 'ParkMchY2'.
- Per lavorazioni in doppio, viene subito scritta la quota Z.
2024-04-17 11:02:19 +02:00
andrea.villa b3b4061a07 Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni 2024-04-15 12:45:18 +02:00
andrea.villa 7b00a25b15 Aggiunto parametro 'IS_TEST_MACHINE' per test interni 2024-04-12 09:26:46 +02:00
andrea.villa 918ba0f7e5 Merge branch 'main' into develop 2024-04-09 11:48:57 +02:00
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 723dec58b4 Piccola correzione: Primo movimento in X per testa 2 a SafeX2 anziché a ParkX2. 2024-02-15 15:41:07 +01:00
andrea.villa de7e8d9c5a Merge branch 'main' into develop 2024-02-15 15:27:20 +01:00
andrea.villa c0e3384dbe Merge branch 'develop' 2024-02-15 15:27:09 +01:00
andrea.villa 23c06ca46d Primo movimento in X per testa 2 a SafeX2 anziché a ParkX2 2024-02-15 15:26:56 +01:00
andrea.villa 8201cbc5f7 Merge branch 'main' into develop 2024-02-07 10:11:24 +01:00
andrea.villa 704ad5e155 Merge branch 'develop' 2024-02-07 10:11:04 +01:00
andrea.villa 956302812f - Inserito parametro 'MinLengthLongCSaw' per gestione motosega molto lunga
- funzione 'GetCurrChainSawingVirtualAxis' spostata in MLDE
2024-02-07 10:10:52 +01:00
andrea.villa 75c0b0371b Merge branch 'main' into develop 2024-01-31 08:11:50 +01:00
andrea.villa 4f26b2c480 Merge branch 'develop' 2024-01-31 08:11:37 +01:00
andrea.villa a631561a7a - Migliorata simulazione apertura/chiusura morse
- Migliorata gestione movimenti con motosega
- Corretta scrittura assi in caso di 'WriteAllCoordsOnFirstM101' per testa 2
2024-01-31 08:11:20 +01:00
andrea.villa 435112f30a Merge branch 'main' into develop 2024-01-25 09:41:25 +01:00
andrea.villa 38ea5b2381 Merge branch 'develop' 2024-01-25 09:41:01 +01:00
andrea.villa 2fbcb05548 Versione stabile 2.6a4
- Corretto movimento in caso di cambio assi rotanti tra due lavorazioni
- Corretta emissione coordinate assi in caso di 'WriteAllCoordsOnFirstM101'
2024-01-25 09:40:38 +01:00
andrea.villa f9269882cc Merge branch 'main' into develop 2024-01-22 09:50:39 +01:00
andrea.villa c4456d6703 Merge branch 'develop' 2024-01-22 09:50:32 +01:00
andrea.villa 55f70a181f Versione stabile 2.6a3 2024-01-22 09:50:18 +01:00
andrea.villa ef11694758 Merge branch 'main' into develop 2024-01-19 08:19:32 +01:00
5 changed files with 671 additions and 268 deletions
+233 -114
View File
@@ -1,11 +1,12 @@
-- Processore macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
-- 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
@@ -29,7 +30,6 @@ function OnStart()
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 116000 -- feed massima pinze
SetToParkLine() -- si inizia con linee da parcheggiare su stack
end
---------------------------------------------------------------------
@@ -40,14 +40,18 @@ end
---------------------------------------------------------------------
function OnProgramStart()
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
-- Intestazioni
if EMT.INFO then
EmitRemark( EMT.INFO)
MyOutput( sPrefixCommentLine..'('..EMT.INFO..')')
else
EmitRemark( 'Program Start')
MyOutput( '(Program Start)')
end
EmitRemark( CSP_INFO)
EmitRemark( MACHINE_INFO)
MyOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
MyOutput( sPrefixCommentLine..'('.. 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')
@@ -105,8 +109,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
@@ -118,13 +134,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
@@ -148,7 +166,7 @@ function OnDispositionStart()
' P15='..EmtLenToString( -DeltaTabY, 2)..' P16='..EmtLenToString( DeltaTabZ - MillOffs, 2)..
' P17='..EmtLenToString( Delta2TabY, 2)..' P18='..EmtLenToString( -Delta2TabZ - Mill2Offs, 2)
-- se è in configurazione a 3 teste
if EgtGetHeadId( 'H31') then
if EgtGetHeadId( 'H31') then
sOut = sOut .. ' P19='..EmtLenToString( -Delta3TabY, 2)..' P20='..EmtLenToString( Delta3TabZ - Mill3Offs, 2)..
' P21='..EmtLenToString( Mill3Offs, 2).. ' P22='.. EmtLenToString( -ParkInLavZ2, 2)
else
@@ -367,20 +385,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
@@ -398,21 +402,29 @@ function OnMachiningStart()
-- valore dell'asse virtuale
dPosA = GetCurrChainSawingVirtualAxis()
-- imposto home dell'asse C1 (A=0 -> T101, A=90 -> T104)
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
EmtModifyAxisHome( 'C1', MyParkCSawC1)
-- se lama su aggregato testa sotto, aggiusto subito angolo scelto per asse virtuale A
elseif EMT.HEAD == 'H22' then
-- valore dell'asse virtuale
local dPrevA = dPosA
dPosA = GetCurrSawingVirtualAxis()
-- imposto home dell'asse C2 (A=0 -> T201, A=90 -> T204)
local MyParkCSawC2 = GetSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkCSawC2)
-- se lavorazione attuale e precedente con sega a catena con angolo A diverso, devo scaricare e ricaricare
if EMT.HEAD == EMT.PREVHEAD_H2 then
if abs( dPosA - dPrevA) > 1 then
EMT.TO_ZMAX = true
EMT.R3_CHANGED = true
end
end
end
-- gestione eventuale lavorazione in doppio
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
if nDouType == 2 or nDouType == 3 then
local sDouTool = EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
local sDouTool = EgtGetValInNotes( EMT.MCHUSERNOTES, 'TOOLDOUBLE', 's') or EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
local sOldTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
if EgtTdbSetCurrTool( sDouTool) and EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
-- salvo dati
@@ -521,6 +533,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
---------------------------------------------------------------------
@@ -536,9 +564,13 @@ function OnPathStart()
--MyOutput( 'CNT='.. tostring( EMT.CNT or 0))
-- se utensile non cambiato, salvo eventuali precedenti rotanti
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
EMT.L2pp = EMT.L2op
EMT.L3pp = EMT.L3op
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
else
EMT.L2pp = nil
EMT.L3pp = nil
EMT.R1pp = nil
EMT.R2pp = nil
end
@@ -652,6 +684,7 @@ function OnRapid()
if EMT.MCHFIRST and not EMT.OPEISDISP then
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
local HomeZ1 = EgtGetAxisHomePos( 'Z1')
local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2'))
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
@@ -662,7 +695,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)
@@ -684,7 +717,12 @@ function OnRapid()
-- se testa 1
if nHSet == 1 then
-- selezione testa (posso muovere X solo a Zmax)
local MaxZ1 = EgtGetAxisMax( 'Z1')
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- 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))
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MyMaxZ1, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
-- se necessario allargo le cabine
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
@@ -692,14 +730,12 @@ function OnRapid()
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, bSplitCut)
end
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
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})
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
else
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MaxZ1, S=Speed})
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=MyMaxZ1, S=Speed})
end
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
@@ -710,17 +746,28 @@ function OnRapid()
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
-- se sega a catena
if EMT.HEAD == 'H15' then
EmitMoveDataHead( 1, { X=ParkCSawX1, Z=ParkCSawZ1, B=HomeB1, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
if EMT.HEAD == 'H13' then
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
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
if EMT.HEAD ~= 'H13' then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
else
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
end
end
EmitMoveStartHead( 1)
-- se lavorazione in doppio
@@ -767,9 +814,20 @@ 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=ParkSawX2, 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})
if EMT.HEAD == 'H22' then
EmitMoveDataHead( 2, { X=ParkSawX2, S=Speed})
else
EmitMoveDataHead( 2, { X=ParkX2, S=Speed})
end
end
if ( not EMT.L2pp or ( EMT.L2pp and EMT.L2pp > ParkMchY2)) and ( ParkB2 ~= EMT.R2 or ParkC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, Z=ParkZ2, B=ParkB2, C=ParkC2, S=Speed})
end
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
@@ -780,8 +838,11 @@ function OnRapid()
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, bSplitCut)
end
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, S=Speed})
EmitMoveDataHead( 2, { 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)
@@ -816,10 +877,6 @@ function OnRapid()
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
end
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
if not EMT.Y1DELTA then
EMT.V1NEXTPOS = ParkV1
end
-- dati aggancio a trave
local BhData = { T=EMT.L1, SetHead=0}
if EMT.Y1DELTA then
@@ -872,7 +929,18 @@ function OnRapid()
else
--MyOutput( string.format( 'V1Pos=%.3f V2Pos=%.3f', EMT.V1POS, EMT.V2POS))
if not EMT.RELOAD and not EMT.ZMAX and #EMT.AUXCMD > 0 and EMT.TO_ZMAX then
EmitZmax( false, false, PrevR1, PrevR2)
-- caso speciale in cui bisogna solo cambiare presa aggregato lama sotto
if EMT.R3_CHANGED then
-- EmitZmax è fatta per essere chiamata con utensile attuale. In questo caso l'attuale è già quello con nuova rotazione
-- Allora salvo l'attuale e imposto il vecchio solo momentanemente, per poi ripristinarlo
local sBckTcPos = EMT.TCPOS
EMT.TCPOS = EMT.PREVTCPOSREAL_H2
EmitZmax( false, false, PrevR1, PrevR2)
EMT.TCPOS = sBckTcPos
EMT.R3_CHANGED = nil
else
EmitZmax( false, false, PrevR1, PrevR2)
end
EMT.ZMAX = true
EMT.TO_ZMAX = nil
PrevR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
@@ -899,10 +967,6 @@ function OnRapid()
EmitMoveWaitChars( nMoveType)
end
EMT.MDCHAR = {}
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
if not EMT.Y1DELTA then
EMT.V1NEXTPOS = ParkV1
end
-- se necessario allargo le cabine
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
@@ -948,7 +1012,7 @@ function OnRapid()
if not WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), S=Speed})
end
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { Z=MyMaxZ1, B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
@@ -962,14 +1026,19 @@ function OnRapid()
else
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 1, { X=ParkCSawX1, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=dSafeZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- Porto la Z alla giusta quota
if EMT.L3 > HomeZ1 + 1 and abs( EMT.R2) > 89.9 then
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
EmitMoveDataHead( 1, { Z=HomeZ1, S=Speed})
end
EmitMoveDataHead( 1, { Z=HomeZ1, B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se motosega molto lunga, ruoto prima di muovermi in X
if EMT.TTOTLEN >= MinLengthLongCSaw then
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
end
end
end
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
@@ -1030,16 +1099,44 @@ 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)
if not EMT.L2pp then EMT.L2pp = EgtGetAxisHomePos( 'X2') end
-- 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=ParkSawX2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
else
EmitMoveDataHead( 2, { X=SafeX2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
end
-- scrivo solo se gli assi rotanti sono cambiati
EmitMoveDataHead( 2, { Z=-dSafeZ2, S=Speed})
if EMT.L2pp > ParkMchY2 and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, Z=-dSafeZ2, B=CurrB2, C=CurrC2, S=Speed})
end
else
-- scrivo solo se gli assi rotanti sono cambiati
if EMT.L2pp > ParkMchY2 and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, 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.ZMAX and EMT.L2pp > ParkMchY2 and ( CurrB2 ~= EMT.R2 or CurrC2 ~= EMT.R1) then
EmitMoveDataHead( 2, { X=ParkMchY2, 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)
@@ -1124,11 +1221,15 @@ 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))
local dZ2 = -Head2Z + MillOffs + Mill2Offs + EMT.L3
-- dato che la testa 2 è slave, bisogna controllare eventuale extra-corsa da post
if dZ2 > MaxZ2 then
EmtSetLastError( 1220, EMT.MCHNAME..' ==> Out of Stroke: Z2 : '.. EgtNumToString( dZ2-MaxZ2, 2))
end
local dC2 = EMT.R1
local dB2 = EMT.R2
EmitMoveDataHead( 2, { Z=-dZ2, B=dB2, C=dC2, TPos=EMT.DOU_TPOS, S=EMT.DOU_SPEED})
@@ -1144,7 +1245,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
@@ -1183,11 +1284,11 @@ function OnRapid()
local sAxes = EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
if #sAxes > 0 then
if EmitRapidInG0 then
MyOutput( 'G0' .. sAxes)
else
if EmitRapidInG1 then
local sFeed = ' F30000'
MyOutput( 'G1' .. sAxes .. sFeed)
else
MyOutput( 'G0' .. sAxes)
end
end
-- se altrimenti risalita a Z max a fine lavorazione
@@ -1198,9 +1299,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
@@ -1246,13 +1347,13 @@ function OnLinear()
-- emissione movimento
EMT.R1p = nil
EMT.R2p = nil
if EmitRapidInG0 then
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
else
if EmitRapidInG1 then
local sFeed = ' F30000'
sOut = 'G1'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')..sFeed
else
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
end
MyOutput( sOut)
@@ -1351,7 +1452,7 @@ end
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.6 -- [s]
local MaxTempoAcc = 6.0 -- [s]
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
@@ -1376,7 +1477,7 @@ function CalcForzaPinze( dH, dS, dL, dT)
if dMinJoin < 0.9 * BD.MIN_JOIN_L then
return MinForzaPinze
else
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local Forza = Massa / MassaRef * MaxForzaPinze
return EgtClamp( Forza, MinForzaPinze, MaxForzaPinze)
@@ -1624,7 +1725,10 @@ function PrepareMoveChar( sCmd, nInd)
elseif Cmd[1] == '11' then
EMT.ISY1 = CalcCharStatusN( Cmd[2])
EMT.FSY1 = EMT.ISY1
EMT.BV = EgtIf( Cmd[2] ~= '0', 1, 2)
-- se pinza due in presa, non attivo la 1
if EMT.BV ~= 2 then
EMT.BV = EgtIf( Cmd[2] ~= '0', 1, 2)
end
if #EMT.MDCHAR > 0 then EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = EMT.FSY1 end
elseif Cmd[1] == '12' then
EMT.ISY2 = CalcCharStatusN( Cmd[2])
@@ -1939,7 +2043,7 @@ end
function GetV1ToCloseTPA()
local dMaxHeadPos = EMT.MAXMAX[1] + ( EMT.HOVM or 0) - ( EMT.X_OFF or 0)
local dMinTailPos = EMT.MAXMIN[1] + EMT.LB + EgtIf( IsStartOrMidPhase( EMT.PHASE), 0, ( EMT.HOVM or 0)) - ( EMT.X_OFF or 0)
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0)))
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f V1NextPos=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0), EMT.V1NEXTPOS))
return ( dMaxHeadPos <= EMT.V1NEXTPOS + RollCageMin and dMinTailPos >= EMT.V1NEXTPOS + RollCageMax)
end
@@ -1980,7 +2084,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
@@ -2062,17 +2166,17 @@ function AdjustTcPos( bLen3, sTcPos, dAxR3)
if not dAxR3 then dAxR3 = EMT.R3 end
if abs( dAxR3 - 0) < 0.1 then
sPos = '201'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '202'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '203'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '204'
-- Lama su aggregato da sotto non può essere presa in queste posizioni per problemi di collisione durante parcheggio
--elseif abs( dAxR3 - 270) < 0.1 then
-- sPos = '202'
--elseif abs( dAxR3 - 180) < 0.1 then
-- sPos = '203'
else
EmtSetLastError( 1210, 'Saw orientation not allowed')
end
end
return sPos
end
@@ -2107,7 +2211,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) ..
@@ -2210,19 +2315,15 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
EmitMoveWaitHead( 1)
-- altrimenti sega a catena
else
-- salzo in Z sicurezza raddrizzando la B
EmitMoveDataHead( 1, { Z=ParkCSawZ1, B=dHomeB1, Fmt=1})
-- salgo in Z sicurezza raddrizzando la B
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')
@@ -2236,7 +2337,15 @@ 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
-- solo se è macchina a 3 teste, devo stare più alto
if EgtGetHeadId( 'H31') then
EmitMoveDataHead( 2, { Z=-ParkInLavZ2, Fmt=1})
end
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
-- altrimenti testa 3
@@ -2351,8 +2460,8 @@ function EmitParkRoller( dPosT, bSplitCut)
local dPosY2 = dPosT + EMT.Y2DELTA
local DiffY2 = MyParkY2 - dPosY2
local dMoveY2 = EgtIf( DiffY2 < -0.1, dMoveV2, 0)
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT
if ( dPosT + EMT.LT < ParkV1 + ExtraParkV and dPosT + EMT.LT > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT - EMT.HOVM
if ( dPosT + EMT.LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
--MyOutput( string.format( 'PosT=%.3f LT=%.3f PosY2=%.3f V2POS=%.3f', dPosT, EMT.LT, dPosY2, EMT.V2POS))
MDChar.Y2 = dPosY2 + dMoveY2
MDChar.MovType = 2
@@ -2428,8 +2537,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
@@ -2448,14 +2557,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
@@ -2471,7 +2580,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
@@ -2480,7 +2589,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
@@ -2505,7 +2614,7 @@ function PreselectNextDiffHead( nMchId, sHead)
elseif sNextHead == 'H13' then
-- recupero il valore dell'asse virtuale bloccato A
local dPosA = GetCurrChainSawingVirtualAxis()
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
local bXSpec = EgtIf( BD.RIGHT_LOAD, ( dNextX > -DeltaTabY), ( dNextX < -DeltaTabY))
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, dNextX), B=ParkCSawB1, C=MyParkCSawC1, TPos=AdjustTcPos( false, sNextTcPos, dPosA), Fmt=2})
EmitMoveStartHead( 1)
@@ -2589,8 +2698,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
@@ -2599,7 +2718,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
+275 -121
View File
@@ -1,4 +1,4 @@
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2023/12/14
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2024/01/22
-- Funzioni generiche indipendenti dal controllo
@@ -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
@@ -78,9 +120,15 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'CEIL'},
{ 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 = 'X3', Sub = 'COLLISION', Name = 'STM'})
end
-- inserisco gruppi opzionali
if SecondChain then table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW2'}) end
@@ -259,8 +307,8 @@ function OnSimulDispositionStart()
EMT.SCRAP = nil
end
EMT.LB = b3Bar:getDimX()
EMT.LT = b3Raw:getDimX()
EMT.LP = b3Part:getDimX()
EMT.LR = b3Raw:getDimX()
EMT.LT = b3Part:getDimX()
EMT.CUTID = EgtGetInfo( EgtGetFirstPartInRawPart( nPartRawId or GDB_ID.NULL) or GDB_ID.NULL, 'CUTID', 'i') or 0
EMT.Y1SPEC = nil
-- se vero inizio, assegno solidi per verifica collisione
@@ -408,6 +456,9 @@ function OnSimulToolSelect( dPosA)
if EgtGetHeadId( 'H31') then
EgtSetAxisPos( 'X3', ParkX3)
end
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' then
EgtSetAxisPos( 'Z1', MaxZ1Blade)
end
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
-- se testa 3 parcheggio la 1
@@ -421,7 +472,7 @@ function OnSimulToolSelect( dPosA)
-- imposto il valore di A
EgtSetAxisPos( 'A1', dPosA)
-- imposto home dell'asse C1 (A1=0 -> T101, A1=90 -> T104)
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
EmtModifyAxisHome( 'C1', MyParkCSawC1)
EgtSetAxisPos( 'C1', MyParkCSawC1)
-- Imposto visualizzazione
@@ -429,16 +480,20 @@ 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)
-- se c'era un altro utensile, imposto subito asse virtuale
if EMT.PREVHEAD_H2 ~= 'H22' then
dPosA = dPosA or GetNextSawingVirtualAxis( EMT.MCHID)
end
if dPosA then
-- imposto il valore di A
EgtSetAxisPos( 'A2', dPosA)
-- imposto home dell'asse C1 (A2=0 -> T201, A2=90 -> T204)
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)
@@ -467,14 +522,18 @@ 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
local nSetHead = GetHeadSet( EMT.NEXTHEAD)
-- recupero il gruppo attuale e il successivo
local nNextSetHead = GetHeadSet( EMT.NEXTHEAD)
local nSetHead = GetHeadSet( EMT.HEAD)
-- se devo deselezionare testa 3, la mando a parcheggio
if nSetHead == 3 then
SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID)
-- per testa gruppo 2
if nSetHead == 2 then
elseif nNextSetHead == 2 then
-- deposito lama su aggregato testa sotto
if EMT.PREVHEAD_H2 == 'H22' then
-- simulo movimento
@@ -482,6 +541,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
@@ -492,7 +552,7 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetStatus( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_ST.OFF)
-- se testa gruppo 1
else
elseif nNextSetHead == 1 and EMT.PREVTCPOS_H1 then
-- deposito utensile fresa
if EMT.PREVHEAD_H1 == 'H11' then
-- simulo movimento
@@ -503,11 +563,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
@@ -522,7 +582,7 @@ function OnSimulToolDeselect( dPrevA)
-- simulo movimento
local ParkC1 = EgtGetAxisHomePos( 'C1')
if dPrevA then
ParkC1 = GetChainSawCHomeFromVirtualAxis( dPrevA)
ParkC1 = GetChainSawCHomeFromVirtualAxis( dPrevA, EMT.TTOTLEN)
end
SimulMoveAxes( 'B1', ParkCSawB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkCSawX1, MCH_SIM_STEP.RAPID)
@@ -549,8 +609,6 @@ function OnSimulToolDeselect( dPrevA)
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
end
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
elseif nNextSetHead == 1 then
SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID)
end
-- movimento per prendere nuovo utensile
-- prendo utensile fresa
@@ -611,32 +669,15 @@ function OnSimulMachiningStart()
local dPosA = tonumber( sVal:sub( 4)) or 0
if abs( dPosA - dPrevA) > 1 then
ExecParkRoller( nil, nil, nil, nil, false, bAgg)
-- setto i valori per la funzione ToolDesel
EMT.NEXTHEAD = EMT.HEAD
EMT.NEXTTOOL = EMT.TOOL
EMT.NEXTEXIT = EMT.EXIT
OnSimulToolDeselect( dPrevA)
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.ON)
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)
@@ -697,6 +738,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
@@ -714,6 +756,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
---------------------------------------------------------------------
@@ -730,13 +795,13 @@ 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
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
EMT.Y1DELTA = nil
SetPY1Light( false)
ExecMovePY1( false)
end
ExecMoveZmax( EMT.MCHSPLIT)
EMT.TO_ZMAX = nil
@@ -746,19 +811,19 @@ end
---------------------------------------------------------------------
function OnSimulPathStartAux()
-- eseguo il comando
ExecAuxCmd( EMT.AUX)
ExecAuxCmd( EMT.AUX, true)
-- se ultimo comando e lavorazione di split, sgancio il carro Y1
if EMT.AUXIND == EMT.AUXTOT and EMT.MCHSPLIT and not EMT.TO_FALL then
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
EMT.Y1DELTA = nil
SetPY1Light( false)
ExecMovePY1( false)
end
end
---------------------------------------------------------------------
function OnSimulPathEndAux()
-- eseguo il comando
ExecAuxCmd( EMT.AUX)
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)
@@ -848,6 +913,7 @@ function OnSimulMoveStart()
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
@@ -856,7 +922,7 @@ function OnSimulMoveStart()
-- 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)
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
@@ -882,6 +948,10 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
SimulMoveAxes( 'Z1', Z1Home, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- 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
@@ -889,13 +959,39 @@ function OnSimulMoveStart()
local B2Home = EgtGetAxisHomePos( 'B2')
local C2Home = EgtGetAxisHomePos( 'C2')
local Z2Home = EgtGetAxisHomePos( 'Z2')
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)
local X2Home = EgtGetAxisHomePos( 'X2')
local X2Pos = EgtGetAxisPos( 'X2')
local B2Pos = EgtGetAxisPos( 'B2')
local C2Pos = EgtGetAxisPos( 'C2')
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', ParkSawX2, 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)
-- Porto la X alla giusta quota
if EMT.HEAD ~= 'H22' and X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
end
else
-- Porto la X alla giusta quota
if EMT.ZMAX and X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
else
-- Porto la X alla giusta quota
if EMT.ZMAX and X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, 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
@@ -947,7 +1043,7 @@ function OnSimulMoveStart()
EmtSetLastError( 1208, sErr)
end
-- se appena sopra inizio, sistemo subito la quota in Z
if EMT.MOVE == 0 and EMT.FLAG == 1 then
if EMT.MOVE == 0 then
SimulMoveAxes( 'Z2', EMT.A6, MCH_SIM_STEP.RAPID)
end
end
@@ -1009,16 +1105,21 @@ 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
if EMT.SPLIT_Y1DELTA then
EMT.SPLIT_Y1DELTA = nil
SetPY1Light( true)
ExecMovePY1( true)
end
-- chiusura o apertura rulli V1
if GetV1ToClose() then
@@ -1052,7 +1153,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
@@ -1081,7 +1182,7 @@ function OnSimulCollision()
end
---------------------------------------------------------------------
function ExecAuxCmd( sCmd)
function ExecAuxCmd( sCmd, bPathStart)
-- analizzo il comando
local Cmd = EgtSplitString( sCmd)
if Cmd[1] == '0' then
@@ -1094,29 +1195,31 @@ function ExecAuxCmd( sCmd)
end
EgtOutText( Cmd[2])
elseif Cmd[1] == '1' then
if EMT.SPLIT then ExecOpenRoller( 1) end
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
sV1, MoveV1, MCH_SIM_STEP.RAPID,
sV2, MoveV2, MCH_SIM_STEP.RAPID)
if not bOk then
if not bOk1 then
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
if Cmd[2] ~= 'Z' then
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
sV1, MoveV1, MCH_SIM_STEP.RAPID,
sV2, MoveV2, MCH_SIM_STEP.RAPID)
if not bOk then
if not bOk1 then
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
end
elseif not bOk2 then
VerifyV1V2Stroke( sV1, MoveV1)
elseif not bOk3 then
VerifyV1V2Stroke( sV2, MoveV2)
end
elseif not bOk2 then
VerifyV1V2Stroke( sV1, MoveV1)
elseif not bOk3 then
VerifyV1V2Stroke( sV2, MoveV2)
end
end
elseif Cmd[1] == '2' then
-- Verifico movimento carrello con trave agganciata
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
-- Eseguo i movimenti necessari
if EMT.SPLIT then ExecOpenRoller( 1) end
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
local bOk, bOk1, bOk2, bOk3, bOk4 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
@@ -1138,8 +1241,8 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrelli con trave agganciata
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
-- Eseguo i movimenti necessari
if EMT.SPLIT then ExecOpenRoller( 1) end
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
local bOk, bOk1, bOk2, bOk3, bOk4, bOk5 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
@@ -1159,13 +1262,13 @@ function ExecAuxCmd( sCmd)
end
end
elseif Cmd[1] == '4' then
ExecMoveHome( Cmd[2] == '1', EMT.MCHSPLIT)
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
elseif Cmd[1] == '11' then
SimulMoveAxes( 'PY1', EgtIf( Cmd[2] == '0', MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( Cmd[2] ~= '0')
local bClose = Cmd[2] ~= '0'
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
ExecMovePY1( bClose)
elseif Cmd[1] == '12' then
SimulMoveAxes( 'PY2', EgtIf( Cmd[2] == '0', MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( Cmd[2] ~= '0')
ExecMovePY2( Cmd[2] ~= '0')
elseif Cmd[1] == '21' then
local nY1Delta = tonumber( Cmd[2])
local nY2Delta = tonumber( Cmd[3])
@@ -1221,7 +1324,7 @@ function ExecStartHome()
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
-- Testa 2
EgtResetAxisPos( 'X2')
EgtSetAxisPos( 'X2', SafeX2)
EgtSetAxisPos( 'Z2', MinZ2)
EgtResetAxisPos( 'C2')
EgtResetAxisPos( 'B2')
@@ -1231,12 +1334,16 @@ end
function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit)
-- se testa sotto
if GetHeadSet( EMT.HEAD) == 2 then
-- se testa sotto e macchian a 3 teste
if GetHeadSet( EMT.HEAD) == 2 and EgtGetHeadId( 'H31') then
if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
end
if not SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
end
end
EMT.TO_ZMAX = nil
-- se richiesto, avvicino i rulli
if bNearV then
ExecOpenRoller( 1)
@@ -1273,13 +1380,14 @@ function ExecMoveZmax( bMchSplit)
end
-- se testa sopra
if nSetHead == 1 then
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- se fresa o lama
if EMT.HEAD ~= 'H13' then
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) then
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
end
if ( not BD.RIGHT_LOAD and EMT.L2 > DeltaTabY) or ( BD.RIGHT_LOAD and EMT.L2 < DeltaTabY) then
SimulMoveAxis( 'X1', DeltaTabY, MCH_SIM_STEP.RAPID)
@@ -1287,11 +1395,12 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID)
-- altrimenti sega a catena
else
-- salzo in Z sicurezza raddrizzando la B
SimulMoveAxes( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
-- salgo in Z sicurezza raddrizzando la B
local SafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
SimulMoveAxes( 'Z1', SafeZ1, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
-- se lavorazione in doppio
@@ -1311,7 +1420,15 @@ 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
-- solo se è macchina a 3 teste, devo stare più alto
if EgtGetHeadId( 'H31') then
SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID)
end
-- altrimenti testa 3
else
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
@@ -1340,10 +1457,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
@@ -1368,6 +1489,18 @@ function ExecUnloading()
end
end
---------------------------------------------------------------------
function ExecMovePY1( bClose)
SimulMoveAxes( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( bClose)
end
---------------------------------------------------------------------
function ExecMovePY2( bClose)
SimulMoveAxes( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( bClose)
end
---------------------------------------------------------------------
local function LinkRemainingPartsToY1()
local nCurrOrd = GetPhaseOrd( EMT.PHASE)
@@ -1397,6 +1530,9 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
-- Parcheggi pinze
local MyParkY1 = ParkY1 + EgtIf( bAgg, AggLoad, 0)
local MyParkY2 = ParkY2
-- Apro i rulli, se necessario
if abs( ParkV1 - PosV1) > 0.1 then ExecOpenRoller( 1) end
if abs( ParkV2 - PosV2) > 0.1 then ExecOpenRoller( 2) end
-- Eseguo spostamenti
if EMT.Y1DELTA and EMT.Y2DELTA then
local DiffY1 = MyParkY1 - PosY1
@@ -1450,7 +1586,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV1 = ParkV1 - PosV1
local DiffY1 = MyParkY1 - PosY1
local MoveY1 = EgtIf( DiffY1 > 0.1, MoveV1, 0)
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LP, 0)
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0)
if ( PosT > ParkV2 - ExtraParkV and PosT < ParkV1 and PosY1 + TryMoveY1 < MaxY1) then MoveY1 = max( MoveY1, TryMoveY1) end
-- se appena eseguito taglio di separazione
if bSpliCut then
@@ -1480,8 +1616,8 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV2 = ParkV2 - PosV2
local DiffY2 = MyParkY2 - PosY2
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
local TryMoveY2 = ParkV2 - PosT - EMT.LP
if ( PosT + EMT.LP < ParkV1 + ExtraParkV and PosT + EMT.LP > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
local TryMoveY2 = ParkV2 - PosT - EMT.LT
if ( PosT + EMT.LT < ParkV1 + ExtraParkV and PosT + EMT.LT > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
'V1', ParkV1, MCH_SIM_STEP.RAPID,
'V2', ParkV2, MCH_SIM_STEP.RAPID,
@@ -1516,14 +1652,14 @@ 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]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local dTCenX = -EgtGetAxisPos( 'T') - EMT.LP / 2
local dTCenX = -EgtGetAxisPos( 'T') - EMT.LT / 2
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
@@ -1547,7 +1683,6 @@ function RemoveScraps()
end
EMT.VMRS = false
end
end
---------------------------------------------------------------------
@@ -1716,14 +1851,14 @@ end
---------------------------------------------------------------------
function GetV1ToClose()
--EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB))
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LP or 0))
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax)
end
---------------------------------------------------------------------
function GetV2ToClose()
--EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB))
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LP or 0))
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
return ( EMT.MAXMAX[1] <= EMT.V2NEXTPOS - RollCageMax and EMT.MAXMIN[1] + EMT.LB >= EMT.V2NEXTPOS - RollCageMin)
end
@@ -1741,7 +1876,7 @@ function LoadFirstTool( nHSet, sTcPosDef)
if nHSet ~= 1 and nHSet ~= 2 then return end
EgtUnloadTool( EgtIf( nHSet == 1, 'H11', 'H21'), 1)
if GetHeadSetFromTcPos( sTcPosDef) ~= nHSet then return end
local sTool, sHead, sTcPos = FindFirstToolOnHeadSet( nHSet)
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis = FindFirstToolOnHeadSet( nHSet)
if not sTool then
local vTools = EgtGetToolsInCurrSetupPos( sTcPosDef)
if vTools and vTools[1] then
@@ -1753,12 +1888,32 @@ function LoadFirstTool( nHSet, sTcPosDef)
if sTool then
-- imposto correttamente i dati di testa
local OrigEMC = EMC
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = 0}
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)
-- salvo utensili caricati
if nHSet == 1 then
EMT.PREVTOOL_H1 = sTool
EMT.PREVHEAD_H1 = sHead
EMT.PREVTCPOS_H1 = sTcPos
EMT.PREVTTOTLEN_H1 = sTTotLen
-- per gruppo testa 2
elseif nHSet == 2 then
EMT.PREVTOOL_H2 = sTool
EMT.PREVHEAD_H2 = sHead
EMT.PREVTCPOS_H2 = sTcPos
EMT.PREVTTOTLEN_H2 = sTTotLen
end
end
return sTool
end
@@ -2172,7 +2327,7 @@ function FindFirstToolOnHeadSet( nHSet)
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
local OpId = EgtGetFirstActiveOperation()
while OpId do
local nType = EgtGetOperationType( OpId)
@@ -2182,8 +2337,15 @@ function FindFirstToolOnHeadSet( nHSet)
if EgtTdbSetCurrTool( sTest) then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if GetHeadSet( sHead) == nHSet then
sTool = sTest
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
-- aggregato lama non si può mai preselezionare e viene sempre scaricato, quindi non sarà mai già caricato
if nHSet == 2 and sTcPos == 'T201' then
sTcPos = nil
break
end
sTool = sTest
sTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
sBlockedAxis = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
break
end
end
@@ -2195,7 +2357,7 @@ function FindFirstToolOnHeadSet( nHSet)
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
return sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
end
---------------------------------------------------------------------
@@ -2213,14 +2375,6 @@ function GetToolTcPos( sTool)
return sTcPos
end
---------------------------------------------------------------------
function GetCurrChainSawingVirtualAxis()
-- recupero il valore dell'asse virtuale bloccato A
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A1=0'
local dPosA = tonumber( sVal:sub( 4)) or 0
return dPosA
end
---------------------------------------------------------------------
function GetNextChainSawingVirtualAxis( MchId)
-- recupero la lavorazione successiva
+62 -25
View File
@@ -1,12 +1,11 @@
-- Special Operations macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
-- 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 ***
@@ -72,14 +71,14 @@ function OnSpecialGetMaxZ()
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 = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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
else
EMC.MAXZ = ParkZ1 + 1
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 = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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)
@@ -90,14 +89,14 @@ function OnSpecialGetMaxZ()
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 = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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
else
EMC.MAXZ = ParkZ1 + 1
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 = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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)
@@ -253,6 +252,22 @@ local function GetNextStartOrRestPhase( nPhase)
return nNextPhase
end
---------------------------------------------------------------------
local function IsFirstMachiningOfStart( nMchId)
-- se non è fase inizio di pezzo, ritorno risultato negativo
if not IsStartOrRestPhase( EMC.PHASE) then
return false
end
-- recupero la precedente operazione attiva
local nPrevOperId = EgtGetPrevActiveOperation( nMchId)
-- se non esiste o non è una disposizione, ritorno risultato negativo
if not nPrevOperId or EgtGetOperationType( nPrevOperId) ~= MCH_OY.DISP then
return false
end
-- è la prima
return true
end
---------------------------------------------------------------------
local function UpdateMinJoin()
MinJoin = BD.GetMinJoin( EMC.SB, EMC.HB, EMC.LB)
@@ -669,6 +684,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
EMC.SB = b3Tot:getDimY()
EMC.HB = b3Tot:getDimZ()
EMC.LT = b3Raw:getDimX()
EgtOutLog( ' BarLen='..EgtNumToString( EMC.LB, 1), 3)
-- Aggiorno limiti di presa
UpdateMinJoin()
@@ -872,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
@@ -1061,8 +1081,8 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
return {}
end
-- al carico si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
if EMC.LOAD then EMC.HCING = 0 end
-- al carico o con prima lavorazione di un pezzo si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
if EMC.LOAD or IsFirstMachiningOfStart( EMC.MCHID) then EMC.HCING = 0 end
return SpecAdjustCarriages( WorkTab)
@@ -1264,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
--------------------------------------------------------------------------------------------------------
@@ -1287,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
@@ -1298,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]**
@@ -1819,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
@@ -1883,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
@@ -1958,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
@@ -2126,8 +2163,8 @@ function SpecAdjustCarrB1( WorkTab)
if not SpecTestSomeMoveInCmds( vCmd) then
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
end
table.insert( vCmd, { 11, 1}) -- chiudo Y1
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
table.insert( vCmd, { 11, 1}) -- chiudo Y1
-- imposto i nuovi parametri di aggancio
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
@@ -2198,8 +2235,8 @@ function SpecAdjustCarrB2( WorkTab)
if not SpecTestSomeMoveInCmds( vCmd) then
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
end
table.insert( vCmd, { 11, 1}) -- chiudo Y1
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
table.insert( vCmd, { 11, 1}) -- chiudo Y1
-- imposto i nuovi parametri di aggancio
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
@@ -2259,7 +2296,7 @@ function SpecAdjustCarrC( WorkTab)
WorkTab.dY1DeltaMaxF = EMC.LB - ( MinJoin + MyTCING)
-- se Y1 deve accentrarsi
if WorkTab.dY1DeltaI > WorkTab.dY1DeltaMaxF then
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin + MyTCING
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin - MyTCING
end
end
-- posizioni obiettivo dei carrelli al centro dei rispettivi intervalli di validità
+99 -6
View File
@@ -1,11 +1,97 @@
==== 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.6e6 (28/05/2024)
- (GEN) Aggiunta possibilità di scrivere nome utensile doppio anche in lavorazione con parametro "TOOLDOUBLE". Note sulla lavorazione hanno precedenza su note utensile.
- (GEN) Ripristinato controllo extra-corsa per testa 2 in caso di lavorazioni in doppio in Y (si era perso in un vecchio commit)
- (SIM-GEN) Corretto movimento testa sotto su prima lavorazione. Ruotava a parcheggio invece di andare a quota sicurezza rotazione assi.
Versione 2.6e5 (23/05/2024)
- (GEN) Controllo extra-corsa per testa 2 in caso di lavorazioni in doppio in Y
- (GEN) Corretta lettura e salvataggio coordinala asse L2 con coordinate rispetto origine. Prima erano locali e sbagliava alcuni calcoli
- (SIM-GEN) Se lavorazione con testa 2 e stesso utensile, piccola correzione che manda a parcheggio se cambiano assi rotanti solo se si trova a ZMAX
Versione 2.6e4 (15/05/2024)
- (SIM-GEN) Miglioramento gestione lama su aggregato da sotto
Versione 2.6e3 (09/05/2024)
- (SIM) Corretto prelievo lama 2 (H16). Prima di visualizzare utensile, si sposta la Z alla quota massima. Prima trovava collisione in caso utensile precedente non lama (perchè era già oltre la quota massima).
Versione 2.6e2 (06/05/2024)
- (GEN) In parcheggio paratie/pinze, viene considerato sovramateriale di testa. Simulazione era corretta. Ticket#1789
Versione 2.6e1 (30/04/2024)
- (SIM-GEN) Per macchina a 3 teste, ripristinato posizionamento testa 2 tramite parametro ParkInLavZ2. La gestione era stata persa dal common.
- (MLDE-GEN) Gestione facoltativa parametro WOOD_DENSITY settabile in Ts3. In MLDE, mettere il valore di WOOD_DENSITY nella nostra variabile 'WoodDensity'.
Versione 2.6d2 (23/04/2024)
- (MLDE-GEN) Aggiunto parametro 'IS_TEST_MACHINE' FACOLTATIVO. Se non esiste o 'false' è macchina standard, se 'true' è una macchina utilizzata per i test Egalware interni
- (GEN) Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni, equivalente a settare 'IS_TEST_MACHINE' (che comunque rimane)
- (SIM-GEN) Modificato movimenti testa sotto. Prima si muove in quota 'ParkMchY2' e poi va alla coordinata di lavoro ruotando gli assi
- (SIM) Per lavorazioni in doppio, viene subito scritta la quota Z. La generazione era già corretta. Ticket#1377
- (GEN) Ripristinato movimento iniziale testa sopra assieme alle pinze. Spostato comando wait dopo primo movimento testa. Ticket#1730
- (MLDE-SIM-GEN) Aggiunto parametro MaxZ1Blade per differenziare Z massima aggregato lama e altri utensili.
- (SIM) Aggiunto controllo con solido di collisione per verificare di non salire oltre il massimo
- (SIM) Corretta simulazione scambio testa 3 -> testa 1
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_PINZE_2_3_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
@@ -13,3 +99,10 @@ Versione 2.6a2 (19/01/2024)
- (SIM-GEN) Tolta gestione rotazione pezzo (di derivazione PF), in macchina non è previsto ribaltamento
- (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.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
+2 -2
View File
@@ -1,9 +1,9 @@
-- Version.lua by EgalWare s.r.l. 2023/11/28
-- Version.lua by EgalWare s.r.l. 2024/01/22
-- Gestione della versione dei file comuni post-processori macchine PF1250 e PF1500 di Essetre
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6a2', -- versione script
VERSION = '2.6e6', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}