Allineamento con Common ver. 2.6k1

This commit is contained in:
andrea.villa
2024-11-04 09:16:16 +01:00
parent 4048d52280
commit 2c984eb276
6 changed files with 187 additions and 47 deletions
+111 -27
View File
@@ -166,7 +166,7 @@ function OnDispositionStart()
' P15='..EmtLenToString( -DeltaTabY, 2)..' P16='..EmtLenToString( DeltaTabZ - MillOffs, 2)..
' P17='..EmtLenToString( Delta2TabY, 2)..' P18='..EmtLenToString( -Delta2TabZ - Mill2Offs, 2)
-- se è in configurazione a 3 teste
if IsHeadExisting( 3) then
if IsHeadExisting( 3) then
sOut = sOut .. ' P19='..EmtLenToString( -Delta3TabY, 2)..' P20='..EmtLenToString( Delta3TabZ - Mill3Offs, 2)..
' P21='..EmtLenToString( Mill3Offs, 2).. ' P22='.. EmtLenToString( -ParkInLavZ2, 2)
else
@@ -887,13 +887,40 @@ function OnRapid()
end
-- eseguo movimenti
local Speed = EMT.S
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
-- se gruppo lama dedicato, senza cambio utensile
elseif EgtGetHeadId( 'H38') then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
EmitMoveDataHead( 3, { X=SafeX3RotAxis, S=Speed})
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 3, { X=EMT.L2, S=Speed})
end
-- muovo in posizione finale
EmitMoveDataHead( 3, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- aspetto esecuzione movimento testa 3
EmitMoveWaitHead( 3)
-- errore, testa non gestita
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
-- dati aggancio a trave
local BhData = { T=EMT.L1, SetHead=0}
@@ -1193,20 +1220,43 @@ function OnRapid()
local HomeC3 = EgtGetAxisHomePos( 'C3')
local HomeB3 = EgtGetAxisHomePos( 'B3')
local Speed = EMT.S
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local CurrB3 = PrevR2
local CurrC3 = PrevR1
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, B=CurrB3, C=CurrC3, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, S=Speed})
end
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local CurrB3 = PrevR2
local CurrC3 = PrevR1
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, B=CurrB3, C=CurrC3, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=MyMaxZ3, S=Speed})
end
EmitMoveDataHead( 3, { Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmitMoveDataHead( 3, { Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmitMoveDataHead( 3, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
end
-- se gruppo lama dedicato, senza cambio utensile
elseif EgtGetHeadId( 'H38') then
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
EmitMoveDataHead( 3, { X=SafeX3RotAxis, S=Speed})
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, S=Speed})
EmitMoveDataHead( 3, { B=EMT.R2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 3, { Z=EMT.L3, S=Speed})
EmitMoveDataHead( 3, { X=EMT.L2, S=Speed})
end
end
-- muovo in posizione finale
EmitMoveDataHead( 3, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
else
EmtSetLastError( 1212, "HEAD not managed")
end
EmitMoveStartHead( 3)
-- eventuale preselezione successiva testa 2
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
@@ -2454,11 +2504,36 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome, bUsePrev
local dMaxZ3 = EgtGetAxisMax( 'Z3')
local dHomeX3 = EgtGetAxisHomePos( 'X3')
local dHomeB3 = EgtGetAxisHomePos( 'B3')
-- eseguo la salita a Z3max
EmitMoveDataHead( 3, { Z=dMaxZ3, Fmt=1})
if bTopGoHome then
EmitMoveDataHead( 3, { X=-dHomeX3, B=dHomeB3, Fmt=1})
-- se è macchina a 3 teste con gruppo truciolatore 4 assi
if EgtGetHeadId( 'H39') then
-- eseguo la salita a Z3max
EmitMoveDataHead( 3, { Z=dMaxZ3, Fmt=1})
if bTopGoHome then
EmitMoveDataHead( 3, { X=-dHomeX3, B=dHomeB3, Fmt=1})
end
-- se gruppo lama dedicato, senza cambio utensile
elseif EgtGetHeadId( 'H38') then
local dHomeC3 = EgtGetAxisHomePos( 'C3')
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, dHomeC3, dHomeB3) then
local dPosT = EgtIf( bEnd, EMT.L1o, EMT.TPOS or EMT.L1op)
EmitParkRoller( dPosT, bSplitCut)
end
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( dHomeC3 - PrevR1) > 1 or abs( dHomeB3 - PrevR2) > 1 then
EmitMoveDataHead( 3, { X=SafeX3RotAxis, Fmt=1})
EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, Fmt=1})
EmitMoveDataHead( 3, { B=dHomeB3, C=dHomeC3, Fmt=1})
end
-- eseguo la salita a Z3max
EmitMoveDataHead( 3, { Z=dMaxZ3, Fmt=1})
if bTopGoHome then
EmitMoveDataHead( 3, { X=-dHomeX3, Fmt=1})
end
else
EmtSetLastError( 1212, "HEAD not managed")
end
EmitMoveStartHead( 3)
EmitMoveWaitHead( 3)
end
@@ -2683,8 +2758,10 @@ function PreselectNextDiffHead( nMchId, sHead)
else
-- se preselezione testa 1
if nNextHSet == 1 then
-- TC su montante destro
if nPrevTc == 1 then return
local nNextTc = GetTcForTopHeadTool( sNextTcPos) -- utensile da caricare
local nPrevTc = GetTcForTopHeadTool( EMT.PREVTCPOS_H1) -- utensile da depositare
-- se devo lasciare o prelevare da TC1 oppure non so cosa c'è montato, non posso preselezionare
if nNextTc == 1 or nPrevTc == 1 or nPrevTc == 0 then return
-- TC su montante sinistro
else
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 200) then return end
@@ -2704,8 +2781,15 @@ function PreselectNextDiffHead( nMchId, sHead)
-- faccio preselezione ( se sono arrivato qui, vuol dire che posso preselezionare)
if nNextHSet == 1 then
-- Recupero quota X1 (nostro L2)
local dNextX = GetStartMachiningXaxis( nNextMchId)
local dNextX
-- se sto lavorando con testa 3, la testa 1 deve restare in home
if nHSet == 3 then
dNextX = EgtGetAxisHomePos( 'X1')
-- altrimenti recupero quota X1 (nostro L2)
else
dNextX = GetStartMachiningXaxis( nNextMchId)
end
-- Emetto preselezione
if sNextHead == 'H11' then
if dNextTotLen < LongTool then
+55 -13
View File
@@ -753,7 +753,7 @@ function OnSimulMachiningStart()
elseif EgtGetHeadId( 'H38') then
sHeadName = 'H38'
else
sHeadName = 'H31'
EmtSetLastError( 1212, "HEAD not managed")
end
AddToolToCollisionObj( nil, sHeadName, nPrevExit_H3, 1001)
AddToolHolderToCollisionObj( nil, sHeadName, nPrevExit_H3, 1002)
@@ -1058,8 +1058,35 @@ function OnSimulMoveStart()
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- altrimenti testa 3
else
; -- non devo fare alcunchè di speciale
else
-- testa 4 assi dedicata truciolatore
if EgtGetHeadId( 'H39') then
if EMT.ZMAX then
local MaxZ3 = EgtGetAxisMax( 'Z3')
SimulMoveAxes( 'X3', EMT.L2, MCH_SIM_STEP.RAPID, 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
-- testa 5 assi dedicata lama
elseif EgtGetHeadId( 'H38') then
if EMT.ZMAX then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X3', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
-- si muovono tutti gli assi assieme
-- altre configurazioni
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
end
-- se lavorazione split, muovo per riaggancio del carro Y1
@@ -1426,15 +1453,15 @@ function ExecMoveZmax( bMchSplit)
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
-- posizioni correnti degli assi testa
local CurrX = EgtGetAxisPos( EgtIf( nSetHead == 1, 'X1', 'X2'))
local CurrZ = EgtGetAxisPos( EgtIf( nSetHead == 1, 'Z1', 'Z2'))
local CurrC = EgtGetAxisPos( EgtIf( nSetHead == 1, 'C1', 'C2'))
local CurrB = EgtGetAxisPos( EgtIf( nSetHead == 1, 'B1', 'B2'))
local CurrX = EgtGetAxisPos( 'X'..nSetHead)
local CurrZ = EgtGetAxisPos( 'Z'..nSetHead)
local CurrC = EgtGetAxisPos( 'C'..nSetHead)
local CurrB = EgtGetAxisPos( 'B'..nSetHead)
-- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'X1', 'X2'))
local HomeZ = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'Z1', 'Z2'))
local HomeC = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'C1', 'C2'))
local HomeB = EgtGetAxisHomePos( EgtIf( nSetHead == 1, 'B1', 'B2'))
local HomeX = EgtGetAxisHomePos( 'X'..nSetHead)
local HomeZ = EgtGetAxisHomePos( 'Z'..nSetHead)
local HomeC = EgtGetAxisHomePos( 'C'..nSetHead)
local HomeB = EgtGetAxisHomePos( 'B'..nSetHead)
-- verifico se necessario ruotare la testa
local bRot = ( abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1)
-- se necessario ruotare la testa, allargo i carrelli
@@ -1497,8 +1524,21 @@ function ExecMoveZmax( bMchSplit)
end
-- altrimenti testa 3
else
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', ParkB3, MCH_SIM_STEP.COLLROT)
if EgtGetHeadId( 'H39') then
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', ParkB3, MCH_SIM_STEP.COLLROT)
elseif EgtGetHeadId( 'H38') then
local MyMaxZ3 = EgtGetAxisMax( 'Z3')
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1 then
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'C3', HomeC, MCH_SIM_STEP.COLLROT, 'B3', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z3', MyMaxZ3, MCH_SIM_STEP.RAPID)
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
EMT.ZMAX = true
end
@@ -2521,6 +2561,8 @@ function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2)
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
elseif sHead == 'H21' or sHead == 'H22' then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
elseif sHead == 'H38' then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
end
end
+14 -3
View File
@@ -54,6 +54,9 @@ function OnSpecialGetMaxZ()
elseif nSetHead == 2 then
EMC.R1p = ParkC2
EMC.R2p = ParkB2
elseif nSetHead == 3 then
EMC.R1p = ParkC3
EMC.R2p = ParkB3
end
end
local vtT = Vector3d( EMC.TDIR)
@@ -111,14 +114,16 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}}
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H38' then
EMC.MAXZ = SafeZ3RotAxis
end
end
---------------------- OnSpecialMoveZup -----------------------------
function OnSpecialMoveZup()
--EgtOutLog( 'OnSpecialMoveZup : ' .. EMC.HEAD .. '.' .. tostring( EMC.EXIT))
-- Inizializzazioni
EMC.ERR = 0
EMC.MODIF = false
@@ -135,7 +140,7 @@ function OnSpecialMoveZup()
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' or EMC.HEAD == 'H22' then
;
-- se lama
else
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H16' then
-- riporto i valori tra -179 e + 180
local dCheckAxR1 = EMC.R1
if dCheckAxR1 < -180 then
@@ -180,6 +185,12 @@ function OnSpecialMoveZup()
end
end
end
elseif EMC.HEAD == 'H38' then
EMC.L3 = SafeZ3RotAxis
-- dichiaro modificato
EMC.MODIF = true
else
; -- non si fa nulla
end
end
+3 -3
View File
@@ -8,8 +8,8 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6j3'
PP_NVER = '2.6.10.3'
PP_VER = '2.6k1'
PP_NVER = '2.6.11.1'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PF1250MAX'
@@ -239,7 +239,7 @@ if EgtExistsFile( sDataBeam) then
if Machine.Offsets.MAXPRESS then MaxForzaPinze = Machine.Offsets.MAXPRESS end
if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
if Machine.Offsets.MOTORS23KW then Motors23KW = Machine.Offsets.MOTORS23KW end
if Machine.Offsets.MOTORS23KW then Motors23KW = Machine.Offsets.MOTORS23KW == 1 end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
+3
View File
@@ -1,5 +1,8 @@
==== Common_PF1250 Update Log ====
Versione 2.6k1 (04/11/2024)
- (SIM-GEN) Gestione terza testa 5 assi dedicata lama (H38)
Versione 2.6j3 (25/10/2024)
- (GEN) Piccola correzione per capire se testa 3 presente
- (SIM-GEN) In caso di lavorazione successiva alla prima, rivisto primo posizionamento alla quota Z di lavoro se precedentemente spostati a quota rotazione assi rotanti.
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6j3', -- versione script
VERSION = '2.6k1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}