Compare commits

..

13 Commits

Author SHA1 Message Date
andrea.villa f958adc7d9 Merge branch 'develop' 2024-03-12 13:14:52 +01:00
andrea.villa 6ba7cb4829 - 'EgtVolZmapSetShowEdges' per settare flag visualizzazione spigoli
- Corretto problema di movimento pinze assieme a discesa asse Z
2024-03-12 13:14:41 +01:00
andrea.villa c52e303318 Merge branch 'main' into develop 2024-03-04 10:47:30 +01:00
andrea.villa 989475b17e Merge branch 'develop' 2024-03-04 10:47:23 +01:00
andrea.villa e4e029375f Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina 2024-03-04 10:47:00 +01:00
andrea.villa b39903565a Merge branch 'main' into develop 2024-02-29 08:31:40 +01:00
andrea.villa 6f61a8af5f Merge branch 'develop' 2024-02-29 08:31:32 +01:00
andrea.villa 829db46d77 - Aggiunto comando di wait fine M101/G101
- Gestione accelerazioni pinze in M115
- Rimozione VMILL per tagli a cubetti a zig-zag
2024-02-29 08:31:19 +01:00
andrea.villa 4f82ac6775 Merge branch 'main' into develop 2024-02-27 14:48:56 +01:00
andrea.villa 40af75d2ad - Aggiunto parametro 'SafeXRotAxes' in MLDE per ruotare motosega in zona sicura
- In simulazione utilizzate costanti 'MCH_SIM_STEP'
2024-02-27 14:48:28 +01:00
luca.mazzoleni 7f1b58136b Merge branch 'develop' 2024-02-23 16:56:52 +01:00
luca.mazzoleni 9381a03912 - eliminato readme
- sistemato ordine updatelog
2024-02-23 16:56:36 +01:00
andrea.villa 6053be6d93 Merge branch 'main' into develop 2024-02-23 12:09:57 +01:00
7 changed files with 272 additions and 118 deletions
+44 -8
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -490,6 +490,7 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
end
---------------------------------------------------------------------
@@ -499,6 +500,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -609,25 +615,55 @@ function OnRapid()
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
EMT.ZMAX = true
bHeadFirst = false
end
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- ricavo i dati per la lavorazione
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' EH1'
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
local MyZPos = EMT.L3
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'G101' .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( MyZPos, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
-- faccio backup dati in caso mi servano per lavorazione successiva
EMT.PREVsEE = sEE ; EMT.PREVsEL = sEL ; EMT.PREVsER = sER ; EMT.PREVsET = sET ; EMT.PREVsES = sES
if EMT.LOAD or bHeadFirst then
sOut = sOut..' L0=0'
EmtOutput( sOut)
+44 -8
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -517,6 +517,7 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVR3 = EMT.R3
end
@@ -527,6 +528,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -638,25 +644,55 @@ function OnRapid()
EmitZmax( EMT.TOOL ~= EMT.PREVTOOL)
EMT.ZMAX = true
EMT.PREVTOOL = EMT.TOOL
bHeadFirst = false
end
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- ricavo i dati per la lavorazione
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' EH1'
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
local MyZPos = EMT.L3
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'G101' .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( MyZPos, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
-- faccio backup dati in caso mi servano per lavorazione successiva
EMT.PREVsEE = sEE ; EMT.PREVsEL = sEL ; EMT.PREVsER = sER ; EMT.PREVsET = sET ; EMT.PREVsES = sES
if EMT.LOAD or bHeadFirst then
sOut = sOut .. ' L0=0'
if EMT.LOAD or #EMT.AUXSTR > 0 then
+74 -21
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -206,19 +206,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 +240,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 +255,8 @@ function OnDispositionEnd()
-- altrimenti recupero rimanenza
else
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) ..
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2)
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2) ..
' P7=' .. EgtNumToString( TempAccPinze, 2) .. ' P8=' .. EgtNumToString( TempAccPinz2, 2) .. ' P9=' .. EgtNumToString( TempAccPinz1, 2)
EmtOutput( sOut)
EmtOutput( 'M112'..' P1='..EmtLenToString( LoadT, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
@@ -511,6 +506,8 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVS = EMT.S
end
---------------------------------------------------------------------
@@ -521,6 +518,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -634,22 +636,49 @@ function OnRapid()
if not ( EMT.LOAD or EMT.RELOAD) then
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
bHeadFirst = false
end
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2pp, 3) .. ' P5=' .. EgtNumToString( EMT.R1pp, 3) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']')
EmtOutput( '( * ' .. sOut .. ' * )')
end
-- primo posizionamento
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
-- resetto valori precedenti
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
local MyZPos = EMT.L3
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( MyZPos, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' P12=1'
end
if EMT.LOAD then
ParkLine( sOut)
else
@@ -948,6 +977,28 @@ function OnArc()
EmtUpdatePrev()
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc)
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
@@ -1613,6 +1664,8 @@ function AdjustTcPos( bLen3)
sPos = '0' .. sPos
end
end
-- salvo posizione
EMT.PREVTCPOS = sPos
return sPos
end
+84 -71
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')
@@ -533,39 +533,40 @@ function OnSimulToolDeselect()
-- se sega a catena o rinvio o punta lunga o utensile di grosso diametro, devo cambiare
if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then
EgtOutText( 'Tool change in progress...')
local RapSimStep = 4 * EMT.SIMSTEP
local RapSimRotStep = RapSimStep / 10
local CollSimRotStep = min( RapSimRotStep, 5)
-- movimento scarico sega a catena
if EMT.HEAD == 'H3' then
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.HB > BeamHeightForFixRot then
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
end
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), CollSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), CollSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico rinvio
elseif EMT.HEAD == 'H5' then
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', -90, CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico punta lunga su T111
elseif EMT.TOTLEN > LONG_TOOL_MINLEN then
-- se su cambio utensile T111
if EMT.TCPOS == 'T111' then
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', 0, CollSimRotStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', 0, MCH_SIM_STEP.COLLROT)
-- altrimenti posizioni standard rastrelliera
else
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 90, CollSimRotStep, 'C', -90, CollSimRotStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
end
-- movimento scarico utensile di grosso diametro (su T111)
else
local dPosB = EgtGetAxisPos( 'B')
local dNewB = EgtIf( dPosB < 0, -90, 90)
SimulMoveAxes( 'B', dNewB, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', dNewB, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
end
-- breve pausa
EgtPause( 100)
@@ -574,9 +575,9 @@ function OnSimulToolDeselect()
ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' then
SimulMoveAxes( 'B', 90, RapSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, RapSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
end
-- se segue lama, carico utensile di default
if EMT.NEXTHEAD == 'H2' then
@@ -592,12 +593,9 @@ function OnSimulToolDeselect()
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
local RapSimStep = 4 * EMT.SIMSTEP
local RapSimRotStep = RapSimStep / 10
local CollSimRotStep = min( RapSimRotStep, 10)
-- simulo movimento
SimulMoveAxes( 'B', 90, CollSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- breve pausa
EgtPause( 100)
ShowToolInTcPos( EMT.TCPOS_1, true)
@@ -608,7 +606,7 @@ function OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
end
-- eseguo movimento opportuno
SimulMoveAxes( 'B', 0, RapSimRotStep, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
-- se altrimenti lama su cambio utensile
elseif EMT.NEXTHEAD == 'H1' and SpecialBH and EMT.NEXTTCPOS == 'T111' then
-- se non lama, nascondo l'utensile corrente
@@ -616,7 +614,7 @@ function OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
end
-- eseguo movimento opportuno
SimulMoveAxes( 'B', -90, RapSimRotStep, 'C', 0, RapSimRotStep)
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.RAPROT, 'C', 0, MCH_SIM_STEP.RAPROT)
end
else
EMT.TOOL_1 = nil
@@ -673,35 +671,8 @@ end
---------------------------------------------------------------------
function OnSimulPathEnd()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
EgtOutLog( 'OnSimulPathEnd', 5)
local vMillId = EMT.VMILL[1]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
-- aggiorno visualizzazione
EgtDraw()
end
end
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
---------------------------------------------------------------------
@@ -779,17 +750,23 @@ function OnSimulMoveStart()
EgtOutText( '')
EMT.MCHFIRST = false
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot then
local RapSimStep = 4 * EMT.SIMSTEP
SimulMoveAxes( 'C', EMT.R1, RapSimStep/10, 'B', EMT.R2, RapSimStep/10)
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare
if EMT.HEAD == 'H3'then
SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
EMT.POSTROT = nil
end
end
---------------------------------------------------------------------
--function OnSimulMoveEnd()
--end
function OnSimulMoveEnd()
if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
end
---------------------------------------------------------------------
function OnSimulCollision()
@@ -814,7 +791,6 @@ end
---------------------------------------------------------------------
function ExecAuxCmd( sCmd)
local RapSimStep = 4 * EMT.SIMSTEP
local Cmd = EgtSplitString( sCmd)
if Cmd[1] == '0' then
if Cmd[2] == 'Unloading' then
@@ -824,7 +800,7 @@ function ExecAuxCmd( sCmd)
end
EgtOutText( EgtIf( Cmd[3], Cmd[3], Cmd[2]))
elseif Cmd[1] == '1' then
if not SimulMoveAxis( Cmd[2], tonumber( Cmd[3]), RapSimStep) then
if not SimulMoveAxis( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID) then
if VerifyYVStroke( Cmd[2], tonumber( Cmd[3])) == nil then
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
end
@@ -838,8 +814,8 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrello con trave agganciata
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
-- Eseguo il movimento
local _, bOk, bOk2 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), RapSimStep,
Cmd[4], tonumber( Cmd[5]), RapSimStep)
local _, bOk, bOk2 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID)
if not ( bOk and bOk2) then
local nI = EgtIf( not bOk, 2, 4)
if VerifyYVStroke( Cmd[nI], tonumber( Cmd[nI+1])) == nil then
@@ -850,9 +826,9 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrelli con trave agganciata
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
-- Eseguo il movimento
local _, bOk, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), RapSimStep,
Cmd[4], tonumber( Cmd[5]), RapSimStep,
Cmd[6], tonumber( Cmd[7]), RapSimStep)
local _, bOk, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
Cmd[6], tonumber( Cmd[7]), MCH_SIM_STEP.RAPID)
if not ( bOk and bOk2 and bOk3) then
local nI = EgtIf( not bOk, 2, EgtIf( not bOk2, 4, 6))
if VerifyYVStroke( Cmd[nI], tonumber( Cmd[nI+1])) == nil then
@@ -864,14 +840,14 @@ function ExecAuxCmd( sCmd)
if Cmd[2] ~= '0' then
dPY = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
end
SimulMoveAxis( 'PY', dPY, RapSimStep)
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
SetPYLight( Cmd[2] ~= '0')
elseif Cmd[1] == '12' then
local dPV = MaxOpen
if Cmd[2] ~= '0' then
dPV = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
end
SimulMoveAxis( 'PV', dPV, RapSimStep)
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( Cmd[2] ~= '0')
elseif Cmd[1] == '21' then
local nYDelta = tonumber( Cmd[2])
@@ -894,6 +870,39 @@ function ExecAuxCmd( sCmd)
end
end
---------------------------------------------------------------------
function ExecRemoveScraps()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
EgtOutLog( 'OnSimulPathEnd', 5)
local vMillId = EMT.VMILL[1]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
-- aggiorno visualizzazione
EgtDraw()
end
end
end
---------------------------------------------------------------------
function ExecUnloading()
if EMT.VMILL and #EMT.VMILL > 0 then
@@ -914,10 +923,14 @@ function ExecUnloading()
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
View File
+25 -9
View File
@@ -1,15 +1,31 @@
==== Common_FAST Update Log ====
Versione 2.6c1 (23/02/2024)
- (ALL) Prima versione post-proc comune FAST e FASTrl
- (ALL) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (ALL) In BeamData aggiunto flag per direzione carico RIGHT_LOAD
- (ALL) Aggiornamento 'Compile.bat' con nuovi nomi file
Versione 2.6c7 (12/03/2024)
- (SIM) A fine simulazione non si creano gli spigoli ma si setta solo flag per visualizzazione tramite "EgtVolZmapSetShowEdges"
- (GEN) Corretto problema di movimento pinze assieme a discesa asse Z (Ticket #1710)
Versione 2.6c2 (23/02/2024)
- (ALL) Rimossa chiamata funzione EgtGetSourceDir
Versione 2.6c6 (04/03/2024)
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
Versione 2.6c5 (29/02/2024)
- (GEN) Aggiunto comando di wait fine M101/G101 in caso di movimento in zona sicurezza per motosega
- (GEN) Gestione accelerazioni pinze in M115 ( solo per TPA)
- (SIM) Gestione rimozione VMILL per tagli a cubetti a zig-zag
Versione 2.6c4 (27/02/2024)
- (MLDE-SIM-GEN) Con pezzi molto alti '> BeamHeightForFixRot', aggiunto parametro 'SafeXRotAxes' per ruotare motosega in zona sicura lontano dal pezzo
- (SIM) Nelle funzioni movimentaizone assi, utilizzate costanti 'MCH_SIM_STEP'
Versione 2.6c3 (23/02/2024)
- (SIM) Corretta lettura parametro RIGHT_LOAD
- (ALL) Rimossa chiamata funzione EgtGetSourceDir rimasta in MLPE
- (SIM-GEN) Rimossa chiamata funzione EgtGetSourceDir rimasta in MLPE
Versione 2.6c2 (23/02/2024)
- (SIM-GEN) Rimossa chiamata funzione EgtGetSourceDir
Versione 2.6c1 (23/02/2024)
- (SIM-GEN) Prima versione post-proc comune FAST e FASTrl
- (SIM-GEN) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (SIM-GEN) In BeamData aggiunto flag per direzione carico RIGHT_LOAD
- (SIM-GEN) Aggiornamento 'Compile.bat' con nuovi nomi file
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common-FAST', -- nome script PP standard
VERSION = '2.6c3', -- versione script
VERSION = '2.6c7', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}