Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fbfe8187b9 | |||
| 3ef4c18fe6 | |||
| b50c4ef806 | |||
| 7a7981fddb | |||
| 74a0bc4a43 | |||
| 4cc2e5a2d7 |
+19
-4
@@ -627,7 +627,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 +649,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
|
||||
@@ -836,9 +836,24 @@ function OnRapid()
|
||||
-- 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")
|
||||
|
||||
@@ -668,7 +668,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 +713,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
|
||||
@@ -910,9 +910,24 @@ function OnRapid()
|
||||
-- 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")
|
||||
|
||||
+15
-4
@@ -647,7 +647,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 +663,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) ..
|
||||
@@ -852,9 +852,20 @@ function OnRapid()
|
||||
-- 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")
|
||||
|
||||
+4
-1
@@ -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
|
||||
|
||||
+85
-1
@@ -1111,7 +1111,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
|
||||
EgtOutLog( ' *[L2]', 1)
|
||||
end
|
||||
else
|
||||
-- si pinza sempre a 1000mm massimo
|
||||
-- altrimenti si pinza sempre a massimo 1000mm
|
||||
dNewYDelta = min( dNewYDelta, 1000)
|
||||
end
|
||||
|
||||
@@ -1492,6 +1492,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDeltaF, bFixedDelta, bFixedPos)
|
||||
local dYPosA, dVPosA, dTPosA
|
||||
local dGainOnReclamping = BD.GAIN_RECLAMPING or 1000
|
||||
|
||||
-- se primo scambio
|
||||
local MyMinY = EgtIf( EMC.CNT == 1, MinY + AGG_LOAD, MinY)
|
||||
@@ -1568,6 +1569,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
||||
dVPosI = dVPosA
|
||||
table.insert( vCmd, { 11, 1})
|
||||
end
|
||||
|
||||
-- se spostando morsa diretto esco dalle corse, calcolo di quanto devo muovere la trave (cioè l'altra morsa) come minimo
|
||||
-- se non era ingaggiata, vado al suo minimo
|
||||
if not EMC.VDELTA then
|
||||
@@ -1580,6 +1582,27 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
||||
dBeamMove = dVPosI + ( dVDeltaF - dVDeltaI) - MaxV
|
||||
end
|
||||
|
||||
-- se serve un grande spostamento e si sta pinzando poco. Y trascinatore pinza poco e V si sposta per prima per recuperare
|
||||
if not BD.FASTCLAMPING and abs( dBeamMove) > 2000 and dDeltaBeam < 0 and EMC.LB - dYDeltaI < max( 550, (MinJoin * 2)) then
|
||||
table.insert( vCmd, { 12, 0})
|
||||
dVPosA = dVPosI - dGainOnReclamping
|
||||
-- sposto il carrello V di 1000mm
|
||||
table.insert( vCmd, { 1, 'V', dVPosA})
|
||||
table.insert( vCmd, { 12, 1})
|
||||
-- apro morsa Y e recupero i 1000mm
|
||||
table.insert( vCmd, { 11, 0})
|
||||
dVPosA = dVPosI
|
||||
dYPosA = dYPosI
|
||||
dTPosA = dTPosI + dGainOnReclamping
|
||||
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
||||
dTPosI = dTPosA
|
||||
dVPosI = dVPosA
|
||||
dVDeltaI = dVDeltaI - dGainOnReclamping
|
||||
dYDeltaI = dYDeltaI - dGainOnReclamping
|
||||
table.insert( vCmd, { 11, 1})
|
||||
dBeamMove = dBeamMove + dGainOnReclamping
|
||||
end
|
||||
|
||||
table.insert( vCmd, { 12, 0})
|
||||
|
||||
dTPosA = dTPosI - dBeamMove
|
||||
@@ -1667,6 +1690,27 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
||||
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
|
||||
if not BD.FASTCLAMPING and abs( dBeamMove) > 2000 and dDeltaBeam > 0 and dVDeltaI < max( 550, (MinJoin * 2)) then
|
||||
table.insert( vCmd, { 11, 0})
|
||||
dYPosA = dYPosI + dGainOnReclamping
|
||||
-- sposto il carrello V di 1000mm
|
||||
table.insert( vCmd, { 1, 'Y', dYPosA})
|
||||
table.insert( vCmd, { 11, 1})
|
||||
-- apro morsa Y e recupero i 1000mm
|
||||
table.insert( vCmd, { 12, 0})
|
||||
dVPosA = dVPosI
|
||||
dYPosA = dYPosI
|
||||
dTPosA = dTPosI - dGainOnReclamping
|
||||
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
||||
dTPosI = dTPosA
|
||||
dVPosI = dVPosA
|
||||
dVDeltaI = dVDeltaI + dGainOnReclamping
|
||||
dYDeltaI = dYDeltaI + dGainOnReclamping
|
||||
table.insert( vCmd, { 12, 1})
|
||||
dBeamMove = dBeamMove - dGainOnReclamping
|
||||
end
|
||||
|
||||
table.insert( vCmd, { 11, 0})
|
||||
|
||||
dTPosA = dTPosI + dBeamMove
|
||||
@@ -1768,6 +1812,26 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
||||
-- Il trascinatore si decide in base alla direzione di movimento trave
|
||||
-- trascino con morsa allo scarico. Obiettivo mandare Y in posizione per prima
|
||||
if dDeltaBeam > 0 then
|
||||
-- se serve un grande spostamento e si sta pinzando poco. Y trascinatore pinza poco e V si sposta per prima per recuperare
|
||||
if not BD.FASTCLAMPING and abs( dDeltaBeam) > 2000 and dVDeltaI < max( 550, (MinJoin * 2)) then
|
||||
table.insert( vCmd, { 11, 0})
|
||||
dYPosA = dYPosI + dGainOnReclamping
|
||||
-- sposto il carrello V di 1000mm
|
||||
table.insert( vCmd, { 1, 'Y', dYPosA})
|
||||
table.insert( vCmd, { 11, 1})
|
||||
-- apro morsa Y e recupero i 1000mm
|
||||
table.insert( vCmd, { 12, 0})
|
||||
dVPosA = dVPosI
|
||||
dYPosA = dYPosI
|
||||
dTPosA = dTPosI - dGainOnReclamping
|
||||
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
||||
dTPosI = dTPosA
|
||||
dVPosI = dVPosA
|
||||
dVDeltaI = dVDeltaI + dGainOnReclamping
|
||||
dYDeltaI = dYDeltaI + dGainOnReclamping
|
||||
table.insert( vCmd, { 12, 1})
|
||||
end
|
||||
|
||||
-- apro morsa al carico
|
||||
table.insert( vCmd, { 11, 0})
|
||||
-- devo recuperare più delle corse disponibili di entrambi i carrelli
|
||||
@@ -1853,6 +1917,26 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
||||
end
|
||||
-- trave si muove dallo scarico verso il carico. Obiettivo mandare V in posizione per prima
|
||||
else
|
||||
-- se serve un grande spostamento e si sta pinzando poco. Y trascinatore pinza poco e V si sposta per prima per recuperare
|
||||
if not BD.FASTCLAMPING and abs( dDeltaBeam) > 2000 and EMC.LB - dYDeltaI < max( 550, (MinJoin * 2)) then
|
||||
table.insert( vCmd, { 12, 0})
|
||||
dVPosA = dVPosI - dGainOnReclamping
|
||||
-- sposto il carrello V di 1000mm
|
||||
table.insert( vCmd, { 1, 'V', dVPosA})
|
||||
table.insert( vCmd, { 12, 1})
|
||||
-- apro morsa Y e recupero i 1000mm
|
||||
table.insert( vCmd, { 11, 0})
|
||||
dVPosA = dVPosI
|
||||
dYPosA = dYPosI
|
||||
dTPosA = dTPosI + dGainOnReclamping
|
||||
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
||||
dTPosI = dTPosA
|
||||
dVPosI = dVPosA
|
||||
dVDeltaI = dVDeltaI - dGainOnReclamping
|
||||
dYDeltaI = dYDeltaI - dGainOnReclamping
|
||||
table.insert( vCmd, { 11, 1})
|
||||
end
|
||||
|
||||
-- apro morsa allo scarico
|
||||
table.insert( vCmd, { 12, 0})
|
||||
-- devo recuperare più del doppio delle corse
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
==== Common_FAST Update Log ====
|
||||
|
||||
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.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_FAST', -- nome script PP standard
|
||||
VERSION = '2.6i3', -- versione script
|
||||
VERSION = '2.6i5', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user