- Aggiunta gestione trave in linea con scarico lineare da variabile globale in mlde che può essere impostato a valore minimo della trave da scaricare

- Aggiunta visualizzazione dello scarico in linea e ottimizzata quella normale
- Allineato approccio in simulazione a generazione in caso di lavorazione in doppio verticale
This commit is contained in:
daniele.nicoli
2026-01-22 10:04:59 +01:00
parent 20e0e0d3d9
commit 60bc26fc3c
4 changed files with 55 additions and 9 deletions
+2 -1
View File
@@ -2065,7 +2065,8 @@ function PrepareUnload( sCmd, nInd)
if Cmd[2] == 'Y2' then
-- se non è ultima fase e non è fase successiva a scarico su carico c'è una barra sulla pinza Y1
local bBarOnY = ( EMT.PHASE < EgtGetPhaseCount() and not IsEnd2Phase( EMT.PHASE))
local MDChar = { Y2=tonumber(Cmd[3]), V2=ParkV2, IniStatY2=1, FinStatY2=-84, BeamVise=EgtIf( bBarOnY, 1, 0), MovType=EgtIf( EMT.CHY_ON, 3, 2)}
local nFinStatY2 = EgtIf( Cmd[4] == 'NoWaitUnload', -84, -1)
local MDChar = { Y2=tonumber(Cmd[3]), V2=ParkV2, IniStatY2=1, FinStatY2=nFinStatY2, BeamVise=EgtIf( bBarOnY, 1, 0), MovType=EgtIf( EMT.CHY_ON, 3, 2)}
table.insert( EMT.MDCHAR, MDChar)
end
elseif Cmd[1] == '2' then
+28 -3
View File
@@ -1302,6 +1302,12 @@ function OnSimulMoveStart()
local sErr = 'Z1 Z2 tools in collision (distance=' .. EgtNumToString( dDistToolZ1Z2, 1) .. ')'
EmtSetLastError( 1208, sErr)
end
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local B2Home = EgtGetAxisHomePos( 'B2')
local C2Home = EgtGetAxisHomePos( 'C2')
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'C2', C2Home, MCH_SIM_STEP.RAPROT, 'B2', B2Home, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X2', X2, MCH_SIM_STEP.RAPID)
end
end
end
-- se necessario ...
@@ -1741,17 +1747,36 @@ function ExecUnloading()
local vMillId = EMT.VMILL[1]
-- gruppo dei Vmill
local nVmGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill')
local sUnloadType = ''
local sUnloadTypeOld = ''
local vtMove = Vector3d( 0, 0, 0)
local vtMoveOldElements = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.HB + 50.0), -( EMT.HB + 50.0)), 0)
-- Se scarico in linea
if MinBeamLenUnloadInLine and EMT.LT >= MinBeamLenUnloadInLine then
sUnloadType = 'LINE'
vtMove = Vector3d( EgtIf( BD.RIGHT_LOAD, -MinBeamLenUnloadInLine, MinBeamLenUnloadInLine), EgtIf( BD.RIGHT_LOAD, ( EMT.HB + 50.0), -( EMT.HB + 50.0)), 0)
else
if EMT.FALL then
sUnloadType = 'FALL'
vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 3200, -2600), -1150)
else
sUnloadType = 'STD'
vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 1600, -1600), 0)
end
end
-- li sposto per lasciare spazio al nuovo pezzo
local nId = EgtGetFirstInGroup( nVmGrpId)
while nId do
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.HB + 50.0), -( EMT.HB + 50.0)), 0), GDB_RT.GLOB)
sUnloadTypeOld = EgtGetInfo( nId, 'UNLOAD_TYPE')
if sUnloadTypeOld == sUnloadType then
EgtMove( nId, vtMoveOldElements, GDB_RT.GLOB)
end
nId = EgtGetNext( nId)
end
-- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 1600, -1600), 0)
if EMT.FALL then vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 3200, -2600), -1150) end
EgtSetInfo( nLayId, 'UNLOAD_TYPE', sUnloadType)
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
+22 -4
View File
@@ -1372,8 +1372,26 @@ function SpecCalcUnload()
table.insert( vCmd, { 11, 0})
EMC.CNT = nil
end
-- Se scarico in "linea"
if MinBeamLenUnloadInLine and EMC.LB >= MinBeamLenUnloadInLine then
local dY2MoveMax = MinY2
local dTMove = dY2MoveMax - EMC.Y2DELTA
local dBeamTailY2 = dY2MoveMax + ( EMC.LB - EMC.Y2DELTA) - ( EMC.TCING or 0)
table.insert( vCmd, { 2, 'T', dTMove, 'Y2', dY2MoveMax})
-- apro la morsa
table.insert( vCmd, { 12, 0})
if dBeamTailY2 >= ( dY2MoveMax + ( EMC.TCING or 0)) then
dTMove = dY2MoveMax - EMC.LB + ( EMC.TCING or 0)
-- riporto il carrello in home
table.insert( vCmd, { 1, 'Y2', dBeamTailY2})
-- chiudo la morsa
table.insert( vCmd, { 12, 1})
-- finisco scarico trave
table.insert( vCmd, { 2, 'T', dTMove, 'Y2', dY2MoveMax})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dY2MoveMax), 1)
end
-- Se non supero la lunghezza massima di scarico, sposto il pezzo in posizione di scarico
if bStdUl then
elseif bStdUl then
local dFinT = EgtIf( EMC.LB < MaxLenSmT, UnloadSmT, UnloadT) - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
@@ -1384,7 +1402,7 @@ function SpecCalcUnload()
-- apro la morsa
table.insert( vCmd, { 12, 0})
-- riporto il carrello in home
table.insert( vCmd, { 1, 'Y2', ParkY2})
table.insert( vCmd, { 1, 'Y2', ParkY2, 'NoWaitUnload'})
-- eventuale unione tabelle
if #vCmdPre > 0 then
@@ -1561,7 +1579,7 @@ local function PosForEnl1FY1( dY1a, dY2a, dTa, dExtra, dCorsaY1e, dCorsaY2Te)
if dDispl/2 <= dCorsaY1e then
dY1a = dY1a + dDispl / 2
dY2a = dY2a - dDispl / 2
dTa = dTa - dDispl / 2
dTa = dTa - dDispl / 2
else
dY1a = dY1a + dCorsaY1e
dY2a = dY2a - (dDispl - dCorsaY1e)
@@ -2509,7 +2527,7 @@ function SpecOutputCmds( vCmd, bEnd)
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- movimento di 1 asse
elseif Cmd[1] == 1 then
local sInfo = '1,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..EgtIf( Cmd[4], ',*', '')
local sInfo = '1,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..EgtIf( Cmd[4], ','..tostring(Cmd[4]), '')
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- movimento di 2 assi
elseif Cmd[1] == 2 then
+3 -1
View File
@@ -5,7 +5,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1a1_DEV1'
PP_VER = '3.1a1_DEV2'
PP_NVER = '3.1.1.1'
MIN_MACH_VER = '2.7d2'
MACH_NAME = EgtGetCurrMachineName()
@@ -172,6 +172,7 @@ Motors23KW = true
EstimationRapidMultiplier = 1
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
MinBeamLenUnloadInLine = 2400 -- se lo scarico è su una linea deve scaricare il pezzo al massimo e deve essere maggiore del valore della variabile
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250-3T_5Ax.data"
@@ -270,6 +271,7 @@ if EgtExistsFile( sDataBeam) then
if Machine.Offsets.MOTORS23KW then Motors23KW = Machine.Offsets.MOTORS23KW == 1 end
if Machine.Offsets.LEN_STEM_H2 then LenStemH2 = Machine.Offsets.LEN_STEM_H2 end
if Machine.Offsets.COEFF_CLAMP_CHECK then ClampingCoeffMin = Machine.Offsets.COEFF_CLAMP_CHECK end
if Machine.Offsets.MIN_BEAM_LEN_UNLOAD_IN_LINE then MinBeamLenUnloadInLine = Machine.Offsets.MIN_BEAM_LEN_UNLOAD_IN_LINE end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV