Compare commits

..

100 Commits

Author SHA1 Message Date
andrea.villa 343298e87f Viene ripristinato il tipo di arco corretto 2024-07-29 09:53:59 +02:00
andrea.villa be109120f1 Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. 2024-07-29 09:31:14 +02:00
andrea.villa cdbb04441b Se motosega allineata ad asse B per tagli di fianco, corretto movimento che manda testa a parcheggio. Pezzi più alti di 650 va solo in Zmax. 2024-07-23 10:33:46 +02:00
andrea.villa 5620e2b9e5 Merge remote-tracking branch 'origin/main' into develop 2024-07-19 16:43:32 +02:00
andrea.villa 9b99aa2a40 Merge remote-tracking branch 'origin/develop' 2024-07-19 16:43:15 +02:00
andrea.villa 97ae764439 Commit per versione 2.6g4 2024-07-19 16:43:00 +02:00
andrea.villa 566bb9e592 Aumentato numero iterazioni per scambio carrelli (da 5 a 10), per pezzi lunghi 30m. 2024-07-19 10:23:24 +02:00
andrea.villa 9948a9cfeb Merge remote-tracking branch 'origin/main' into develop 2024-07-17 15:57:34 +02:00
andrea.villa 8901acb95a Correzione modifica precedente (2.6g2). Con lama precedente e motosega successiva, andava a parcheggio con lama alla quota della motosega. 2024-07-17 15:57:15 +02:00
andrea.villa 74d58029a5 Merge branch 'main' into develop 2024-07-16 07:58:48 +02:00
andrea.villa f25aecf62a Merge branch 'develop' 2024-07-16 07:58:32 +02:00
andrea.villa 3d4246e540 Commit per versione 2.6g2 2024-07-16 07:58:18 +02:00
andrea.villa dad97ad557 Per preselezione o movimenti in home, non si scrive più 'ET0' perchè non è più supportato 2024-07-12 15:12:42 +02:00
andrea.villa 6c84aacd5a Merge remote-tracking branch 'origin/main' into develop 2024-07-10 15:57:54 +02:00
andrea.villa 3cd9d39aa0 Se prima lavorazione con motosega, dopo G151 di attesa carrelli si ribadiscono tutti gli assi. Sistemati tutti i casi 2024-07-10 15:57:32 +02:00
andrea.villa 77bb66d8d6 Merge branch 'main' into develop 2024-07-10 15:54:22 +02:00
andrea.villa a3b714f790 Se prima lavorazione con motosega, dopo G151 di attesa carrelli si ribadiscono tutti gli assi. 2024-07-10 15:54:07 +02:00
andrea.villa 929e1308a9 Merge branch 'main' into develop 2024-06-03 12:21:24 +02:00
andrea.villa 37d98a4324 Merge branch 'develop' 2024-06-03 12:21:07 +02:00
andrea.villa f3890dc20f Versione 2.6f1 2024-06-03 12:20:53 +02:00
andrea.villa 8bd92a578b Versione 2.6f1 2024-06-03 12:20:35 +02:00
andrea.villa 37b9eb3a9b 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:53:45 +02:00
andrea.villa ac09d872eb Merge branch 'main' into develop 2024-04-30 17:06:27 +02:00
andrea.villa 047669d63f Merge branch 'develop' 2024-04-30 17:06:16 +02:00
andrea.villa fcaeb8530b Gestione facoltativa parametro WOOD_DENSITY settabile in Ts3. In MLDE, mettere il valore di WOOD_DENSITY nella nostra variabile 'WoodDensity' 2024-04-30 17:06:08 +02:00
andrea.villa d174f8b79f In log collisioni, si scrive anche ID del gruppo 2024-04-22 10:42:17 +02:00
andrea.villa 621a31e283 Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni 2024-04-15 12:46:43 +02:00
andrea.villa acdc1cfce6 Merge branch 'main' into develop 2024-04-12 08:44:41 +02:00
andrea.villa 8d162200b1 Aggiornato file versione 2024-04-12 08:44:11 +02:00
andrea.villa 59e132478d Merge branch 'develop' 2024-04-12 08:43:15 +02:00
andrea.villa 62aefca5c8 Aggiunta variabile 'ForceToCloseRollersGate' per agevolare scambio pinze con pezzi storti 2024-04-09 09:35:05 +02:00
andrea.villa 530f70de94 Merge branch 'main' into develop 2024-03-28 12:21:37 +01:00
andrea.villa 04a2d35872 Merge branch 'develop' 2024-03-28 12:21:25 +01:00
andrea.villa edf7a29dfb Corretto movimento in simulazione se motosega su testa 2 2024-03-28 12:21:17 +01:00
andrea.villa 2edcbf52ad Rimosso da generazione funzione GetNextTool duplicata
- Se fase successiva start di un altro pezzo,  forza movimento home per utensili speciali
- Aggiunto parametro 'IS_TEST_MACHINE'
2024-03-28 10:35:33 +01:00
andrea.villa 0fa2ea3c67 Merge branch 'main' into develop 2024-03-26 15:08:15 +01:00
andrea.villa 9789092791 Merge branch 'develop' 2024-03-26 15:08:08 +01:00
andrea.villa bdd4cc17a4 In 'PreparePostRotation' si resetta sempre anche la paratia in uscita 2024-03-26 15:08:01 +01:00
andrea.villa b14b3bfc26 Corretta gestione cambio utensile con motosega. In alcuni casi non era coerente con generazione. 2024-03-26 08:07:44 +01:00
andrea.villa c77d354a5c Merge branch 'main' into develop 2024-03-22 07:44:12 +01:00
andrea.villa a47cb7d9be Merge branch 'develop' 2024-03-22 07:44:07 +01:00
andrea.villa fca293d3db Aggiornamento file per versione 2024-03-22 07:43:59 +01:00
andrea.villa 1d4f262aef Miglioramento visualizzazione spigoli VMILL alla fine della simulazione 2024-03-12 14:48:18 +01:00
andrea.villa cc299918f6 Merge branch 'main' into develop 2024-03-11 09:37:32 +01:00
andrea.villa 4e390c3eea Merge branch 'develop' 2024-03-11 09:37:20 +01:00
andrea.villa 63452aa0d5 Aggiunto parametro "WriteM05Command" (NON OBBLIGATORIO) per decidere se scrivere il comando M05 2024-03-11 09:37:00 +01:00
andrea.villa 0f78c5186f Aggiunta gestione parametro "SECDIST" 2024-03-11 09:01:40 +01:00
andrea.villa 55c72bf40c Merge branch 'main' into develop 2024-03-08 13:10:45 +01:00
andrea.villa c2d4c7166c Gestione rotazioni 90° come su FAST, caso MID2 2024-03-08 13:10:35 +01:00
andrea.villa 5470f2dbbb Merge branch 'main' into develop 2024-03-07 13:04:20 +01:00
andrea.villa fe1e3b1550 - Se cambiato utensile, si aprono sempre paratie
- Spostato salvataggio dati utensile precedente in MachiningEnd
2024-03-07 13:04:10 +01:00
andrea.villa 3ab4e8326a Merge branch 'main' into develop 2024-03-07 10:44:02 +01:00
andrea.villa f743ebdcf5 Merge branch 'develop' 2024-03-07 10:43:52 +01:00
andrea.villa 0ec16e7f4c Aggiornati messaggi e versione 2024-03-07 10:43:22 +01:00
andrea.villa 80a9bc337e Per ribaltamento, i comandi si differenziano per macchina 2024-03-07 10:39:11 +01:00
andrea.villa 399e239d93 Merge branch 'main' into develop 2024-03-06 17:28:50 +01:00
andrea.villa 4383459661 Piccola correzione movimento Z-MAX lama (no aggiornamento versione) 2024-03-06 17:28:32 +01:00
andrea.villa ba8f960e4f Merge branch 'main' into develop 2024-03-06 16:17:29 +01:00
andrea.villa 1f5b334bfb Merge branch 'develop' 2024-03-06 16:17:20 +01:00
andrea.villa 600dc8ff8b Modifica movimento a Z-MAX con lama. Home solo se cambia utensile 2024-03-06 10:15:00 +01:00
luca.mazzoleni 332cff04dc Merge branch 'main' into develop 2024-03-05 12:18:38 +01:00
luca.mazzoleni eb0a32eab4 Merge branch 'develop' 2024-03-05 12:18:14 +01:00
luca.mazzoleni bda944cf0a Aggiunta variabile FACOLTATIVA 'EstimationRapidMultiplier' in mlde per regolare il tempo stimato di rapido su macchine vecchie. Se non presente default 1. 2024-03-05 11:41:01 +01:00
andrea.villa edeb12fd51 Merge branch 'main' into develop 2024-03-04 10:56:43 +01:00
andrea.villa 7064857ff2 Merge branch 'develop' 2024-03-04 10:56:35 +01:00
andrea.villa 1c25c71da0 Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina 2024-03-04 10:56:27 +01:00
andrea.villa 2089e50c5e Merge branch 'main' into develop 2024-02-29 09:38:54 +01:00
andrea.villa 0dee81a170 Aggiornamento versione 2024-02-29 09:38:42 +01:00
andrea.villa fd2ae40d50 Merge branch 'main' into develop 2024-02-29 09:36:53 +01:00
andrea.villa b9914e0d2f Merge branch 'develop' 2024-02-29 09:36:46 +01:00
andrea.villa a348800d87 Gestione rimozione VMILL per tagli a cubetti Zig-Zag 2024-02-29 09:36:35 +01:00
luca.mazzoleni 2478117e49 Merge branch 'main' into develop 2024-02-26 17:58:44 +01:00
luca.mazzoleni c8e2a76964 Merge branch 'develop' 2024-02-26 17:58:19 +01:00
luca.mazzoleni 3e8874907f - EgtAddToPackagePath spostato in mlde
- sistemato updatelog
- rimosse chiamate a EgtGetSourceDir e sostituite con EgtGetCurrMachineDir
2024-02-26 16:57:59 +01:00
andrea.villa 8a2954c6fe Merge branch 'main' into develop 2024-02-20 11:47:33 +01:00
andrea.villa 701a803eeb Merge branch 'develop' 2024-02-20 11:47:18 +01:00
andrea.villa c7ba99b94a - Aggiunta funzioni "OnSimulInit" e "OnSimulExit"
- "BeamData" caricato come libreria con 'require'
- In "GetMovesInAuxCmd" si passa la posizione calcolata V1 indipendentemente dall'utilizzo
2024-02-20 11:46:25 +01:00
andrea.villa b44dfb952d Corretto emissione movimenti per macchine con motosega su testa 2 2024-02-19 12:51:21 +01:00
andrea.villa 5a65152212 Correto emissione movimenti per macchine con motosega su testa 2 2024-02-19 12:23:54 +01:00
andrea.villa 768cc2f099 Corretto controllo calcolo Z su primo movimento lama, allineato a generazione 2024-02-19 11:57:40 +01:00
andrea.villa 5c77772f3c Merge branch 'main' into develop 2024-02-12 11:49:20 +01:00
andrea.villa 8fb7138855 Merge branch 'develop' 2024-02-12 11:49:10 +01:00
andrea.villa f7fa43e849 Per movimento con motosega, si ribadiscono tutti gli assi nella prima G141 2024-02-12 11:48:59 +01:00
andrea.villa 728dfa48c6 Merge branch 'main' into develop 2024-02-07 08:15:49 +01:00
andrea.villa c60570be6e Merge branch 'develop' 2024-02-07 08:15:40 +01:00
andrea.villa ce73fe9d1b - Modificata gestione movimenti motosega, in aggiunta con caso particolare di pezzo alto più di 650mm
- Caricamento BeamData come local
2024-02-07 08:15:19 +01:00
andrea.villa 281f14667f - Aggiornato UpdateLog 2024-01-29 17:00:18 +01:00
andrea.villa dc91813d5a - se la lavorazione è un taglio di separazione, se necessario, ripristino posizione di Y1DELTA prima di aprire i rulli 2024-01-29 16:57:38 +01:00
andrea.villa 193c0911b4 - Corretta simulazione movimento in X-Home, coerente con generazione
- Aggiunta lettura parametro 'Split'
2024-01-29 15:49:48 +01:00
andrea.villa 4bbc00b181 Merge branch 'main' into develop 2024-01-26 15:29:58 +01:00
andrea.villa 94095e79a6 Merge branch 'develop' 2024-01-26 15:29:41 +01:00
andrea.villa c3a61b1433 Migliorato calcolo dimensioni grezzo per apertura rulli in caso di 'precut' 2024-01-26 15:29:28 +01:00
andrea.villa 1555d809df Merge branch 'main' into develop 2024-01-24 16:36:27 +01:00
andrea.villa 08cde3ae2c Merge branch 'develop' 2024-01-24 16:36:03 +01:00
andrea.villa 86665b87d8 Aggiunto solido collisione lama sotto traversa (per PF-progress) 2024-01-24 16:35:51 +01:00
andrea.villa 524bfc43e1 - Se pezzo tenuto solo con pinza destra non si esclude la rulliera di sinistra
- Correzione gestione apertura/chiusura rulli sul fine barra e in generale (da PF1250)
2024-01-23 15:22:25 +01:00
andrea.villa 69bc812e35 Merge branch 'main' into develop 2024-01-23 11:26:06 +01:00
andrea.villa 41e6ab02e3 Merge branch 'develop' 2024-01-23 11:25:43 +01:00
andrea.villa 50aa503f3a Corretto gestione del movimento precedente all'ultimo che manda il pezzo alla posizione di scarico 2024-01-23 11:25:21 +01:00
andrea.villa 78527ac703 Merge branch 'main' into develop 2024-01-09 12:39:08 +01:00
5 changed files with 737 additions and 317 deletions
+295 -167
View File
@@ -1,9 +1,12 @@
-- Processore standard macchine ONE e PF by EgalWare s.r.l. 2023/11/24
-- Con controllo numerico NUM
-- 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
@@ -25,6 +28,9 @@ function OnStart()
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 102000 -- feed massima pinze
-- utensili default
EMT.PREVTCPOS_H1 = DefTcPos1
EMT.PREVTCPOS_H2 = DefTcPos2
end
---------------------------------------------------------------------
@@ -39,13 +45,17 @@ function OnProgramStart()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nPattId = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
EmtOutput( '%' .. EgtNumToString( nPattId,-1))
-- 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
if EMT.INFO then
EmtOutput( '('..EMT.INFO..')')
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
else
EmtOutput( '(Program Start)')
end
EmtOutput( '('.. CSP_INFO..')')
EmtOutput( '('.. MACHINE_INFO..')\n')
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmitTestProgramStart()
@@ -261,22 +271,38 @@ function OnDispositionEnd()
end
-- se altrimenti disposizione intermedia, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- verifico se sono diverse
if nRot ~= nPrevRot then
local nDeltaRot = nRot - nPrevRot
-- rotazione automatica o manuale (sempre con il medesimo comando)
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
EmtOutput( sOut)
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
if VerifyEmitRotation() then
-- imposto stato post-rotazione
EMT.POSTROT = true
-- imposto recupero sovramateriale in X non più presente
EMT.X_OFF = EMT.HOVM
end
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
elseif IsMid2Phase( EMT.PHASE) then
-- emissione movimento carrelli
EMT.AUXCMD = {}
if #EMT.MDCHAR > 0 then
EmtOutput( '(ROTATION)')
end
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
end
if #EMT.MDCHAR > 0 then
EmitMoveStartChars( 1)
EmitMoveStartChars( 2)
end
EMT.MDCHAR = {}
EMT.AUXTYPE = nil
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
if VerifyEmitRotation() then
-- imposto stato post-rotazione
EMT.POSTROT = true
-- imposto recupero sovramateriale in X non più presente
EMT.X_OFF = EMT.HOVM
end
-- altrimenti disposizione finale, eventuale scarico pezzo lavorato se non ci sono lavorazioni
else
else
if #EMT.MDCHAR > 0 then
MyOutputNoNum( '(PART UNLOAD)')
for i = 1, #EMT.MDCHAR do
@@ -351,6 +377,7 @@ function OnRawMoveData()
EMT.HT = b3Part:getDimY()
EMT.ST = b3Part:getDimZ()
EMT.HOVM = EgtGetInfo( EMT.RAWID, 'HOVM', 'd') or 0
EMT.XMINT = b3Part:getMin():getX()
else
EMT.IDT = GDB_ID.NULL
EMT.IT = -1
@@ -395,6 +422,9 @@ function OnMachiningStart()
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
-- se sega a catena, aggiusto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H13' or EMT.HEAD == 'H15' then
-- valore dell'asse virtuale
@@ -412,7 +442,7 @@ function OnMachiningStart()
-- 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
@@ -572,6 +602,20 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTCPOS = EMT.TCPOS
-- salvo anche utlimo utensile su testa
local nHSet = GetHeadSet( EMT.HEAD)
if nHSet == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
EMT.PREVHOMEX_H1 = EgtGetAxisHomePos( 'X1')
elseif nHSet == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
EMT.PREVHOMEX_H2 = EgtGetAxisHomePos( 'X2')
end
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end
EMT.DOU_TYPE = nil
end
@@ -594,7 +638,7 @@ function OnPathStart()
--EMT.CNT = EgtGetInfo( EMT.PATHID, 'CNT', 'i')
--EmtOutput( 'CNT='.. tostring( EMT.CNT or 0))
-- se taglio di separazione, verifico se ci sarà caduta
if ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil) then
if EMT.MCHSPLIT then
local sCmd = EgtGetInfo( EMT.PATHID, 'AE1') or ''
if sCmd:find( 'Fall', 1, true) then
EMT.TO_FALL = true
@@ -602,6 +646,14 @@ function OnPathStart()
EMT.TO_SPECSPLIT = true
end
end
-- se taglio di precut verifico quanto è più lungo il grezzo rispetto al pezzo (non tiene conto dell'ultimo cubetto)
EMT.DELTA_LT = 0
if EMT.MCHPRECUT then
local dCosA = sqrt( max( 1 - EMT.EXTR[1] * EMT.EXTR[1], 0))
EMT.DELTA_LT = max( EMT.XMINT - Point3d( EMT.MMAX):getX() - dCosA * EMT.TDIAM / 2, 0)
end
-- se utensile non cambiato, salvo eventuali precedenti lineari e rotanti
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
EMT.L1pp = EMT.L1op
@@ -752,14 +804,13 @@ function OnRapid()
-- primo posizionamento
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12' and EMT.HEAD ~= 'H22', 1, 1.65)
local bOnlyCharY = true
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
-- eventuale Movimento Pinze
for i = 1, #EMT.AUXCMD do
ProcessPathStartAux( EMT.AUXCMD[i], i)
end
EMT.AUXCMD = {}
if bSplitCut and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
if EMT.MCHSPLIT and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = 1
end
for i = 1, #EMT.MDCHAR do
@@ -775,7 +826,7 @@ function OnRapid()
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, bSplitCut)
EmitParkRoller( dPosT, EMT.MCHSPLIT)
end
-- se testa 1 e CU 1
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
@@ -794,7 +845,7 @@ function OnRapid()
dXref = -LimX1PlRotSaw
end
-- se fresa o lama
if EMT.HEAD ~= 'H13' and EMT.HEAD ~= 'H15' then
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
@@ -817,11 +868,20 @@ function OnRapid()
end
-- altrimenti sega a catena
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=HomeB1, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=ParkCSawZ1, B=ParkCSawB1, C=ParkCSawC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
EmitMoveDataHead( 1, { Z=dSafeZ1, B=EMT.R2, C=EMT.R1, S=Speed})
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
@@ -853,7 +913,7 @@ function OnRapid()
local HomeB1 = EgtGetAxisHomePos( 'B1')
local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama
if EMT.HEAD ~= 'H13' and EMT.HEAD ~= 'H15' then
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=EMT.L2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
@@ -875,23 +935,21 @@ function OnRapid()
end
-- altrimenti sega a catena
else
-- se pezzo molto alto e R3=0, mi sposto prima in X (per ora solo davanti)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { X=-SafeCSaw0X2, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
EmitMoveDataHead( 1, { X=EMT.L2, Z=dSafeZ1, B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=ParkCSawZ1, B=ParkCSawB1, C=ParkCSawC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
EmitMoveDataHead( 1, { Z=dSafeZ1, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
@@ -909,7 +967,7 @@ function OnRapid()
local HomeB2 = EgtGetAxisHomePos( 'B2')
local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama
if EMT.HEAD ~= 'H23' then
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
@@ -931,21 +989,19 @@ function OnRapid()
end
-- altrimenti sega a catena
else
-- se pezzo molto alto e R3=0, mi sposto prima in X (per ora solo davanti)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 2, { X=-SafeCSaw0X2, Z=ParkCSawZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
EmitMoveDataHead( 2, { X=EMT.L2, Z=dSafeZ2, B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=-ParkCSawX2, Z=ParkCSawZ2, B=ParkCSawB2, C=ParkCSawC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
-- se motosega configurata per lavorazioni di fianco o circa orizzontale. Dopo attesa movimento carrelli si devono scrivere tutti gli assi.
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 2, { X=EMT.L2, Z=ParkCSawZ2, B=ParkCSawB2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 2, { X=EMT.L2, Z=ParkCSawZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
EmitMoveDataHead( 2, { X=EMT.L2, Z=dSafeZ2, B=EMT.R2, C=HomeC2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, Z=ParkCSawZ2, B=ParkCSawB2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
EmitMoveDataHead( 2, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
@@ -966,7 +1022,7 @@ function OnRapid()
BhData.Y1 = ParkY1
BhData.ViseY1 = 2
end
if bSplitCut and EMT.Y2DELTA then
if EMT.MCHSPLIT and EMT.Y2DELTA then
BhData.ViseY1 = 3
end
if EMT.Y2DELTA then
@@ -1025,42 +1081,42 @@ function OnRapid()
EMT.AUXCMD = {}
-- se necessario posizionamento in home (sono sicuramente già a Zmax)
if EMT.TO_XHOME then
-- se precedente non era sega a catena, vado in home con quella
if not HeadIsChainSaw( EMT.PREVHEAD) then
local nPrevHSet = GetHeadSet( EMT.PREVHEAD)
if nPrevHSet == 1 then
local nHSet = GetHeadSet( EMT.HEAD)
local nPrevHSet = GetHeadSet( EMT.PREVHEAD)
-- se successivo non è sega a catena e la testa è la stessa, vado in home con utensile succesivo
if not HeadIsChainSaw( EMT.HEAD) and nHSet == nPrevHSet then
if nHSet == 1 then
local HomeX1 = EgtGetAxisHomePos( 'X1')
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1})
EmitMoveStartHead( 1, 'EA1')
else
local HomeX2 = EgtGetAxisHomePos( 'X2')
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2})
EmitMoveStartHead( 2, 'EA1')
end
-- altrimenti la deposito e vado in home speciale
else
-- se successivo non è sega a catena, ne lancio il carico
if not HeadIsChainSaw( EMT.HEAD) then
if nHSet == 1 then
if not HeadIsChainSaw( EMT.PREVHEAD) then
if nPrevHSet == 1 then
local HomeX1 = EgtGetAxisHomePos( 'X1')
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=HomeR2, C=HomeR1})
EmitMoveDataHead( 1, { X=-EMT.PREVHOMEX_H1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1, 'EA1')
else
local HomeX2 = EgtGetAxisHomePos( 'X2')
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=HomeR2, C=HomeR1})
EmitMoveDataHead( 2, { X=-EMT.PREVHOMEX_H2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2, 'EA1')
end
-- altrimenti deposito e mi metto in posizione sicura
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' or GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then
EmitMoveDataHead( 1, { X=-ParkCSawX1S, Z=MaxZ1, B=HomeR2, C=HomeR1, TPos='0'})
if GetHeadTCSet( EMT.PREVHEAD, EMT.PREVTCPOS) == 'Head1_TC1' or GetHeadTCSet( EMT.PREVHEAD, EMT.PREVTCPOS) == 'Head1_TC2' then
EmitMoveDataHead( 1, { X=-ParkCSawX1S, Z=MaxZ1, B=HomeR2, C=HomeR1, TPos='50'})
EmitMoveStartHead( 1, 'EA1')
else
EmitMoveDataHead( 2, { X=-ParkCSawX2S, Z=MaxZ2, B=HomeR2, C=HomeR1, TPos='0'})
EmitMoveDataHead( 2, { X=-ParkCSawX2S, Z=MaxZ2, B=HomeR2, C=HomeR1, TPos='50'})
EmitMoveStartHead( 2, 'EA1')
end
end
end
EMT.TO_XHOME = nil
EMT.L3pp = nil
PrevR1 = HomeR1
@@ -1076,8 +1132,7 @@ function OnRapid()
if EMT.DOU_TYPE then sOut = sOut .. ' Double' end
EmtOutput( '( *** '..sOut..' *** )')
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
if bSplitCut and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
if EMT.MCHSPLIT and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = 1
end
for i = 1, #EMT.MDCHAR do
@@ -1089,13 +1144,11 @@ 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
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or EMT.TOOL ~= EMT.PREVTOOL or
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, bSplitCut)
EmitParkRoller( dPosT, EMT.MCHSPLIT)
end
-- se testa 1
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
@@ -1108,7 +1161,7 @@ function OnRapid()
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12' and EMT.HEAD ~= 'H22', 1, 1.65)
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if EMT.HEAD ~= 'H13' and EMT.HEAD ~= 'H15' then
if not HeadIsChainSaw( EMT.HEAD) then
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
@@ -1134,9 +1187,16 @@ function OnRapid()
end
-- altrimenti sega a catena 'H13'
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { Z=dSafeZ1, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=ParkCSawZ1, B=ParkCSawB1, C=ParkCSawC1, TRad=dTRad, TLen=dTLen, S=Speed})
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
end
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
@@ -1175,7 +1235,7 @@ function OnRapid()
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12' and EMT.HEAD ~= 'H22', 1, 1.65)
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if EMT.HEAD ~= 'H13' and EMT.HEAD ~= 'H15' then
if not HeadIsChainSaw( EMT.HEAD) then
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
@@ -1197,16 +1257,15 @@ function OnRapid()
end
-- altrimenti sega a catena
else
-- se pezzo molto alto e R3=0, mi sposto prima in X (per ora solo davanti)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { X=-SafeCSaw0X1, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, Z=dSafeZ1, B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=ParkCSawZ1, B=ParkCSawB1, C=ParkCSawC1, TRad=dTRad, TLen=dTLen, S=Speed})
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { Z=dSafeZ1, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
end
@@ -1224,7 +1283,7 @@ function OnRapid()
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12' and EMT.HEAD ~= 'H22', 1, 1.65)
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if EMT.HEAD ~= 'H23' then
if not HeadIsChainSaw( EMT.HEAD) then
local CurrZ2 = EMT.L3pp or MyMaxZ2
local CurrB2 = PrevR2
local CurrC2 = PrevR1
@@ -1246,15 +1305,15 @@ function OnRapid()
end
-- altrimenti sega a catena
else
-- se pezzo molto alto e R3=0, mi sposto prima in X (per ora solo davanti)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 2, { X=-SafeCSaw0X2, Z=ParkCSawZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, Z=dSafeZ2, B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=-ParkCSawX2, Z=ParkCSawZ2, B=ParkCSawB2, C=ParkCSawC2, TRad=dTRad, TLen=dTLen, S=Speed})
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 2, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 2, { X=EMT.L2, Z=ParkCSawZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 2, { Z=dSafeZ2, B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
end
@@ -1272,7 +1331,7 @@ function OnRapid()
BhData.Y1 = EgtIf( EMT.Y1POS, EMT.Y1POS, ParkY1)
BhData.ViseY1 = 2
end
if bSplitCut and EMT.Y2DELTA then
if EMT.MCHSPLIT and EMT.Y2DELTA then
BhData.ViseY1 = 3
end
if EMT.Y2DELTA then
@@ -1403,13 +1462,13 @@ function OnRapid()
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or EMT.HEAD == 'H12' or EMT.HEAD == 'H22'
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
local CurrL3o = EMT.L3o
EMT.L3o = EMT.L3op
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, bSplitCut)
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, EMT.MCHSPLIT)
EMT.L3o = CurrL3o
-- aggiorno quota finale trave dopo Zmax
EMT.L1o = EMT.TPOS
@@ -1511,6 +1570,44 @@ end
---------------------------------------------------------------------
function OnArc()
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- salvo posizione attuale
local OldL1 = EMT.L1
local OldL2 = EMT.L2
local OldL3 = EMT.L3
-- imposto posizione precedente (non contiene l'offset in X per sovramateriale di testa EMT.X_OFF)
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
-- aggiorno precedenti
local nOriginalMove = EMT.MOVE
EMT.MOVE = 0
EmtUpdatePrev()
EMT.MOVE = nOriginalMove
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
end
-- non modale su archi
EmtResetPrevLinear()
-- aggiustamento valori
@@ -1547,7 +1644,7 @@ end
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.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]
@@ -1802,7 +1899,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])
@@ -2033,8 +2133,8 @@ function PreparePreRotation( sCmd, nInd)
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
end
if EMT.ROLL_IN then
MDChar.V1 = MinV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2POS = MDChar.V2
MDChar.V1 = MinV1 ; EMT.V1NEXTPOS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2NEXTPOS = MDChar.V2
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
@@ -2044,8 +2144,8 @@ function PreparePreRotation( sCmd, nInd)
if Cmd[2] ~= 'T' then MDChar[Cmd[2]] = tonumber( Cmd[3]) end
if Cmd[4] ~= 'T' then MDChar[Cmd[4]] = tonumber( Cmd[5]) end
if EMT.ROLL_IN then
MDChar.V1 = MinV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2POS = MDChar.V2
MDChar.V1 = MinV1 ; EMT.V1NEXTPOS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2NEXTPOS = MDChar.V2
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
@@ -2055,8 +2155,8 @@ function PreparePreRotation( sCmd, nInd)
if Cmd[4] ~= 'T' then MDChar[Cmd[4]] = tonumber( Cmd[5]) end
if Cmd[6] ~= 'T' then MDChar[Cmd[6]] = tonumber( Cmd[7]) end
if EMT.ROLL_IN then
MDChar.V1 = MinV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2POS = MDChar.V2
MDChar.V1 = MinV1 ; EMT.V1NEXTPOS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2NEXTPOS = MDChar.V2
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
@@ -2124,9 +2224,10 @@ function PreparePostRotation( sCmd, nInd)
elseif Cmd[1] == '2' then
if Cmd[2] == 'Y1' then
-- tolgo eventuale sovramateriale presente sul pezzo in posizione iniziale (la misura laser è ora col finito)
local MDChar = { Y1=tonumber(Cmd[3])-EMT.HOVM, IniStatY1=75, V1=ParkV1, FinStatY1=-1, BeamVise=0, Aux=' (E80058=0)', MovType=1}
local MDChar = { Y1=tonumber(Cmd[3])-EMT.HOVM, IniStatY1=75, V1=ParkV1, V2=ParkV2, FinStatY1=-1, BeamVise=0, Aux=' (E80058=0)', MovType=1}
table.insert( EMT.MDCHAR, MDChar)
EMT.V1POS = ParkV1
EMT.V2POS = ParkV2
elseif Cmd[2] == 'T' then
local MDChar = { Y1=tonumber(Cmd[3]), IniStatY1=76, FinStatY1=EMT.FSY1, BeamVise=0, MovType=1}
table.insert( EMT.MDCHAR, MDChar)
@@ -2201,7 +2302,7 @@ function GetMovesInAuxCmd( vAuxCmd)
if Cmd[1] == '1' or Cmd[1] == '2' or Cmd[1] == '3' then
return true
elseif Cmd[1] == '22' then
local dV1NextPos = EgtIf( EMT.Y1DELTA, tonumber( Cmd[2]), ParkV1)
local dV1NextPos = tonumber( Cmd[2]) -- EgtIf( EMT.Y1DELTA, tonumber( Cmd[2]), ParkV1)
if not GetV1ToCloseNum( dV1NextPos) then
dV1NextPos = ParkV1
end
@@ -2420,6 +2521,48 @@ function GetSpecUnloading( nPathId)
return ( sVal == '0,Unloading SpecSplit')
end
---------------------------------------------------------------------
function VerifyEmitRotation()
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- se sono uguali non devo fare alcunchè
if nRot == nPrevRot then
return false
end
-- se ho la testa 2, quindi tipo PF
if EgtGetHeadId( 'H21') then
local nDeltaRot = nRot - nPrevRot
-- rotazione automatica o manuale (sempre con il medesimo comando)
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
EmtOutput( sOut)
-- altrimenti se ONE
else
if nRot > nPrevRot then nRot = nRot - 4 end
local nDeltaRot = nRot - nPrevRot
-- se rotazione automatica richiesta e possibile
local dRefLen = EgtIf( IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE), EMT.LT, EMT.LB)
-- se rotazione automatica richiesta e possibile
if AutomaticRotation and dRefLen >= AutoRotMinLen then
local sOut = 'M180 L0=' .. tostring( -nDeltaRot)
EmtOutput( sOut)
else
local sOut
if nDeltaRot == -1 then
sOut = 'M151'
elseif nDeltaRot == -2 then
sOut = 'M152'
elseif nDeltaRot == -3 then
sOut = 'M153'
end
EmtOutput( sOut)
EmtOutput( 'M86')
EmtOutput( 'G4F.5')
end
end
return true
end
---------------------------------------------------------------------
function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelta)
if bReset then
@@ -2473,15 +2616,16 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveWaitHead( 1)
-- altrimenti sega a catena
else
if BD.RIGHT_LOAD then
EmitMoveDataHead( 1, { X=-EMT.L2o, Z=dSafeZ1, B=dSafeB1, C=PrevR1})
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
EmitMoveDataHead( 1, { X=-ParkX1, Z=ParkCSawZ1, B=ParkB1, C=ParkC1, TPos=50})
end
else
EmitMoveDataHead( 1, { X=-EMT.L2o, Z=dSafeZ1, B=dSafeB1, C=PrevR1})
EmitMoveDataHead( 1, { C=dSafeC1})
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -EMT.L2o, Z = EMT.L3o, B = PrevR2, C = PrevR1}
EmitMoveDataHead( 1, MovH)
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dSafeB1})
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { Z=ParkCSawZ1})
end
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
EmitMoveDataHead( 1, { X=-ParkX1, Z=ParkCSawZ1, B=ParkB1, C=ParkC1, TPos=50})
end
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
@@ -2489,7 +2633,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
-- se altrimenti fresa o lama su TC frontale
else
-- se fresa o lama
if EMT.HEAD ~= 'H13' and EMT.HEAD ~= 'H15' then
if not HeadIsChainSaw( EMT.HEAD) then
-- eseguo la salita a Z1max (oriento solo se assi rotanti non già a posto)
if abs( dSafeC1 - PrevR1) > 0.1 or abs( dSafeB1 - PrevR2) > 0.1 then
local dZref = dSafeZ1 + GetZExtra( EMT.HEAD, PrevR2)
@@ -2513,13 +2657,14 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveWaitHead( 1)
-- altrimenti sega a catena
else
EmitMoveDataHead( 1, { X=-EMT.L2o, Z=dSafeZ1, B=dSafeB1, C=PrevR1})
EmitMoveDataHead( 1, { C=dSafeC1})
-- se pezzo molto alto e R3=0, mi sposto prima in X (per ora solo davanti)
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -EMT.L2o, Z = EMT.L3o, B = PrevR2, C = PrevR1}
EmitMoveDataHead( 1, MovH)
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dSafeB1})
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { X=-SafeCSaw0X1})
EmitMoveDataHead( 1, { Z=ParkCSawZ1})
end
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
EmitMoveDataHead( 1, { X=-ParkX1, Z=ParkCSawZ1, B=ParkB1, C=ParkC1, TPos=50})
end
@@ -2541,7 +2686,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
end
-- se fresa o lama
if EMT.HEAD ~= 'H23' then
if not HeadIsChainSaw( EMT.HEAD) then
-- eseguo la salita a Z2max (oriento solo se assi rotanti non già a posto)
if abs( dSafeC2 - PrevR1) > 0.1 or abs( dSafeB2 - PrevR2) > 0.1 then
local dZref = dSafeZ2 + GetZExtra( EMT.HEAD, PrevR2)
@@ -2565,13 +2710,14 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveWaitHead( 2)
-- altrimenti sega a catena
else
EmitMoveDataHead( 2, { X=-EMT.L2o, Z=dSafeZ2, B=dSafeB2, C=PrevR1})
EmitMoveDataHead( 2, { C=dSafeC2})
-- se pezzo molto alto e R3=0, mi sposto prima in X (per ora solo davanti)
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -EMT.L2o, Z = EMT.L3o, B = PrevR2, C = PrevR1}
EmitMoveDataHead( 2, MovH)
EmitMoveDataHead( 2, { Z=dSafeZ2, B=dSafeB2})
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 2, { X=-SafeCSaw0X2})
EmitMoveDataHead( 2, { Z=ParkCSawZ2})
end
EmitMoveDataHead( 2, { X=-dSafeX2, C=dSafeC2})
if bXhome then
EmitMoveDataHead( 2, { X=-ParkX2, Z=ParkCSawZ2, B=ParkB2, C=ParkC2, TPos=50})
end
@@ -2641,7 +2787,10 @@ end
---------------------------------------------------------------------
function EmitResetMachining()
if ( EMT.TOOL ~= GetNextTool( EMT.MCHID) and IsLastPath( EMT.PATHID)) or GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID) then
EmtOutput( 'M05')
-- se da MLDE parametro non settato, o settato a true, scrivo il comando arresto mandrino
if WriteM05Command == nil or WriteM05Command then
EmtOutput( 'M05')
end
end
local sOut = 'G157 EA1'
EmtOutput( sOut)
@@ -2710,8 +2859,8 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
local dPosY2 = dPosT + dY2Delta
local DiffY2 = MyParkY2 - dPosY2
local dMoveY2 = EgtIf( DiffY2 < -0.1, dMoveV2, 0)
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
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
if ( dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
MDChar.Y2 = dPosY2 + dMoveY2
MDChar.MovType = 2
MDChar.BeamVise = 2
@@ -2735,28 +2884,6 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
EMT.TPOS = dPosT
end
---------------------------------------------------------------------
function GetNextTool( nMchId)
-- inizializzo prossimo utensile
local sNextTool
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
break
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
end
-- se trovata
if nNextMchId and EgtSetCurrMachining( nNextMchId) then
sNextTool = EgtGetMachiningParam( MCH_MP.TOOL)
end
-- ripristino stato corrente
EgtSetCurrMachining( EMT.MCHID)
EgtTdbSetCurrTool( EMT.TOOL)
return sNextTool
end
---------------------------------------------------------------------
function PreselectNextDiffHead( nMchId, sHead)
-- se non ho due teste, esco subito
@@ -2795,11 +2922,11 @@ function PreselectNextDiffHead( nMchId, sHead)
local sNextTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
-- se testa attuale da caricare è sega a catena, mando l'altra prima in HomeX (per evitare possibili collisioni) e poi lancio preselezione
if sHead == 'H13' and EMT.PREVHEAD ~= 'H13' then
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
elseif sHead == 'H23' and EMT.PREVHEAD ~= 'H23' then
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
@@ -2832,15 +2959,16 @@ function PreselectNextDiffHead( nMchId, sHead)
-- mi assicuro che l'altra testa sia in parcheggio
if nHSet == 1 then
-- non può essere la sega a catena
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
EmitMoveStartHead( 2)
if EMT.PREVHEAD == 'H23' and EMT.PREVHEAD ~= EMT.HEAD then
EmitMoveWaitHead( 2)
if EMT.PREVHEAD_H2 ~= 'H23' then
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2)
end
else
-- va bene per frese e lama
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveStartHead( 1)
-- non può essere la sega a catena
if EMT.PREVHEAD_H1 ~= 'H13' and EMT.PREVHEAD_H1 ~= 'H15' then
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1)
end
end
end
end
+281 -127
View File
@@ -6,12 +6,15 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Carico libreria
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** GENERATION ***
---------------------------------------------------------------------
local sBaseDir = EgtGetSourceDir()
local sBaseDir = EgtGetCurrMachineDir()
if NumericalControl == 'NUM' or NumericalControl == 'NUM_FLEX' then
dofile( sBaseDir .. 'Common_ONE-PF.NUM.mlpe')
dofile( sBaseDir .. '\\Common_ONE-PF.NUM.mlpe')
elseif NumericalControl == 'TPA' then
error( 'Numerical Control error : TPA not yet managed')
else
@@ -23,6 +26,45 @@ end
---------------------------------------------------------------------
local COLL_SAFE_DIST = 4
---------------------------------------------------------------------
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,7 +120,7 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}}
-- gruppo CHSAW si attiva solo se progress, one con BIT ortiser o PF
-- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF
if Progress or Mortiser or EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'})
end
@@ -86,6 +128,11 @@ function OnSimulStart()
if Mortiser and EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'MORTISER'})
end
-- se Progress si attiva magazzino lama sotto traversa
if Progress and EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'SAW1'})
end
if Clamp5 then
table.insert( McdData, { Grp = 'W', Sub = 'COLLISION', Name = 'STM1'})
table.insert( McdData, { Grp = 'W', Sub = 'COLLISION', Name = 'STM2'})
@@ -105,7 +152,7 @@ function OnSimulStart()
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId, McdData[i].Sub), McdData[i].Name)
if nId then
table.insert( EMT.MCODET, nId)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is ok', 4)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
@@ -271,6 +318,9 @@ function OnSimulDispositionStart()
EMT.LB = b3Bar:getDimX()
EMT.LR = b3Raw:getDimX()
EMT.LT = b3Part:getDimX()
if b3Part:getMin() then
EMT.XMINT = b3Part:getMin():getX() + ( EgtGetAxisPos( 'T') - EgtGetAxisHomePos( 'T'))
end
EMT.HOVM = EgtGetInfo( nPartRawId or GDB_ID.NULL, 'HOVM', 'd') or 0
EMT.CUTID = EgtGetInfo( PartId or GDB_ID.NULL, 'CUTID', 'i') or 0
EMT.Y1SPEC = nil
@@ -309,7 +359,6 @@ function OnSimulDispositionStart()
if EMT.VMILL and #EMT.VMILL > 0 then
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
end
-- se altrimenti fasi intermedia o finale speciali, aggancio primo grezzo alla tavola e gli altri in posizione pre-carico
elseif IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- se cambiata giacitura, lo segnalo
@@ -404,6 +453,21 @@ function OnSimulDispositionEnd()
EMT.FALL = false
EMT.TO_FALL = false
end
-- se disposizione intermedia
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- se le rotazioni delle fasi corrente e precedente sono diverse
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
-- imposto stato post-rotazione
EMT.POSTROT = true
end
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
elseif IsMid2Phase( EMT.PHASE) then
-- se le rotazioni delle fasi corrente e precedente sono diverse
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
-- imposto stato post-rotazione
EMT.POSTROT = true
end
end
EMT.SPLIT = false
EMT.SPECSPLIT = false
EMT.TO_SPECSPLIT = false
@@ -416,6 +480,7 @@ function OnSimulToolSelect( dPosA)
EMT.TOOLTYPE = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
local nSetHead = GetHeadSet( EMT.HEAD)
-- se ho due teste, verifico che l'altra sia dalla parte opposta
@@ -443,6 +508,8 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C1', MyParkCSawC1)
EgtSetAxisPos( 'B1', ParkCSawB1)
EgtSetAxisPos( 'X1', ParkCSawX1)
-- l'utensile viene caricato qui, quindi setto come già cambiato
EMT.PREVHEAD_H1 = EMT.HEAD
else
-- imposto home dell'asse C2 (A=0 -> T111, A=-90 -> T112)
local MyParkCSawC2 = GetChainSawCHomeFromVirtualAxis( dPosA)
@@ -450,6 +517,8 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C2', MyParkCSawC2)
EgtSetAxisPos( 'B2', ParkCSawB2)
EgtSetAxisPos( 'X2', ParkCSawX2)
-- l'utensile viene caricato qui, quindi setto come già cambiato
EMT.PREVHEAD_H2 = EMT.HEAD
end
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
@@ -504,13 +573,6 @@ function OnSimulToolDeselect( dPrevA)
end
elseif HeadIsChainSaw( EMT.PREVHEAD_H2) then
-- simulo movimento
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
local CurrX2 = EgtGetAxisPos( 'X2')
if CurrX2 < SafeCSaw0X2 then
SimulMoveAxis( 'X2', SafeCSaw0X2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'X2', ParkCSawX2, MCH_SIM_STEP.RAPID)
local dMyParkC = EgtGetAxisHomePos( 'C2')
if dPrevA then dMyParkC = GetChainSawCHomeFromVirtualAxis( dPrevA) end
@@ -594,10 +656,10 @@ function OnSimulToolDeselect( dPrevA)
-- se devo scaricare un utensile normale
else
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 1 then
if nSetHead == 1 and EMT.PREVHEAD_H1 then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID)
else
elseif EMT.PREVHEAD_H2 then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
end
@@ -683,23 +745,13 @@ function OnSimulMachiningStart()
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
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
-- recupero alcuni dati della lavorazione
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and not EMT.MCHUSERNOTES:find( 'VMRS=0;', 1, true))
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
-- recupero TASKID della feature lavorata
local vId = EgtGetMachiningGeometry()
if vId and #vId > 0 and #vId[1] > 0 then
@@ -743,7 +795,7 @@ function OnSimulMachiningStart()
local bAgg = EgtExistsInfo( EMT.PATHID, 'CNT')
ExecParkRoller( nil, nil, nil, nil, false, bAgg)
-- eseguo
SimulMoveAxes( 'Z2', ParkZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z2', ParkZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
@@ -768,6 +820,23 @@ function OnSimulMachiningEnd()
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end
EMT.DOU_TYPE = nil
EMT.DOU_TOOL = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- se non ho già tolto la sega a catena, aggiorno valori
if not EMT.CHSAW_OUT then
-- 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
---------------------------------------------------------------------
@@ -781,20 +850,27 @@ function OnSimulPathStart()
EMT.TO_SPECSPLIT = true
end
end
-- se taglio di precut verifico quanto è più lungo il grezzo rispetto al pezzo (non tiene conto dell'ultimo cubetto)
EMT.DELTA_LT = 0
if EMT.MCHPRECUT then
local dCosA = sqrt( max( 1 - EMT.EXTR[1] * EMT.EXTR[1], 0))
EMT.DELTA_LT = max( EMT.XMINT - Point3d( EMT.MMAX):getX() - dCosA * EMT.TDIAM / 2, 0)
EgtOutLog( 'PreCutDeltaLT='..EgtNumToString( EMT.DELTA_LT, 3), 5)
end
end
---------------------------------------------------------------------
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 and not EMT.TO_SPECSPLIT then
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
EMT.Y1DELTA = nil
SetPY1Light( false)
ExecMovePY1( false)
end
ExecMoveZmax( EMT.MCHSPLIT)
ExecMoveZmax( EMT.MCHSPLIT, false)
EMT.TO_ZMAX = nil
end
end
@@ -802,22 +878,22 @@ 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_SPECSPLIT 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)
ExecMoveZmax( EMT.MCHSPLIT, false)
EMT.TO_ZMAX = nil
end
end
@@ -859,7 +935,8 @@ function OnSimulMoveStart()
local bParkV = false
if EMT.MCHFIRST then
-- se rulli più chiusi del richiesto o cambio direzione utensile (tranne solo asse B con C0 o equivalenti) devo mettere i rulli in parcheggio
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) then
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) or
( EMT.TOOL ~= EMT.PREVTOOL_H1 and EMT.TOOL ~= EMT.PREVTOOL_H2) then
bParkV = true
EMT.A3 = ParkV1
EMT.A4 = ParkV2
@@ -881,7 +958,10 @@ function OnSimulMoveStart()
local nRes = 0
if bParkV then
local bAgg = EgtExistsInfo( EMT.PATHID, 'CNT')
-- se la lavorazione è un taglio di separazione, se necessario, ripristino posizione di Y1DELTA prima di aprire i rulli
if EMT.SPLIT_Y1DELTA and not EMT.MCHSPLIT then EMT.Y1DELTA = EMT.SPLIT_Y1DELTA end
nRes = ExecParkRoller( Y1Pos, Y2Pos, V1Pos, V2Pos, false, bAgg)
if EMT.SPLIT_Y1DELTA then EMT.Y1DELTA = nil end
end
-- se movimento in rapido ad inizio lavorazione
if EMT.MOVE == 0 and EMT.MOVEIND <= 3 then
@@ -905,7 +985,7 @@ function OnSimulMoveStart()
end
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
@@ -935,18 +1015,18 @@ function OnSimulMoveStart()
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'B1', ParkCSawB1)
B1Home = EgtGetAxisHomePos( 'B1')
C1Home = EgtGetAxisHomePos( 'C1')
Z1Home = EgtGetAxisHomePos( 'Z1')
EMT.CHSAW_OUT = nil
end
-- Porto la Z alla giusta quota
if Z1Pos > Z1Home + 1 and abs( B1Pos) > 89.9 then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', Z1Home, MCH_SIM_STEP.RAPID)
end
-- se movimento iniziale da Zmax
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'Z1', Z1Home, MCH_SIM_STEP.RAPID, 'B1', B1Home, MCH_SIM_STEP.COLLROT, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se circa verticale
else
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
-- altrimenti testa 2
@@ -988,18 +1068,18 @@ function OnSimulMoveStart()
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'B1', ParkCSawB1)
B1Home = EgtGetAxisHomePos( 'B1')
C1Home = EgtGetAxisHomePos( 'C1')
Z1Home = EgtGetAxisHomePos( 'Z1')
EMT.CHSAW_OUT = nil
end
-- Porto la Z alla giusta quota
if Z1Pos > Z1Home + 1 and abs( B1Pos) > 89.9 then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', Z1Home, MCH_SIM_STEP.RAPID)
end
-- se movimento iniziale da Zmax
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'Z1', Z1Home, MCH_SIM_STEP.RAPID, 'B1', B1Home, MCH_SIM_STEP.COLLROT, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se circa verticale
else
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
else
@@ -1034,20 +1114,31 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
-- Porto la Z alla giusta quota
if Z2Pos > Z2Home + 1 and abs( B2Pos) > 89.9 then
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
ShowToolInTcPos( EMT.TCPOS, false)
OnSimulToolSelect( dPosA)
-- recupero i dati dato che ho scaricato motosega e preso quelli dell'utensile di default
EmtModifyAxisHome( 'Z2', GetChainSawZHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'C2', GetChainSawCHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'B2', ParkCSawB2)
B2Home = EgtGetAxisHomePos( 'B2')
C2Home = EgtGetAxisHomePos( 'C2')
Z2Home = EgtGetAxisHomePos( 'Z2')
EMT.CHSAW_OUT = nil
end
-- se movimento iniziale da Zmax
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se pezzo molto alto e R3=0, mi sposto in X (per ora solo davanti)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxes( 'X2', SafeCSaw0X2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'Z2', Z2Home, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z2', Z2Home, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
end
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se circa verticale
else
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
end
@@ -1122,12 +1213,17 @@ 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 pinza speciale (e posizionamento iniziale)
if EMT.W2DELTA then
@@ -1163,9 +1259,14 @@ function OnSimulMoveEnd()
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
-- eventuale rimozione sfridi
RemoveScraps()
ExecRemoveScraps()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT)
ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
EMT.TO_ZMAX = nil
end
end
@@ -1192,7 +1293,7 @@ function OnSimulCollision()
end
---------------------------------------------------------------------
function ExecAuxCmd( sCmd)
function ExecAuxCmd( sCmd, bPathStart)
-- analizzo il comando
local Cmd = EgtSplitString( sCmd)
if Cmd[1] == '0' then
@@ -1212,29 +1313,31 @@ function ExecAuxCmd( sCmd)
end
EgtOutText( Cmd[2])
elseif Cmd[1] == '1' then
if EMT.SPLIT or EMT.SPECSPLIT then ExecOpenRoller( 1) end
if EMT.UNLOADING or EMT.TO_FALL or EMT.TO_SPECSPLIT 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 or EMT.TO_SPECSPLIT 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,
@@ -1256,8 +1359,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 or EMT.TO_SPECSPLIT 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,
@@ -1277,15 +1380,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
local dPY = EgtIf( Cmd[2] == '0', MaxHoOpen, EgtIf( EMT.ROT == -1, EMT.SB, EMT.HB))
SimulMoveAxis( 'PY1', dPY, 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
local dPY = EgtIf( Cmd[2] == '0', MaxHoOpen, EgtIf( EMT.ROT == -1, EMT.SB, EMT.HB))
SimulMoveAxis( 'PY2', dPY, 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])
@@ -1366,7 +1467,8 @@ end
---------------------------------------------------------------------
function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit)
ExecMoveZmax( bMchSplit, true)
EMT.TO_ZMAX = nil
-- se richiesto, avvicino i rulli
if bNearV then
-- se sega a catena su testa 1 devo prima depositarla
@@ -1411,7 +1513,7 @@ function ExecMoveHome( bNearV, bMchSplit)
end
---------------------------------------------------------------------
function ExecMoveZmax( bMchSplit)
function ExecMoveZmax( bMchSplit, btoXHome)
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 0 then return end
@@ -1452,20 +1554,28 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- se lavorazione in doppio
if EMT.DOU_TYPE == 2 then
local CurrZ2 = EgtGetAxisPos( 'Z2')
if CurrZ2 < ParkZ2 then
SimulMoveAxes( 'Z2', ParkZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z2', ParkZ2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'B2', ParkB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
if bToXHome then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
EMT.DOU_TO_ZMAX = nil
end
-- altrimenti sega a catena
else
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
else
@@ -1481,10 +1591,24 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
else
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
if btoXHome then
EgtUnloadTool( EMT.HEAD, 1)
ShowToolInTcPos( EMT.TCPOS, true)
EMT.PREVTOOL_H1 = nil
EMT.PREVHEAD_H1 = nil
EMT.PREVTCPOS_H1 = nil
EMT.CHSAW_OUT = true
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
end
@@ -1502,10 +1626,16 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'B2', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
-- altrimenti sega a catena
if btoXHome then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
else
SimulMoveAxes( 'Z2', HomeZ, MCH_SIM_STEP.RAPID, 'B2', HomeB, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
end
end
EMT.ZMAX = true
@@ -1540,10 +1670,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
@@ -1576,6 +1710,18 @@ function ExecUnloading()
end
end
---------------------------------------------------------------------
function ExecMovePY1( bClose)
SimulMoveAxis( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( bClose)
end
---------------------------------------------------------------------
function ExecMovePY2( bClose)
SimulMoveAxis( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( bClose)
end
---------------------------------------------------------------------
local function LinkRemainingPartsToY1()
local nCurrOrd = GetPhaseOrd( EMT.PHASE)
@@ -1607,6 +1753,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
@@ -1692,8 +1841,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.LT - EMT.HOVM
if ( PosT + EMT.LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.HOVM > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
local TryMoveY2 = ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
if ( PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
'V1', ParkV1, MCH_SIM_STEP.RAPID,
'V2', ParkV2, MCH_SIM_STEP.RAPID,
@@ -1730,7 +1879,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]
@@ -1761,7 +1910,6 @@ function RemoveScraps()
end
EMT.VMRS = false
end
end
---------------------------------------------------------------------
@@ -2026,18 +2174,19 @@ end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 70000 -- mm/min
local RAPID_Y_FEED = 100000 -- mm/min
local RAPID_Z_FEED = 32000 -- mm/min
local RAPID_C_FEED = 15000 -- deg/min
local RAPID_B_FEED = 15000 -- deg/min
local RAPID_MIN_T = 0.1 -- s
local LOAD_T = 2 -- s
local CHAR_ONE_MOVE_T = 1 -- s
local ROTATION_T = 40 -- s
local SPLIT_T = 6 -- s
local UNLOAD_T = 4 -- s
local FALL_T = 2 -- s
local ESTIMATION_RAPID_COEFF = EstimationRapidMultiplier or 1
local RAPID_X_FEED = 70000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 32000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_C_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_B_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_MIN_T = 0.1 * ESTIMATION_RAPID_COEFF -- s
local LOAD_T = 2 * ESTIMATION_RAPID_COEFF -- s
local CHAR_ONE_MOVE_T = 1 * ESTIMATION_RAPID_COEFF -- s
local ROTATION_T = 40 * ESTIMATION_RAPID_COEFF -- s
local SPLIT_T = 6 * ESTIMATION_RAPID_COEFF -- s
local UNLOAD_T = 4 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
@@ -2103,9 +2252,9 @@ function OnEstimDispositionEnd()
-- Se disposizione inizio o rimanenza
if IsStartOrRestPhase( EMT.PHASE) then
;
-- se altrimenti disposizione intermedia, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
-- se altrimenti disposizione intermedia o finale dopo separazione e rotazione, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) or IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- verifico se sono diverse
@@ -2561,7 +2710,12 @@ function GetNextTool( nMchId)
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
-- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali
if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then
if IsStartOrRestPhase( EMT.PHASE+1) then
return nil
end
else
break
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
+46 -18
View File
@@ -4,9 +4,8 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Carico i dati globali
local sBaseDir = EgtGetSourceDir()
BD = dofile( sBaseDir .. 'Beam\\BeamData.lua')
-- Carico libreria
local BD = require( 'BeamData')
---------------------- OnSpecialGetMaxZ -----------------------------
---------------------------------------------------------------------
@@ -291,6 +290,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 GetPhaseRot( nPhase)
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
@@ -839,6 +854,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
EMC.SB = b3Tot:getDimY()
EMC.HB = b3Tot:getDimZ()
EMC.LT = b3Raw:getDimX()
EgtOutLog( ' BarLen='..EgtNumToString( EMC.LB, 1), 3)
-- Aggiorno limiti di presa
UpdateMinJoin()
@@ -1100,8 +1116,12 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
end
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + SIC_V
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + SIC_V
-- Forzo la distanza di sicurezza da utensile
local nSecRollerDist = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES), 'SECDIST', 'i') or SIC_V
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + nSecRollerDist
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + nSecRollerDist
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip
@@ -1297,6 +1317,9 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
return {}
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)
-- [B] se richiesti entrambi e posso metterli
@@ -1633,19 +1656,24 @@ function SpecAdjustCarriages( WorkTab)
local bCloseV = false
if WorkTab.dY1DeltaI then
if WorkTab.dY1DeltaI <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EMC.HCING + EMC.HOVM + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaI then
if EMC.LB - WorkTab.dY2DeltaI <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EgtIf( SPLIT, EMC.TCING, 0) + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaMinF then
if EMC.LB - WorkTab.dY2DeltaMinF <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EgtIf( SPLIT, EMC.TCING, 0) + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
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
EgtOutLog( ' Tool : '..( EgtIf( bChangedTool, 'CHANGED', 'same')).. ' CloseV : '..( EgtIf( bCloseV, 'TRUE', 'false')), 1)
@@ -1801,7 +1829,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- allontano (Y1+T) e (Y2)
dY1a = MaxY1
dY2a = MinY2
dTa = ( MaxY1 - TabI.dY1PosI) + dTa
dTa = ( dY1a - TabI.dY1PosI) + dTa
-- **[M2]** = allontanamento dei trascinatori con Y2 in presa
elseif sType == 'M2' then
EmitComment( vCmd, '[M2]')
@@ -1812,7 +1840,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- allontano (Y2+T) e (Y1)
dY1a = MaxY1
dY2a = MinY2
dTa = ( MinY2 - TabI.dY2PosI) + dTa
dTa = ( dY2a - TabI.dY2PosI) + dTa
-- **[M3]** = accentramento dei trascinatori con Y1 in presa
elseif sType == 'M3' then
EmitComment( vCmd, '[M3]')
@@ -1822,7 +1850,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- accentro (Y1+T) e (Y2)
dY1a = TabI.MyMinY1V1
dY2a = TabI.MaxY2V2
dTa = ( TabI.MyMinY1V1 - TabI.dY1PosI) + dTa
dTa = ( dY1a - TabI.dY1PosI) + dTa
-- **[M4]** = accentramento dei trascinatori con Y2 in presa
elseif sType == 'M4' then
EmitComment( vCmd, '[M4]')
@@ -1833,7 +1861,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- accentro (Y2+T) e (Y1)
dY1a = TabI.MyMinY1V1
dY2a = TabI.MaxY2V2
dTa = ( TabI.MaxY2V2 - TabI.dY2PosI) + dTa
dTa = ( dY2a - TabI.dY2PosI) + dTa
end
--
table.insert( vCmd, { 3, 'Y1', dY1a, 'Y2', dY2a, 'T', dTa, EMC.CNT})
@@ -2159,7 +2187,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
@@ -2298,7 +2326,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
@@ -2370,7 +2398,7 @@ function SpecAdjustCarrA( WorkTab)
dY1DeltaF = PosY1Y2B( TabValI, vCmd)
else
--[A(1)A] **ALLONTANAMENTO** (dall'origine) del trascinatore Y1
EmitComment( vCmd, '[AY1A]')
EmitComment( vCmd, '[A-Y1A]')
dY1DeltaF = PosY1Y2A( TabValI, vCmd)
end
-- chiudo Y1
@@ -2466,8 +2494,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)
@@ -2538,8 +2566,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)
@@ -2599,7 +2627,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à
+114 -4
View File
@@ -1,4 +1,103 @@
==== Essetre_StdPF Update Log ====
==== Common_ONE-PF Update Log ====
Versione 2.6-- (--/--/2024)
- (SIM-GEN) Se motosega allineata ad asse B per tagli di fianco, corretto movimento che manda testa a parcheggio. Pezzi più alti di 650 va solo in Zmax. Ticket#1943
- (GEN) Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. Ticket#1891
Versione 2.6g4 (19/07/2024)
- (SIM-GEN) Aumentato numero iterazioni per scambio carrelli (da 5 a 10), per pezzi lunghi 30m.
Versione 2.6g3 (17/07/2024)
- (GEN) Correzione modifica precedente (2.6g2). Con lama precedente e motosega successiva, andava a parcheggio con lama alla quota della motosega. Ticket#1880
Versione 2.6g2 (16/07/2024)
- (GEN) Per preselezione o movimenti in home, non si scrive più 'ET0' perchè non è più supportato. Ticket#1926
Versione 2.6g1 (10/07/2024)
- (GEN) Se prima lavorazione con motosega, dopo G151 di attesa carrelli si ribadiscono tutti gli assi. Ticket#1924
Versione 2.6f1 (03/06/2024)
- (GEN) Aggiunta possibilità di scrivere nome utensile doppio anche in lavorazione con parametro "TOOLDOUBLE". Note sulla lavorazione hanno precedenza su note utensile.
Versione 2.6e1 (30/04/2024)
- (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) In log collisioni, si scrive anche ID del gruppo per facilitare riconoscimento in caso di collisione
- (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 (12/04/2024)
- (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.
Versione 2.6d1 (28/03/2024)
- (GEN) Rimosso da generazione funzione GetNextTool duplicata
- (SIM-GEN) Se fase successiva start di un altro pezzo, la GetNextTool restituisce nil, per forzare movimento home in caso di utensili speciali
- (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
- (SIM) Corretto movimento in simulazione se motosega su testa 2
Versione 2.6c9 (26/03/2024)
- (SIM) Corretta gestione cambio utensile con motosega. In alcuni casi non era coerente con generazione
- (GEN) In 'PreparePostRotation' si resetta sempre anche la paratia in uscita (Ticket#1733)
Versione 2.6c8 (22/03/2024)
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. CAM5 ver. 2.6c2 FACOLTATIVA.
Versione 2.6c7 (11/03/2024)
- (SIM-GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile.
- (MLPE-GEN) Aggiunto parametro "WriteM05Command" (NON OBBLIGATORIO) per decidere se scrivere il comando M05 per arresto mandrino. Default a true.
Versione 2.6c6 (08/03/2024)
- (SIM-GEN) Gestione rotazioni 90° come su FAST, caso MID2 (split/cut prima delle rotazioni)
Versione 2.6c5 (07/03/2024)
- (GEN) Per ribaltamento, i comandi si differenziano per macchina. Sembra che ONE e PF abbiano comandi diversi. In attesa di conferma da parte di Essetre
- (SIM-GEN) Se cambiato utensile, si aprono sempre paratie
- (SIM) Spostato salvataggio dati utensile precedente in MachiningEnd, prima era in MachininsStart
Versione 2.6c4 (06/03/2024)
- (SIM-GEN) Alla fine del movimento a Z-MAX, in home con lama solo se si cambia utensile. Prima andava sempre in home se era lama, anche se non doveva cambiare utensile
Versione 2.6c3 (05/03/2024)
- (MLDE-SIM) Aggiunta variabile FACOLTATIVA 'EstimationRapidMultiplier' in mlde per regolare il tempo stimato di rapido su macchine vecchie. Se non presente default 1.
Versione 2.6c2 (04/03/2024)
- (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.6b2 (26/02/2024)
- (MLDE-SIM-GEN) EgtAddToPackagePath spostato in mlde
Versione 2.6b1 (20/02/2024)
- (SIM) Corretto controllo calcolo Z su primo movimento lama, allineato a generazione
- (GEN) Corretto emissione movimenti per macchine con motosega su testa 2
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (ALL) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (GEN) In "GetMovesInAuxCmd" si passa la posizione calcolata V1 indipendentemente dall'utilizzo di Y1
Versione 2.6a7 (12/02/2024)
- (GEN) Per movimento con motosega, si ribadiscono tutti gli assi nella prima G141
Versione 2.6a6 (02/02/2024)
- (SIM) Corretta simulazione movimento in X-Home, coerente con generazione
- (GEN) Aggiunta lettura parametro 'Split'
- (SIM) Se lavorazione è un taglio di separazione, se necessario, ripristino posizione di Y1DELTA prima di aprire i rulli
- (SIM-GEN) Modificata gestione movimenti motosega, in aggiunta con caso particolare di pezzo alto più di 650mm
- (ALL) Caricamento BeamData come local
Versione 2.6a5 (26/01/2024)
- (SIM-GEN) Migliorato calcolo dimensioni grezzo per apertura rulli in caso di 'precut'
Versione 2.6a4 (24/01/2024)
- (GEN) Se pezzo tenuto solo con pinza destra non si esclude la rulliera di sinistra, se pezzogrande, può venire in supporto
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra e in generale (da PF1250)
- (SIM) Aggiunto solido collisione lama sotto traversa (per PF-progress)
Versione 2.6a3 (23/01/2024)
- (GEN) Corretto gestione del movimento precedente all'ultimo che manda il pezzo alla posizione di scarico
Versione 2.6a2 (09/01/2024)
- Nuova versione. Prima versione stabile rilasciabile.
Versione 2.6a1 (28/11/2023)
- Prima versione post-proc comune tra macchine ONE e PF
@@ -9,6 +108,17 @@ Versione 2.6a1 (28/11/2023)
- (GEN+MLDE) Inserita gestione macro con carico ottimizzato. Macro macchina presente come standard solo su macchine PF. Parametro "OptimizedLoadBeam"
- (GEN+SIM) Migliorata gestione riposizionamento pinze, in caso testa debba andare in home
- (GEN) Se a zeta massima con lama e utensile successivo diverso, mi sposto sempre verso X-HOME
- (GEN) Corretto movimento in caso di testa 1 su TC-2. Utilizzava le quote della testa 2 anziché della 1.
Versione 2.6a2 (09/01/2024)
- Nuova versione. Prima versione stabile rilasciabile.
- (GEN) Corretto movimento in caso di testa 1 su TC-2. Utilizzava le quote della testa 2 anziché della 1
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6a2', -- versione script
VERSION = '2.6--', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}