Compare commits

..

38 Commits

Author SHA1 Message Date
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 4cc2e5a2d7 Merge remote-tracking branch 'origin/main' into develop 2024-09-23 12:55:32 +02:00
7 changed files with 302 additions and 60 deletions
+71 -4
View File
@@ -3,6 +3,7 @@
-- 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.'
@@ -602,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
@@ -627,7 +630,7 @@ function OnRapid()
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' or EMT.TTOTLEN > 200) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
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
@@ -649,7 +652,7 @@ 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' or EMT.TTOTLEN > 200) 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
@@ -833,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")
@@ -941,6 +979,35 @@ 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 CalcCharStatus( sCmd, bSkipPress)
-- aperto
+71 -4
View File
@@ -3,6 +3,7 @@
-- 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.'
@@ -642,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
@@ -668,7 +671,7 @@ function OnRapid()
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' or EMT.TTOTLEN > 200) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
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
@@ -713,7 +716,7 @@ 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' or EMT.TTOTLEN > 200) 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
@@ -907,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")
@@ -1020,6 +1058,35 @@ 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]
+66 -4
View File
@@ -3,6 +3,7 @@
-- 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.'
@@ -625,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
@@ -647,7 +650,7 @@ function OnRapid()
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' or EMT.TTOTLEN > 200) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
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) ..
@@ -663,7 +666,7 @@ function OnRapid()
end
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if ( EMT.HEAD == 'H3' or EMT.TTOTLEN > 200) 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) ..
@@ -849,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")
@@ -981,6 +1014,35 @@ 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]
+4 -1
View File
@@ -662,6 +662,7 @@ function OnSimulMachiningEnd()
EMT.FALL = false
end
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTOOL = EMT.TOOL
EMT.PREVEXIT = EMT.EXIT
end
@@ -749,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' or EMT.TOTLEN > 200 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
+51 -46
View File
@@ -1214,6 +1214,9 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
end
local dDistBackEff = min( dDistBack, EMC.LB - MyMinOther - EMC.HCING - EMC.HOVM)
-- se primo scambio
local MyMinY = EgtIf( EMC.CNT == 1, MinY + AGG_LOAD, MinY)
EgtOutLog( ' Dist/Min : Back=' .. EgtNumToString( dDistBackEff, 1) .. '/' .. EgtNumToString( MinBackJoin, 1) ..
' Front=' .. EgtNumToString( dDistFrontEff, 1) .. '/' .. EgtNumToString( MinFrontJoin, 1) ..
' Fixed : Delta=' .. EgtIf( bFixedDelta, 'T', 'F') .. ' Pos=' .. EgtIf( bFixedPos, 'T', 'F'), 3)
@@ -1233,7 +1236,7 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
if dDistFrontEff < MinFrontJoin and dDistBackEff > MinBackJoin - GEO.EPS_SMALL then
-- se Y non era in presa, mi ricalcolo la posizione
if not dYDelta then
dYDelta = dVDelta + ( MinY - MaxV)
dYDelta = dVDelta + ( MyMinY - MaxV)
end
dNewYDelta = EMC.LB - dDistBackEff
-- verifico se posso lasciare la morsa in posizione
@@ -1250,11 +1253,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
elseif dDistBackEff > MinBackJoin - GEO.EPS_SMALL and dDistFrontEff > MinFrontJoin - GEO.EPS_SMALL then
-- se Y non era in presa, mi ricalcolo la posizione
if not dYDelta then
dYDelta = dVDelta + ( MinY - MaxV)
dYDelta = dVDelta + ( MyMinY - MaxV)
end
-- se V non era in presa, mi ricalcolo la posizione
if not dVDelta then
dVDelta = dYDelta - ( MinY - MaxV)
dVDelta = dYDelta - ( MyMinY - MaxV)
end
dNewYDelta = EMC.LB - dDistBackEff
@@ -1284,12 +1287,17 @@ function SpecCalcCarriages( dDistFront, dDistBack, bFixedDelta, bFixedPos)
elseif dDistBackEff < MinBackJoin and dDistFrontEff > MinFrontJoin - GEO.EPS_SMALL then
-- se V non era in presa, mi ricalcolo la posizione
if not dVDelta then
dVDelta = dYDelta - ( MinY - MaxV)
dVDelta = dYDelta - ( MyMinY - MaxV)
end
dNewVDelta = dDistFrontEff
-- verifico se posso lasciare la morsa in posizione
local dVDeltaTol = GetDeltaTol( dNewVDelta, EMC.TCING, EMC.HCING, EMC.HOVM, 'V', bFixedDelta)
local bVDeltaS = ( dNewVDelta > dVDelta + dVDeltaTol or dNewVDelta < dVDelta - DELTA_SIC)
local bVDeltaS
if EMC.YDELTA == nil and EMC.YDELTANEXT == nil then
bVDeltaS = (( dNewVDelta > dVDelta + dVDeltaTol and not bFixedPos) or dNewVDelta < dVDelta - DELTA_SIC)
else
bVDeltaS = ( dNewVDelta > dVDelta + dVDeltaTol or dNewVDelta < dVDelta - DELTA_SIC)
end
-- reimposto i delta finali in caso di spostamenti richiesti significativi, tenuto conto delle tolleranze
if bVDeltaS then
dNewVDelta = dNewVDelta - dVDeltaTol/2
@@ -1489,6 +1497,17 @@ function SpecCalcPreRot()
return vCmd
end
---------------------------------------------------------------------
local function CalcCharStatus( sType, dDelta)
-- se per carrello Y
if sType == 'Y' then
return EgtIf( EMC.LB - dDelta < LenToPress, 1, 2)
-- altrimenti per carrello V
else
return EgtIf( dDelta < LenToPress, 1, 2)
end
end
---------------------------------------------------------------------
function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDeltaF, bFixedDelta, bFixedPos)
local dYPosA, dVPosA, dTPosA
@@ -1525,6 +1544,14 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
local bZmaxOk = EnsureZmax( bZmaxOk, vCmd)
end
-- ribadisco pinzaggio
if EMC.YDELTA then
table.insert( vCmd, { 11, 1})
end
if EMC.VDELTA then
table.insert( vCmd, { 12, 1})
end
-- reset contatore primo riposizionamento con compensazione lettura laser
EMC.CNT = nil
@@ -1556,7 +1583,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- * deve effettivamente spostarsi
-- * non si arriva da gestione passo del pellegrino
-- * se riesce a raggiungere la posizione con le corse a disposizione per come sono posizionate le morse attualmente
if ( dYDeltaI - dVDeltaF) >= MyMinY - MaxV and abs( dVDeltaF - dVDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and
if ( dYDeltaI - dVDeltaF) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and abs( dVDeltaF - dVDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and
( dVDeltaF - dVDeltaI > MinV - dVPosI + MyMinY - dYPosI) then
table.insert( vCmd, { 0, 'Direct-V-Y'})
-- se l'altra morsa non era in presa, vado a pinzare il pezzo
@@ -1615,7 +1642,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosI = dTPosA
-- blocco la morsa
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
@@ -1626,7 +1653,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dYPosA = dTPosF + dYDeltaF
dVPosA = dTPosF + dVDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- la morsa al carico è adesso in posizione
dYDeltaI = dYDeltaF
end
@@ -1638,7 +1665,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosA = -( dYPosA + dVDeltaF)
dVPosA = dTPosA + dVDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- la morsa al carico è adesso in posizione
dYDeltaI = dYDeltaF
end
@@ -1661,7 +1688,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- * deve effettivamente spostarsi
-- * non si arriva da gestione passo del pellegrino
-- * se riesce a raggiungere la posizione con le corse a disposizione per come sono posizionate le morse attualmente
elseif ( dYDeltaF - dVDeltaI) >= MyMinY - MaxV and abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and
elseif ( dYDeltaF - dVDeltaI) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and
( dYDeltaF - dYDeltaI < MaxY - dYPosI + MaxV - dVPosI) then
table.insert( vCmd, { 0, 'Direct-Y-V'})
-- se l'altra morsa non era in presa, vado a pinzare il pezzo
@@ -1687,7 +1714,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dBeamMove = -( dYPosI + ( dYDeltaF - dYDeltaI) - MyMinY)
-- se spostamento verso il carico
elseif ( dYPosI + ( dYDeltaF - dYDeltaI)) > MaxY then
dBeamMove = dYPosI + ( dYDeltaF - dYDeltaI) - MaxY
dBeamMove = -( dYPosI + ( dYDeltaF - dYDeltaI) - MaxY)
end
-- se serve un grande spostamento e si sta pinzando poco. V trascinatore pinza poco e Y si sposta per prima per recuperare
@@ -1723,7 +1750,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosI = dTPosA
-- blocco la morsa
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
@@ -1733,7 +1760,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dYPosA = dTPosF + dYDeltaF
dVPosA = dTPosF + dVDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
-- la morsa al carico è adesso in posizione
dVDeltaI = dVDeltaF
end
@@ -1745,7 +1772,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dTPosA = dVPosA - dVDeltaF
dYPosA = dTPosA + dYDeltaF
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
-- la morsa al carico è adesso in posizione
dVDeltaI = dVDeltaF
end
@@ -1855,10 +1882,10 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- morsa Y arriva in posizione finale
dYDeltaI = dYDeltaF
dVPosA = MinV
dTPosA = dTPosI - MaxV + MinV
dTPosA = dTPosI - dVPosI + MinV
dYPosA = dYDeltaF + dTPosA
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
table.insert( vCmd, { 12, 0})
dTPosI = dTPosA
EMC.YDELTA = dYDeltaF
@@ -1875,7 +1902,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dVPosA = dTPosI + dVDeltaI - dTotMove
dTPosA = dTPosI - dTotMove
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
table.insert( vCmd, { 12, 0})
-- aggiorno nuova posizione della morsa al carico dopo riposizionamento
@@ -1903,12 +1930,12 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 21, dYDeltaF, dVDeltaF})
elseif EMC.YDELTANEXT then
table.insert( vCmd, { 21, dYDeltaF, 0})
else
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 11, 0})
-- sposto il carrello Y in parcheggio
table.insert( vCmd, { 1, 'Y', ParkY})
@@ -1959,13 +1986,12 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
-- recupero una corsa massima e l'altra solo di quello che serve
elseif abs( dVDeltaI - dVDeltaF) > dMaxMovePilgrimStepSingleClampV then
-- aggiorno nuova posizione della morsa al carico dopo riposizionamento
local dTotMove = MaxY - dTPosI - dYDeltaI
dVDeltaI = dVDeltaF
dYPosA = MaxY
dTPosA = dTPosI + dTotMove
dTPosA = dTPosI + ( MaxY - dYPosI)
dVPosA = dVDeltaF + dTPosA
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 11, 0})
dTPosI = dTPosA
EMC.YDELTA = dYDeltaI
@@ -1982,7 +2008,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dVPosA = dTPosI + dVDeltaI - dTotMove
dTPosA = dTPosI + dTotMove
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
table.insert( vCmd, { 12, 1})
table.insert( vCmd, { 12, CalcCharStatus( 'V', dVDeltaF)})
table.insert( vCmd, { 11, 0})
-- aggiorno nuova posizione della morsa allo scarico dopo riposizionamento
@@ -2008,22 +2034,12 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
dYDeltaI = dYDeltaF
end
-- sistemo apertura morse
if EMC.YDELTANEXT then
table.insert( vCmd, { 11, 1})
end
if not EMC.VDELTANEXT then
table.insert( vCmd, { 12, 0})
-- sposto il carrello Y in parcheggio
table.insert( vCmd, { 1, 'V', ParkV})
end
-- imposto i nuovi parametri di aggancio
if EMC.YDELTANEXT and EMC.VDELTANEXT then
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
table.insert( vCmd, { 21, dYDeltaF, dVDeltaF})
elseif EMC.YDELTANEXT then
table.insert( vCmd, { 11, 1})
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
-- sposto il carrello Y in parcheggio
table.insert( vCmd, { 12, 0})
table.insert( vCmd, { 1, 'V', ParkV})
@@ -2278,17 +2294,6 @@ function SpecAdjustCarriagesOLD( dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, d
end
end
---------------------------------------------------------------------
local function CalcCharStatus( sType, dDelta)
-- se per carrello Y
if sType == 'Y' then
return EgtIf( EMC.LB - dDelta < LenToPress, 1, 2)
-- altrimenti per carrello V
else
return EgtIf( dDelta < LenToPress, 1, 2)
end
end
---------------------------------------------------------------------
local function GetCorseDisp( dCorsaYfc, dCorsaVfc, dDistN, sSide)
local dRecTotn = min( dDistN, dCorsaYfc+ dCorsaVfc) -- recupero possibile al netto di dCorsa..TrA)
+38
View File
@@ -1,5 +1,43 @@
==== Common_FAST Update Log ====
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.
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_FAST', -- nome script PP standard
VERSION = '2.6i4', -- versione script
VERSION = '2.6j10', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}