Compare commits

...

100 Commits

Author SHA1 Message Date
andrea.villa e4659394a5 Merge remote-tracking branch 'origin/develop' 2024-11-11 09:24:45 +01:00
andrea.villa 1e8dfdd2f0 - Aggiustato parametro in calcolo ingombro lavorazione
- Cambio versione
2024-11-11 09:24:31 +01:00
andrea.villa 1ff99e2f0f - Aggiunta gestione aggregato a T per NUM
- Tolta gestione testa dummy H4
2024-11-08 09:23:59 +01:00
andrea.villa e8958065ef Merge branch 'main' into develop 2024-10-25 14:35:55 +02:00
andrea.villa eff8fc90c6 Merge branch 'develop' 2024-10-25 14:35:50 +02:00
andrea.villa 4448156fec Miglioria 2.6j9. Si ribadisce pinza in presa sempre, all'inizio, in base a quella attiva 2024-10-25 14:35:36 +02:00
andrea.villa f346df9d27 Merge remote-tracking branch 'origin/main' into develop 2024-10-22 11:18:16 +02:00
andrea.villa 810f85c62a Merge branch 'hotfix/NewReposClampAfterTurn' 2024-10-22 11:17:35 +02:00
andrea.villa 6ec26b5ad1 Miglioria 2.6j6. Oltre al passo pellegrino si ribadisce anche quando è scambio diretto 2024-10-22 11:16:47 +02:00
andrea.villa 304701cb77 Merge branch 'main' into develop 2024-10-21 08:44:10 +02:00
andrea.villa 306945f09b Merge branch 'hotfix/BugFixRepositioningTolerance' 2024-10-21 08:44:03 +02:00
andrea.villa 09eb355037 Corretto problema tolleranza aggiunto con versione 2.6j7 2024-10-21 08:43:49 +02:00
andrea.villa 30ed6aa984 Merge remote-tracking branch 'origin/main' into develop 2024-10-18 10:21:52 +02:00
andrea.villa ff7338e2f4 Merge branch 'hotfix/NewRepositioningTolerance' 2024-10-18 10:21:07 +02:00
andrea.villa 4903a6065e In nuova disposizione carrelli, aggiunta tolleranza di 100 EPS quando si calcola minimo posizionamento 2024-10-18 10:20:51 +02:00
andrea.villa 36df78ed67 Merge remote-tracking branch 'origin/main' into develop 2024-10-17 16:10:15 +02:00
andrea.villa 3132d213c1 Commit per versione 2024-10-17 16:10:03 +02:00
andrea.villa cbf5df9895 Merge branch 'hotfix/NewRepositioning' 2024-10-17 16:08:39 +02:00
andrea.villa ec8fa72ca2 Si ribadisce che la pinza era in presa, prima di cominciare con lo scambio del passo del pellegrino 2024-10-17 16:08:22 +02:00
andrea.villa 8c5e759bec Merge remote-tracking branch 'origin/main' into develop 2024-10-17 09:28:19 +02:00
andrea.villa 6ace9c266d Merge remote-tracking branch 'origin/develop' 2024-10-17 09:28:03 +02:00
andrea.villa 2a7b732444 Piccola correzione nuovo riposizionamento. Nel taglio dello scarto finale riposizionava nel vuoto 2024-10-17 09:27:45 +02:00
andrea.villa 6206ba44db Merge remote-tracking branch 'origin/main' into develop 2024-10-15 09:10:14 +02:00
andrea.villa ad882352d0 Merge remote-tracking branch 'origin/develop' 2024-10-15 09:09:56 +02:00
andrea.villa 8ef399a55c - Piccola correzione nuovo riposizionamento. Non considerava i 50mm di tolleranza su primo pinzaggio dopo ribaltamento
- Gestione attivazione pressore verticale in nuovo riposizionamento
2024-10-15 09:09:45 +02:00
andrea.villa e397ac2627 Merge branch 'main' into develop 2024-10-11 14:50:07 +02:00
andrea.villa cfc1fbc6b6 Merge remote-tracking branch 'origin/develop' 2024-10-11 14:49:49 +02:00
andrea.villa 3b91c0c603 Corretta scrittura macro start/attesa movimenti per NUM. Veniva scritto codice per TPA. 2024-10-11 14:49:30 +02:00
andrea.villa a2d0ff4d77 Merge remote-tracking branch 'origin/main' into develop 2024-10-03 10:25:40 +02:00
andrea.villa 977f006bdc Merge remote-tracking branch 'origin/develop' 2024-10-03 10:25:20 +02:00
andrea.villa aad0a2dee1 Piccola correwzione calcolo posizione carrello durante riposizionamento, nuova gestione 2024-10-03 10:24:52 +02:00
andrea.villa 5589385f4d Merge branch 'main' into develop 2024-10-01 08:12:46 +02:00
andrea.villa 5fa764cb96 Merge remote-tracking branch 'origin/develop' 2024-10-01 08:12:39 +02:00
andrea.villa f78a042dbe Commit per versione 2024-10-01 08:12:29 +02:00
andrea.villa 1c80767eee Sistemato calcolo in nuova disposzione carrelli 2024-09-26 18:12:26 +02:00
andrea.villa 369d1a7456 Merge remote-tracking branch 'origin/main' into develop 2024-09-26 18:12:03 +02:00
andrea.villa d23a9c6fa9 Migliorata gestione movimenti per portare testa vicino a cambio utensile se trave alta. 2024-09-25 13:22:18 +02:00
andrea.villa fbfe8187b9 Merge remote-tracking branch 'origin/develop' 2024-09-24 17:41:08 +02:00
andrea.villa 3ef4c18fe6 Corretto emissione movimento ZMAX con EMT.FLAG =5 2024-09-24 17:40:56 +02:00
andrea.villa b50c4ef806 - Tolto controllo su lunghezza maggiore di 200mm introdotto con 2.6i2
- Gestione in OnRapid() di EMT.FLAG=5
2024-09-24 16:03:40 +02:00
andrea.villa 7a7981fddb Merge remote-tracking branch 'origin/main' into develop 2024-09-24 10:13:27 +02:00
andrea.villa 74a0bc4a43 Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco 2024-09-24 10:13:10 +02:00
andrea.villa 4cc2e5a2d7 Merge remote-tracking branch 'origin/main' into develop 2024-09-23 12:55:32 +02:00
andrea.villa 24857bc252 Merge branch 'develop' 2024-09-23 12:55:14 +02:00
andrea.villa 5e90232086 - Aggiunta nuova strategia riposizionamento morse
- Aggiunta lettura flag NEWCLAMPING in BeamData, per abilitare nuova strategia riposizionamento
- Aggiunta lettura flag FASTCLAMPING. Se false, al carico prende al massimo 1000mm
2024-09-23 12:54:44 +02:00
andrea.villa 6e1faf69bc Merge branch 'NewClampRepos' into develop 2024-09-23 12:49:53 +02:00
andrea.villa 8fdda065d4 Ripristinato vecchio metodo riposizionamento morse 2024-09-23 11:28:35 +02:00
andrea.villa 5ae185cd0e Prima versione funzionante con tutti i test 101 e altri test ulteriori 2024-09-23 09:51:06 +02:00
andrea.villa 446b56d975 Piccole correzioni a calcoli e gestione offset iniziale 2024-09-20 17:05:55 +02:00
andrea.villa 48626b7f90 - Compensazione errore laser al carico per primo riposizionamento
- Rimosse variabili non più utilizzate
2024-09-20 16:00:24 +02:00
andrea.villa 21104984ad Aggiunto controllo tolleranza su posizione pinze per evitare riposizionamenti 2024-09-20 12:13:25 +02:00
andrea.villa c33c3196f2 Rimosse variabili non più utilizzate 2024-09-20 10:01:56 +02:00
andrea.villa 9b6c24017d Piccole correzioni ai calcoli del posizionamento 2024-09-20 08:19:22 +02:00
andrea.villa 5b7bab2873 Rivisitazione condizioni per scambio diretto 2024-09-19 12:07:30 +02:00
andrea.villa 1886d6620e Se posso fare scambio diretto non suddivido il movimento 2024-09-18 10:29:42 +02:00
andrea.villa 235a8dacb7 Offset minimo impostato prima del controllo se spostare morse 2024-09-18 08:28:26 +02:00
andrea.villa aad2a95dff - Risalita a ZMAX
- Migliorie se scambio diretto
2024-09-17 15:56:47 +02:00
andrea.villa 26126ac892 Aggiunto gestione riposizionamento per trave che si muove dallo scarico al carico 2024-09-17 12:52:32 +02:00
andrea.villa 5491e5cd81 Cancellate vecchie funzioni 2024-09-17 12:32:25 +02:00
andrea.villa 16e04c8502 Prima bozza nuova gestione riposizionamento carrelli 2024-09-17 12:24:29 +02:00
andrea.villa 3b1133f88c Merge branch 'main' into develop 2024-09-16 10:29:16 +02:00
andrea.villa 5d72e04f7e Merge remote-tracking branch 'origin/develop' 2024-09-16 10:28:55 +02:00
andrea.villa 72d61b4561 - Se utensili più lunghi di 200mm, si ruota in home e poi si approccia il pezzo.
- Aumentata distanza ingombro da 650mm a 660mm.
2024-09-16 10:28:41 +02:00
andrea.villa 7a16f26a63 Merge remote-tracking branch 'origin/main' into develop 2024-09-02 08:56:48 +02:00
andrea.villa c425cf1be3 Merge branch 'develop' 2024-09-02 08:56:27 +02:00
andrea.villa 79ecca7e02 Commit per versione 2024-09-02 08:56:17 +02:00
andrea.villa b9cc8a3aa9 Rinominato file da "Common-" a "Common_" 2024-08-02 09:32:17 +02:00
andrea.villa 0c8769dd81 Merge branch 'main' into develop 2024-07-03 10:07:33 +02:00
andrea.villa 7c9ec51f55 corretto nome versione in Version.lua 2024-07-03 10:07:09 +02:00
andrea.villa d0817659e5 Merge branch 'main' into develop 2024-07-03 10:05:57 +02:00
andrea.villa f283fe8fa9 Merge branch 'develop' 2024-07-03 10:05:36 +02:00
andrea.villa 87a7a89dbd commit per versione 2024-07-03 10:05:26 +02:00
andrea.villa 1a1f775c88 Per controllo NUM, se arco maggiore di 99999mm, si approssima con una retta 2024-06-26 16:32:03 +02:00
andrea.villa fd7cc25a4f Corretto chiamata macro precarico in caso di taglio finale, ma con ribaltaemnto successivo. 2024-06-26 15:20:15 +02:00
andrea.villa bdbec7cf37 Merge branch 'main' into develop 2024-05-06 16:37:51 +02:00
andrea.villa 6f115a81a0 Gestione facoltativa parametri MIN_JOIN_xx settabili in Ts3 2024-05-06 16:37:35 +02:00
andrea.villa 8e6daeeac7 Merge branch 'main' into develop 2024-05-06 14:52:48 +02:00
andrea.villa f029673970 Modificata tolleranza calcolo ingombri lavorazioni per posizionamento pinze 2024-05-06 14:52:33 +02:00
andrea.villa 01e5018c3d Merge branch 'main' into develop 2024-04-30 16:53:49 +02:00
andrea.villa c91ded71cd Merge branch 'develop' 2024-04-30 16:53:31 +02:00
andrea.villa 1e00fa27a0 - Gestione facoltativa parametro WOOD_DENSITY con variabile 'WoodDensity' 2024-04-30 16:53:23 +02:00
andrea.villa d57b86b046 Merge branch 'main' into develop 2024-04-18 10:49:14 +02:00
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
7 changed files with 1472 additions and 334 deletions
+97 -16
View File
@@ -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 MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -41,13 +42,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')
@@ -178,7 +183,7 @@ function OnDispositionEnd()
-- 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)
@@ -598,6 +603,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
@@ -615,12 +622,9 @@ function OnRapid()
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
EMT.ZMAX = true
bHeadFirst = false
end
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
@@ -631,6 +635,13 @@ function OnRapid()
' 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
-- ricavo i dati per la lavorazione
@@ -641,11 +652,13 @@ function OnRapid()
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
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) 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
@@ -823,12 +836,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")
@@ -920,13 +968,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
@@ -1566,8 +1647,8 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' then
return ' E'..sTcPos
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
elseif sHead == 'H3' then
@@ -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 MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -41,13 +42,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 +138,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 +164,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 +431,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
@@ -626,6 +643,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
@@ -644,12 +663,10 @@ function OnRapid()
EmitZmax( EMT.TOOL ~= EMT.PREVTOOL)
EMT.ZMAX = true
EMT.PREVTOOL = EMT.TOOL
bHeadFirst = false
end
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
@@ -659,21 +676,53 @@ function OnRapid()
' 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
-- 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)
-- 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
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) 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
@@ -797,7 +846,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
@@ -861,12 +910,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")
@@ -932,6 +1016,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
@@ -958,18 +1047,51 @@ 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 CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
@@ -1511,16 +1633,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()
@@ -1560,7 +1690,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)
@@ -1611,7 +1741,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'
+116 -26
View File
@@ -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 MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -38,14 +39,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 +211,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 +245,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 +260,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
@@ -626,6 +626,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
@@ -641,12 +643,9 @@ function OnRapid()
if not ( EMT.LOAD or EMT.RELOAD) then
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
bHeadFirst = false
end
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']')
EmtOutput( '( * ' .. sOut .. ' * )')
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
@@ -657,14 +656,24 @@ function OnRapid()
' 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
-- 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
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
' 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()
@@ -768,7 +777,7 @@ 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
@@ -843,12 +852,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, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
' P4=' .. EgtNumToString( dBAxis, 3) .. ' P5=' .. EgtNumToString( dCAxis, 3) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
' P4=' .. EgtNumToString( dBAxis, 3) .. ' P5=' .. EgtNumToString( dCAxis, 3) ..
' 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, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
' 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")
@@ -975,6 +1014,57 @@ function OnArc()
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 CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc)
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
+68 -45
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')
@@ -15,11 +15,11 @@ BIG_TOOL_DIAM = 300
---------------------------------------------------------------------
local sBaseDir = EgtGetCurrMachineDir()
if NumericalControl == 'NUM' then
dofile( sBaseDir .. '\\Common-FAST.NUM.mlpe')
dofile( sBaseDir .. '\\Common_FAST.NUM.mlpe')
elseif NumericalControl == 'TPA' then
dofile( sBaseDir .. '\\Common-FAST.TPA.mlpe')
dofile( sBaseDir .. '\\Common_FAST.TPA.mlpe')
elseif NumericalControl == 'NUM_PLUS' then
dofile( sBaseDir .. '\\Common-FAST.NUM_PLUS.mlpe')
dofile( sBaseDir .. '\\Common_FAST.NUM_PLUS.mlpe')
else
EmtSetLastError( 1201, 'Numerical Control error : unkwnown type')
end
@@ -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)
@@ -477,8 +477,8 @@ function OnSimulToolSelect( dPosA)
EMT.A1n = 'Y'
EMT.A2n = 'V'
end
-- carico utensile se non lama su sua testa o dummy
if EMT.HEAD ~= 'H2' and EMT.HEAD ~= 'H4' then
-- carico utensile se non lama
if EMT.HEAD ~= 'H2' then
-- se sega a catena, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H3' then
if not dPosA then
@@ -589,8 +589,8 @@ function OnSimulToolDeselect()
ShowToolInTcPos( EMT.TCPOS_1, false)
end
EgtOutText( '')
-- deposito utensile se prossimo non lama su sua testa o dummy
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then
-- deposito utensile se prossimo non lama su sua testa
elseif EMT.NEXTHEAD ~= 'H2' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
-- simulo movimento
@@ -662,6 +662,7 @@ function OnSimulMachiningEnd()
EMT.FALL = false
end
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTOOL = EMT.TOOL
EMT.PREVEXIT = EMT.EXIT
end
@@ -671,35 +672,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
---------------------------------------------------------------------
@@ -776,10 +750,12 @@ function OnSimulMoveStart()
if EMT.MCHFIRST then
EgtOutText( '')
EMT.MCHFIRST = false
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare
if EMT.HEAD == 'H3'then
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) then
SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
@@ -788,8 +764,12 @@ function OnSimulMoveStart()
end
---------------------------------------------------------------------
--function OnSimulMoveEnd()
--end
function OnSimulMoveEnd()
if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
end
---------------------------------------------------------------------
function OnSimulCollision()
@@ -893,6 +873,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
@@ -913,10 +926,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
@@ -1510,6 +1527,12 @@ function IsStartOrRestPhase( nPhase)
return ( sVal == 'START' or sVal == 'REST')
end
---------------------------------------------------------------------
function IsEndPhase( nPhase)
local sVal = GetPhaseType( nPhase)
return ( sVal == 'END')
end
---------------------------------------------------------------------
function IsMidPhase( nPhase)
local sVal = GetPhaseType( nPhase)
File diff suppressed because it is too large Load Diff
+97
View File
@@ -1,5 +1,102 @@
==== Common_FAST Update Log ====
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)
- (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'
+3 -3
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.6c4', -- versione script
NAME = 'Common_FAST', -- nome script PP standard
VERSION = '2.6k1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}