Compare commits

..

93 Commits

Author SHA1 Message Date
andrea.villa fbd5f170de Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C 2025-10-06 15:53:55 +02:00
andrea.villa b06d6d4afe Merge remote-tracking branch 'origin/develop' 2025-09-23 11:25:49 +02:00
andrea.villa 36efe11298 Spostate costanti dimensioni utensili in MLDE 2025-09-23 11:25:32 +02:00
andrea.villa 5447eca3c3 Merge branch 'main' into develop 2025-09-17 09:21:20 +02:00
andrea.villa f5dc0ec3f2 Merge remote-tracking branch 'origin/develop' 2025-09-17 09:21:06 +02:00
andrea.villa a8a708697d Prelievo e deposito motosega con gli angoli comunicati da Essetre 2025-09-17 08:56:07 +02:00
andrea.villa 7806f539b5 Stima tempi considerando accelerazioni 2025-09-10 13:09:55 +02:00
andrea.villa 2f0ee75abf Merge remote-tracking branch 'origin/main' into develop 2025-09-08 08:41:29 +02:00
andrea.villa f515dd0312 Merge remote-tracking branch 'origin/develop' 2025-09-08 08:41:13 +02:00
andrea.villa 6a530927c9 Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico 2025-09-08 08:41:00 +02:00
andrea.villa 1f358ce1e1 Migliorata gestione movimenti speciali in caso di motosega 2025-07-21 13:09:49 +02:00
andrea.villa e5442d976a Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare 2025-07-21 11:57:37 +02:00
andrea.villa bb190b1643 Merge remote-tracking branch 'origin/main' into develop 2025-07-01 08:43:58 +02:00
andrea.villa 8adfbaf24b Corretta accelerazione di default 2025-07-01 08:43:39 +02:00
andrea.villa 55f5710f7c Merge remote-tracking branch 'origin/main' into develop 2025-07-01 08:11:03 +02:00
andrea.villa 1ee84c6cf8 Merge remote-tracking branch 'origin/develop' 2025-07-01 08:10:39 +02:00
andrea.villa 44ea5b2a2c Cambio versione per rilascio 2025-07-01 08:10:24 +02:00
andrea.villa 3c82040b21 Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. 2025-06-30 12:22:10 +02:00
andrea.villa 42ab289444 Merge remote-tracking branch 'origin/main' into develop 2025-06-26 08:48:50 +02:00
andrea.villa e6ab77e59a Merge remote-tracking branch 'origin/develop' 2025-06-26 08:48:34 +02:00
andrea.villa 958b5bbc3a Commit per versione 2025-06-26 08:48:10 +02:00
andrea.villa f223006bc7 Aggiunti 10mm di sicurezza in caso di primo pinzaggio. La tolleranza per riqualifica laser è a 50mm, mettere 50mm di distanza è troppo poco in caso il pezzo venisse caricato lontano dalla battuta di carico. Il calcolo è comunque da rivedere. 2025-06-26 08:45:56 +02:00
andrea.villa 659aa80001 Merge remote-tracking branch 'origin/main' into develop 2025-06-19 16:50:17 +02:00
andrea.villa 6db40176a2 Merge remote-tracking branch 'origin/develop' 2025-06-19 16:49:55 +02:00
andrea.villa 0fa80629f6 Se in separazione il pezzo è andato più lontano della posizione standard, viene riletta 2025-06-19 16:49:39 +02:00
andrea.villa 9eb362d312 Merge remote-tracking branch 'origin/main' into develop 2025-06-18 17:56:50 +02:00
andrea.villa 912bf4f072 Corretto movimento speciale solo se utensile lungo su testa 1 2025-06-18 17:56:16 +02:00
andrea.villa 717a03a549 Merge branch 'main' into develop 2025-06-18 17:33:46 +02:00
andrea.villa 1a68f3e543 Merge remote-tracking branch 'origin/develop' 2025-06-18 17:33:31 +02:00
andrea.villa d5165571da Se utensile più lungo di 350mm, si va in posizione sicurezza come per la motosega 2025-06-18 17:31:34 +02:00
andrea.villa e2a5b11cfa Merge remote-tracking branch 'origin/main' into develop 2025-05-26 09:49:56 +02:00
andrea.villa bd80cd5500 Merge branch 'develop' 2025-05-26 09:49:12 +02:00
andrea.villa 9bb3b85930 - In simulazione, corretto selezione utensile per punte lunghe
- Cambio versione
2025-05-26 09:48:44 +02:00
andrea.villa 4c7380986c Aumentata dimensione massima per la quale si rimuove uno scarto dal VMILL 2025-04-28 16:30:50 +02:00
andrea.villa 837a607ceb Merge remote-tracking branch 'origin/main' into develop 2025-04-14 08:29:33 +02:00
andrea.villa d6f6b91bbb Merge remote-tracking branch 'origin/develop' 2025-04-14 08:29:15 +02:00
andrea.villa 8a35315165 Corretto movimento iniziale in caso di motosega, si controlla solo se non è il carico 2025-04-14 08:29:04 +02:00
andrea.villa 98156b21eb Merge remote-tracking branch 'origin/main' into develop 2025-03-26 12:15:31 +01:00
andrea.villa 2bfb1b4b27 Merge remote-tracking branch 'origin/develop' 2025-03-26 12:15:15 +01:00
andrea.villa bf0c9460c6 Commit per versione 2025-03-26 12:15:03 +01:00
andrea.villa a721fda298 In MyAdjustLinearAxes si utilizza TDIR per calcolarsi gli offset per compatibilità con lavorazioni a 5 assi. 2025-03-26 09:18:38 +01:00
andrea.villa 47516ad370 - All'inizio del codice ISO si scrive nel commento anche il controllo numerico utilizzato per la generazione.
- Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
2025-03-10 08:25:20 +01:00
andrea.villa 09f5c56ac9 Merge remote-tracking branch 'origin/main' into develop 2025-02-20 16:44:42 +01:00
andrea.villa 7765c9c767 Aggiunta gestione per ToolHolder flottante 2025-02-20 16:44:21 +01:00
andrea.villa 9da3bb88e1 Merge remote-tracking branch 'origin/main' into develop 2025-02-20 16:37:02 +01:00
andrea.villa aa0d80735b Merge branch 'develop' 2025-02-20 16:36:43 +01:00
andrea.villa 5426a1a07a Per controllo TPA, modifica al numero di decimali. 2025-02-20 16:36:23 +01:00
andrea.villa db906c0817 Caricamento libreria EmtGenMachining. Si fa una require con PCALL perchè la libreria è opzionale e non è detto che ci sia. In installazione CAM5 dalla 2.7a1 2025-01-16 12:42:27 +01:00
andrea.villa 14d5f35f8f - Aggiunta possibilità di settare HCING/TCING nelle note di ogni singola lavorazione per gestire parte non pinzabile del pezzo. Funziona solo con nuova strategia pinzaggio
- Piccola correzione calcolo posizione carrelli con nuova strategia di pinzaggio
2025-01-14 08:37:23 +01:00
andrea.villa e039384b87 Merge branch 'main' into develop 2025-01-08 16:01:39 +01:00
andrea.villa d2b4a55db4 Dopo separazione, in NUM_PLUS, si srive EH1 solo se macro G101, perchè altrimenti non è prevista 2025-01-08 16:01:29 +01:00
andrea.villa 833c2d95e7 Merge remote-tracking branch 'origin/main' into develop 2025-01-08 12:01:21 +01:00
andrea.villa 2577240699 Aggiunta gestione qualità VMILL da impostazioni macchina 2025-01-08 12:00:56 +01:00
andrea.villa 3a20baca05 Merge remote-tracking branch 'origin/main' into develop 2025-01-08 11:50:27 +01:00
andrea.villa 590f332cea Aggiunta gestione FACOLTATIVA 'EstimationRapidMultiplier' in MLDE per regolare il tempo stimato 2025-01-08 11:50:14 +01:00
andrea.villa c4c818eb6a Merge remote-tracking branch 'origin/main' into develop 2025-01-07 14:37:36 +01:00
andrea.villa 49316c92fc Merge branch 'develop' 2025-01-07 14:37:19 +01:00
andrea.villa a479cfac69 Commit per versione 2025-01-07 14:36:41 +01:00
andrea.villa 692601f07e Aumentati limiti massimi di pinzaggio minimo 2024-12-18 12:03:30 +01:00
andrea.villa 487bbf1ce6 Per controllo NUM si blocca generazione se lavorazione con aggregato (mai gestito) 2024-12-12 14:56:58 +01:00
andrea.villa c7ebf339ec Nuovo aggregato 90° (H7) per fresa tipo BlockHaus. 2024-12-05 16:23:42 +01:00
andrea.villa 685e63dd83 Merge remote-tracking branch 'origin/main' into develop 2024-12-02 08:25:40 +01:00
andrea.villa a19947f6c2 Merge branch 'develop' 2024-12-02 08:25:22 +01:00
andrea.villa 07770ea12e Commit per versione 2024-12-02 08:25:12 +01:00
andrea.villa ce1ae72beb Per decidere posizione parcheggio barra dopo separazione, si considera lunghezza coda del pezzo in lavoro per evitare collisioni 2024-11-18 12:15:30 +01:00
andrea.villa 341e049753 Corretto movimento VMILL durante scarico pezzo piccolo a caduta 2024-11-14 10:42:10 +01:00
andrea.villa e8be6e9ca8 Merge remote-tracking branch 'origin/main' into develop 2024-11-11 09:25:01 +01:00
andrea.villa e4659394a5 Merge remote-tracking branch 'origin/develop' 2024-11-11 09:24:45 +01:00
andrea.villa 1e8dfdd2f0 - Aggiustato parametro in calcolo ingombro lavorazione
- Cambio versione
2024-11-11 09:24:31 +01:00
andrea.villa 1ff99e2f0f - Aggiunta gestione aggregato a T per NUM
- Tolta gestione testa dummy H4
2024-11-08 09:23:59 +01:00
andrea.villa e8958065ef Merge branch 'main' into develop 2024-10-25 14:35:55 +02:00
andrea.villa eff8fc90c6 Merge branch 'develop' 2024-10-25 14:35:50 +02:00
andrea.villa 4448156fec Miglioria 2.6j9. Si ribadisce pinza in presa sempre, all'inizio, in base a quella attiva 2024-10-25 14:35:36 +02:00
andrea.villa f346df9d27 Merge remote-tracking branch 'origin/main' into develop 2024-10-22 11:18:16 +02:00
andrea.villa 810f85c62a Merge branch 'hotfix/NewReposClampAfterTurn' 2024-10-22 11:17:35 +02:00
andrea.villa 6ec26b5ad1 Miglioria 2.6j6. Oltre al passo pellegrino si ribadisce anche quando è scambio diretto 2024-10-22 11:16:47 +02:00
andrea.villa 304701cb77 Merge branch 'main' into develop 2024-10-21 08:44:10 +02:00
andrea.villa 306945f09b Merge branch 'hotfix/BugFixRepositioningTolerance' 2024-10-21 08:44:03 +02:00
andrea.villa 09eb355037 Corretto problema tolleranza aggiunto con versione 2.6j7 2024-10-21 08:43:49 +02:00
andrea.villa 30ed6aa984 Merge remote-tracking branch 'origin/main' into develop 2024-10-18 10:21:52 +02:00
andrea.villa ff7338e2f4 Merge branch 'hotfix/NewRepositioningTolerance' 2024-10-18 10:21:07 +02:00
andrea.villa 4903a6065e In nuova disposizione carrelli, aggiunta tolleranza di 100 EPS quando si calcola minimo posizionamento 2024-10-18 10:20:51 +02:00
andrea.villa 36df78ed67 Merge remote-tracking branch 'origin/main' into develop 2024-10-17 16:10:15 +02:00
andrea.villa 3132d213c1 Commit per versione 2024-10-17 16:10:03 +02:00
andrea.villa cbf5df9895 Merge branch 'hotfix/NewRepositioning' 2024-10-17 16:08:39 +02:00
andrea.villa ec8fa72ca2 Si ribadisce che la pinza era in presa, prima di cominciare con lo scambio del passo del pellegrino 2024-10-17 16:08:22 +02:00
andrea.villa 8c5e759bec Merge remote-tracking branch 'origin/main' into develop 2024-10-17 09:28:19 +02:00
andrea.villa 6ace9c266d Merge remote-tracking branch 'origin/develop' 2024-10-17 09:28:03 +02:00
andrea.villa 2a7b732444 Piccola correzione nuovo riposizionamento. Nel taglio dello scarto finale riposizionava nel vuoto 2024-10-17 09:27:45 +02:00
andrea.villa 6206ba44db Merge remote-tracking branch 'origin/main' into develop 2024-10-15 09:10:14 +02:00
andrea.villa ad882352d0 Merge remote-tracking branch 'origin/develop' 2024-10-15 09:09:56 +02:00
andrea.villa 8ef399a55c - Piccola correzione nuovo riposizionamento. Non considerava i 50mm di tolleranza su primo pinzaggio dopo ribaltamento
- Gestione attivazione pressore verticale in nuovo riposizionamento
2024-10-15 09:09:45 +02:00
andrea.villa e397ac2627 Merge branch 'main' into develop 2024-10-11 14:50:07 +02:00
7 changed files with 675 additions and 262 deletions
+41 -17
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
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 CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -27,7 +27,9 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end
---------------------------------------------------------------------
@@ -53,6 +55,7 @@ function OnProgramStart()
end
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
EmtOutput( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmtOutput( 'M28')
@@ -104,6 +107,7 @@ function OnProgramEnd()
EMT.FALL = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma
if TEST_USE then
EmtOutput( 'M02')
@@ -181,16 +185,12 @@ function OnDispositionEnd()
local STrave = EMT.ST
local HOverM = EMT.HOVM
-- calcolo dati pinze
local MinAccPinze = 0.3
local MaxAccPinze = 4
local KgMtCubo= WoodDensity or 550 -- densità legno in Kg / metro cubo
local Massa = ( HTrave * STrave * LBarra * KgMtCubo ) / 1000000000
local FMaxPinze = EMT.FMAXPINZE
local ForzaAtrito = 700 / 2 -- Serve per regolare P32 (700 valore reale pistone)
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAtrito) / 1000)
if ( TempoAcc < MinAccPinze) then TempoAcc = MinAccPinze end
if ( TempoAcc > MaxAccPinze) then TempoAcc = MaxAccPinze end
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if ( RidFeed > 100) then RidFeed = 100 end
if IdTrave >= 0 then
@@ -250,9 +250,9 @@ function OnDispositionEnd()
EmtOutput( sOut)
-- altrimenti recupero rimanenza
else
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( LoadT, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( EMT.TPOS, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT
EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil
end
-- eventuale preparazione per rotazione immediata
@@ -496,6 +496,7 @@ function OnMachiningEnd()
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
end
---------------------------------------------------------------------
@@ -626,15 +627,26 @@ function OnRapid()
end
end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and sET == EMT.PREVET and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and (EMT.ST > BeamHeightForFixRot or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
@@ -648,14 +660,23 @@ function OnRapid()
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
end
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
@@ -1532,10 +1553,13 @@ function MyAdjustLinearAxes()
if EMT.REFLOC then
local vtE
if EMT.HEAD ~= 'H3' then
-- su NUM aggregati non gestiti
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
EmtSetLastError( 1211, "Aggregates not managed")
elseif EMT.HEAD ~= 'H3' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
else
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
@@ -1647,7 +1671,7 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' then
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' or sHead == 'H7' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
+54 -42
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
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 CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -27,7 +27,9 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end
---------------------------------------------------------------------
@@ -53,6 +55,7 @@ function OnProgramStart()
end
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
EmtOutput( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmtOutput( 'M28')
@@ -108,6 +111,7 @@ function OnProgramEnd()
EMT.FALL = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma
if TEST_USE then
EmtOutput( 'M02')
@@ -145,7 +149,11 @@ function OnToolData()
local sPos = 'N2' .. tostring(nPos)
local sOut = 'L11=' .. EmtLenToString( EMT.SMAX, 3) .. ' L12=' .. EmtLenToString( AngTr1Offs, 1)..' G76H9998.1'..sPos..sPos
EmtOutput( sOut)
-- altro non previsto
-- emissione dati sega a catena
elseif EMT.HEAD == 'H7' then
local sOut = 'L11='..EgtNumToString( EMT.SMAX, 0)..' L12='..EmtLenToString( ( 154.5), 1)..' G76H9998.1N121N121'
EmtOutput( sOut)
-- altro non previsto
end
end
@@ -199,9 +207,9 @@ function OnDispositionEnd()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nLoad90 = EgtGetInfo( BtlInfoId, 'LOAD90', 'i') or 0
-- calcolo dati pinze
local AccPinze, AccMaxPinze, RidFeed, TempoAcc = CalcDinamicaPinze( HTrave, STrave, LBarra)
local AccPinz1, AccMaxPinz1, RidFeed1, TempoAcc1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave)
local AccPinz2, AccMaxPinz2, RidFeed2, TempoAcc2 = CalcDinamicaPinze( HTrave, STrave, LTrave)
local AccPinze, AccMaxPinze, RidFeed, TempoAcc = CalcDinamicaPinze_NUM( HTrave, STrave, LBarra)
local AccPinz1, AccMaxPinz1, RidFeed1, TempoAcc1 = CalcDinamicaPinze_NUM( HTrave, STrave, LBarra - LTrave)
local AccPinz2, AccMaxPinz2, RidFeed2, TempoAcc2 = CalcDinamicaPinze_NUM( HTrave, STrave, LTrave)
if IdTrave >= 0 then
local sOut = '( SN='..IdTrave..' LBarra='..EmtLenToString( LBarra, 3)..' L='..EmtLenToString( LTrave, 3)..
' H='..EmtLenToString( HTrave, 3)..' S='..EmtLenToString( STrave, 3)..' Acc='..EgtNumToString( TempoAcc, 1)..
@@ -265,9 +273,9 @@ function OnDispositionEnd()
EmtOutput( sOut)
-- altrimenti recupero rimanenza
else
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( LoadT, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( EMT.TPOS, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT
EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil
end
-- eventuale preparazione per rotazione immediata
@@ -489,7 +497,7 @@ function OnMachiningEnd()
end
for i = 1, #EMT.AUXSTR do
local sOut = EMT.AUXSTR[i]
if EMT.AUXTYPE == 'S' then
if EMT.AUXTYPE == 'S' and sOut:find( 'G101 ') then
sOut = sOut .. ' EH1'
elseif EMT.AUXTYPE == 'U' and not EMT.CHY_ON and not sOut:find( 'ET') then
sOut = sOut .. ' ET2'
@@ -536,6 +544,7 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVR3 = EMT.R3
EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
end
---------------------------------------------------------------------
@@ -667,15 +676,26 @@ function OnRapid()
end
end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and sET == EMT.PREVET and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and ( EMT.ST > BeamHeightForFixRot or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
@@ -693,7 +713,7 @@ function OnRapid()
if EMT.HEAD == 'H3' then
sEL = sEL..EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
-- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
sEL = sEL..EmtLenToString( AngTr1Offs, 3)
-- se testa normale ( H1 or H2)
else
@@ -705,21 +725,30 @@ function OnRapid()
if EMT.HEAD == 'H3' then
sER = sER..EmtLenToString( EMT.TLEN, 3)
-- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
sER = sER..EmtLenToString( EMT.TLEN + AngTr1Len, 3)
-- se testa normale ( H1 or H2)
else
sER = sER..EmtLenToString( EMT.TDIAM / 2, 3)
end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
end
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
@@ -1017,7 +1046,7 @@ end
---------------------------------------------------------------------
function OnArc()
-- con aggregato non si possono fare archi. Deve essere tutto spezzato
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
EmtSetLastError( 1211, "With aggregate, the arcs must be splitted")
end
@@ -1087,28 +1116,6 @@ function FindNextTool()
return sTool, sHead, sTcPos
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
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]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc)
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed, TempoAcc
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
@@ -1636,17 +1643,22 @@ function MyAdjustLinearAxes()
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H5' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local LenAux = AngTr1Offs + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H7' then
local LenAux = AngTrBHOffs + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -1741,7 +1753,7 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' then
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' or sHead == 'H7' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
+94 -70
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
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 CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -21,14 +21,19 @@ function OnStart()
EMT.USETO1 = false -- abilitazione uso origine tavola
EMT.MODAL = true -- abilitazione emissione modale
EMT.INCHES = false -- unità di misura mm/inches
EMT.DECNUM = 5 -- numero di decimali dopo la virgola
EMT.DECNUM = 4 -- numero di decimali dopo la virgola
EMT.DECVERS = 6 -- numero di decimali dopo la virgola per versori
EMT.DECRAD = 4 -- numero di decimali dopo la virgola per raggio
EMT.DECMACRO = 3 -- numero di decimali dopo la virgola per macro
EMT.NUM = false -- abilitazione numerazione linee
--EMT.Nt = 'N' -- token per la numerazione di linea
--EMT.LINENBR = 0 -- numero di linea
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze
--EMT.Nt = 'N' -- token per la numerazione di linea
--EMT.LINENBR = 0 -- numero di linea
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 4000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 300 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
end
---------------------------------------------------------------------
@@ -51,6 +56,7 @@ function OnProgramStart()
end
ParkLine( sPrefixCommentLine..'('.. CSP_INFO..')')
ParkLine( sPrefixCommentLine..'('.. MACHINE_INFO..')')
ParkLine( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
@@ -108,6 +114,7 @@ function OnProgramEnd()
EMT.FALL = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Termino il programma
EmtOutput( 'M02')
end
@@ -116,8 +123,8 @@ end
function OnToolData()
-- emissione dati utensili
if EMT.HEAD == 'H1' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- cerco posizione di attrezzaggio del primo utensile di lavorazione
if EMT.TOOL == EMT.TOOL_1 and EMT.TLEN_1 < LONG_TOOL_MINLEN then
@@ -125,14 +132,14 @@ function OnToolData()
end
-- emissione dati lama
elseif EMT.HEAD == 'H2' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- emissione dati sega a catena
elseif EMT.HEAD == 'H3' then
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)
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO)
if EMT.TCPOS == 'T101' then
ParkLine( 'M992 P1=101' .. sData)
ParkLine( 'M992 P1=102' .. sData)
@@ -148,10 +155,15 @@ function OnToolData()
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local nPos = EgtIf( EMT.HEAD == 'H5', 91, 93)
if EMT.EXIT == 2 then nPos = nPos + 1 end
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- altro non previsto
-- emissione dati sega a catena
elseif EMT.HEAD == 'H7' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- altro non previsto
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -213,14 +225,14 @@ function OnDispositionEnd()
local HOverM = EMT.HOVM
-- calcolo dati pinze
local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze( HTrave, STrave, LBarra)
local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave)
local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze( HTrave, STrave, LTrave)
local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze_TPA( HTrave, STrave, LBarra)
local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze_TPA( HTrave, STrave, LBarra - LTrave)
local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze_TPA( HTrave, STrave, LTrave)
if IdTrave >= 0 then
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) ..
' H=' .. EmtLenToString( HTrave, 3) .. ' S=' .. EmtLenToString( STrave, 3) .. ' )'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, EMT.DECMACRO) .. ' L='..EmtLenToString( LTrave, EMT.DECMACRO) ..
' H=' .. EmtLenToString( HTrave, EMT.DECMACRO) .. ' S=' .. EmtLenToString( STrave, EMT.DECMACRO) .. ' )'
EMT.PRODID = EgtGetInfo( BtlInfoId, 'PRODID', 'i') or 0
EMT.PATTID = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 0
EMT.CUTID = EgtGetInfo( EMT.IDT, 'CUTID', 'i') or 0
@@ -263,9 +275,9 @@ function OnDispositionEnd()
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2) ..
' P7=' .. EgtNumToString( TempAccPinze, 2) .. ' P8=' .. EgtNumToString( TempAccPinz2, 2) .. ' P9=' .. EgtNumToString( TempAccPinz1, 2)
EmtOutput( sOut)
EmtOutput( 'M112'..' P1='..EmtLenToString( LoadT, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp())
EmtOutput( 'M112'..' P1='..EmtLenToString( EMT.TPOS, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT
EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil
end
-- eventuale preparazione per rotazione immediata
@@ -646,14 +658,26 @@ function OnRapid()
bHeadFirst = false
end
end
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TCPOS == EMT.PREVTCPOS and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2pp, 3) .. ' P5=' .. EgtNumToString( EMT.R1pp, 3) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and ( EMT.ST > BeamHeightForFixRot or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2pp, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
@@ -666,9 +690,23 @@ function OnRapid()
end
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
end
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
@@ -682,8 +720,8 @@ function OnRapid()
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( MyZPos, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZPos, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.LOAD then
@@ -733,7 +771,7 @@ function OnRapid()
sV = EmtLenToString( ParkV)
sB = '2'
end
sOut = 'M112 P1='..EmtLenToString( EMT.L1, 3)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
sOut = 'M112 P1='..EmtLenToString( EMT.L1, EMT.DECMACRO)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
ParkLine( sOut)
EMT.LOAD = false
-- emissione prime linee speciali e linee parcheggiate
@@ -784,7 +822,7 @@ function OnRapid()
sOut = 'M101 P1=3'
EmtOutput( sOut)
end
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, 3) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, EMT.DECMACRO) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
EmtOutput( sOut)
if not bHeadFirst then
sOut = 'M101 P1=2'
@@ -856,15 +894,15 @@ function OnRapid()
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
' P4=' .. EgtNumToString( dBAxis, 3) .. ' P5=' .. EgtNumToString( dCAxis, 3) ..
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
' P4=' .. EgtNumToString( dBAxis, 3) .. ' P5=' .. EgtNumToString( dCAxis, 3) ..
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
@@ -881,8 +919,8 @@ function OnRapid()
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
@@ -1002,7 +1040,7 @@ function OnArc()
--local sCen = ' ' .. EMT.C1t .. EmtLenToString(EMT.C1,3) ..
-- ' ' .. EMT.C2t .. EmtLenToString(EMT.C2,3)
-- raggio
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECNUM)
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECRAD)
-- aggiungo feed
local sFeed = EmtGetFeed()
-- tipo arco
@@ -1043,28 +1081,6 @@ function FindNextTool()
return sTool, sHead, sTcPos
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
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]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc)
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
@@ -1634,18 +1650,24 @@ function MyAdjustLinearAxes()
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H5' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local Len = EMT.TLEN + AngTr1Len
local LenAux = MillOffs + AngTr1Offs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
vtE = Vector3d( EMT.EXTR) * Len + vtAux * LenAux - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H7' then
local Len = EMT.TLEN + AngTrBHLen
local LenAux = MillOffs + AngTrBHOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -1682,6 +1704,8 @@ function AdjustToolKinematic()
return EgtIf( EMT.EXIT == 1, '11', '12')
elseif EMT.HEAD == 'H6' then
return EgtIf( EMT.EXIT == 1, '21', '22')
elseif EMT.HEAD == 'H7' then
return '31'
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -1754,9 +1778,9 @@ function CalcInterpPlane()
local vtY = EMT.IPLGLFR:getVersY()
local vtZ = EMT.IPLGLFR:getVersZ()
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) ..
' P' .. EgtNumToString( - vtZ:getY(), 6) .. ' Q' .. EgtNumToString( vtZ:getX(), 6) .. ' R' .. EgtNumToString( vtZ:getZ(), 6)
' A' .. EgtNumToString( - vtX:getY(), EMT.DECVERS) .. ' B' .. EgtNumToString( vtX:getX(), EMT.DECVERS) .. ' C' .. EgtNumToString( vtX:getZ(), EMT.DECVERS) ..
' I' .. EgtNumToString( - vtY:getY(), EMT.DECVERS) .. ' J' .. EgtNumToString( vtY:getX(), EMT.DECVERS) .. ' K' .. EgtNumToString( vtY:getZ(), EMT.DECVERS) ..
' P' .. EgtNumToString( - vtZ:getY(), EMT.DECVERS) .. ' Q' .. EgtNumToString( vtZ:getX(), EMT.DECVERS) .. ' R' .. EgtNumToString( vtZ:getZ(), EMT.DECVERS)
EMT.IPLGL = true
end
+269 -72
View File
@@ -7,9 +7,6 @@ EgtEnableDebug( false)
-- carico librerie
local BD = require( 'BeamData')
LONG_TOOL_MINLEN = 221
BIG_TOOL_DIAM = 300
---------------------------------------------------------------------
-- *** GENERATION ***
---------------------------------------------------------------------
@@ -105,6 +102,7 @@ function OnSimulStart()
AddToCollisionCheck( 'B', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'C', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'H5', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'H6', 'COLLISION', EMT.COLLOBJ)
AddToolToCollisionCheck( 'H2', 1, EMT.COLLOBJ)
AddToolHolderToCollisionCheck( 'H2', 1, EMT.COLLOBJ)
DumpCollisionCheck( EMT.COLLOBJ, 'Collision Objects :', 4)
@@ -152,7 +150,8 @@ function OnSimulDispositionStarting()
EmtUnlinkAllRawPartsFromGroups()
if EMT.PHASE > 1 then
if IsStartOrRestPhase( EMT.PHASE) then
EgtSetAxisPos( 'T', LoadT)
local ParkT = GetParkT()
EgtSetAxisPos( 'T', ParkT)
end
end
end
@@ -166,20 +165,20 @@ function OnSimulDispositionStart()
-- Determino dimensioni del grezzo
local nSolId = EgtGetFirstNameInGroup( EgtGetFirstRawPart() or GDB_ID.NULL, 'RawSolid') or GDB_ID.NULL
local b3Sol = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD)
EMT.LB = 0
EMT.SB = 0
EMT.HB = 0
EMT.LT = 0
EMT.ST = 0
EMT.HT = 0
if b3Sol then
EMT.LB = b3Sol:getDimX()
EMT.SB = b3Sol:getDimY()
EMT.HB = b3Sol:getDimZ()
EMT.LT = b3Sol:getDimX()
EMT.ST = b3Sol:getDimY()
EMT.HT = b3Sol:getDimZ()
end
-- Carico primo utensile sulla testa 1
local sTool, nTlen = FindFirstToolOnHead( 'H1')
if sTool and nTlen < LONG_TOOL_MINLEN then
EMT.TOOL_1 = sTool
else
EMT.TOOL_1 = GetDefaultToolName()
EMT.TOOL_1 = GetDefaultToolName()
end
EgtLoadTool( 'H1', 1, EMT.TOOL_1)
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
@@ -189,7 +188,7 @@ function OnSimulDispositionStart()
EMT.VMILL = {}
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
local nLastOrd = GetPhaseOrd( EgtGetPhaseCount())
local nPartRawId = EgtGetFirstRawPart()
local nPartRawId = EgtGetFirstRawPart()
while nPartRawId do
-- se è lo scarto finale tagliato a pezzi, esco
local nRawOrd = EgtGetInfo( nPartRawId, 'ORD', 'i')
@@ -211,20 +210,24 @@ function OnSimulDispositionStart()
end
end
-- determino la risoluzione dello Zmap
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
local dTol = 4.71
if dArea < CoeffVM * 0.15e6 then
dTol = 0.71
elseif dArea < CoeffVM * 0.3e6 then
dTol = 1.01
elseif dArea < CoeffVM * 0.6e6 then
dTol = 1.51
elseif dArea < CoeffVM * 1.2e6 then
dTol = 1.97
elseif dArea < CoeffVM * 2.4e6 then
dTol = 2.81
elseif dArea < CoeffVM * 4.8e6 then
dTol = 3.77
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.71)
else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then
dTol = 0.71
elseif dArea < 0.15e6 then
dTol = 1.01
elseif dArea < 0.3e6 then
dTol = 1.51
elseif dArea < 0.6e6 then
dTol = 1.97
elseif dArea < 1.2e6 then
dTol = 2.81
elseif dArea < 2.4e6 then
dTol = 3.77
end
end
-- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
@@ -358,6 +361,8 @@ function OnSimulDispositionStart()
EgtOutText( 'Barra non ruotata')
end
end
-- verifico posizione di carico
local ParkT = GetParkT()
-- indice primo grezzo della fase
local nOrd = GetPhaseOrd( EMT.PHASE)
-- ricerco vettore movimento per i successivi
@@ -365,7 +370,7 @@ function OnSimulDispositionStart()
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then
vtMove = Vector3d( - LoadT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
vtMove = Vector3d( - ParkT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
break
end
nRawId = EgtGetNextRawPart( nRawId)
@@ -386,6 +391,8 @@ function OnSimulDispositionStart()
end
-- altrimenti fase finale, aggancio primo grezzo alla tavola e gli altri in posizione carico al carro Y
else
-- verifico posizione di carico
local ParkT = GetParkT()
-- indice primo grezzo della fase
local nOrd = GetPhaseOrd( EMT.PHASE)
-- ricerco vettore movimento per i successivi
@@ -393,7 +400,7 @@ function OnSimulDispositionStart()
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then
vtMove = Vector3d( - LoadT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
vtMove = Vector3d( - ParkT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
break
end
nRawId = EgtGetNextRawPart( nRawId)
@@ -456,8 +463,10 @@ function OnSimulToolSelect( dPosA)
EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
-- se non è chiamato da altro script (non c'è parametro)
if not dPosA then
-- se attivo Vmill
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
-- se utensile non flottante, abilito per Vmill
if not EMT.TFLOAT then
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
end
-- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then
@@ -477,8 +486,8 @@ function OnSimulToolSelect( dPosA)
EMT.A1n = 'Y'
EMT.A2n = 'V'
end
-- carico utensile se non lama su sua testa o dummy
if EMT.HEAD ~= 'H2' and EMT.HEAD ~= 'H4' then
-- carico utensile se non lama
if EMT.HEAD ~= 'H2' then
-- se sega a catena, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H3' then
if not dPosA then
@@ -506,6 +515,17 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0))
end
EgtSetAxisPos( 'B', 0)
-- se aggregato per fresa tipo blockhaus
elseif EMT.HEAD == 'H7' then
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0))
end
-- se TC 1
if GetTCSet( EMT.TCPOS) == 1 then
EgtSetAxisPos( 'B', 90)
else
if EMT.HEAD ~= 'H3' then
EgtSetAxisPos( 'B', -90)
end
end
-- se punta lunga
if EMT.TOTLEN > LONG_TOOL_MINLEN then
@@ -513,8 +533,7 @@ function OnSimulToolSelect( dPosA)
if EMT.TCPOS == 'T111' then
EgtSetAxisPos( 'B', 0)
end
end
-- breve pausa
end -- breve pausa
EgtPause( 100)
EgtOutText( '')
EMT.TOOL_1 = EMT.TOOL
@@ -529,27 +548,33 @@ function OnSimulToolDeselect()
-- se prossimo utensile non definito, è disposizione ed esco
if EMT.NEXTTOOL == '' then return end
-- se cambia uscita su rinvio non devo fare alcunché
if EMT.HEAD == 'H5' and EMT.NEXTHEAD == 'H5' then return end
if ( EMT.HEAD == 'H5' and EMT.NEXTHEAD == 'H5') or ( EMT.HEAD == 'H6' and EMT.NEXTHEAD == 'H6') then return end
-- se sega a catena o rinvio o punta lunga o utensile di grosso diametro, devo cambiare
if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then
if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then
EgtOutText( 'Tool change in progress...')
-- movimento scarico sega a catena
if EMT.HEAD == 'H3' then
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.HB > BeamHeightForFixRot then
if EMT.HT > BeamHeightForFixRot then
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
-- raddrizzo asse B prima di ruotare il C
SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
end
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, -180, 0), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, 270), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico rinvio
elseif EMT.HEAD == 'H5' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico aggregato BlockHaus
elseif EMT.HEAD == 'H7' then
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
-- movimento scarico punta lunga su T111
elseif EMT.TOTLEN > LONG_TOOL_MINLEN then
-- se su cambio utensile T111
@@ -559,7 +584,11 @@ function OnSimulToolDeselect()
-- altrimenti posizioni standard rastrelliera
else
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
if GetTCSet( EMT.TCPOS) == 1 then
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
end
end
-- movimento scarico utensile di grosso diametro (su T111)
else
@@ -573,24 +602,40 @@ function OnSimulToolDeselect()
-- nascondo utensile su testa e lo visualizzo su TcPos
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' then
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' and EMT.NEXTHEAD ~= 'H6' then
SimulMoveAxes( 'B', EgtIf( GetTCSet( EMT.TCPOS) == 1, 90, -90), MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
if EMT.NEXTHEAD == 'H3' then
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, 270), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, -180, 0), MCH_SIM_STEP.COLLROT)
end
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
end
end
-- se segue lama, carico utensile di default
if EMT.NEXTHEAD == 'H2' then
local sDefTool = GetDefaultToolName()
EgtLoadTool( 'H1', 1, sDefTool)
EMT.TOOL_1 = sDefTool
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
-- se TC 1
if GetTCSet( EMT.TCPOS_1) == 1 then
EgtSetAxisPos( 'B', 90)
else
EgtSetAxisPos( 'B', -90)
end
EgtLoadTool( 'H1', 1, sDefTool)
-- lo nascondo sul portautensili
ShowToolInTcPos( EMT.TCPOS_1, false)
end
EgtOutText( '')
-- deposito utensile se prossimo non lama su sua testa o dummy
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then
-- deposito utensile se prossimo non lama su sua testa
elseif EMT.NEXTHEAD ~= 'H2' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
-- simulo movimento
@@ -600,7 +645,7 @@ function OnSimulToolDeselect()
EgtPause( 100)
ShowToolInTcPos( EMT.TCPOS_1, true)
-- se segue sega a catena
if EMT.NEXTHEAD == 'H3' or EMT.NEXTHEAD == 'H5' then
if EMT.NEXTHEAD == 'H3' or EMT.NEXTHEAD == 'H5' or EMT.NEXTHEAD == 'H6' then
-- se non lama, nascondo l'utensile corrente
if EMT.HEAD ~= 'H2' then
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
@@ -748,33 +793,83 @@ function OnSimulMoveStart()
VerifyVStroke( EMT.A2)
-- se inizio lavorazione
if EMT.MCHFIRST then
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TOOL == EMT.PREVTOOL and abs( EMT.R3p - EMT.R3) < 100 * GEO.EPS_SMALL and ( abs( EMT.R2p - EMT.R2) > 25 or abs( EMT.R1p - EMT.R1) > 25) then
bGoToHome = true
end
EgtOutText( '')
EMT.MCHFIRST = false
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) then
if not EMT.LOAD and EMT.MOVE == 0 and ( EMT.HT > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare, prima si raddrizza B e poi C in posizione
if EMT.HEAD == 'H3' and bGoToHome then
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
elseif ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) then
SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
EMT.POSTROT = nil
end
-- se aggregato flottante su inizio attacco va compresso
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
-- recupero lunghezza
local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL)
-- imposto compressione della parte flottante
SetFloatPos( EMT.HEAD, dOffsL)
-- imposto dati utensile in posizione compressa
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL)
-- dichiaro che è compresso (assegnando Id entità di movimento)
EMT.TFLOAT_CMP = EMT.MOVEID
end
end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- se termine di passata con lama
if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
-- se utensile flottante e movimento di compressione
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
if not EMT.TFLOAT_TH_COMPR_COLL then
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach'
EmtSetLastError( 1222, sErr)
EgtOutLog( 'Error : ' .. sErr, 1)
else
EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1)
end
EMT.TFLOAT_TH_COMPR_COLL = nil
end
-- se aggregato flottante su fine uscita va rilasciato
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then
-- reset compressione della parte flottante
SetFloatPos( EMT.HEAD, 0)
-- dichiaro che è rilasciato
EMT.TFLOAT_CMP = nil
end
end
---------------------------------------------------------------------
function OnSimulCollision()
-- se prima collisione della lavorazione, la segnalo
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
-- speciale per utensile flottante (suo holder contro il grezzo)
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then
if EMT.MOVEID == EMT.TFLOAT_CMP then
EMT.TFLOAT_TH_COMPR_COLL = true
end
return
end
-- standard
local Class = ''
if EMT.SIMCOBIND == 1001 then
Class = 'T_H1'
@@ -841,14 +936,14 @@ function ExecAuxCmd( sCmd)
elseif Cmd[1] == '11' then
local dPY = MaxOpen
if Cmd[2] ~= '0' then
dPY = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
end
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
SetPYLight( Cmd[2] ~= '0')
elseif Cmd[1] == '12' then
local dPV = MaxOpen
if Cmd[2] ~= '0' then
dPV = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
end
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( Cmd[2] ~= '0')
@@ -895,7 +990,7 @@ function ExecRemoveScraps()
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
if b3Vmill:getDimX() < 1250 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
@@ -915,14 +1010,14 @@ function ExecUnloading()
-- li sposto per lasciare spazio al nuovo pezzo
local nId = EgtGetFirstInGroup( nVmGrpId)
while nId do
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.SB + 50.0), -( EMT.SB + 50.0)), 0), GDB_RT.GLOB)
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.ST + 50.0), -( EMT.ST + 50.0)), 0), GDB_RT.GLOB)
nId = EgtGetNext( nId)
end
-- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 450, -450), 0)
if EMT.FALL then vtMove = Vector3d( -500, 0, EgtIf( BD.RIGHT_LOAD, 750, -750)) end
if EMT.FALL then vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 500, -500), -750) end
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
@@ -1116,22 +1211,35 @@ end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 75000 -- mm/min
local RAPID_Y_FEED = 100000 -- mm/min
local RAPID_Z_FEED = 50000 -- 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 = 75000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 50000 / 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()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
-- TPA
if NumericalControl == 'TPA' then
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 4000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 300 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
-- NUM_PLUS e NUM
else
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end
end
---------------------------------------------------------------------
@@ -1217,6 +1325,15 @@ function OnEstimDispositionEnd()
EMT.OPEISDISP = false
end
---------------------------------------------------------------------
function OnEstimRawMoveData()
-- se start del pezzo
if IsStartOrRestPhase( EMT.PHASE) then
EMT.SPLIT = false
end
OnRawMoveData()
end
---------------------------------------------------------------------
function OnEstimToolSelect()
-- reset indice utensile in tabella lunghezze
@@ -1273,6 +1390,12 @@ function OnEstimMachiningEnd()
EMT.TLE_NAME = nil
EMT.TLE_TIME = nil
end
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
if EMT.MCHSPLIT then
EMT.SPLIT = true
end
end
---------------------------------------------------------------------
@@ -1403,11 +1526,11 @@ function OnEstimRapid()
EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen
-- calcolo tempo
local dTime = RAPID_MIN_T
local dT1 = abs( dL1) / RAPID_X_FEED * 60
local dT1 = CalcMoveTime( abs( dL1), RAPID_X_FEED, EMT.SPLIT)
if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60
local dT2 = CalcMoveTime( abs( dL2), EMT.FMAXPINZE, EMT.SPLIT)
if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60
local dT3 = CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT)
if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60
if dT4 > dTime then dTime = dT4 end
@@ -1429,7 +1552,7 @@ function OnEstimLinear()
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo
local dTime = dLen / EMT.F * 60
local dTime = CalcMoveTime( dLen, EMT.F, EMT.SPLIT)
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti
@@ -1566,6 +1689,80 @@ function GetPhaseRot( nPhase)
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
end
---------------------------------------------------------------------
function GetParkT()
local dTmp = EgtGetInfo( EMT.DISPID, 'TPOS', 'd') or EgtGetInfo( EMT.DISPID, 'TPARK', 'd')
if dTmp then
return dTmp
else
return LoadT
end
end
---------------------------------------------------------------------
function CalcDinamicaPinze_TPA( dH, dS, dL)
local MinTempoAcc = EMT.MINACC -- [ms] ~300
local MaxTempoAcc = EMT.MAXACC -- [ms] ~4000
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]
local TempoAcc = EgtClamp( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito), MinTempoAcc, MaxTempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc, MinTempoAcc, RidFeed
end
---------------------------------------------------------------------
function CalcDinamicaPinze_NUM( dH, dS, dL)
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]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
local AccMaxPinze = EMT.MAXACC
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed, TempoAcc
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
if NumericalControl == 'TPA' then
local dTempoAcc, _, _ = CalcDinamicaPinze_TPA( EMT.HT, EMT.ST, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
dTempoAcc = dTempoAcc / 1000
-- se si raggiunge la velocità massima
if dPathLen >= dFeedInSec * dTempoAcc then
dTime = dTempoAcc * 2 + ( ( dPathLen - dFeedInSec * dTempoAcc) / dFeedInSec)
else
dTime = 2 * sqrt( (dPathLen * dTempoAcc) / dFeedInSec)
end
else
local dAcc, _, _, _ = CalcDinamicaPinze_NUM( EMT.HT, EMT.ST, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
-- Caso 1: dFeed raggiunta
if dPathLen >= ( dFeedInSec ^ 2) / dAcc then
dTime = ( dFeedInSec / dAcc) + ( dPathLen / dFeedInSec)
-- Caso 2: dFeed non raggiunta
else
dTime = 2 * sqrt( dPathLen / dAcc)
end
end
return dTime
end
---------------------------------------------------------------------
-- *** END GENERAL ***
---------------------------------------------------------------------
+129 -60
View File
@@ -7,6 +7,12 @@ EgtEnableDebug( false)
-- carico librerie
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
pcall( require, 'EmtGenMachining') -- si fa una require con PCALL perchè la libreria è opzionale
---------------------- OnSpecialMoveZup -----------------------------
---------------------------------------------------------------------
function OnSpecialMoveZup()
@@ -33,9 +39,9 @@ local DeltaTol = DELTA_TOL_S
local DELTA_SIC = 1
local AGG_LOAD = 50
local MIN_JOIN_VV = EgtClamp( MinJoinVV or 75, 60, 150)
local MIN_JOIN_SS = EgtClamp( MinJoinSS or 100, 80, 200)
local MIN_JOIN_SS = EgtClamp( MinJoinSS or 100, 80, 275)
local MIN_JOIN_LS = EgtClamp( MinJoinLS or 290, 250, 400)
local MIN_JOIN_SL = EgtClamp( MinJoinSL or 100, 80, 200)
local MIN_JOIN_SL = EgtClamp( MinJoinSL or 100, 80, 400)
local MIN_JOIN_LL = EgtClamp( MinJoinLL or 400, 300, 600)
local MinJoin = MIN_JOIN_SS
local MinOther = abs( MinY) + abs( MaxV) + MinJoin
@@ -367,7 +373,18 @@ function OnSpecialApplyDisposition()
EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
if dHCING then
EMC.HCING = max( dHCING, -50)
end
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
if dTCING then
EMC.TCING = max( dTCING, -50)
end
-- Devo scaricare il pezzo o il grezzo rimasto
-- Posizione trave
local dPosT
@@ -511,6 +528,17 @@ function OnPostApplyMachining()
local bSplitting = ( sNotes:find( 'Split') ~= nil)
local bPreCut = ( sNotes:find( 'Precut') ~= nil)
local bCutting = ( sNotes:find( 'Cut') ~= nil)
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
if dHCING then
EMC.HCING = max( dHCING, -50)
end
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
if dTCING then
EMC.TCING = max( dTCING, -50)
end
local bUnload = IsEndPhase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
if bPreSplit or bPreCut then
EgtSetInfo( EMC.MCHID, 'IS_PRE', '1')
@@ -634,17 +662,30 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
if dHCING then
EMC.HCING = max( dHCING, -50)
end
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
if dTCING then
EMC.TCING = max( dTCING, -50)
end
-- Calcolo dell'ingombro della lavorazione
local dDistFront, dDistBack = SpecialCalcMachiningEncumbrance( EMC.MCHID, bPreCut)
if not dDistFront or not dDistBack then return end
local dMaxLenLeft = 0
if bPreSplit or bSplitting then
local dDistF = SpecialCalcPhaseEncumbrance( EMC.PHASE + 1)
local dDistF, dDistB, dMaxLF = SpecialCalcPhaseEncumbrance( EMC.PHASE + 1)
dDistFront = min( dDistFront, dDistF)
local dNextHOVM = EgtGetInfo( EgtGetNextRawPart( nCurrRawId) or GDB_ID.NULL, 'HOVM', 'd') or 0
local dBackOther = b3Tot:getDimX() - b3Raw:getDimX() - MinOther - dNextHOVM
EgtOutLog( 'DistBack='..EgtNumToString( dDistBack)..' OtherBack='..EgtNumToString( dBackOther), 3)
dDistBack = min( dDistBack, dBackOther)
if bSplitting then dMaxLenLeft = dMaxLF end
elseif bPreCut or bCutting then
local dDistF = SpecialCalcPhaseEncumbrance( EMC.PHASE + 1)
dDistFront = min( dDistFront, dDistF)
@@ -709,8 +750,9 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
return false
end
-- eseguo la separazione ( standard o di pezzo ruotato)
EgtOutLog( 'MaxLenLeft=' .. EgtNumToString( dMaxLenLeft, 1), 1)
if not IsMid2Phase( EMC.PHASE + 1) then
vCmd = SpecCalcSplit( b3Raw:getDimX())
vCmd = SpecCalcSplit( b3Raw:getDimX(), dMaxLenLeft)
else
vCmd = SpecCalcSplitRot( b3Raw:getDimX())
end
@@ -823,6 +865,7 @@ function SpecialCalcPhaseEncumbrance( nPhase)
-- Deve essere la fase finale di lavorazione di un pezzo (già staccato dal resto della trave)
local dDistFront = EMC.LB
local dDistBack = EMC.LB
local dMaxLenLeft = 0
-- Salvo lavorazione e utensile correnti, per ripristinarli alla fine
local nOrigMchId = EgtGetCurrMachining()
local sOrigTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
@@ -847,6 +890,9 @@ function SpecialCalcPhaseEncumbrance( nPhase)
if dDistF and dDistB then
dDistFront = min( dDistFront, dDistF)
dDistBack = min( dDistBack, dDistB)
local dMaxLenL = EMC.LR - dDistF
EgtOutLog( ' MaxLenLeft = ' .. EgtNumToString( dMaxLenL, 1), 3)
dMaxLenLeft = max( dMaxLenLeft, dMaxLenL)
end
nMchId = EgtGetNextActiveOperation( nMchId)
end
@@ -855,7 +901,7 @@ function SpecialCalcPhaseEncumbrance( nPhase)
if sOrigTool then EgtTdbSetCurrTool( sOrigTool) end
if sOrigTool and sOrigHead and nOrigExit then EgtSetCalcTool( sOrigTool, sOrigHead, nOrigExit) end
-- Restituisco gli ingombri trovati
return dDistFront, dDistBack
return dDistFront, dDistBack, dMaxLenLeft
end
---------------------------------------------------------------------
@@ -885,7 +931,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
local dHeadBack = 350
if bSaw then
if vtTool:getX() > 0 and abs( vtTool:getY()) < 0.088 and abs( vtTool:getZ()) < 0.088 then
dHeadBack = 50 + 0.5 * dTDiam * sqrt( 1 - vtTool:getX() * vtTool:getX())
dHeadBack = 50 + 0.5 * dTDiam * sqrt( 1 - vtTool:getX() * vtTool:getX()) + EgtIf( EMC.CNT == 1, 10, 0)
elseif abs( vtTool:getZ()) < 0.26 and abs( vtTool:getX()) < 0.35 then
dHeadBack = EgtIf( vtArm:getX() < 0, 540, 350)
elseif abs( vtTool:getZ()) < 0.26 and abs( vtTool:getX()) < 0.71 then
@@ -976,7 +1022,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
local dHeadFront = 350
if bSaw then
if vtTool:getX() < 0 and abs( vtTool:getY()) < 0.088 and abs( vtTool:getZ()) < 0.088 then
dHeadFront = 50 + 0.5 * dTDiam * sqrt( 1 - vtTool:getX() * vtTool:getX())
dHeadFront = 50 + 0.5 * dTDiam * sqrt( 1 - vtTool:getX() * vtTool:getX()) + EgtIf( EMC.CNT == 1, 10, 0)
elseif abs( vtTool:getZ()) < 0.26 and abs( vtTool:getX()) < 0.35 then
dHeadFront = EgtIf( vtArm:getX() > 0, 540, 350)
elseif abs( vtTool:getZ()) < 0.26 and abs( vtTool:getX()) < 0.71 then
@@ -1028,9 +1074,9 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
elseif ( vtTool:getX() > 0.5) then
dHeadFront = 450
end
if vtTool:getX() > 0.25 then
if vtTool:getX() > 0.25 then
dHeadFront = dHeadFront + max( dTLen - 130, 0) * vtTool:getX()
elseif vtTool:getX() > 0 then
elseif vtTool:getX() > 0 then
dHeadFront = dHeadFront + ( dTLen + 180) * vtTool:getX()
end
if vtTool:getX() < -0.866 then
@@ -1042,7 +1088,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
if vtArm:getX() > 0.259 then
dHeadFront = 510
else
dHeadFront = EgtIf( vtTool:getZ() > 0.966, 160, 280)
dHeadFront = EgtIf( vtTool:getZ() > 0.966, 170, 280)
end
end
-- per fresature longitudinali con utensile di fianco
@@ -1214,6 +1260,9 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
end
local dDistBackEff = min( dDistBack, EMC.LB - MyMinOther - EMC.HCING - EMC.HOVM)
-- se primo scambio
local MyMinY = EgtIf( EMC.CNT == 1, MinY + AGG_LOAD, MinY)
EgtOutLog( ' Dist/Min : Back=' .. EgtNumToString( dDistBackEff, 1) .. '/' .. EgtNumToString( MinBackJoin, 1) ..
' Front=' .. EgtNumToString( dDistFrontEff, 1) .. '/' .. EgtNumToString( MinFrontJoin, 1) ..
' Fixed : Delta=' .. EgtIf( bFixedDelta, 'T', 'F') .. ' Pos=' .. EgtIf( bFixedPos, 'T', 'F'), 3)
@@ -1233,7 +1282,7 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
if dDistFrontEff < MinFrontJoin and dDistBackEff > MinBackJoin - GEO.EPS_SMALL then
-- se Y non era in presa, mi ricalcolo la posizione
if not dYDelta then
dYDelta = dVDelta + ( MinY - MaxV)
dYDelta = dVDelta + ( MyMinY - MaxV)
end
dNewYDelta = EMC.LB - dDistBackEff
-- verifico se posso lasciare la morsa in posizione
@@ -1250,11 +1299,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
elseif dDistBackEff > MinBackJoin - GEO.EPS_SMALL and dDistFrontEff > MinFrontJoin - GEO.EPS_SMALL then
-- se Y non era in presa, mi ricalcolo la posizione
if not dYDelta then
dYDelta = dVDelta + ( MinY - MaxV)
dYDelta = dVDelta + ( MyMinY - MaxV)
end
-- se V non era in presa, mi ricalcolo la posizione
if not dVDelta then
dVDelta = dYDelta - ( MinY - MaxV)
dVDelta = dYDelta - ( MyMinY - MaxV)
end
dNewYDelta = EMC.LB - dDistBackEff
@@ -1284,12 +1333,17 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
elseif dDistBackEff < MinBackJoin and dDistFrontEff > MinFrontJoin - GEO.EPS_SMALL then
-- se V non era in presa, mi ricalcolo la posizione
if not dVDelta then
dVDelta = dYDelta - ( MinY - MaxV)
dVDelta = dYDelta - ( MyMinY - MaxV)
end
dNewVDelta = dDistFrontEff
-- verifico se posso lasciare la morsa in posizione
local dVDeltaTol = GetDeltaTol( dNewVDelta, EMC.TCING, EMC.HCING, EMC.HOVM, 'V', bFixedDelta)
local bVDeltaS = ( dNewVDelta > dVDelta + dVDeltaTol or dNewVDelta < dVDelta - DELTA_SIC)
local bVDeltaS
if EMC.YDELTA == nil and EMC.YDELTANEXT == nil then
bVDeltaS = (( dNewVDelta > dVDelta + dVDeltaTol and not bFixedPos) or dNewVDelta < dVDelta - DELTA_SIC)
else
bVDeltaS = ( dNewVDelta > dVDelta + dVDeltaTol or dNewVDelta < dVDelta - DELTA_SIC)
end
-- reimposto i delta finali in caso di spostamenti richiesti significativi, tenuto conto delle tolleranze
if bVDeltaS then
dNewVDelta = dNewVDelta - dVDeltaTol/2
@@ -1321,10 +1375,17 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
end
---------------------------------------------------------------------
function SpecCalcSplit( dLenRaw)
function SpecCalcSplit( dLenRaw, dMaxLenLeft)
local vCmd = {}
EgtOutLog( ' *[S]', 1)
table.insert( vCmd, { 0, EgtIf( EMC.VDELTA, 'Split', 'Fall')})
local bSplit = ( EMC.VDELTA ~= nil)
local ParkT = LoadT
if bSplit then
if dMaxLenLeft + 100 > LoadT then
ParkT = dMaxLenLeft + 300
end
end
table.insert( vCmd, { 0, EgtIf( bSplit, 'Split', 'Fall')})
-- determino i grezzi da agganciare al carrello Y (sono quelli presenti nella fase successiva dispari)
local nNextOddPhase = GetNextStartOrRestPhase( EMC.PHASE)
local nRawId = EgtGetFirstRawPart()
@@ -1336,20 +1397,26 @@ function SpecCalcSplit( dLenRaw)
end
-- riporto il carrello Y al carico con il resto della trave
local dLDelta = EMC.YDELTA - dLenRaw
table.insert( vCmd, { 1, 'Y', LoadT + dLDelta})
table.insert( vCmd, { 1, 'Y', ParkT + dLDelta})
table.insert( vCmd, { 21, 0, EMC.VDELTA or 0})
-- imposto subito Y non più attaccato al trave in lavoro
EMC.YDELTA = nil
-- salvo posizione carrello Y in disposizione del pezzo dopo split
local PostDispId = EgtGetPhaseDisposition( EMC.PHASE + 1)
if PostDispId then
EgtSetInfo( PostDispId, 'YPOS', LoadT + dLDelta)
if not bSplit then
EgtSetInfo( PostDispId, 'TPOS', ParkT)
else
EgtRemoveInfo( PostDispId, 'TPOS')
EgtSetInfo( PostDispId, 'TPARK', ParkT)
end
EgtSetInfo( PostDispId, 'YPOS', ParkT + dLDelta)
end
-- salvo posizione grezzo rimasto e posizione carrello Y nella disposizione iniziale del pezzo succ (prossima fase dispari)
local NextDispId = EgtGetPhaseDisposition( nNextOddPhase)
if NextDispId then
EgtSetInfo( NextDispId, 'TPOS', LoadT)
EgtSetInfo( NextDispId, 'YPOS', LoadT + dLDelta)
EgtSetInfo( NextDispId, 'TPOS', ParkT)
EgtSetInfo( NextDispId, 'YPOS', ParkT + dLDelta)
end
return vCmd
end
@@ -1489,6 +1556,17 @@ function SpecCalcPreRot()
return vCmd
end
---------------------------------------------------------------------
local function CalcCharStatus( sType, dDelta)
-- se per carrello Y
if sType == 'Y' then
return EgtIf( EMC.LB - dDelta < LenToPress, 1, 2)
-- altrimenti per carrello V
else
return EgtIf( dDelta < LenToPress, 1, 2)
end
end
---------------------------------------------------------------------
function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDeltaF, bFixedDelta, bFixedPos)
local dYPosA, dVPosA, dTPosA
@@ -1525,6 +1603,14 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
local bZmaxOk = EnsureZmax( bZmaxOk, vCmd)
end
-- ribadisco pinzaggio
if EMC.YDELTA then
table.insert( vCmd, { 11, 1})
end
if EMC.VDELTA then
table.insert( vCmd, { 12, 1})
end
-- reset contatore primo riposizionamento con compensazione lettura laser
EMC.CNT = nil
@@ -1556,7 +1642,9 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- * deve effettivamente spostarsi
-- * non si arriva da gestione passo del pellegrino
-- * se riesce a raggiungere la posizione con le corse a disposizione per come sono posizionate le morse attualmente
if ( dYDeltaI - dVDeltaF) >= MyMinY - MaxV and abs( dVDeltaF - dVDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and
if ( dYDeltaI - dVDeltaF) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and
( abs( dVDeltaF - dVDeltaI) > 10 * GEO.EPS_SMALL or not EMC.VDELTA) and
not EMC.PILGRIMSTEP and
( dVDeltaF - dVDeltaI > MinV - dVPosI + MyMinY - dYPosI) then
table.insert( vCmd, { 0, 'Direct-V-Y'})
-- se l'altra morsa non era in presa, vado a pinzare il pezzo
@@ -1615,7 +1703,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosI = dTPosA
-- blocco la morsa
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
@@ -1626,7 +1714,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dYPosA = dTPosF + dYDeltaF
dVPosA = dTPosF + dVDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- la morsa al carico è adesso in posizione
dYDeltaI = dYDeltaF
end
@@ -1635,10 +1723,10 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
if abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL then
table.insert( vCmd, { 11, 0})
dYPosA = max( MyMinY, dTPosI + dYDeltaF)
dTPosA = -( dYPosA + dVDeltaF)
dTPosA = dYPosA - dYDeltaF
dVPosA = dTPosA + dVDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- la morsa al carico è adesso in posizione
dYDeltaI = dYDeltaF
end
@@ -1661,7 +1749,9 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- * deve effettivamente spostarsi
-- * non si arriva da gestione passo del pellegrino
-- * se riesce a raggiungere la posizione con le corse a disposizione per come sono posizionate le morse attualmente
elseif ( dYDeltaF - dVDeltaI) >= MyMinY - MaxV and abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and
elseif ( dYDeltaF - dVDeltaI) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and
( abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL or not EMC.YDELTA) and
not EMC.PILGRIMSTEP and
( dYDeltaF - dYDeltaI < MaxY - dYPosI + MaxV - dVPosI) then
table.insert( vCmd, { 0, 'Direct-Y-V'})
-- se l'altra morsa non era in presa, vado a pinzare il pezzo
@@ -1723,7 +1813,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosI = dTPosA
-- blocco la morsa
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
@@ -1733,7 +1823,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dYPosA = dTPosF + dYDeltaF
dVPosA = dTPosF + dVDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
-- la morsa al carico è adesso in posizione
dVDeltaI = dVDeltaF
end
@@ -1745,7 +1835,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosA = dVPosA - dVDeltaF
dYPosA = dTPosA + dYDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
-- la morsa al carico è adesso in posizione
dVDeltaI = dVDeltaF
end
@@ -1858,7 +1948,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosA = dTPosI - dVPosI + MinV
dYPosA = dYDeltaF + dTPosA
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
table.insert( vCmd, { 12, 0})
dTPosI = dTPosA
EMC.YDELTA = dYDeltaF
@@ -1875,7 +1965,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dVPosA = dTPosI + dVDeltaI - dTotMove
dTPosA = dTPosI - dTotMove
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
table.insert( vCmd, { 12, 0})
-- aggiorno nuova posizione della morsa al carico dopo riposizionamento
@@ -1903,12 +1993,12 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 21, dYDeltaF, dVDeltaF})
elseif EMC.YDELTANEXT then
table.insert( vCmd, { 21, dYDeltaF, 0})
else
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 11, 0})
-- sposto il carrello Y in parcheggio
table.insert( vCmd, { 1, 'Y', ParkY})
@@ -1964,7 +2054,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosA = dTPosI + ( MaxY - dYPosI)
dVPosA = dVDeltaF + dTPosA
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 11, 0})
dTPosI = dTPosA
EMC.YDELTA = dYDeltaI
@@ -1981,7 +2071,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dVPosA = dTPosI + dVDeltaI - dTotMove
dTPosA = dTPosI + dTotMove
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 11, 0})
-- aggiorno nuova posizione della morsa allo scarico dopo riposizionamento
@@ -2007,22 +2097,12 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dYDeltaI = dYDeltaF
end
-- sistemo apertura morse
if EMC.YDELTANEXT then
table.insert( vCmd, { 11, 1})
end
if not EMC.VDELTANEXT then
table.insert( vCmd, { 12, 0})
-- sposto il carrello Y in parcheggio
table.insert( vCmd, { 1, 'V', ParkV})
end
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
table.insert( vCmd, { 21, dYDeltaF, dVDeltaF})
elseif EMC.YDELTANEXT then
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- sposto il carrello Y in parcheggio
table.insert( vCmd, { 12, 0})
table.insert( vCmd, { 1, 'V', ParkV})
@@ -2277,17 +2357,6 @@ function SpecAdjustCarriagesOLD( dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, d
end
end
---------------------------------------------------------------------
local function CalcCharStatus( sType, dDelta)
-- se per carrello Y
if sType == 'Y' then
return EgtIf( EMC.LB - dDelta < LenToPress, 1, 2)
-- altrimenti per carrello V
else
return EgtIf( dDelta < LenToPress, 1, 2)
end
end
---------------------------------------------------------------------
local function GetCorseDisp( dCorsaYfc, dCorsaVfc, dDistN, sSide)
local dRecTotn = min( dDistN, dCorsaYfc+ dCorsaVfc) -- recupero possibile al netto di dCorsa..TrA)
+87
View File
@@ -1,5 +1,92 @@
==== Common_FAST Update Log ====
Versione 2.7j1 (06/10/2025)
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C.
Versione 2.7i3 (23/09/2025)
- (MLDE-ALL) Spostate costanti dimensioni utensili in MLDE.
Versione 2.7i2 (17/09/2025)
- (EST) Stima tempi considerando accelerazioni
- (SIM) Prelievo e deposito motosega con gli angoli comunicati da Essetre
Versione 2.7i1 (08/09/2025)
- (SIM-GEN) Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare. Ticket#1844
- (SIM-GEN) Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico dove la pinza V poteva andare in posizione direttamente, ma cercava di fare passo pellegrino. Ticket#2572
Versione 2.7g1 (01/07/2025)
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7f3 (26/06/2025)
- (SIM-GEN) Aggiunti 10mm di sicurezza in caso di primo pinzaggio per stare oltre tolleranza riqualifica laser di 50mm. Ticket#2504
Versione 2.7f2 (19/06/2025)
- (GEN) Se in separazione il pezzo è andato più lontano della posizione standard, viene riletta. Ticket#2498
Versione 2.7f1 (18/06/2025)
- (SIM-GEN) Se utensile più lungo di 350mm, si va in posizione sicurezza come per la motosega. Ticket#2438
Versione 2.7e1 (26/05/2025)
- (SIM) Aumentata dimensione massima per la quale si rimuove uno scarto dal VMILL. Ticket#1438
- (SIM) In simulazione, corretto selezione utensile per punte lunghe. Ticket#2438
Versione 2.7d1 (14/04/2025)
- (GEN) Corretto movimento iniziale in caso di motosega, si controlla solo se non è il carico. Ticket#2385
Versione 2.7c1 (26/03/2025)
- (GEN) All'inizio del codice ISO si scrive nel commento anche il controllo numerico utilizzato per la generazione.
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
- (GEN) In MyAdjustLinearAxes si utilizza TDIR per calcolarsi gli offset per compatibilità con lavorazioni a 5 assi.
Versione 2.7b1 (20/02/2025)
- (SIM-GEN) Aggiunta possibilità di settare HCING/TCING nelle note di ogni singola lavorazione per gestire parte non pinzabile del pezzo. Funziona solo con nuovo pinzaggio.
- (SIM-GEN) Piccola correzione calcolo posizione carrelli con nuova strategia di pinzaggio.
- (SIM-GEN) Caricamento libreria EmtGenMachining. Si fa una require con PCALL perchè la libreria è opzionale e non è detto che ci sia. In installazione CAM5 dalla 2.7a1
- (GEN) Per controllo TPA, modifica al numero di decimali.
- (SIM) Aggiunta gestione per ToolHolder flottante
Versione 2.7a3 (08/01/2025)
- (GEN) Dopo separazione, in NUM_PLUS, si srive EH1 solo se macro G101, perchè altrimenti non è prevista. Ticket#2239
Versione 2.7a2 (08/01/2025)
- (MLDE-SIM) Aggiunta gestione FACOLTATIVA 'EstimationRapidMultiplier' in MLDE per regolare il tempo stimato. Se non presente in MLDE, default 1.
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina
Versione 2.7a1 (07/01/2025)
- (MLDE-SIM-GEN) Nuovo aggregato 90° (H7) per fresa tipo BlockHaus. Ticket#2142
- (SIM-GEN) Aumentati limiti massimi di pinzaggio minimo
Versione 2.6l1 (02/12/2024)
- (SIM) Corretto movimento VMILL durante scarico pezzo piccolo a caduta
- (SIM-GEN) Per decidere posizione parcheggio barra dopo separazione, si considera lunghezza coda del pezzo in lavoro per evitare collisioni. Ticket#2168
Versione 2.6k1 (11/11/2024)
- (GEN) Aggiunta gestione aggregato a T per NUM
- (SIM) Tolta gestione testa dummy H4
- (SIM-GEN) Aggiustato parametro in calcolo ingombro lavorazione. Ticket#2163
Versione 2.6j10 (25/10/2024)
- (SIM-GEN) Miglioria 2.6j9. Si ribadisce pinza in presa sempre, all'inizio, in base a quella attiva
Versione 2.6j9 (22/10/2024)
- (SIM-GEN) Miglioria 2.6j6. Oltre al passo pellegrino si ribadisce anche quando è scambio diretto
Versione 2.6j8 (21/10/2024)
- (SIM-GEN) Corretto problema tolleranza aggiunto con versione 2.6j7
Versione 2.6j7 (18/10/2024)
- (SIM-GEN) In nuova disposizione carrelli, aggiunta tolleranza di 100 EPS quando si calcola minimo posizionamento
Versione 2.6j6 (17/10/2024)
- (GEN) Si ribadisce che la pinza era in presa, prima di cominciare con lo scambio del passo del pellegrino. Ticket#2121
Versione 2.6j5 (17/10/2024)
- (SIM-GEN) Piccola correzione nuovo riposizionamento. Nel taglio dello scarto finale riposizionava nel vuoto. Ticket#2115
Versione 2.6j4 (15/10/2024)
- (SIM-GEN) Piccola correzione nuovo riposizionamento. Non considerava i 50mm di tolleranza su primo pinzaggio dopo ribaltamento
- (SIM-GEN) Gestione attivazione pressore verticale in nuovo riposizionamento
Versione 2.6j3 (11/10/2024)
- (GEN) Corretta scrittura macro start/attesa movimenti per NUM. Veniva scritto codice per TPA.
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_FAST', -- nome script PP standard
VERSION = '2.6j3', -- versione script
VERSION = '2.7j1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}