Compare commits

...

3 Commits

Author SHA1 Message Date
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
6 changed files with 107 additions and 58 deletions
+9 -4
View File
@@ -617,10 +617,6 @@ function OnRapid()
EMT.ZMAX = true EMT.ZMAX = true
end end
end end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento -- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z') local MyZHome = EgtGetAxisHomePos( 'Z')
@@ -631,6 +627,13 @@ function OnRapid()
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) .. ' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES ' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove) 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 end
-- ricavo i dati per la lavorazione -- ricavo i dati per la lavorazione
@@ -646,6 +649,8 @@ function OnRapid()
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end end
EmtResetPrev() EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima -- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
+10 -4
View File
@@ -646,10 +646,7 @@ function OnRapid()
EMT.PREVTOOL = EMT.TOOL EMT.PREVTOOL = EMT.TOOL
end end
end end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento -- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z') local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
@@ -659,6 +656,13 @@ function OnRapid()
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) .. ' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES ' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove) 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 end
-- ricavo i dati per la lavorazione -- ricavo i dati per la lavorazione
@@ -674,6 +678,8 @@ function OnRapid()
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end end
EmtResetPrev() EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima -- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
+41 -18
View File
@@ -206,19 +206,12 @@ function OnDispositionEnd()
local HTrave = EMT.HT local HTrave = EMT.HT
local STrave = EMT.ST local STrave = EMT.ST
local HOverM = EMT.HOVM local HOverM = EMT.HOVM
-- calcolo dati pinze -- calcolo dati pinze
local MinAccPinze = 0.3 local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze( HTrave, STrave, LBarra)
local MaxAccPinze = 4 local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave)
local KgMtCubo= 550 -- densità legno in Kg / metro cubo local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze( HTrave, STrave, LTrave)
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
if IdTrave >= 0 then if IdTrave >= 0 then
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)' local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) .. local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) ..
@@ -247,7 +240,8 @@ function OnDispositionEnd()
-- se carico barra -- se carico barra
if EMT.LOAD or EMT.RELOAD then if EMT.LOAD or EMT.RELOAD then
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) .. 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 if EMT.LOAD then
ParkLine( sOut) ParkLine( sOut)
SetStartValue( 1, LBarra) SetStartValue( 1, LBarra)
@@ -261,7 +255,8 @@ function OnDispositionEnd()
-- altrimenti recupero rimanenza -- altrimenti recupero rimanenza
else else
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) .. 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( sOut)
EmtOutput( 'M112'..' P1='..EmtLenToString( LoadT, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp()) 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 -- aggiorno dati aggancio carrelli alla trave
@@ -643,10 +638,6 @@ function OnRapid()
EmitZmax() EmitZmax()
end end
end end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']')
EmtOutput( '( * ' .. sOut .. ' * )')
end
-- primo posizionamento -- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z') local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
@@ -657,7 +648,15 @@ function OnRapid()
' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) .. ' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end 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 -- 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' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
@@ -665,6 +664,8 @@ function OnRapid()
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end end
-- resetto valori precedenti -- resetto valori precedenti
EmtResetPrev() EmtResetPrev()
@@ -975,6 +976,28 @@ function OnArc()
EmtUpdatePrev() EmtUpdatePrev()
end 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) function CalcCharStatus( sCmd, bSkipPress)
-- aperto -- aperto
+41 -31
View File
@@ -671,35 +671,8 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnSimulPathEnd() function OnSimulPathEnd()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi -- rimozione eventuali sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then ExecRemoveScraps()
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 end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -788,8 +761,12 @@ function OnSimulMoveStart()
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
--function OnSimulMoveEnd() function OnSimulMoveEnd()
--end if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnSimulCollision() function OnSimulCollision()
@@ -893,6 +870,39 @@ function ExecAuxCmd( sCmd)
end end
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() function ExecUnloading()
if EMT.VMILL and #EMT.VMILL > 0 then if EMT.VMILL and #EMT.VMILL > 0 then
+5
View File
@@ -1,5 +1,10 @@
==== Common_FAST Update Log ==== ==== Common_FAST Update Log ====
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) 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 - (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' - (SIM) Nelle funzioni movimentaizone assi, utilizzate costanti 'MCH_SIM_STEP'
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = { local InfoCommon_STD_PP = {
NAME = 'Common-FAST', -- nome script PP standard NAME = 'Common-FAST', -- nome script PP standard
VERSION = '2.6c4', -- versione script VERSION = '2.6c5', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
} }