Compare commits
216 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92ab99cde9 | |||
| 4496302ec3 | |||
| c85df70b61 | |||
| a8f142e8d7 | |||
| 9bebdcc4e7 | |||
| f8436a983a | |||
| d7e870cf1e | |||
| 82f0eab4ae | |||
| 04ab01cba8 | |||
| 536352b802 | |||
| 1484fb761b | |||
| 660209bdea | |||
| 3867f7b7ed | |||
| bc2388dd43 | |||
| 86d9b2ec3d | |||
| 2221224e9a | |||
| 0b7fefd0fd | |||
| 51e2180b15 | |||
| ee7087b003 | |||
| be993f47df | |||
| 2522967e95 | |||
| 40e049dbb5 | |||
| 270039d7e3 | |||
| 9241a53f97 | |||
| ff984c30b4 | |||
| 001fd45f0c | |||
| 24e73d886d | |||
| f3e7254b48 | |||
| 3cf27288f3 | |||
| fce0068d45 | |||
| 07a261bfce | |||
| b0a7be8454 | |||
| 18cf79bb82 | |||
| 4986b48e31 | |||
| 523c5a99ce | |||
| db68ad1a90 | |||
| 9259b6e633 | |||
| 0c2387c901 | |||
| 24ea5db4f5 | |||
| fb3d203f77 | |||
| 9fab4f9330 | |||
| f1faaa1eda | |||
| c9469ee7e2 | |||
| 108c6d2d8e | |||
| 052f6aa18e | |||
| d4376dfa8e | |||
| f25d90518d | |||
| 5ff538314a | |||
| db91129c66 | |||
| 8f124af521 | |||
| fbd5f170de | |||
| 00fffeb388 | |||
| 0f6e9b9899 | |||
| b06d6d4afe | |||
| 36efe11298 | |||
| 5447eca3c3 | |||
| f5dc0ec3f2 | |||
| a8a708697d | |||
| 7806f539b5 | |||
| 2f0ee75abf | |||
| f515dd0312 | |||
| 6a530927c9 | |||
| 1f358ce1e1 | |||
| e5442d976a | |||
| bb190b1643 | |||
| 8adfbaf24b | |||
| 55f5710f7c | |||
| 1ee84c6cf8 | |||
| 44ea5b2a2c | |||
| 3c82040b21 | |||
| 42ab289444 | |||
| e6ab77e59a | |||
| 958b5bbc3a | |||
| f223006bc7 | |||
| 659aa80001 | |||
| 6db40176a2 | |||
| 0fa80629f6 | |||
| 9eb362d312 | |||
| 912bf4f072 | |||
| 717a03a549 | |||
| 1a68f3e543 | |||
| d5165571da | |||
| e2a5b11cfa | |||
| bd80cd5500 | |||
| 9bb3b85930 | |||
| 4c7380986c | |||
| 837a607ceb | |||
| d6f6b91bbb | |||
| 8a35315165 | |||
| 98156b21eb | |||
| 2bfb1b4b27 | |||
| bf0c9460c6 | |||
| a721fda298 | |||
| 47516ad370 | |||
| 09f5c56ac9 | |||
| 7765c9c767 | |||
| 9da3bb88e1 | |||
| aa0d80735b | |||
| 5426a1a07a | |||
| db906c0817 | |||
| 14d5f35f8f | |||
| e039384b87 | |||
| d2b4a55db4 | |||
| 833c2d95e7 | |||
| 2577240699 | |||
| 3a20baca05 | |||
| 590f332cea | |||
| c4c818eb6a | |||
| 49316c92fc | |||
| a479cfac69 | |||
| 692601f07e | |||
| 487bbf1ce6 | |||
| c7ebf339ec | |||
| 685e63dd83 | |||
| a19947f6c2 | |||
| 07770ea12e | |||
| ce1ae72beb | |||
| 341e049753 | |||
| e8be6e9ca8 | |||
| e4659394a5 | |||
| 1e8dfdd2f0 | |||
| 1ff99e2f0f | |||
| e8958065ef | |||
| eff8fc90c6 | |||
| 4448156fec | |||
| f346df9d27 | |||
| 810f85c62a | |||
| 6ec26b5ad1 | |||
| 304701cb77 | |||
| 306945f09b | |||
| 09eb355037 | |||
| 30ed6aa984 | |||
| ff7338e2f4 | |||
| 4903a6065e | |||
| 36df78ed67 | |||
| 3132d213c1 | |||
| cbf5df9895 | |||
| ec8fa72ca2 | |||
| 8c5e759bec | |||
| 6ace9c266d | |||
| 2a7b732444 | |||
| 6206ba44db | |||
| ad882352d0 | |||
| 8ef399a55c | |||
| e397ac2627 | |||
| cfc1fbc6b6 | |||
| 3b91c0c603 | |||
| a2d0ff4d77 | |||
| 977f006bdc | |||
| aad0a2dee1 | |||
| 5589385f4d | |||
| 5fa764cb96 | |||
| f78a042dbe | |||
| 1c80767eee | |||
| 369d1a7456 | |||
| d23a9c6fa9 | |||
| fbfe8187b9 | |||
| 3ef4c18fe6 | |||
| b50c4ef806 | |||
| 7a7981fddb | |||
| 74a0bc4a43 | |||
| 4cc2e5a2d7 | |||
| 24857bc252 | |||
| 5e90232086 | |||
| 6e1faf69bc | |||
| 8fdda065d4 | |||
| 5ae185cd0e | |||
| 446b56d975 | |||
| 48626b7f90 | |||
| 21104984ad | |||
| c33c3196f2 | |||
| 9b6c24017d | |||
| 5b7bab2873 | |||
| 1886d6620e | |||
| 235a8dacb7 | |||
| aad2a95dff | |||
| 26126ac892 | |||
| 5491e5cd81 | |||
| 16e04c8502 | |||
| 3b1133f88c | |||
| 5d72e04f7e | |||
| 72d61b4561 | |||
| 7a16f26a63 | |||
| c425cf1be3 | |||
| 79ecca7e02 | |||
| b9cc8a3aa9 | |||
| 0c8769dd81 | |||
| 7c9ec51f55 | |||
| d0817659e5 | |||
| f283fe8fa9 | |||
| 87a7a89dbd | |||
| 1a1f775c88 | |||
| fd7cc25a4f | |||
| bdbec7cf37 | |||
| 6f115a81a0 | |||
| 8e6daeeac7 | |||
| f029673970 | |||
| 01e5018c3d | |||
| c91ded71cd | |||
| 1e00fa27a0 | |||
| d57b86b046 | |||
| 5476431a1b | |||
| ced2337e75 | |||
| 8b03855934 | |||
| 523e7261cc | |||
| 0eedd5a10d | |||
| 708c2bf020 | |||
| e01361aa93 | |||
| 724dafe7ad | |||
| 2b79262d52 | |||
| f958adc7d9 | |||
| 6ba7cb4829 | |||
| c52e303318 | |||
| 989475b17e | |||
| e4e029375f | |||
| b39903565a |
@@ -3,10 +3,11 @@
|
||||
|
||||
-- carico librerie
|
||||
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 MACHINE_INFO = 'PP_VER ver.'..PP_VER
|
||||
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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -26,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -41,13 +44,18 @@ function OnProgramStart()
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
|
||||
local nPatt = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
|
||||
EmtOutput( '%'..EgtNumToString( nPatt, 0)..'.0')
|
||||
|
||||
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
|
||||
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
|
||||
|
||||
if EMT.INFO then
|
||||
EmtOutput( '('..EMT.INFO..')')
|
||||
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
|
||||
else
|
||||
EmtOutput( '(Program Start)')
|
||||
end
|
||||
EmtOutput( '('.. CSP_INFO..')')
|
||||
EmtOutput( '('.. MACHINE_INFO..')\n')
|
||||
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
|
||||
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
|
||||
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')
|
||||
@@ -99,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')
|
||||
@@ -176,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= 550 -- densità legno in Kg / metro cubo
|
||||
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
|
||||
@@ -245,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
|
||||
@@ -491,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -504,6 +510,7 @@ function OnPathStart()
|
||||
-- salvo precedenti rotanti
|
||||
EMT.R1pp = EMT.R1p
|
||||
EMT.R2pp = EMT.R2p
|
||||
EMT.R3pp = EMT.R3p
|
||||
|
||||
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
|
||||
EmtResetPrev()
|
||||
@@ -598,9 +605,14 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnRapid()
|
||||
-- recupero prossimo utensile
|
||||
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
|
||||
MyBackupAxes()
|
||||
-- se primo movimento della lavorazione, gestione speciale
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- decido se muovere prima testa o carrelli (standard prima testa)
|
||||
local bHeadFirst = true
|
||||
local sLateG101
|
||||
@@ -615,18 +627,35 @@ function OnRapid()
|
||||
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
|
||||
EmitZmax()
|
||||
EMT.ZMAX = true
|
||||
bHeadFirst = false
|
||||
end
|
||||
end
|
||||
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
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 or abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
|
||||
bGoToHome = true
|
||||
end
|
||||
|
||||
-- ricavo i dati per la lavorazione
|
||||
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 sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
|
||||
-- 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.FLAG2 == 1 then
|
||||
-- se ho ancora motosega, si setta già asse C, altrimenti asse C per andare in home
|
||||
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' .. EmtLenToString( 0, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
|
||||
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
|
||||
EmtOutput( sOutPreMove)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
end
|
||||
@@ -636,18 +665,27 @@ function OnRapid()
|
||||
EmtOutput( '( *** ' .. sOut .. ' *** )')
|
||||
end
|
||||
|
||||
-- ricavo i dati per la lavorazione
|
||||
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' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
|
||||
if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
|
||||
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
|
||||
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOutPreMove)
|
||||
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')
|
||||
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
|
||||
elseif 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 = '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')
|
||||
@@ -828,12 +866,47 @@ function OnRapid()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmitZmax()
|
||||
EMT.ZMAX = true
|
||||
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
|
||||
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 sEE = ' EE3'
|
||||
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)
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
|
||||
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
sOut = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
|
||||
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
end
|
||||
-- se altrimenti movimento in Home
|
||||
elseif EMT.FLAG == 4 then
|
||||
-- non previsto
|
||||
-- se altrimenti rotazione a Z max
|
||||
-- se altrimenti rotazione a Z max per lavorazione successiva
|
||||
elseif EMT.FLAG == 5 then
|
||||
-- viene gestito all'inizio della lavorazione successiva
|
||||
EMT.REFLOC = nil
|
||||
EMT.IPLGL = false
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmtResetPrev()
|
||||
-- ricavo i dati per la lavorazione
|
||||
local sEE = ' EE3'
|
||||
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)
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
-- altrimenti errore
|
||||
else
|
||||
EmtSetLastError( 1212, "Unknown Rapid flag")
|
||||
@@ -925,13 +998,46 @@ function OnArc()
|
||||
local sFeed = EmtGetFeed()
|
||||
-- tipo arco
|
||||
local sArc = 'G' .. EgtNumToString(EMT.MOVE,0)
|
||||
-- emetto arco
|
||||
EmtOutput( sArc..sAxes..sRad..sFeed)
|
||||
-- se arco molto grande, approssimo con una retta
|
||||
if EMT.RR > 99999 then
|
||||
EmtOutput( "G1"..sAxes..sFeed)
|
||||
else
|
||||
EmtOutput( sArc..sAxes..sRad..sFeed)
|
||||
end
|
||||
|
||||
-- aggiorno valori come precedenti
|
||||
EmtUpdatePrev()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FindNextTool()
|
||||
-- salvo stato iniziale
|
||||
local CurrMachId = EgtGetCurrMachining()
|
||||
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
-- cerco lavorazione con utensile su gruppo testa indicato
|
||||
local sTool, sHead, sTcPos
|
||||
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
|
||||
while OpId do
|
||||
local nType = EgtGetOperationType( OpId)
|
||||
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
|
||||
if EgtSetCurrMachining( OpId) then
|
||||
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
|
||||
if EgtTdbSetCurrTool( sTool) then
|
||||
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
OpId = EgtGetNextActiveOperation( OpId)
|
||||
end
|
||||
-- ripristino stato iniziale
|
||||
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
|
||||
EgtTdbSetCurrTool( CurrTool or '')
|
||||
-- restituisco risultato
|
||||
return sTool, sHead, sTcPos
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function CalcCharStatus( sCmd, bSkipPress)
|
||||
-- aperto
|
||||
@@ -1242,7 +1348,7 @@ function PrepareUnload( sCmd)
|
||||
table.insert( EMT.AUXCMD, sMsg)
|
||||
if Cmd[2] == 'V' then
|
||||
-- se non è ultima fase c'è una barra sulla pinza Y (1)
|
||||
local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '0', '1')
|
||||
local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '0', '1')
|
||||
local sOut = 'G111 '..Cmd[2]..Cmd[3]..' EC141 ED83 EE'..sEE..' EF'..GetFmaxClamp()
|
||||
table.insert( EMT.AUXSTR, sOut)
|
||||
end
|
||||
@@ -1251,7 +1357,7 @@ function PrepareUnload( sCmd)
|
||||
table.insert( EMT.AUXCMD, sMsg)
|
||||
if Cmd[4] == 'V' then
|
||||
-- se non è ultima fase c'è una barra sulla pinza Y (1)
|
||||
local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '111', '112')
|
||||
local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '111', '112')
|
||||
local sOut = 'G111 '..Cmd[4]..Cmd[5]..' EA'..sEAB..' EB'..sEAB..' EC142 ED141 EE2 EF'..GetFmaxClamp()
|
||||
table.insert( EMT.AUXSTR, sOut)
|
||||
EMT.U_STD = true
|
||||
@@ -1456,10 +1562,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
|
||||
@@ -1571,7 +1680,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'
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
-- carico librerie
|
||||
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 MACHINE_INFO = 'PP_VER ver.'..PP_VER
|
||||
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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -26,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -41,13 +44,18 @@ function OnProgramStart()
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
|
||||
local nPatt = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
|
||||
EmtOutput( '%'..EgtNumToString( nPatt, 0)..'.0')
|
||||
|
||||
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
|
||||
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
|
||||
|
||||
if EMT.INFO then
|
||||
EmtOutput( '('..EMT.INFO..')')
|
||||
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
|
||||
else
|
||||
EmtOutput( '(Program Start)')
|
||||
end
|
||||
EmtOutput( '('.. CSP_INFO..')')
|
||||
EmtOutput( '('.. MACHINE_INFO..')\n')
|
||||
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
|
||||
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
|
||||
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')
|
||||
@@ -103,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')
|
||||
@@ -133,6 +142,18 @@ function OnToolData()
|
||||
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
|
||||
local sOut = 'L11='..EgtNumToString( EMT.SMAX, 0)..' L12='..EmtLenToString( ( EMT.TDIST or ChSawLen), 1)..' G76H9998.1N301N304'
|
||||
EmtOutput( sOut)
|
||||
-- emissione dati rinvio
|
||||
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 sPos = 'N2' .. tostring(nPos)
|
||||
local sOut = 'L11=' .. EmtLenToString( EMT.SMAX, 3) .. ' L12=' .. EmtLenToString( AngTr1Offs, 1)..' G76H9998.1'..sPos..sPos
|
||||
EmtOutput( sOut)
|
||||
-- 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
|
||||
|
||||
@@ -151,7 +172,7 @@ function OnDispositionStart()
|
||||
' EG'..EmtLenToString( SawOffs, 2)..' EI'..EmtLenToString( ParkY, 2)..' EL'..EmtLenToString( ParkV, 2)..
|
||||
' EM'..EmtLenToString( TurnerOffs, 2)..' EN'..EmtLenToString( -DeltaTabY, 2)..' EO'..EmtLenToString( DeltaTabZ, 2)
|
||||
if SecondSupport >= 3 then
|
||||
sOut = sOut ..' EP'..EmtLenToString( AngTr1Len, 2) ..' EQ'..EmtLenToString( AngTr1Offs + MillOffs,2)
|
||||
sOut = sOut ..' EP'..EmtLenToString( AngTr1Len, 2) ..' EQ'..EmtLenToString( AngTr1Offs,2)
|
||||
end
|
||||
EmtOutput( '\n' .. sOut .. '\n')
|
||||
-- carico barra
|
||||
@@ -186,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)..
|
||||
@@ -252,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
|
||||
@@ -418,6 +439,10 @@ function OnMachiningStart()
|
||||
-- sistemazione speed
|
||||
if EMT.HEAD == 'H2' then
|
||||
EMT.S = EMT.S * 6
|
||||
elseif EMT.HEAD == 'H5' and EMT.EXIT == 1 then
|
||||
EMT.S = -EMT.S
|
||||
elseif EMT.HEAD == 'H6' and EMT.EXIT == 1 then
|
||||
EMT.S = -EMT.S
|
||||
end
|
||||
-- determino subito se taglio di separazione di pezzo a caduta
|
||||
EMT.PREFALLCUT = nil
|
||||
@@ -472,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'
|
||||
@@ -519,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -532,6 +558,7 @@ function OnPathStart()
|
||||
-- salvo precedenti rotanti
|
||||
EMT.R1pp = EMT.R1p
|
||||
EMT.R2pp = EMT.R2p
|
||||
EMT.R3pp = EMT.R3p
|
||||
|
||||
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
|
||||
EmtResetPrev()
|
||||
@@ -626,9 +653,14 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnRapid()
|
||||
-- recupero prossimo utensile
|
||||
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
|
||||
MyBackupAxes()
|
||||
-- se primo movimento della lavorazione, gestione speciale
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- decido se muovere prima testa o carrelli (standard prima testa)
|
||||
local bHeadFirst = true
|
||||
local sLateG101
|
||||
@@ -644,18 +676,58 @@ function OnRapid()
|
||||
EmitZmax( EMT.TOOL ~= EMT.PREVTOOL)
|
||||
EMT.ZMAX = true
|
||||
EMT.PREVTOOL = EMT.TOOL
|
||||
bHeadFirst = false
|
||||
end
|
||||
end
|
||||
|
||||
-- primo posizionamento
|
||||
local MyZHome = EgtGetAxisHomePos( 'Z')
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
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 or abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
|
||||
bGoToHome = true
|
||||
end
|
||||
|
||||
-- ricavo i dati per la lavorazione
|
||||
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
|
||||
|
||||
local sEL = ' EL'
|
||||
-- se motosega
|
||||
if EMT.HEAD == 'H3' then
|
||||
sEL = sEL..EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
|
||||
-- se aggregato
|
||||
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
|
||||
sEL = sEL..EmtLenToString( EMT.TLEN, 3)
|
||||
end
|
||||
|
||||
local sER = ' ER'
|
||||
-- se motosega
|
||||
if EMT.HEAD == 'H3' then
|
||||
sER = sER..EmtLenToString( EMT.TLEN, 3)
|
||||
-- se aggregato
|
||||
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 sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
|
||||
-- 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.FLAG2 == 1 then
|
||||
-- se ho ancora motosega, si setta già asse C, altrimenti asse C per andare in home
|
||||
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' .. EmtLenToString( 0, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
|
||||
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
|
||||
EmtOutput( sOutPreMove)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
end
|
||||
@@ -665,18 +737,27 @@ function OnRapid()
|
||||
EmtOutput( '( *** ' .. sOut .. ' *** )')
|
||||
end
|
||||
|
||||
-- ricavo i dati per la lavorazione
|
||||
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' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
|
||||
if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
|
||||
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
|
||||
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOutPreMove)
|
||||
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')
|
||||
-- ruoto in zona sicura prima di approcciare la lavorazione
|
||||
elseif 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 = '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')
|
||||
@@ -803,7 +884,7 @@ function OnRapid()
|
||||
sOut = 'G112 EA'..sA..' EB'..sB..EmtGetAxis('L1')..' EY'..sY..' EV'..sV..' EF'..GetFmaxClamp()
|
||||
EmtOutput( sOut)
|
||||
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
|
||||
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') then
|
||||
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') and ( IsEndPhase( EMT.PHASE+1) or IsEnd2Phase( EMT.PHASE+1)) then
|
||||
EmtOutput( '(M175)')
|
||||
end
|
||||
if not bHeadFirst then
|
||||
@@ -867,12 +948,47 @@ function OnRapid()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmitZmax( false)
|
||||
EMT.ZMAX = true
|
||||
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
|
||||
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 sEE = ' EE3'
|
||||
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)
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
|
||||
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
sOut = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
|
||||
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
end
|
||||
-- se altrimenti movimento in Home
|
||||
elseif EMT.FLAG == 4 then
|
||||
-- non previsto
|
||||
-- se altrimenti rotazione a Z max
|
||||
-- se altrimenti rotazione a Z max per lavorazione successiva
|
||||
elseif EMT.FLAG == 5 then
|
||||
-- viene gestito all'inizio della lavorazione successiva
|
||||
EMT.REFLOC = nil
|
||||
EMT.IPLGL = false
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmtResetPrev()
|
||||
-- ricavo i dati per la lavorazione
|
||||
local sEE = ' EE3'
|
||||
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)
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'G101 ET1001')
|
||||
EmtOutput( 'G101 ET2001')
|
||||
-- altrimenti errore
|
||||
else
|
||||
EmtSetLastError( 1212, "Unknown Rapid flag")
|
||||
@@ -938,6 +1054,11 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnArc()
|
||||
-- con aggregato non si possono fare archi. Deve essere tutto spezzato
|
||||
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
|
||||
EmtSetLastError( 1211, "With aggregate, the arcs must be splitted")
|
||||
end
|
||||
|
||||
MyBackupAxes()
|
||||
EMT.TLAST = EMT.L1
|
||||
-- non modale su archi
|
||||
@@ -964,33 +1085,44 @@ function OnArc()
|
||||
local sFeed = EmtGetFeed()
|
||||
-- tipo arco
|
||||
local sArc = 'G' .. EgtNumToString(EMT.MOVE,0)
|
||||
-- emetto arco
|
||||
EmtOutput( sArc..sAxes..sRad..sFeed)
|
||||
-- se arco molto grande, approssimo con una retta
|
||||
if EMT.RR > 99999 then
|
||||
EmtOutput( "G1"..sAxes..sFeed)
|
||||
else
|
||||
EmtOutput( sArc..sAxes..sRad..sFeed)
|
||||
end
|
||||
|
||||
-- aggiorno valori come precedenti
|
||||
EmtUpdatePrev()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function CalcDinamicaPinze( dH, dS, dL)
|
||||
local MinTempoAcc = 0.3 -- [s]
|
||||
local MaxTempoAcc = 4.0 -- [s]
|
||||
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
|
||||
local 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
|
||||
function FindNextTool()
|
||||
-- salvo stato iniziale
|
||||
local CurrMachId = EgtGetCurrMachining()
|
||||
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
-- cerco lavorazione con utensile su gruppo testa indicato
|
||||
local sTool, sHead, sTcPos
|
||||
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
|
||||
while OpId do
|
||||
local nType = EgtGetOperationType( OpId)
|
||||
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
|
||||
if EgtSetCurrMachining( OpId) then
|
||||
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
|
||||
if EgtTdbSetCurrTool( sTool) then
|
||||
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
OpId = EgtGetNextActiveOperation( OpId)
|
||||
end
|
||||
return AccPinze, AccMaxPinze, RidFeed, TempoAcc
|
||||
-- ripristino stato iniziale
|
||||
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
|
||||
EgtTdbSetCurrTool( CurrTool or '')
|
||||
-- restituisco risultato
|
||||
return sTool, sHead, sTcPos
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -1303,7 +1435,7 @@ function PrepareUnload( sCmd)
|
||||
table.insert( EMT.AUXCMD, sMsg)
|
||||
if Cmd[2] == 'V' then
|
||||
-- se non è ultima fase c'è una barra sulla pinza Y (1)
|
||||
local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '0', '1')
|
||||
local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '0', '1')
|
||||
local sOut = 'G111 '..Cmd[2]..Cmd[3]..' EC141 ED83 EE'..sEE..' EF'..GetFmaxClamp()
|
||||
table.insert( EMT.AUXSTR, sOut)
|
||||
end
|
||||
@@ -1312,7 +1444,7 @@ function PrepareUnload( sCmd)
|
||||
table.insert( EMT.AUXCMD, sMsg)
|
||||
if Cmd[4] == 'V' then
|
||||
-- se non è ultima fase c'è una barra sulla pinza Y (1)
|
||||
local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '111', '112')
|
||||
local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '111', '112')
|
||||
local sOut = 'G111 '..Cmd[4]..Cmd[5]..' EA'..sEAB..' EB'..sEAB..' EC142 ED141 EE2 EF'..GetFmaxClamp()
|
||||
table.insert( EMT.AUXSTR, sOut)
|
||||
EMT.U_STD = true
|
||||
@@ -1517,16 +1649,29 @@ function MyAdjustLinearAxes()
|
||||
|
||||
if EMT.REFLOC then
|
||||
local vtE
|
||||
if EMT.HEAD ~= 'H3' then
|
||||
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
|
||||
else
|
||||
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' 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
|
||||
|
||||
EMT.L1 = EMT.L1 - vtE:getX()
|
||||
EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY()
|
||||
EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ()
|
||||
@@ -1566,7 +1711,7 @@ function CalcInterpPlane()
|
||||
local ptS = Point3d( xS, 0, 0)
|
||||
-- calcolo per piano generico
|
||||
local vtE
|
||||
if EMT.HEAD ~= 'H3' then
|
||||
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
|
||||
vtE = Vector3d( EMT.EXTR)
|
||||
else
|
||||
vtE = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
|
||||
@@ -1617,7 +1762,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'
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
-- carico librerie
|
||||
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 MACHINE_INFO = 'PP_VER ver.'..PP_VER
|
||||
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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -20,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -38,14 +44,19 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnProgramStart()
|
||||
|
||||
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
|
||||
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
|
||||
|
||||
-- Intestazioni
|
||||
if EMT.INFO then
|
||||
ParkLine( '('..EMT.INFO..')')
|
||||
ParkLine( sPrefixCommentLine..'('..EMT.INFO..')')
|
||||
else
|
||||
ParkLine( '(Program Start)')
|
||||
end
|
||||
ParkLine( '('.. CSP_INFO..')')
|
||||
ParkLine( '('.. MACHINE_INFO..')')
|
||||
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
|
||||
@@ -103,6 +114,7 @@ function OnProgramEnd()
|
||||
EMT.FALL = nil
|
||||
EMT.RELOAD = nil
|
||||
EMT.RELOAD2 = nil
|
||||
EmtOutput( '(FOOTER)')
|
||||
-- Termino il programma
|
||||
EmtOutput( 'M02')
|
||||
end
|
||||
@@ -111,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
|
||||
@@ -120,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)
|
||||
@@ -143,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
|
||||
@@ -208,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
|
||||
@@ -258,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
|
||||
@@ -508,6 +525,9 @@ function OnMachiningEnd()
|
||||
EMT.PREVTOOL = EMT.TOOL
|
||||
EMT.PREVHEAD = EMT.HEAD
|
||||
EMT.PREVS = EMT.S
|
||||
-- salvo posizione
|
||||
EMT.PREVTCPOS = AdjustTcPos( false)
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -522,6 +542,7 @@ function OnPathStart()
|
||||
-- salvo precedenti rotanti
|
||||
EMT.R1pp = EMT.R1p
|
||||
EMT.R2pp = EMT.R2p
|
||||
EMT.R3pp = EMT.R3p
|
||||
|
||||
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
|
||||
EmtResetPrev()
|
||||
@@ -621,6 +642,8 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnRapid()
|
||||
-- recupero prossimo utensile
|
||||
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
|
||||
MyBackupAxes()
|
||||
-- se primo movimento della lavorazione, gestione speciale
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
@@ -636,18 +659,33 @@ function OnRapid()
|
||||
if not ( EMT.LOAD or EMT.RELOAD) then
|
||||
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
|
||||
EmitZmax()
|
||||
bHeadFirst = false
|
||||
end
|
||||
end
|
||||
|
||||
local sTcPosReal = AdjustTcPos( false)
|
||||
|
||||
local bGoToHome = false
|
||||
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
|
||||
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( sTcPosReal ~= EMT.PREVTCPOS or 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.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=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
|
||||
EmtOutput( sOutPreMove)
|
||||
EmtOutput( 'M101 P1=2')
|
||||
EmtOutput( 'M101 P1=3')
|
||||
end
|
||||
@@ -658,9 +696,41 @@ function OnRapid()
|
||||
end
|
||||
|
||||
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
|
||||
if EMT.HEAD == '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.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
|
||||
if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
|
||||
local 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')
|
||||
if EMT.LOAD then
|
||||
ParkLine( sOutPreMove)
|
||||
else
|
||||
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')
|
||||
if EMT.LOAD then
|
||||
ParkLine( sOutPreMove)
|
||||
ParkLine( 'M101 P1=2')
|
||||
ParkLine( 'M101 P1=3')
|
||||
else
|
||||
EmtOutput( sOutPreMove)
|
||||
EmtOutput( 'M101 P1=2')
|
||||
EmtOutput( 'M101 P1=3')
|
||||
end
|
||||
elseif 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.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)
|
||||
@@ -674,8 +744,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
|
||||
@@ -725,7 +795,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
|
||||
@@ -769,14 +839,14 @@ function OnRapid()
|
||||
sB = '2'
|
||||
end
|
||||
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
|
||||
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') then
|
||||
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') and ( IsEndPhase( EMT.PHASE+1) or IsEnd2Phase( EMT.PHASE+1)) then
|
||||
EmtOutput( 'M175')
|
||||
end
|
||||
if bHeadFirst then
|
||||
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'
|
||||
@@ -844,12 +914,42 @@ function OnRapid()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmitZmax( true)
|
||||
EMT.ZMAX = true
|
||||
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
|
||||
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, 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, 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')
|
||||
end
|
||||
-- se altrimenti movimento in Home
|
||||
elseif EMT.FLAG == 4 then
|
||||
-- non previsto
|
||||
-- se altrimenti rotazione a Z max
|
||||
-- se altrimenti rotazione a Z max per lavorazione successiva
|
||||
elseif EMT.FLAG == 5 then
|
||||
-- viene gestito all'inizio della lavorazione successiva
|
||||
EMT.REFLOC = nil
|
||||
EMT.IPLGL = false
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmtResetPrev()
|
||||
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)
|
||||
EmtOutput( 'M101 P1=2')
|
||||
EmtOutput( 'M101 P1=3')
|
||||
-- altrimenti errore
|
||||
else
|
||||
error( "Unknown Rapid flag")
|
||||
@@ -964,7 +1064,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
|
||||
@@ -977,25 +1077,32 @@ function OnArc()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function CalcDinamicaPinze( dH, dS, dL)
|
||||
local MinTempoAcc = 0.3 -- [s]
|
||||
local MaxTempoAcc = 4.0 -- [s]
|
||||
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
|
||||
local 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
|
||||
function FindNextTool()
|
||||
-- salvo stato iniziale
|
||||
local CurrMachId = EgtGetCurrMachining()
|
||||
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
-- cerco lavorazione con utensile su gruppo testa indicato
|
||||
local sTool, sHead, sTcPos
|
||||
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
|
||||
while OpId do
|
||||
local nType = EgtGetOperationType( OpId)
|
||||
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
|
||||
if EgtSetCurrMachining( OpId) then
|
||||
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
|
||||
if EgtTdbSetCurrTool( sTool) then
|
||||
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
OpId = EgtGetNextActiveOperation( OpId)
|
||||
end
|
||||
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
|
||||
-- ripristino stato iniziale
|
||||
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
|
||||
EgtTdbSetCurrTool( CurrTool or '')
|
||||
-- restituisco risultato
|
||||
return sTool, sHead, sTcPos
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -1567,18 +1674,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
|
||||
@@ -1615,6 +1728,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
|
||||
@@ -1663,8 +1778,6 @@ function AdjustTcPos( bLen3)
|
||||
sPos = '0' .. sPos
|
||||
end
|
||||
end
|
||||
-- salvo posizione
|
||||
EMT.PREVTCPOS = sPos
|
||||
return sPos
|
||||
end
|
||||
|
||||
@@ -1687,9 +1800,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
|
||||
|
||||
+531
-109
File diff suppressed because it is too large
Load Diff
+1045
-289
File diff suppressed because it is too large
Load Diff
+193
@@ -1,5 +1,198 @@
|
||||
==== Common_FAST Update Log ====
|
||||
|
||||
Versione 3.1d1 (14/04/2026)
|
||||
- (SIM-GEN) Aggiorna lo step totale del PilgrimStep e lo step Y con il valore di MyMinY, di modo che tenga conto del AGG_LOAD quando c'è. Ticket#2919
|
||||
- (GEN) Per NUM, si lascia aperta la pinza di carico in caso di END2. TPA era già corretto. Ticket#2869
|
||||
|
||||
Versione 3.1c2 (30/03/2026)
|
||||
- (SIM-GEN) Corretti moviemnti con motosega. Ora si ruota la C con B sempre a zero, anche alla posizione X di sicurezza. Ticket#2866
|
||||
|
||||
Versione 3.1c1 (27/03/2026)
|
||||
- (SIM-GEN) FASTCLAMPING = true : si suddivide il movimento metà tirando e metà spingendo con altra pinza. Così si aumenta la velocità.
|
||||
- FASTCLAMPING = false : una pinza resta ferma e si fa il movimento tutto con una pinza. Così si limita lo scivolamento del pezzo.
|
||||
- (GEN) In caso di motosega prelevata, si ruota in home. Ticket#2866
|
||||
|
||||
Versione 3.1a2 (26/01/2026)
|
||||
- (GEN) Nella G101 il parametro EE era sempre a 4 perchè la variabile veniva settata dopo. Ticket#2796
|
||||
|
||||
Versione 3.1a1 (08/01/2026)
|
||||
- (SIM) Ottimizzata scrittura funzione ClampCheck post aggiornamento dll
|
||||
- (SIM) Corretto problema della funzione OnSimulDispositionStart in caso di fase finale.
|
||||
- (MLDE-SIM-GEN) Variabile DeltaTol deve essere spostata in MLDE
|
||||
|
||||
Versione 2.7l3 (22/12/2025)
|
||||
- (SIM) Eliminata MinJoin, utilizzata al suo posto funzione già esistente UpdateMinJoin nell'mlde
|
||||
- (SIM) Modificata formula calcolo Area minima
|
||||
|
||||
Versione 2.7l2 (18/12/2025)
|
||||
- (SIM) Aggiunta funzione CheckClamping
|
||||
|
||||
Versione 2.7l1 (10/12/2025)
|
||||
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
|
||||
- (EST) Modifiche a calcolo stima tempi, da verificare.
|
||||
- (SIM) Corretto movimento in simulazione che non rispettava movimento generato.
|
||||
- (GEN) Con controllo NUM/NUM_PLUS nella scrittura della coordinata tolto il simbolo '='
|
||||
- (SIM) Aggiunto controllo C in base a carico Dx o Sx durante il cambio utensile
|
||||
|
||||
Versione 2.7k1 (10/11/2025)
|
||||
- (GEN) Corretto set variabili info utensile prima del movimento in home in caso di pezzi alti per NUM/NUM_PLUS.
|
||||
|
||||
Versione 2.7j2 (08/10/2025)
|
||||
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C. Ora sempre e non solo se pezzo alto.
|
||||
|
||||
Versione 2.7j1 (06/10/2025)
|
||||
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C.
|
||||
- (MLDE-SIM) Controllo collisione tra utensile e TOP testa C. Serve CAM5 2.7j1
|
||||
|
||||
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.
|
||||
|
||||
Versione 2.6j2 (03/10/2024)
|
||||
- (SIM-GEN) Piccola correzione calcolo posizione carrello durante riposizionamento, nuova gestione
|
||||
|
||||
Versione 2.6j1 (01/10/2024)
|
||||
- (SIM-GEN) Sistemato calcolo in nuova disposzione carrelli
|
||||
|
||||
Versione 2.6i6 (25/09/2024)
|
||||
- (GEN) Migliorata gestione movimenti per portare testa vicino a cambio utensile se trave alta. Ticket#2066
|
||||
|
||||
Versione 2.6i5 (24/09/2024)
|
||||
- (SIM-GEN) Tolto controllo su lunghezza maggiore di 200mm introdotto con 2.6i2 perchè non completamente funzionante
|
||||
- (GEN) Gestione in OnRapid() di EMT.FLAG=5 (rotazione a Z max per lavorazione successiva). Ora allineata alla simulazione
|
||||
|
||||
Versione 2.6i4 (24/09/2024)
|
||||
- (SIM-GEN) Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco.
|
||||
L'aggiunta del ripinzaggio dipende da FASTCLAMPING (che deve essere disattiva). Viene aggiunta GAIN_RECLAMPING per decidere il guadagno in mm del ripinzaggio.
|
||||
|
||||
Versione 2.6i3 (23/09/2024)
|
||||
- (SIM-GEN) Aggiunta nuova strategia riposizionamento morse
|
||||
- (SIM-GEN) Aggiunta lettura flag NEWCLAMPING in BeamData, per abilitare nuova strategia riposizionamento. Se false o nil, funziona con metodo vecchio.
|
||||
- (SIM-GEN) Aggiunta lettura flag FASTCLAMPING. Se false, al carico prende al massimo 1000mm, per evitare collisioni durante ciclo di lettura laser e prima lavorazione.
|
||||
|
||||
Versione 2.6i2 (16/09/2024)
|
||||
- (SIM-GEN) Se utensili più lunghi di 200mm, si ruota in home e poi si approccia il pezzo. Ticket#2038
|
||||
- (SIM-GEN) Aumentata distanza ingombro da 650mm a 660mm. In casi di utensile abbastanza lungo poteva andare in colisione. Ticket#2041
|
||||
|
||||
Versione 2.6i1 (02/09/2024)
|
||||
- (MLDE-SIM-GEN) Rinominato file da "Common-" a "Common_" per uniformità con i file common delle altre macchine. Serve modifica a MLDE macchina.
|
||||
|
||||
Versione 2.6g1 (03/07/2024)
|
||||
- (GEN) Corretto chiamata macro precarico in caso di taglio finale, ma con ribaltamento successivo. Ora si chiama solo se la fase successiva è una "END". Ticket#1881
|
||||
- (GEN) Per controllo NUM, se arco maggiore di 99999mm, si approssima con una retta. Ticket#1888
|
||||
|
||||
Versione 2.6e3 (06/05/2024)
|
||||
- (MLDE-SIM-GEN) Gestione facoltativa parametri MIN_JOIN_xx settabili in Ts3. Ticket#1794
|
||||
|
||||
Versione 2.6e2 (06/05/2024)
|
||||
- (SIM-GEN) Modificata tolleranza calcolo ingombri lavorazioni per posizionamento pinze. Ticket#1790
|
||||
|
||||
Versione 2.6e1 (30/04/2024)
|
||||
- (MLDE-GEN) Gestione facoltativa parametro WOOD_DENSITY settabile in Ts3. In MLDE, mettere il valore di WOOD_DENSITY nella nostra variabile 'WoodDensity'.
|
||||
|
||||
Versione 2.6d2 (18/04/2024)
|
||||
- (SIM-GEN) In MLSE, quando c'è una rotazione, viene settato EMT.CNT=1 per considerare i 50mm di compensazione laser.
|
||||
- (SIM) Nel file di log dove c'è stampa gruppi di collisione, viene scritto anche ID del gruppo
|
||||
|
||||
Versione 2.6d1 (15/04/2024)
|
||||
- (GEN) Aggiunta gestione aggregato doppia uscita per controllo NUM_PLUS
|
||||
- (GEN) Con aggregato con si possono fare archi, se OnArc con aggregato, dà errore.
|
||||
- (GEN) Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni, equivalente a settare 'IS_TEST_MACHINE' (che comunque rimane)
|
||||
|
||||
Versione 2.6c8 (28/03/2024)
|
||||
- (MLSE) Possibilità di lavorazione da X- tra le pinze, se abilitata da flag (User.ENABLE_TOOL_BETWEEN_VICES == 1).
|
||||
- (MLDE-GEN) Aggiunto parametro 'IS_TEST_MACHINE' FACOLTATIVO. Se non esiste o 'false' è macchina standard, se 'true' è una macchina utilizzata per i test Egalware interni
|
||||
|
||||
Versione 2.6c7 (12/03/2024)
|
||||
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. N.B.= serve CAM5 2.6c2 NON OBBLIGATORIO
|
||||
- (GEN) Corretto problema di movimento pinze assieme a discesa asse Z (Ticket #1710)
|
||||
|
||||
Versione 2.6c6 (04/03/2024)
|
||||
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
|
||||
|
||||
Versione 2.6c5 (29/02/2024)
|
||||
- (GEN) Aggiunto comando di wait fine M101/G101 in caso di movimento in zona sicurezza per motosega
|
||||
- (GEN) Gestione accelerazioni pinze in M115 ( solo per TPA)
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
-- Version.lua by EgalWare s.r.l. 2024/02/23
|
||||
-- Version.lua by EgalWare s.r.l. 2024/03/28
|
||||
-- Gestione della versione dei file comuni post-processori macchine FAST e FASTrl di Essetre
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common-FAST', -- nome script PP standard
|
||||
VERSION = '2.6c5', -- versione script
|
||||
NAME = 'Common_FAST', -- nome script PP standard
|
||||
VERSION = '3.1d1', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user