Compare commits

...

22 Commits

Author SHA1 Message Date
andrea.villa 5476431a1b commit per versione 2024-04-18 10:48:46 +02:00
andrea.villa ced2337e75 Merge branch 'develop' 2024-04-18 10:47:19 +02:00
andrea.villa 8b03855934 Merge branch 'temp' 2024-04-18 10:46:48 +02:00
andrea.villa 523e7261cc - In MLSE, quando c'è una rotazione del pezzo, viene settato EMT.CNT=1 per offset carico.
- Nel file di log per collisioni si scrive anche ID del gruppo
2024-04-18 10:46:18 +02:00
andrea.villa 0eedd5a10d - Aggiunta gestione aggregato doppia uscita per controllo NUM_PLUS
- Errore se archi con aggregato
- Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni
2024-04-15 14:54:55 +02:00
andrea.villa 708c2bf020 Merge branch 'main' into develop 2024-03-28 16:36:41 +01:00
andrea.villa e01361aa93 Merge branch 'develop' 2024-03-28 16:36:31 +01:00
andrea.villa 724dafe7ad - Possibilità di lavorazione da X- tra le pinze, se abilitata da flag (User.ENABLE_TOOL_BETWEEN_VICES == 1).
- Aggiunto parametro 'IS_TEST_MACHINE' per test Egalware interni
2024-03-28 16:36:20 +01:00
andrea.villa 2b79262d52 Merge branch 'main' into develop 2024-03-12 13:15:02 +01:00
andrea.villa f958adc7d9 Merge branch 'develop' 2024-03-12 13:14:52 +01:00
andrea.villa 6ba7cb4829 - 'EgtVolZmapSetShowEdges' per settare flag visualizzazione spigoli
- Corretto problema di movimento pinze assieme a discesa asse Z
2024-03-12 13:14:41 +01:00
andrea.villa c52e303318 Merge branch 'main' into develop 2024-03-04 10:47:30 +01:00
andrea.villa 989475b17e Merge branch 'develop' 2024-03-04 10:47:23 +01:00
andrea.villa e4e029375f Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina 2024-03-04 10:47:00 +01:00
andrea.villa b39903565a Merge branch 'main' into develop 2024-02-29 08:31:40 +01:00
andrea.villa 6f61a8af5f Merge branch 'develop' 2024-02-29 08:31:32 +01:00
andrea.villa 829db46d77 - Aggiunto comando di wait fine M101/G101
- Gestione accelerazioni pinze in M115
- Rimozione VMILL per tagli a cubetti a zig-zag
2024-02-29 08:31:19 +01:00
andrea.villa 4f82ac6775 Merge branch 'main' into develop 2024-02-27 14:48:56 +01:00
andrea.villa 40af75d2ad - Aggiunto parametro 'SafeXRotAxes' in MLDE per ruotare motosega in zona sicura
- In simulazione utilizzate costanti 'MCH_SIM_STEP'
2024-02-27 14:48:28 +01:00
luca.mazzoleni 7f1b58136b Merge branch 'develop' 2024-02-23 16:56:52 +01:00
luca.mazzoleni 9381a03912 - eliminato readme
- sistemato ordine updatelog
2024-02-23 16:56:36 +01:00
andrea.villa 6053be6d93 Merge branch 'main' into develop 2024-02-23 12:09:57 +01:00
8 changed files with 374 additions and 140 deletions
+51 -11
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -41,13 +41,17 @@ 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')
-- 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')
@@ -490,6 +494,7 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
end
---------------------------------------------------------------------
@@ -499,6 +504,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -609,25 +619,55 @@ 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)
-- 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 = '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)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- 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)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' EH1'
-- 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')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
local MyZPos = EMT.L3
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'G101' .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( MyZPos, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
-- faccio backup dati in caso mi servano per lavorazione successiva
EMT.PREVsEE = sEE ; EMT.PREVsEL = sEL ; EMT.PREVsER = sER ; EMT.PREVsET = sET ; EMT.PREVsES = sES
if EMT.LOAD or bHeadFirst then
sOut = sOut..' L0=0'
EmtOutput( sOut)
+106 -18
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -41,13 +41,17 @@ 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')
-- 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')
@@ -133,6 +137,14 @@ 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)
-- altro non previsto
end
end
@@ -151,7 +163,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
@@ -418,6 +430,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
@@ -517,6 +533,7 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVR3 = EMT.R3
end
@@ -527,6 +544,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -638,25 +660,78 @@ 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)
-- 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 = '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)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- 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 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' 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' 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)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' EH1'
-- 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')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
local MyZPos = EMT.L3
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'G101' .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( MyZPos, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
-- faccio backup dati in caso mi servano per lavorazione successiva
EMT.PREVsEE = sEE ; EMT.PREVsEL = sEL ; EMT.PREVsER = sER ; EMT.PREVsET = sET ; EMT.PREVsES = sES
if EMT.LOAD or bHeadFirst then
sOut = sOut .. ' L0=0'
if EMT.LOAD or #EMT.AUXSTR > 0 then
@@ -903,6 +978,11 @@ end
---------------------------------------------------------------------
function OnArc()
-- con aggregato non si possono fare archi. Deve essere tutto spezzato
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
EmtSetLastError( 1211, "With aggregate, the arcs must be splitted")
end
MyBackupAxes()
EMT.TLAST = EMT.L1
-- non modale su archi
@@ -1482,16 +1562,24 @@ 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
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
local LenAux = AngTr1Offs + 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()
@@ -1531,7 +1619,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)
@@ -1582,7 +1670,7 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' then
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
+81 -24
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -38,14 +38,18 @@ end
---------------------------------------------------------------------
function OnProgramStart()
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
-- Intestazioni
if EMT.INFO then
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..')')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
@@ -206,19 +210,12 @@ function OnDispositionEnd()
local HTrave = EMT.HT
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 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 RidFeed = 100 / Massa * 100
if ( RidFeed > 100) then RidFeed = 100 end
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)
if IdTrave >= 0 then
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) ..
@@ -247,7 +244,8 @@ function OnDispositionEnd()
-- se carico barra
if EMT.LOAD or EMT.RELOAD then
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) ..
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( LTrave, 2)
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( LTrave, 2) ..
' P7=' .. EgtNumToString( TempAccPinze, 2) .. ' P8=' .. EgtNumToString( TempAccPinz2, 2) .. ' P9=' .. EgtNumToString( TempAccPinz1, 2)
if EMT.LOAD then
ParkLine( sOut)
SetStartValue( 1, LBarra)
@@ -261,7 +259,8 @@ function OnDispositionEnd()
-- altrimenti recupero rimanenza
else
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) ..
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2)
' 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())
-- aggiorno dati aggancio carrelli alla trave
@@ -511,6 +510,8 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVS = EMT.S
end
---------------------------------------------------------------------
@@ -521,6 +522,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -634,22 +640,49 @@ function OnRapid()
if not ( EMT.LOAD or EMT.RELOAD) then
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
bHeadFirst = false
end
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) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']')
EmtOutput( '( * ' .. sOut .. ' * )')
end
-- primo posizionamento
-- 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) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
-- resetto valori precedenti
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
local MyZPos = EMT.L3
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
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) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' P12=1'
end
if EMT.LOAD then
ParkLine( sOut)
else
@@ -948,6 +981,28 @@ function OnArc()
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
end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
@@ -1613,6 +1668,8 @@ function AdjustTcPos( bLen3)
sPos = '0' .. sPos
end
end
-- salvo posizione
EMT.PREVTCPOS = sPos
return sPos
end
+85 -72
View File
@@ -1,4 +1,4 @@
-- Processore macchina Essetre-FAST by EgalWare s.r.l. 2024/02/23
-- Processore macchina Essetre-FAST by EgalWare s.r.l. 2024/03/09
-- Intestazioni
require( 'EmtGenerator')
@@ -130,7 +130,7 @@ function OnSimulStart()
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId or GDB_ID.NULL, McdData[i].Sub) or GDB_ID.NULL, McdData[i].Name)
if nId then
table.insert( EMT.MCODET, nId)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is ok', 4)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
@@ -533,39 +533,40 @@ function OnSimulToolDeselect()
-- 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
EgtOutText( 'Tool change in progress...')
local RapSimStep = 4 * EMT.SIMSTEP
local RapSimRotStep = RapSimStep / 10
local CollSimRotStep = min( RapSimRotStep, 5)
-- 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
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
end
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), CollSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), CollSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico rinvio
elseif EMT.HEAD == 'H5' then
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', -90, CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico punta lunga su T111
elseif EMT.TOTLEN > LONG_TOOL_MINLEN then
-- se su cambio utensile T111
if EMT.TCPOS == 'T111' then
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', 0, CollSimRotStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', 0, MCH_SIM_STEP.COLLROT)
-- altrimenti posizioni standard rastrelliera
else
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 90, CollSimRotStep, 'C', -90, CollSimRotStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
end
-- movimento scarico utensile di grosso diametro (su T111)
else
local dPosB = EgtGetAxisPos( 'B')
local dNewB = EgtIf( dPosB < 0, -90, 90)
SimulMoveAxes( 'B', dNewB, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', dNewB, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
end
-- breve pausa
EgtPause( 100)
@@ -574,9 +575,9 @@ function OnSimulToolDeselect()
ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' then
SimulMoveAxes( 'B', 90, RapSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, RapSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
end
-- se segue lama, carico utensile di default
if EMT.NEXTHEAD == 'H2' then
@@ -592,12 +593,9 @@ function OnSimulToolDeselect()
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
local RapSimStep = 4 * EMT.SIMSTEP
local RapSimRotStep = RapSimStep / 10
local CollSimRotStep = min( RapSimRotStep, 10)
-- simulo movimento
SimulMoveAxes( 'B', 90, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- breve pausa
EgtPause( 100)
ShowToolInTcPos( EMT.TCPOS_1, true)
@@ -608,7 +606,7 @@ function OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
end
-- eseguo movimento opportuno
SimulMoveAxes( 'B', 0, RapSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
-- se altrimenti lama su cambio utensile
elseif EMT.NEXTHEAD == 'H1' and SpecialBH and EMT.NEXTTCPOS == 'T111' then
-- se non lama, nascondo l'utensile corrente
@@ -616,7 +614,7 @@ function OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
end
-- eseguo movimento opportuno
SimulMoveAxes( 'B', -90, RapSimRotStep, 'C', 0, RapSimRotStep)
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.RAPROT, 'C', 0, MCH_SIM_STEP.RAPROT)
end
else
EMT.TOOL_1 = nil
@@ -673,35 +671,8 @@ end
---------------------------------------------------------------------
function OnSimulPathEnd()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
EgtOutLog( 'OnSimulPathEnd', 5)
local vMillId = EMT.VMILL[1]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
-- aggiorno visualizzazione
EgtDraw()
end
end
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
---------------------------------------------------------------------
@@ -779,17 +750,23 @@ function OnSimulMoveStart()
EgtOutText( '')
EMT.MCHFIRST = false
-- 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 then
local RapSimStep = 4 * EMT.SIMSTEP
SimulMoveAxes( 'C', EMT.R1, RapSimStep/10, 'B', EMT.R2, RapSimStep/10)
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'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
end
---------------------------------------------------------------------
--function OnSimulMoveEnd()
--end
function OnSimulMoveEnd()
if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
end
---------------------------------------------------------------------
function OnSimulCollision()
@@ -814,7 +791,6 @@ end
---------------------------------------------------------------------
function ExecAuxCmd( sCmd)
local RapSimStep = 4 * EMT.SIMSTEP
local Cmd = EgtSplitString( sCmd)
if Cmd[1] == '0' then
if Cmd[2] == 'Unloading' then
@@ -824,7 +800,7 @@ function ExecAuxCmd( sCmd)
end
EgtOutText( EgtIf( Cmd[3], Cmd[3], Cmd[2]))
elseif Cmd[1] == '1' then
if not SimulMoveAxis( Cmd[2], tonumber( Cmd[3]), RapSimStep) then
if not SimulMoveAxis( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID) then
if VerifyYVStroke( Cmd[2], tonumber( Cmd[3])) == nil then
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
end
@@ -838,8 +814,8 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrello con trave agganciata
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
-- Eseguo il movimento
local _, bOk, bOk2 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), RapSimStep,
Cmd[4], tonumber( Cmd[5]), RapSimStep)
local _, bOk, bOk2 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID)
if not ( bOk and bOk2) then
local nI = EgtIf( not bOk, 2, 4)
if VerifyYVStroke( Cmd[nI], tonumber( Cmd[nI+1])) == nil then
@@ -850,9 +826,9 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrelli con trave agganciata
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
-- Eseguo il movimento
local _, bOk, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), RapSimStep,
Cmd[4], tonumber( Cmd[5]), RapSimStep,
Cmd[6], tonumber( Cmd[7]), RapSimStep)
local _, bOk, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
Cmd[6], tonumber( Cmd[7]), MCH_SIM_STEP.RAPID)
if not ( bOk and bOk2 and bOk3) then
local nI = EgtIf( not bOk, 2, EgtIf( not bOk2, 4, 6))
if VerifyYVStroke( Cmd[nI], tonumber( Cmd[nI+1])) == nil then
@@ -864,14 +840,14 @@ function ExecAuxCmd( sCmd)
if Cmd[2] ~= '0' then
dPY = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
end
SimulMoveAxis( 'PY', dPY, RapSimStep)
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)
end
SimulMoveAxis( 'PV', dPV, RapSimStep)
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( Cmd[2] ~= '0')
elseif Cmd[1] == '21' then
local nYDelta = tonumber( Cmd[2])
@@ -894,6 +870,39 @@ function ExecAuxCmd( sCmd)
end
end
---------------------------------------------------------------------
function ExecRemoveScraps()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
EgtOutLog( 'OnSimulPathEnd', 5)
local vMillId = EMT.VMILL[1]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
-- aggiorno visualizzazione
EgtDraw()
end
end
end
---------------------------------------------------------------------
function ExecUnloading()
if EMT.VMILL and #EMT.VMILL > 0 then
@@ -914,10 +923,14 @@ function ExecUnloading()
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
+11 -4
View File
@@ -1,4 +1,4 @@
-- Special Operations macchina Essetre-FAST by EgalWare s.r.l. 2024/02/23
-- Special Operations macchina Essetre-FAST by EgalWare s.r.l. 2024/03/28
-- Intestazioni
require( 'EmtGenerator')
@@ -445,6 +445,7 @@ function OnPostApplyMachining()
EMC.YDELTA = nil
EMC.VDELTA = nil
EMC.HCING_IGNORE = true
EMC.CNT = 1
elseif IsStartOrRestPhase( EMC.PHASE) then
-- carico le posizioni
local dPosT = EgtGetInfo( nPrevOpeId, 'TPOS', 'd')
@@ -461,6 +462,7 @@ function OnPostApplyMachining()
EMC.VDELTA = nil
end
EMC.HCING_IGNORE = true
EMC.CNT = nil
else
-- aggiornamento posizioni (da lavorazione precedente a disposizione)
local nPrev2OpeId = EgtGetPrevActiveOperation( nPrevOpeId)
@@ -478,8 +480,8 @@ function OnPostApplyMachining()
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
EMC.YDELTA = EgtGetInfo( nLastPathId, 'YDELTA', 'd')
EMC.VDELTA = EgtGetInfo( nLastPathId, 'VDELTA', 'd')
EMC.CNT = nil
end
EMC.CNT = nil
-- altrimenti precedente operazione è lavorazione
else
-- aggiornamento posizioni
@@ -796,6 +798,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
local bAngTrasm = ( sHead == 'H5' or sHead == 'H6')
local dTLen = EgtTdbGetCurrToolParam( MCH_TP.LEN)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dThLen = EgtTdbGetCurrToolThLength()
-- Se sega a catena, devo correggere il versore Aux per farlo coincidere con la direzione del braccio C
if bChain then
if abs( vAxes[6] or 0) < 1 then
@@ -811,7 +814,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
if nExit == 2 then vtAux = -vtAux end
end
-- Calcolo limiti derivanti dalla lavorazione
local dDistFront, dDistBack = SpecCalcEncumbrance( vtTool, vtAux, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam)
local dDistFront, dDistBack = SpecCalcEncumbrance( vtTool, vtAux, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam, dThLen)
return dDistFront, dDistBack
end
@@ -870,7 +873,7 @@ function GetFinalCutPmax( nMchId)
end
---------------------------------------------------------------------
function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam)
function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam, dThLen)
-- Quota in Z dal punto di inclinazione dei carrelli
local dCompZ = sqrt( 1 - vtTool:getZ() * vtTool:getZ())
local dZup = ptMin:getZ() - 0.5 * dCompZ * dTDiam - ( EMC.ZMIN + 130)
@@ -1055,6 +1058,10 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
(( vtTool:getY() > 0 and ptHeadMin:getY() > 80) or ( vtTool:getY() < 0 and ptHeadMax:getY() < -EMC.SB - 80)) then
dHeadFront = 130
end
-- per forature di coda abbastanza lontane dai bordi pezzo in Y
if BD.ENABLE_TOOL_BETWEEN_VICES and not bChain and vtTool:getX() < -0.999 and ptHeadMax:getY() + dTDiam / 2 < -15 and ptHeadMin:getY() - dTDiam / 2 > -EMC.SB + 15 then
dHeadFront = - ( dTLen - dThLen - 15)
end
-- per interferenza con triangolo di rinforzo sulla pinza V
if ( vtTool:getZ() < 0.25 and vtTool:getX() > -0.10 and vtTool:getY() > 0 and vtArm:getX() > 0.707 and not BD.RIGHT_LOAD) or
( vtTool:getZ() < 0.25 and vtTool:getX() > -0.10 and vtTool:getY() < 0 and vtArm:getX() > 0.707 and BD.RIGHT_LOAD) then
View File
+38 -9
View File
@@ -1,15 +1,44 @@
==== Common_FAST Update Log ====
Versione 2.6c1 (23/02/2024)
- (ALL) Prima versione post-proc comune FAST e FASTrl
- (ALL) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (ALL) In BeamData aggiunto flag per direzione carico RIGHT_LOAD
- (ALL) Aggiornamento 'Compile.bat' con nuovi nomi file
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.6c2 (23/02/2024)
- (ALL) Rimossa chiamata funzione EgtGetSourceDir
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)
- (SIM) Gestione rimozione VMILL per tagli a cubetti a zig-zag
Versione 2.6c4 (27/02/2024)
- (MLDE-SIM-GEN) Con pezzi molto alti '> BeamHeightForFixRot', aggiunto parametro 'SafeXRotAxes' per ruotare motosega in zona sicura lontano dal pezzo
- (SIM) Nelle funzioni movimentaizone assi, utilizzate costanti 'MCH_SIM_STEP'
Versione 2.6c3 (23/02/2024)
- (SIM) Corretta lettura parametro RIGHT_LOAD
- (ALL) Rimossa chiamata funzione EgtGetSourceDir rimasta in MLPE
- (SIM-GEN) Rimossa chiamata funzione EgtGetSourceDir rimasta in MLPE
Versione 2.6c2 (23/02/2024)
- (SIM-GEN) Rimossa chiamata funzione EgtGetSourceDir
Versione 2.6c1 (23/02/2024)
- (SIM-GEN) Prima versione post-proc comune FAST e FASTrl
- (SIM-GEN) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (SIM-GEN) In BeamData aggiunto flag per direzione carico RIGHT_LOAD
- (SIM-GEN) Aggiornamento 'Compile.bat' con nuovi nomi file
+2 -2
View File
@@ -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.6c3', -- versione script
VERSION = '2.6d2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}