Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b1d3882275 | |||
| de461afbc9 | |||
| 3f13a7267e | |||
| 8ba4e8bf3f | |||
| 53d7ec91c8 | |||
| 3986246bae | |||
| 25917ff9a8 | |||
| 9719ee616f | |||
| 2414169862 | |||
| 473a3a8fe6 | |||
| dcf475d446 | |||
| 2add45fe3a | |||
| caab876f4e | |||
| 1113c02971 | |||
| a65d80cbf1 | |||
| bb5fef1d7b | |||
| 6c37440557 | |||
| a00ed32933 | |||
| 2f4499b15d | |||
| b4646d8fa7 | |||
| 47942a8921 | |||
| a4b28964a3 |
@@ -15,3 +15,4 @@
|
||||
/Wall/PocketingData.lua
|
||||
/Wall/SawingData.lua
|
||||
/Wall/Ts3Data.lua
|
||||
.vscode/settings.json
|
||||
|
||||
+32
-19
@@ -78,11 +78,9 @@ local BeamData = {
|
||||
---------------------------------------------------------------------
|
||||
-- Aggiornamento con dati da TechnoEssetre7
|
||||
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250MAX.data"
|
||||
local sDataBeam = EgtGetSourceDir().."\\Ts3Data.lua"
|
||||
local sDataWall = EgtGetCurrMachineDir()..'\\Wall\\Ts3Data.lua'
|
||||
local sDataBeam = EgtGetCurrMachineDir().."\\Beam\\Ts3Data.lua"
|
||||
if EgtExistsFile( sTs3Data) then
|
||||
EgtCopyFile( sTs3Data, sDataBeam)
|
||||
EgtCopyFile( sTs3Data, sDataWall)
|
||||
local sTs3DataOld = sTs3Data..'.old'
|
||||
EgtEraseFile( sTs3DataOld)
|
||||
EgtRenameFile( sTs3Data, sTs3DataOld)
|
||||
@@ -178,25 +176,40 @@ end
|
||||
BeamData.GetMinUnloadableRaw = GetMinUnloadableRaw
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetChainSawBlockedAxis( nInd)
|
||||
if nInd == 1 then
|
||||
return 'A1=90'
|
||||
local function GetBlockedAxis( sHead, nToolType, sBlockedAxis)
|
||||
-- lama
|
||||
if nToolType == MCH_TY.SAW_STD or nToolType == MCH_TY.SAW_FLAT then
|
||||
if sHead == 'H22' then
|
||||
if sBlockedAxis == 'parallel' then
|
||||
return 'A2=0'
|
||||
elseif sBlockedAxis == 'perpendicular' then
|
||||
return 'A2=90'
|
||||
end
|
||||
else
|
||||
return ''
|
||||
end
|
||||
-- sega a catena
|
||||
elseif nToolType == MCH_TY.MORTISE_STD then
|
||||
if sHead == 'H13' then
|
||||
if sBlockedAxis == 'parallel' then
|
||||
return 'A1=0'
|
||||
elseif sBlockedAxis == 'perpendicular' then
|
||||
return 'A1=90'
|
||||
end
|
||||
else
|
||||
return ''
|
||||
end
|
||||
-- fresa
|
||||
elseif nToolType == MCH_TY.MILL_STD or nToolType == MCH_TY.MILL_NOTIP then
|
||||
return ''
|
||||
-- punta
|
||||
elseif nToolType == MCH_TY.DRILL_STD or nToolType == MCH_TY.DRILL_LONG then
|
||||
return ''
|
||||
else
|
||||
return 'A1=0'
|
||||
return ''
|
||||
end
|
||||
end
|
||||
BeamData.GetChainSawBlockedAxis = GetChainSawBlockedAxis
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetSawBlockedAxis( nInd, bDownHead)
|
||||
if nInd == 1 then
|
||||
return EgtIf( bDownHead, 'A2=90', '')
|
||||
else
|
||||
return EgtIf( bDownHead, 'A2=0', '')
|
||||
end
|
||||
end
|
||||
BeamData.GetSawBlockedAxis = GetSawBlockedAxis
|
||||
|
||||
BeamData.GetBlockedAxis = GetBlockedAxis
|
||||
---------------------------------------------------------------------
|
||||
|
||||
return BeamData
|
||||
|
||||
+135
-51
@@ -1,11 +1,12 @@
|
||||
-- Processore macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
|
||||
-- Processore macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Con controllo numerico TPA
|
||||
|
||||
-- Variabili di modulo
|
||||
local MLE_INFO = 'Essetre-PF1250.TPA.mlpe ver.'..PP_VER..' by EgalTech s.r.l.'
|
||||
-- Carico libreria
|
||||
local BD = require( 'BeamData')
|
||||
|
||||
-- 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
|
||||
|
||||
@@ -29,7 +30,6 @@ function OnStart()
|
||||
--EMT.St = 'S' -- token per speed
|
||||
EMT.FMAXPINZE = 116000 -- feed massima pinze
|
||||
SetToParkLine() -- si inizia con linee da parcheggiare su stack
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -42,12 +42,13 @@ end
|
||||
function OnProgramStart()
|
||||
-- Intestazioni
|
||||
if EMT.INFO then
|
||||
EmitRemark( EMT.INFO)
|
||||
MyOutput( '('..EMT.INFO..')')
|
||||
else
|
||||
EmitRemark( 'Program Start')
|
||||
MyOutput( '(Program Start)')
|
||||
end
|
||||
EmitRemark( CSP_INFO)
|
||||
EmitRemark( MACHINE_INFO)
|
||||
MyOutput( '('.. CSP_INFO..')')
|
||||
MyOutput( '('.. MACHINE_INFO..')')
|
||||
|
||||
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
|
||||
if TEST_USE then
|
||||
MyOutput( 'M199')
|
||||
@@ -398,7 +399,7 @@ function OnMachiningStart()
|
||||
-- valore dell'asse virtuale
|
||||
dPosA = GetCurrChainSawingVirtualAxis()
|
||||
-- imposto home dell'asse C1 (A=0 -> T101, A=90 -> T104)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
|
||||
EmtModifyAxisHome( 'C1', MyParkCSawC1)
|
||||
-- se lama su aggregato testa sotto, aggiusto subito angolo scelto per asse virtuale A
|
||||
elseif EMT.HEAD == 'H22' then
|
||||
@@ -536,9 +537,11 @@ function OnPathStart()
|
||||
--MyOutput( 'CNT='.. tostring( EMT.CNT or 0))
|
||||
-- se utensile non cambiato, salvo eventuali precedenti rotanti
|
||||
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
|
||||
EMT.L3pp = EMT.L3op
|
||||
EMT.R1pp = EMT.R1p
|
||||
EMT.R2pp = EMT.R2p
|
||||
else
|
||||
EMT.L3pp = nil
|
||||
EMT.R1pp = nil
|
||||
EMT.R2pp = nil
|
||||
end
|
||||
@@ -652,6 +655,7 @@ function OnRapid()
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
local HomeZ1 = EgtGetAxisHomePos( 'Z1')
|
||||
local HomeR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
|
||||
local HomeR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2'))
|
||||
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
|
||||
@@ -710,17 +714,23 @@ function OnRapid()
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
-- se sega a catena
|
||||
if EMT.HEAD == 'H15' then
|
||||
EmitMoveDataHead( 1, { X=ParkCSawX1, Z=ParkCSawZ1, B=HomeB1, C=EMT.R1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
if EMT.HEAD == 'H13' then
|
||||
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=HomeZ1, B=HomeR2, C=HomeR1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
-- utensili standard
|
||||
else
|
||||
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), Z=EMT.L3, B=ParkB1, C=ParkC1, S=Speed})
|
||||
end
|
||||
end
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
|
||||
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
if EMT.HEAD ~= 'H13' then
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
|
||||
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
else
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
end
|
||||
end
|
||||
EmitMoveStartHead( 1)
|
||||
-- se lavorazione in doppio
|
||||
@@ -816,10 +826,6 @@ function OnRapid()
|
||||
-- aspetto esecuzione movimento testa 3
|
||||
EmitMoveWaitHead( 3)
|
||||
end
|
||||
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
|
||||
if not EMT.Y1DELTA then
|
||||
EMT.V1NEXTPOS = ParkV1
|
||||
end
|
||||
-- dati aggancio a trave
|
||||
local BhData = { T=EMT.L1, SetHead=0}
|
||||
if EMT.Y1DELTA then
|
||||
@@ -899,10 +905,6 @@ function OnRapid()
|
||||
EmitMoveWaitChars( nMoveType)
|
||||
end
|
||||
EMT.MDCHAR = {}
|
||||
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
|
||||
if not EMT.Y1DELTA then
|
||||
EMT.V1NEXTPOS = ParkV1
|
||||
end
|
||||
-- se necessario allargo le cabine
|
||||
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
|
||||
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
|
||||
@@ -948,7 +950,7 @@ function OnRapid()
|
||||
if not WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, EMT.L2), S=Speed})
|
||||
end
|
||||
EmitMoveDataHead( 1, { B=0, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=MyMaxZ1, B=0, S=Speed})
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
|
||||
@@ -962,14 +964,19 @@ function OnRapid()
|
||||
else
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
EmitMoveDataHead( 1, { X=ParkCSawX1, Z=ParkCSawZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
|
||||
EmitMoveDataHead( 1, { X=-ParkCSawX1, Z=dSafeZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
|
||||
end
|
||||
-- Porto la Z alla giusta quota
|
||||
if EMT.L3 > HomeZ1 + 1 and abs( EMT.R2) > 89.9 then
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=HomeZ1, S=Speed})
|
||||
end
|
||||
EmitMoveDataHead( 1, { Z=HomeZ1, B=EMT.R2, S=Speed})
|
||||
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
|
||||
-- se motosega molto lunga, ruoto prima di muovermi in X
|
||||
if EMT.TTOTLEN >= MinLengthLongCSaw then
|
||||
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
|
||||
end
|
||||
end
|
||||
end
|
||||
EmitMoveDataHead( 1, { X=EMT.L2, Z=EMT.L3, B=EMT.R2, C=EMT.R1, S=Speed})
|
||||
@@ -1183,7 +1190,12 @@ function OnRapid()
|
||||
local sAxes = EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
if #sAxes > 0 then
|
||||
MyOutput( 'G0' .. sAxes)
|
||||
if EmitRapidInG1 then
|
||||
local sFeed = ' F30000'
|
||||
MyOutput( 'G1' .. sAxes .. sFeed)
|
||||
else
|
||||
MyOutput( 'G0' .. sAxes)
|
||||
end
|
||||
end
|
||||
-- se altrimenti risalita a Z max a fine lavorazione
|
||||
elseif EMT.FLAG == 3 then
|
||||
@@ -1241,8 +1253,15 @@ function OnLinear()
|
||||
-- emissione movimento
|
||||
EMT.R1p = nil
|
||||
EMT.R2p = nil
|
||||
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
if EmitRapidInG1 then
|
||||
local sFeed = ' F30000'
|
||||
sOut = 'G1'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')..sFeed
|
||||
else
|
||||
sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
end
|
||||
|
||||
MyOutput( sOut)
|
||||
-- aggiorno precedenti
|
||||
EMT.MOVE = 0
|
||||
@@ -1612,7 +1631,10 @@ function PrepareMoveChar( sCmd, nInd)
|
||||
elseif Cmd[1] == '11' then
|
||||
EMT.ISY1 = CalcCharStatusN( Cmd[2])
|
||||
EMT.FSY1 = EMT.ISY1
|
||||
EMT.BV = EgtIf( Cmd[2] ~= '0', 1, 2)
|
||||
-- se pinza due in presa, non attivo la 1
|
||||
if EMT.BV ~= 2 then
|
||||
EMT.BV = EgtIf( Cmd[2] ~= '0', 1, 2)
|
||||
end
|
||||
if #EMT.MDCHAR > 0 then EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = EMT.FSY1 end
|
||||
elseif Cmd[1] == '12' then
|
||||
EMT.ISY2 = CalcCharStatusN( Cmd[2])
|
||||
@@ -1927,7 +1949,7 @@ end
|
||||
function GetV1ToCloseTPA()
|
||||
local dMaxHeadPos = EMT.MAXMAX[1] + ( EMT.HOVM or 0) - ( EMT.X_OFF or 0)
|
||||
local dMinTailPos = EMT.MAXMIN[1] + EMT.LB + EgtIf( IsStartOrMidPhase( EMT.PHASE), 0, ( EMT.HOVM or 0)) - ( EMT.X_OFF or 0)
|
||||
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0)))
|
||||
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f V1NextPos=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0), EMT.V1NEXTPOS))
|
||||
return ( dMaxHeadPos <= EMT.V1NEXTPOS + RollCageMin and dMinTailPos >= EMT.V1NEXTPOS + RollCageMax)
|
||||
end
|
||||
|
||||
@@ -2198,8 +2220,9 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome)
|
||||
EmitMoveWaitHead( 1)
|
||||
-- altrimenti sega a catena
|
||||
else
|
||||
-- salzo in Z sicurezza raddrizzando la B
|
||||
EmitMoveDataHead( 1, { Z=ParkCSawZ1, B=dHomeB1, Fmt=1})
|
||||
-- salgo in Z sicurezza raddrizzando la B
|
||||
local dSafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
|
||||
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dHomeB1, Fmt=1})
|
||||
EmitMoveDataHead( 1, { X=-dHomeX1, C=dHomeC1, Fmt=1})
|
||||
if bTopGoHome then
|
||||
-- !!! da verificare bene (come PF) !!!
|
||||
@@ -2387,27 +2410,94 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function PreselectNextDiffHead( nMchId, sHead)
|
||||
-- se in uso testa 1, verifico di non scendere troppo in Z per evitare collisioni (per testa 3 non serve il controllo)
|
||||
local nHSet = GetHeadSet( sHead)
|
||||
if nHSet == 1 then
|
||||
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then return end
|
||||
end
|
||||
-- recupero lavorazione successiva
|
||||
-- recupero lavorazione successiva, se non esiste esco subito
|
||||
local nNextMchId = EgtGetNextActiveOperation( nMchId)
|
||||
while nNextMchId do
|
||||
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then break end
|
||||
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
|
||||
end
|
||||
if not nNextMchId then return end
|
||||
-- se esiste ed appartiene a gruppo diverso
|
||||
|
||||
-- se esiste lavorazione successiva
|
||||
if EgtSetCurrMachining( nNextMchId) then
|
||||
local sNextTool = EgtGetMachiningParam( MCH_MP.TOOL)
|
||||
if EgtTdbSetCurrTool( sNextTool) then
|
||||
local nHSet = GetHeadSet( sHead)
|
||||
local sNextHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nNextHSet = GetHeadSet( sNextHead)
|
||||
if nNextHSet ~= nHSet and nNextHSet ~= 3 and ( nHSet ~= 3 or nNextHSet ~= 1) then
|
||||
-- se utensile su altra testa
|
||||
if nNextHSet ~= nHSet then
|
||||
local sNextTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
local dNextTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
|
||||
-- se sto lavorando con testa 1
|
||||
if nHSet == 1 then
|
||||
-- se preselezione testa 2
|
||||
if nNextHSet == 2 then
|
||||
-- se agregato lama speciale non preseleziono mai
|
||||
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then return end
|
||||
-- se la Z di lavoro è più bassa del cambio della minima Z
|
||||
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
|
||||
-- verifico quota del TC
|
||||
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 400) then return end
|
||||
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + 400) then return end
|
||||
end
|
||||
-- se preselezione testa 3
|
||||
else
|
||||
; -- non devo fare nulla
|
||||
end
|
||||
-- se sto lavorando con testa 2
|
||||
elseif nHSet == 2 then
|
||||
-- se preselezione testa 1
|
||||
if nNextHSet == 1 then
|
||||
-- se sopra Z oltre la faccia sotto della trave, controllo il cambio utensile
|
||||
if EMT.MAXMIN[3] > Delta2TabZ then
|
||||
local nNextTc = GetTcForTopHeadTool( sNextTcPos) -- utensile da caricare
|
||||
local nPrevTc = GetTcForTopHeadTool( EMT.PREVTCPOS_H1) -- utensile da depositare
|
||||
-- se deposito e carico da diversi TC non faccio preselezione
|
||||
if nNextTc ~= nPrevTc and nPrevTc ~= 0 then return
|
||||
-- altrimenti se operazione su stesso TC
|
||||
else
|
||||
-- TC su montante destro oppure non so cosa c'è montato
|
||||
if nNextTc == 1 or nPrevTc ~= 0 then
|
||||
if BD.RIGHT_LOAD and EMT.MAXMIN[2] < ( Delta2TabY - 400) then return end
|
||||
if not BD.RIGHT_LOAD and EMT.MAXMIN[2] < ( Delta2TabY - MaxHoOpen - 400) then return end
|
||||
end
|
||||
-- TC su montante sinistro oppure non so cosa c'è montato
|
||||
if nNextTc == 2 or nPrevTc ~= 0 then
|
||||
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( Delta2TabY + MaxHoOpen + 400) then return end
|
||||
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( Delta2TabY + 400) then return end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se preselezione testa 3
|
||||
else
|
||||
; -- non devo fare nulla
|
||||
end
|
||||
-- altrimenti (testa 3)
|
||||
else
|
||||
-- se preselezione testa 1
|
||||
if nNextHSet == 1 then
|
||||
-- TC su montante destro
|
||||
if nPrevTc == 1 then return
|
||||
-- TC su montante sinistro
|
||||
else
|
||||
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 400) then return end
|
||||
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
|
||||
end
|
||||
-- se preselezione testa 2
|
||||
else
|
||||
-- se agregato lama speciale non preseleziono mai
|
||||
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then return end
|
||||
-- se la Z di lavoro è più bassa del cambio utensili, verifico quota X (la nostra Y)
|
||||
if EMT.MAXMIN[3] < MinZ1ToChangeH2 then
|
||||
if BD.RIGHT_LOAD and EMT.MAXMAX[2] > ( DeltaTabY + MaxHoOpen + 400) then return end
|
||||
if not BD.RIGHT_LOAD and EMT.MAXMAX[2] > DeltaTabY then return end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- faccio preselezione ( se sono arrivato qui, vuol dire che posso preselezionare)
|
||||
if nNextHSet == 1 then
|
||||
-- Recupero quota X1 (nostro L2)
|
||||
local dNextX = GetStartMachiningXaxis( nNextMchId)
|
||||
@@ -2417,7 +2507,7 @@ function PreselectNextDiffHead( nMchId, sHead)
|
||||
EmitMoveDataHead( 1, { X=dNextX, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
|
||||
else
|
||||
local nNextTc = GetTcForTopHeadTool( sNextTcPos)
|
||||
EmitMoveDataHead( 1, { X=dNextX, B=ParkLongB1, C=EgtIf( nTc ~= 2, ParkLongTc1C1, ParkLongTc2C1), TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
|
||||
EmitMoveDataHead( 1, { X=dNextX, B=ParkLongB1, C=EgtIf( nPrevTc ~= 2, ParkLongTc1C1, ParkLongTc2C1), TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
|
||||
end
|
||||
EmitMoveStartHead( 1)
|
||||
elseif sNextHead == 'H12' or sNextHead == 'H16' then
|
||||
@@ -2426,19 +2516,13 @@ function PreselectNextDiffHead( nMchId, sHead)
|
||||
elseif sNextHead == 'H13' then
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local dPosA = GetCurrChainSawingVirtualAxis()
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
|
||||
local bXSpec = EgtIf( BD.RIGHT_LOAD, ( dNextX > -DeltaTabY), ( dNextX < -DeltaTabY))
|
||||
EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, dNextX), B=ParkCSawB1, C=MyParkCSawC1, TPos=AdjustTcPos( false, sNextTcPos, dPosA), Fmt=2})
|
||||
EmitMoveStartHead( 1)
|
||||
end
|
||||
else
|
||||
-- non si può preselezionare lama su aggregato da sotto
|
||||
-- Se è già montata, non preseleziono altro utensile fino all'effettiva lavorazione altro utensile
|
||||
if sNextHead == 'H22' or EMT.PREVHEAD_H2 == 'H22' then
|
||||
return
|
||||
else
|
||||
EmitMoveDataHead( 2, { B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
|
||||
end
|
||||
EmitMoveDataHead( 2, { B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, sNextTcPos), Fmt=2})
|
||||
EmitMoveStartHead( 2)
|
||||
end
|
||||
end
|
||||
|
||||
+132
-64
@@ -1,4 +1,4 @@
|
||||
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2023/12/14
|
||||
-- Processore standard macchine tipo PF1250 by EgalWare s.r.l. 2024/01/22
|
||||
|
||||
-- Funzioni generiche indipendenti dal controllo
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
-- Carico libreria
|
||||
local BD = require( 'BeamData')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- *** GENERATION ***
|
||||
---------------------------------------------------------------------
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
local sBaseDir = EgtGetCurrMachineDir()
|
||||
if NumericalControl == 'NUM' then
|
||||
error( 'Numerical Control error : NUM not yet managed')
|
||||
elseif NumericalControl == 'TPA' then
|
||||
dofile( sBaseDir .. 'Common-PF1250.TPA.mlpe')
|
||||
dofile( sBaseDir .. '\\Common-PF1250.TPA.mlpe')
|
||||
else
|
||||
error( 'Numerical Control error : unkwnown type')
|
||||
end
|
||||
@@ -23,6 +26,45 @@ end
|
||||
---------------------------------------------------------------------
|
||||
local COLL_SAFE_DIST = 3
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulInit()
|
||||
-- se macchina con carico destro, imposto offset direzioni di vista standard
|
||||
if BD.RIGHT_LOAD then
|
||||
local nOrigViewOffs = EgtGetViewOrizzOffsStep()
|
||||
local dOrigViewAngV, dOrigViewAngH = EgtGetGenericView()
|
||||
if nOrigViewOffs ~= 2 then
|
||||
EgtSetViewOrizzOffsStep( 2)
|
||||
if dOrigViewAngV < 0.1 then
|
||||
EgtSetView( SCE_VD.TOP, false)
|
||||
elseif dOrigViewAngV > 179.9 then
|
||||
EgtSetView( SCE_VD.BOTTOM, false)
|
||||
else
|
||||
local dViewAngH = dOrigViewAngH + EgtIf( dOrigViewAngH > 180, 2 * 90, 0)
|
||||
EgtSetGenericView( dOrigViewAngV, dViewAngH, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulExit()
|
||||
-- se macchina con carico destro, annullo offset direzioni di vista standard
|
||||
if BD.RIGHT_LOAD then
|
||||
local nOrigViewOffs = EgtGetViewOrizzOffsStep()
|
||||
local dOrigViewAngV, dOrigViewAngH = EgtGetGenericView()
|
||||
if nOrigViewOffs == 2 then
|
||||
EgtSetViewOrizzOffsStep( 0)
|
||||
if dOrigViewAngV < 0.1 then
|
||||
EgtSetView( SCE_VD.TOP, false)
|
||||
elseif dOrigViewAngV > 179.9 then
|
||||
EgtSetView( SCE_VD.BOTTOM, false)
|
||||
else
|
||||
EgtSetGenericView( dOrigViewAngV, dOrigViewAngH - 2 * 90, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulStart()
|
||||
-- controllo versione programma
|
||||
@@ -81,6 +123,11 @@ function OnSimulStart()
|
||||
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL1'},
|
||||
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'CHAIN'},
|
||||
{ Grp = 'Z2', Sub = 'COLLISION', Name = 'COL2'}}
|
||||
|
||||
if EgtGetHeadId('H31') then
|
||||
table.insert( McdData, { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'})
|
||||
table.insert( McdData, { Grp = 'X3', Sub = 'COLLISION', Name = 'STM'})
|
||||
end
|
||||
|
||||
-- inserisco gruppi opzionali
|
||||
if SecondChain then table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW2'}) end
|
||||
@@ -259,8 +306,8 @@ function OnSimulDispositionStart()
|
||||
EMT.SCRAP = nil
|
||||
end
|
||||
EMT.LB = b3Bar:getDimX()
|
||||
EMT.LT = b3Raw:getDimX()
|
||||
EMT.LP = b3Part:getDimX()
|
||||
EMT.LR = b3Raw:getDimX()
|
||||
EMT.LT = b3Part:getDimX()
|
||||
EMT.CUTID = EgtGetInfo( EgtGetFirstPartInRawPart( nPartRawId or GDB_ID.NULL) or GDB_ID.NULL, 'CUTID', 'i') or 0
|
||||
EMT.Y1SPEC = nil
|
||||
-- se vero inizio, assegno solidi per verifica collisione
|
||||
@@ -421,7 +468,7 @@ function OnSimulToolSelect( dPosA)
|
||||
-- imposto il valore di A
|
||||
EgtSetAxisPos( 'A1', dPosA)
|
||||
-- imposto home dell'asse C1 (A1=0 -> T101, A1=90 -> T104)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
local MyParkCSawC1 = GetChainSawCHomeFromVirtualAxis( dPosA, EMT.TTOTLEN)
|
||||
EmtModifyAxisHome( 'C1', MyParkCSawC1)
|
||||
EgtSetAxisPos( 'C1', MyParkCSawC1)
|
||||
-- Imposto visualizzazione
|
||||
@@ -474,7 +521,7 @@ function OnSimulToolDeselect( dPrevA)
|
||||
-- recupero il gruppo
|
||||
local nSetHead = GetHeadSet( EMT.NEXTHEAD)
|
||||
-- per testa gruppo 2
|
||||
if nSetHead == 2 then
|
||||
if nSetHead == 2 and EMT.PREVTCPOS_H2 then
|
||||
-- deposito lama su aggregato testa sotto
|
||||
if EMT.PREVHEAD_H2 == 'H22' then
|
||||
-- simulo movimento
|
||||
@@ -492,7 +539,7 @@ function OnSimulToolDeselect( dPrevA)
|
||||
-- nascondo l'utensile sulla testa
|
||||
EgtSetStatus( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_ST.OFF)
|
||||
-- se testa gruppo 1
|
||||
else
|
||||
elseif nSetHead == 1 and EMT.PREVTCPOS_H1 then
|
||||
-- deposito utensile fresa
|
||||
if EMT.PREVHEAD_H1 == 'H11' then
|
||||
-- simulo movimento
|
||||
@@ -522,7 +569,7 @@ function OnSimulToolDeselect( dPrevA)
|
||||
-- simulo movimento
|
||||
local ParkC1 = EgtGetAxisHomePos( 'C1')
|
||||
if dPrevA then
|
||||
ParkC1 = GetChainSawCHomeFromVirtualAxis( dPrevA)
|
||||
ParkC1 = GetChainSawCHomeFromVirtualAxis( dPrevA, EMT.TTOTLEN)
|
||||
end
|
||||
SimulMoveAxes( 'B1', ParkCSawB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
|
||||
SimulMoveAxis( 'X1', ParkCSawX1, MCH_SIM_STEP.RAPID)
|
||||
@@ -730,13 +777,13 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathEnd()
|
||||
-- rimozione sfridi
|
||||
RemoveScraps()
|
||||
ExecRemoveScraps()
|
||||
-- se non ci sono comandi ausiliari associati e richiesta risalita a Zmax
|
||||
if EMT.AUXTOT == 0 and EMT.TO_ZMAX then
|
||||
if EMT.MCHSPLIT and not EMT.TO_FALL then
|
||||
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
|
||||
EMT.Y1DELTA = nil
|
||||
SetPY1Light( false)
|
||||
ExecMovePY1( false)
|
||||
end
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
EMT.TO_ZMAX = nil
|
||||
@@ -746,19 +793,19 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathStartAux()
|
||||
-- eseguo il comando
|
||||
ExecAuxCmd( EMT.AUX)
|
||||
ExecAuxCmd( EMT.AUX, true)
|
||||
-- se ultimo comando e lavorazione di split, sgancio il carro Y1
|
||||
if EMT.AUXIND == EMT.AUXTOT and EMT.MCHSPLIT and not EMT.TO_FALL then
|
||||
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
|
||||
EMT.Y1DELTA = nil
|
||||
SetPY1Light( false)
|
||||
ExecMovePY1( false)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathEndAux()
|
||||
-- eseguo il comando
|
||||
ExecAuxCmd( EMT.AUX)
|
||||
ExecAuxCmd( EMT.AUX, false)
|
||||
-- se ultimo comando e richiesta risalita a Zmax
|
||||
if EMT.AUXIND == EMT.AUXTOT and EMT.TO_ZMAX then
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
@@ -856,7 +903,7 @@ function OnSimulMoveStart()
|
||||
-- in caso di rotazione della lama lontano dalla posizione di home degli assi rotanti
|
||||
if ( EMT.HEAD == 'H12' or EMT.HEAD == 'H16') and ( abs( C1Pos - EMT.R1) > 1 or abs( B1Pos - EMT.R2) > 1) and ( abs( C1Home - EMT.R1) > 30.1 or abs( B1Home - EMT.R2) > 30.1) then
|
||||
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
|
||||
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
|
||||
SimulMoveAxes( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
|
||||
@@ -882,6 +929,10 @@ function OnSimulMoveStart()
|
||||
-- se movimento iniziale da Zmax
|
||||
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
|
||||
SimulMoveAxes( 'Z1', Z1Home, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
|
||||
-- se motosega molto lunga, ruoto prima di muovermi in X
|
||||
if EMT.TTOTLEN >= MinLengthLongCSaw then
|
||||
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se altrimenti testa 2
|
||||
@@ -889,6 +940,7 @@ function OnSimulMoveStart()
|
||||
local B2Home = EgtGetAxisHomePos( 'B2')
|
||||
local C2Home = EgtGetAxisHomePos( 'C2')
|
||||
local Z2Home = EgtGetAxisHomePos( 'Z2')
|
||||
local X2Home = EgtGetAxisHomePos( 'X2')
|
||||
if EMT.ZMAX then
|
||||
-- se bisogna scrivere tutti gli assi
|
||||
if WriteAllCoordsOnFirstM101 then
|
||||
@@ -1013,12 +1065,16 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulMoveEnd()
|
||||
-- rimozione eventuali sfridi
|
||||
if EMT.FLAG == 301 then
|
||||
ExecRemoveScraps()
|
||||
end
|
||||
-- se primo rapido della lavorazione
|
||||
if EMT.MCHFIRST and EMT.MOVE == 0 then
|
||||
-- se lavorazione split, dichiaro carro Y1 riagganciato
|
||||
if EMT.SPLIT_Y1DELTA then
|
||||
EMT.SPLIT_Y1DELTA = nil
|
||||
SetPY1Light( true)
|
||||
ExecMovePY1( true)
|
||||
end
|
||||
-- chiusura o apertura rulli V1
|
||||
if GetV1ToClose() then
|
||||
@@ -1052,7 +1108,7 @@ function OnSimulMoveEnd()
|
||||
-- se Zmax dopo fine lavorazione
|
||||
if EMT.MOVE == 0 and EMT.FLAG == 3 then
|
||||
-- eventuale rimozione sfridi
|
||||
RemoveScraps()
|
||||
ExecRemoveScraps()
|
||||
-- eseguo
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
EMT.TO_ZMAX = nil
|
||||
@@ -1081,7 +1137,7 @@ function OnSimulCollision()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecAuxCmd( sCmd)
|
||||
function ExecAuxCmd( sCmd, bPathStart)
|
||||
-- analizzo il comando
|
||||
local Cmd = EgtSplitString( sCmd)
|
||||
if Cmd[1] == '0' then
|
||||
@@ -1094,29 +1150,31 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
EgtOutText( Cmd[2])
|
||||
elseif Cmd[1] == '1' then
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
sV1, MoveV1, MCH_SIM_STEP.RAPID,
|
||||
sV2, MoveV2, MCH_SIM_STEP.RAPID)
|
||||
if not bOk then
|
||||
if not bOk1 then
|
||||
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
|
||||
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
|
||||
if Cmd[2] ~= 'Z' then
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
sV1, MoveV1, MCH_SIM_STEP.RAPID,
|
||||
sV2, MoveV2, MCH_SIM_STEP.RAPID)
|
||||
if not bOk then
|
||||
if not bOk1 then
|
||||
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
|
||||
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
|
||||
end
|
||||
elseif not bOk2 then
|
||||
VerifyV1V2Stroke( sV1, MoveV1)
|
||||
elseif not bOk3 then
|
||||
VerifyV1V2Stroke( sV2, MoveV2)
|
||||
end
|
||||
elseif not bOk2 then
|
||||
VerifyV1V2Stroke( sV1, MoveV1)
|
||||
elseif not bOk3 then
|
||||
VerifyV1V2Stroke( sV2, MoveV2)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '2' then
|
||||
-- Verifico movimento carrello con trave agganciata
|
||||
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
|
||||
-- Eseguo i movimenti necessari
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3, bOk4 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
|
||||
@@ -1138,8 +1196,8 @@ function ExecAuxCmd( sCmd)
|
||||
-- Verifico movimento carrelli con trave agganciata
|
||||
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
|
||||
-- Eseguo i movimenti necessari
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL then ExecOpenRoller( 2) end
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3, bOk4, bOk5 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
|
||||
@@ -1159,13 +1217,13 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '4' then
|
||||
ExecMoveHome( Cmd[2] == '1', EMT.MCHSPLIT)
|
||||
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
|
||||
elseif Cmd[1] == '11' then
|
||||
SimulMoveAxes( 'PY1', EgtIf( Cmd[2] == '0', MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY1Light( Cmd[2] ~= '0')
|
||||
local bClose = Cmd[2] ~= '0'
|
||||
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
|
||||
ExecMovePY1( bClose)
|
||||
elseif Cmd[1] == '12' then
|
||||
SimulMoveAxes( 'PY2', EgtIf( Cmd[2] == '0', MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY2Light( Cmd[2] ~= '0')
|
||||
ExecMovePY2( Cmd[2] ~= '0')
|
||||
elseif Cmd[1] == '21' then
|
||||
local nY1Delta = tonumber( Cmd[2])
|
||||
local nY2Delta = tonumber( Cmd[3])
|
||||
@@ -1217,7 +1275,7 @@ end
|
||||
function ExecStartHome()
|
||||
-- Testa 1
|
||||
EgtResetAxisPos( 'X1')
|
||||
EgtSetAxisPos( 'Z1', MaxZ1)
|
||||
EgtResetAxisPos( 'Z1')
|
||||
EgtResetAxisPos( 'C1')
|
||||
EgtResetAxisPos( 'B1')
|
||||
-- Testa 2
|
||||
@@ -1231,6 +1289,7 @@ end
|
||||
function ExecMoveHome( bNearV, bMchSplit)
|
||||
-- risalita a Zmax
|
||||
ExecMoveZmax( bMchSplit)
|
||||
EMT.TO_ZMAX = nil
|
||||
-- se testa sotto
|
||||
if GetHeadSet( EMT.HEAD) == 2 then
|
||||
if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then
|
||||
@@ -1290,8 +1349,9 @@ function ExecMoveZmax( bMchSplit)
|
||||
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
|
||||
-- altrimenti sega a catena
|
||||
else
|
||||
-- salzo in Z sicurezza raddrizzando la B
|
||||
SimulMoveAxes( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
|
||||
-- salgo in Z sicurezza raddrizzando la B
|
||||
local SafeZ1 = EgtIf( EMT.TTOTLEN < MinLengthLongCSaw, ParkCSawZ1, ParkLongCSawZ1)
|
||||
SimulMoveAxes( 'Z1', SafeZ1, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
@@ -1368,6 +1428,18 @@ function ExecUnloading()
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY1( bClose)
|
||||
SimulMoveAxes( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY1Light( bClose)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY2( bClose)
|
||||
SimulMoveAxes( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY2Light( bClose)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function LinkRemainingPartsToY1()
|
||||
local nCurrOrd = GetPhaseOrd( EMT.PHASE)
|
||||
@@ -1397,6 +1469,9 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
-- Parcheggi pinze
|
||||
local MyParkY1 = ParkY1 + EgtIf( bAgg, AggLoad, 0)
|
||||
local MyParkY2 = ParkY2
|
||||
-- Apro i rulli, se necessario
|
||||
if abs( ParkV1 - PosV1) > 0.1 then ExecOpenRoller( 1) end
|
||||
if abs( ParkV2 - PosV2) > 0.1 then ExecOpenRoller( 2) end
|
||||
-- Eseguo spostamenti
|
||||
if EMT.Y1DELTA and EMT.Y2DELTA then
|
||||
local DiffY1 = MyParkY1 - PosY1
|
||||
@@ -1450,7 +1525,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
local MoveV1 = ParkV1 - PosV1
|
||||
local DiffY1 = MyParkY1 - PosY1
|
||||
local MoveY1 = EgtIf( DiffY1 > 0.1, MoveV1, 0)
|
||||
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LP, 0)
|
||||
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0)
|
||||
if ( PosT > ParkV2 - ExtraParkV and PosT < ParkV1 and PosY1 + TryMoveY1 < MaxY1) then MoveY1 = max( MoveY1, TryMoveY1) end
|
||||
-- se appena eseguito taglio di separazione
|
||||
if bSpliCut then
|
||||
@@ -1480,8 +1555,8 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
local MoveV2 = ParkV2 - PosV2
|
||||
local DiffY2 = MyParkY2 - PosY2
|
||||
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
|
||||
local TryMoveY2 = ParkV2 - PosT - EMT.LP
|
||||
if ( PosT + EMT.LP < ParkV1 + ExtraParkV and PosT + EMT.LP > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
|
||||
local TryMoveY2 = ParkV2 - PosT - EMT.LT
|
||||
if ( PosT + EMT.LT < ParkV1 + ExtraParkV and PosT + EMT.LT > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
|
||||
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
|
||||
'V1', ParkV1, MCH_SIM_STEP.RAPID,
|
||||
'V2', ParkV2, MCH_SIM_STEP.RAPID,
|
||||
@@ -1516,14 +1591,14 @@ function ExecOpenRoller( nInd)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function RemoveScraps()
|
||||
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
|
||||
local vMillId = EMT.VMILL[1]
|
||||
local nPart = EgtVolZmapPartCount( vMillId)
|
||||
if nPart > 1 then
|
||||
-- ricerca del pezzo con massimo volume
|
||||
local dTCenX = -EgtGetAxisPos( 'T') - EMT.LP / 2
|
||||
local dTCenX = -EgtGetAxisPos( 'T') - EMT.LT / 2
|
||||
local nPartMax = 0
|
||||
local dVolMax = 0
|
||||
for i = 1, nPart do
|
||||
@@ -1547,7 +1622,6 @@ function RemoveScraps()
|
||||
end
|
||||
EMT.VMRS = false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -1716,14 +1790,14 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function GetV1ToClose()
|
||||
--EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB))
|
||||
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LP or 0))
|
||||
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
|
||||
return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetV2ToClose()
|
||||
--EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB))
|
||||
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LP or 0))
|
||||
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
|
||||
return ( EMT.MAXMAX[1] <= EMT.V2NEXTPOS - RollCageMax and EMT.MAXMIN[1] + EMT.LB >= EMT.V2NEXTPOS - RollCageMin)
|
||||
end
|
||||
|
||||
@@ -1741,7 +1815,7 @@ function LoadFirstTool( nHSet, sTcPosDef)
|
||||
if nHSet ~= 1 and nHSet ~= 2 then return end
|
||||
EgtUnloadTool( EgtIf( nHSet == 1, 'H11', 'H21'), 1)
|
||||
if GetHeadSetFromTcPos( sTcPosDef) ~= nHSet then return end
|
||||
local sTool, sHead, sTcPos = FindFirstToolOnHeadSet( nHSet)
|
||||
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis = FindFirstToolOnHeadSet( nHSet)
|
||||
if not sTool then
|
||||
local vTools = EgtGetToolsInCurrSetupPos( sTcPosDef)
|
||||
if vTools and vTools[1] then
|
||||
@@ -1753,7 +1827,7 @@ function LoadFirstTool( nHSet, sTcPosDef)
|
||||
if sTool then
|
||||
-- imposto correttamente i dati di testa
|
||||
local OrigEMC = EMC
|
||||
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = 0}
|
||||
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTLEN = sTTotLen, BLOCKEDAXIS = sBlockedAxis}
|
||||
OnSetHead()
|
||||
EMC = OrigEMC
|
||||
-- carico l'utensile
|
||||
@@ -2172,7 +2246,7 @@ function FindFirstToolOnHeadSet( nHSet)
|
||||
local CurrMachId = EgtGetCurrMachining()
|
||||
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
-- cerco lavorazione con utensile su gruppo testa indicato
|
||||
local sTool, sHead, sTcPos
|
||||
local sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
|
||||
local OpId = EgtGetFirstActiveOperation()
|
||||
while OpId do
|
||||
local nType = EgtGetOperationType( OpId)
|
||||
@@ -2184,6 +2258,8 @@ function FindFirstToolOnHeadSet( nHSet)
|
||||
if GetHeadSet( sHead) == nHSet then
|
||||
sTool = sTest
|
||||
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
sTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
sBlockedAxis = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -2195,7 +2271,7 @@ function FindFirstToolOnHeadSet( nHSet)
|
||||
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
|
||||
EgtTdbSetCurrTool( CurrTool or '')
|
||||
-- restituisco risultato
|
||||
return sTool, sHead, sTcPos
|
||||
return sTool, sHead, sTcPos, sTTotLen, sBlockedAxis
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -2213,14 +2289,6 @@ function GetToolTcPos( sTool)
|
||||
return sTcPos
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetCurrChainSawingVirtualAxis()
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A1=0'
|
||||
local dPosA = tonumber( sVal:sub( 4)) or 0
|
||||
return dPosA
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetNextChainSawingVirtualAxis( MchId)
|
||||
-- recupero la lavorazione successiva
|
||||
|
||||
+15
-43
@@ -1,12 +1,11 @@
|
||||
-- Special Operations macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
|
||||
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Intestazioni
|
||||
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
-- Carico i dati globali
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
BD = dofile( sBaseDir .. 'Beam\\BeamData.lua')
|
||||
-- Carico libreria
|
||||
local BD = require( 'BeamData')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- *** Special Z moves ***
|
||||
@@ -254,33 +253,9 @@ local function GetNextStartOrRestPhase( nPhase)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetPhaseRot( nPhase)
|
||||
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsLastMachiningBeforeRotation( nMchId)
|
||||
-- se ultima fase, ritorno risultato negativo
|
||||
if EMC.PHASE == EgtGetPhaseCount() then
|
||||
return false
|
||||
end
|
||||
-- recupero la successiva operazione attiva
|
||||
local nNextOperId = EgtGetNextActiveOperation( nMchId)
|
||||
-- se non esiste o non è una disposizione, ritorno risultato negativo
|
||||
if not nNextOperId or EgtGetOperationType( nNextOperId) ~= MCH_OY.DISP then
|
||||
return false
|
||||
end
|
||||
-- recupero le rotazioni della fase corrente e della prossima fase
|
||||
local nRot = GetPhaseRot( EMC.PHASE)
|
||||
local nNextRot = GetPhaseRot( EMC.PHASE + 1)
|
||||
-- ritorno se sono diverse
|
||||
return ( nRot ~= nNextRot)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsFirstMachiningAfterRotation( nMchId)
|
||||
-- se prima fase, ritorno risultato negativo
|
||||
if EMC.PHASE == 1 then
|
||||
local function IsFirstMachiningOfStart( nMchId)
|
||||
-- se non è fase inizio di pezzo, ritorno risultato negativo
|
||||
if not IsStartOrRestPhase( EMC.PHASE) then
|
||||
return false
|
||||
end
|
||||
-- recupero la precedente operazione attiva
|
||||
@@ -289,11 +264,8 @@ local function IsFirstMachiningAfterRotation( nMchId)
|
||||
if not nPrevOperId or EgtGetOperationType( nPrevOperId) ~= MCH_OY.DISP then
|
||||
return false
|
||||
end
|
||||
-- recupero le rotazioni della fase corrente e della fase precedente
|
||||
local nRot = GetPhaseRot( EMC.PHASE)
|
||||
local nPrevRot = GetPhaseRot( EMC.PHASE - 1)
|
||||
-- ritorno se sono diverse
|
||||
return ( nRot ~= nPrevRot)
|
||||
-- è la prima
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -545,7 +517,7 @@ function OnPostApplyMachining()
|
||||
return
|
||||
-- se precedente operazione è disposizione
|
||||
elseif EgtGetOperationType( nPrevOpeId) == MCH_OY.DISP then
|
||||
if EMC.PHASE == 1 or ( IsMidPhase( EMC.PHASE) and IsFirstMachiningAfterRotation( EMC.MCHID)) then
|
||||
if EMC.PHASE == 1 then
|
||||
-- posizioni home
|
||||
EMC.TPOS = nil
|
||||
EMC.Y1DELTA = nil
|
||||
@@ -712,6 +684,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
|
||||
EMC.SB = b3Tot:getDimY()
|
||||
EMC.HB = b3Tot:getDimZ()
|
||||
EMC.LT = b3Raw:getDimX()
|
||||
EgtOutLog( ' BarLen='..EgtNumToString( EMC.LB, 1), 3)
|
||||
|
||||
-- Aggiorno limiti di presa
|
||||
UpdateMinJoin()
|
||||
@@ -766,7 +739,6 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
|
||||
-- Se inizio o appena dopo rotazione, eseguo il carico
|
||||
if not EMC.TPOS then
|
||||
local dPosT = LoadT
|
||||
if IsFirstMachiningAfterRotation( EMC.MCHID) then dPosT = dPosT + TurnerOffs end
|
||||
local vCmd = SpecCalcLoad( dPosT, dDistFront, max( dDistBack, MinJoin, EMC.LB - ( MaxY1 - MinY1) + 6))
|
||||
EMC.LOAD = true
|
||||
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
|
||||
@@ -1105,8 +1077,8 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
|
||||
return {}
|
||||
end
|
||||
|
||||
-- al carico si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
|
||||
if EMC.LOAD then EMC.HCING = 0 end
|
||||
-- al carico o con prima lavorazione di un pezzo si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
|
||||
if EMC.LOAD or IsFirstMachiningOfStart( EMC.MCHID) then EMC.HCING = 0 end
|
||||
|
||||
return SpecAdjustCarriages( WorkTab)
|
||||
|
||||
@@ -2170,8 +2142,8 @@ function SpecAdjustCarrB1( WorkTab)
|
||||
if not SpecTestSomeMoveInCmds( vCmd) then
|
||||
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
|
||||
end
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
-- imposto i nuovi parametri di aggancio
|
||||
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
|
||||
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
|
||||
@@ -2242,8 +2214,8 @@ function SpecAdjustCarrB2( WorkTab)
|
||||
if not SpecTestSomeMoveInCmds( vCmd) then
|
||||
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
|
||||
end
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
-- imposto i nuovi parametri di aggancio
|
||||
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
|
||||
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
|
||||
@@ -2303,7 +2275,7 @@ function SpecAdjustCarrC( WorkTab)
|
||||
WorkTab.dY1DeltaMaxF = EMC.LB - ( MinJoin + MyTCING)
|
||||
-- se Y1 deve accentrarsi
|
||||
if WorkTab.dY1DeltaI > WorkTab.dY1DeltaMaxF then
|
||||
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin + MyTCING
|
||||
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin - MyTCING
|
||||
end
|
||||
end
|
||||
-- posizioni obiettivo dei carrelli al centro dei rispettivi intervalli di validità
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
|
||||
REM Compilazione degli script macchina Egaltech 2024.02.22
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 bit e copia file da non compilare
|
||||
|
||||
@echo off
|
||||
|
||||
REM chiedo all'utente la versione da assegnare alla macchina da compilare
|
||||
set /p "machineVersion=Inserisci versione: "
|
||||
|
||||
REM variabili per costruire i percorsi delle cartelle
|
||||
set "machineName=Essetre-PF1250MAX"
|
||||
set "deployFolder=C:\MachinesDeploy"
|
||||
set "machinePath=%deployFolder%\%machineName%\"
|
||||
set "fullPathSource=%deployFolder%\%machineName%\%machineVersion%\%machineName%"
|
||||
set "fullPathZip=%deployFolder%\%machineName%\%machineVersion%"
|
||||
|
||||
REM elimino eventuale cartella esistente
|
||||
rmdir /s /Q %fullPathZip%
|
||||
|
||||
REM copio i sorgenti nel percorso di destinazione
|
||||
ROBOCOPY . %fullPathSource%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
|
||||
REM copio i sorgenti nel percorso temporaneo per i compilati
|
||||
ROBOCOPY . %fullPathSource%\bin\%machineName%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
|
||||
|
||||
REM copio i file compilati nel percorso temporaneo per i compilati
|
||||
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-PF1250.mlpe Common-PF1250.mlpe
|
||||
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-PF1250.mlse Common-PF1250.mlse
|
||||
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-PF1250.TPA.mlpe Common-PF1250.TPA.mlpe
|
||||
|
||||
REM comprimo i file compilati in uno zip pronto per essere distribuito
|
||||
tar.exe acvf %fullPathZip%\%machineName%.zip -C %fullPathSource%\bin\ %machineName%\*.*
|
||||
|
||||
REM elimino il percorso temporaneo
|
||||
rmdir /s /Q %fullPathSource%\bin\
|
||||
+42
-13
@@ -1,4 +1,4 @@
|
||||
-- Descrizione macchina Essetre-PF1250MAX by EgalWare s.r.l. 2023/12/07
|
||||
-- Descrizione macchina Essetre-PF1250MAX by EgalWare s.r.l. 2024/02/20
|
||||
-- 2023/12/07 ver 2.5l1 Prima versione. Derivata da PF1250 ver 2.5l4
|
||||
-- 2023/12/15 ver 2.5l2 Corretti vari offset in simulazione
|
||||
-- 2023/12/18 ver 2.5l3 Ultimata gestione aggregato lama da sotto
|
||||
@@ -12,22 +12,41 @@
|
||||
-- Costanti MinForzaPinze e MaxForzaPinze portati in mlde/Ts3data (erano hardcoded - Common)
|
||||
-- Aggiunto variabile 'WriteAllCoordsOnFirstM101' e allineamento con 2.6a1 common
|
||||
-- 2023/12/20 ver 2.6a2 Allineamento con Common-PF1250 v.2.6a2
|
||||
-- 2024/01/22 ver 2.6a3 Migliorata preselezione utensile
|
||||
-- Rimosse funzioni ribaltamento pezzo
|
||||
-- Allineamento con Common-PF1250 v.2.6a3
|
||||
-- In BeamData aggiunta la funzione GetBlockedAxis che sostituisce le altre (GetChainSawBlockedAxis e GetSawBlockedAxis)
|
||||
-- 2024/01/25 ver 2.6a4 Allineamento con Common 2.6a4
|
||||
-- 2024/02/09 ver 2.6b1 Corretto errore in definizione testa H22
|
||||
-- In BeamData migliorata funzione GetBlockedAxis
|
||||
-- 2024/02/12 ver 2.6b2 Allineamento con common 2.6b2
|
||||
-- 2024/02/20 ver 2.6b3 Allineamento con common 2.6b3
|
||||
-- 2024/02/26 ver 2.6b4 Allineamento con common ver. 2.6b4; in mlde aggiunte chiamate EgtAddToPackagePath
|
||||
-- 2024/02/29 ver 2.6c1 Allineamento con common ver. 2.6c1
|
||||
-- 2024/03/04 ver 2.6c2 Modificato log con nome macchina
|
||||
-- Allineamento con common ver. 2.6c2
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.6a2'
|
||||
PP_VER = '2.6c2'
|
||||
MIN_MACH_VER = '2.5k1'
|
||||
MACH_NAME = 'Essetre-PF1250MAX'
|
||||
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
INFO_STD_PP = dofile( sBaseDir .. 'Version.lua')
|
||||
-- Carico i dati globali
|
||||
local sMachDir = EgtGetCurrMachineDir()
|
||||
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
|
||||
EgtRemoveBaseMachineDirFromPackagePath()
|
||||
EgtAddToPackagePath( sMachDir .. '\\Beam\\?.lua')
|
||||
EgtAddToPackagePath( sMachDir .. '\\?.lua')
|
||||
INFO_STD_PP = require( 'Version')
|
||||
-- prendo la versione kernel minima necessaria piu' nuova tra macchina e script comuni
|
||||
if INFO_STD_PP.MIN_MACH_VER_PP_COMMON > MIN_MACH_VER then
|
||||
MIN_MACH_VER = INFO_STD_PP.MIN_MACH_VER_PP_COMMON
|
||||
end
|
||||
|
||||
EgtOutLog ( '** Essetre-PF1250MAX '..PP_VER..' (MinMach '.. MIN_MACH_VER ..') **', 1)
|
||||
EgtOutLog ( '** ' .. MACH_NAME..' '..PP_VER..' ** ( '..INFO_STD_PP.NAME..': '..INFO_STD_PP.VERSION..' - MinMach: '.. MIN_MACH_VER ..') **', 1)
|
||||
|
||||
-- Parametri macchina
|
||||
NumericalControl = 'TPA' -- NUM o TPA
|
||||
@@ -99,6 +118,10 @@ ParkCSaw0Z1 = -400
|
||||
ParkCSawC1 = -90
|
||||
ParkCSaw0C1 = 0
|
||||
ParkCSawB1 = 0
|
||||
MinLengthLongCSaw = 580 -- gestione speciale per motosega molto lunga. Lunghezza al di sopra della quale è considerata motosega lunga
|
||||
ParkLongCSawZ1 = -50 -- gestione speciale per motosega molto lunga. Parcheggio asse Z
|
||||
ParkLongCSawC1 = 0 -- gestione speciale per motosega molto lunga. Parcheggio asse C
|
||||
ParkLongCSawB1 = -90 -- gestione speciale per motosega molto lunga. Parcheggio asse B
|
||||
LongTool = 400
|
||||
ParkLongTc1C1 = 0
|
||||
ParkLongTc2C1 = -180
|
||||
@@ -152,8 +175,8 @@ WriteAllCoordsOnFirstM101 = true
|
||||
|
||||
-- Aggiornamento con dati da TechnoEssetre7
|
||||
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250MAX.data"
|
||||
local sDataBeam = EgtGetSourceDir().."\\Beam\\Ts3Data.lua"
|
||||
local sDataWall = EgtGetSourceDir().."\\Wall\\Ts3Data.lua"
|
||||
local sDataBeam = sMachDir.."\\Beam\\Ts3Data.lua"
|
||||
local sDataWall = sMachDir.."\\Wall\\Ts3Data.lua"
|
||||
if EgtExistsFile( sTs3Data) then
|
||||
EgtCopyFile( sTs3Data, sDataBeam)
|
||||
EgtCopyFile( sTs3Data, sDataWall)
|
||||
@@ -474,8 +497,8 @@ if TcAggreBladeUnder then
|
||||
Rot2Stroke = { MinB2b, MaxB2b},
|
||||
OthColl = {'B2/SOLID', 'C2/SOLID'},
|
||||
Geo = 'H22_HEAD/GEO'}
|
||||
EgtSetInfo( H21Id, 'ABOVE', '0')
|
||||
EgtSetInfo( H21Id, 'ZHOMEDOWN', '1')
|
||||
EgtSetInfo( H22Id, 'ABOVE', '0')
|
||||
EgtSetInfo( H22Id, 'ZHOMEDOWN', '1')
|
||||
end
|
||||
-- *** Carrelli ***
|
||||
-- Morse
|
||||
@@ -955,9 +978,8 @@ function OnSetHead()
|
||||
-- aggiustamenti per distanza
|
||||
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
|
||||
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT or 1, Point3d( 0, 0, -dDist))
|
||||
-- recupero valore asse A1 bloccato
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
|
||||
local CSawPosA = tonumber( sVal:sub( 4) or '')
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local CSawPosA = GetCurrChainSawingVirtualAxis()
|
||||
EmtModifyAxisHome( 'X1', ParkCSawX1)
|
||||
EmtModifyAxisHome( 'Z1', GetChainSawZHomeFromVirtualAxis( CSawPosA))
|
||||
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
|
||||
@@ -979,7 +1001,7 @@ function OnSetHead()
|
||||
-- se testa H22 (lama su aggregato sotto)
|
||||
elseif EMC.HEAD == 'H22' then
|
||||
-- recupero valore asse A2 bloccato
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A1=0'
|
||||
local SawUnderPosA2 = tonumber( sVal:sub( 4) or '') or 0
|
||||
EmtModifyAxisHome( 'C2', GetSawCHomeFromVirtualAxis( SawUnderPosA2))
|
||||
EmtModifyAxisDirection( 'B2', Vector3d( cos( SawUnderC2Offs), -sin( SawUnderC2Offs), 0))
|
||||
@@ -1180,6 +1202,13 @@ function GetPY2Light()
|
||||
return ( EgtGetInfo( PY2LightId, 'On') == '1')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetCurrChainSawingVirtualAxis()
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A1=0'
|
||||
local dPosA = tonumber( sVal:sub( 4)) or 0
|
||||
return dPosA
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione per resettare tutte le attivazioni della macchina
|
||||
|
||||
Binary file not shown.
+44
-5
@@ -1,12 +1,51 @@
|
||||
==== Common_PF1250 Update Log ====
|
||||
|
||||
Versione 2.6c2 (04/03/2024)
|
||||
- (GEN) I commenti iniziali si scrivono in modo standard, per poterli commentare nella macchina di test
|
||||
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
|
||||
|
||||
Versione 2.6c1 (29/02/2024)
|
||||
- (SIM) Gestione rimozione VMILL per tagli a cubetti Zig-Zag
|
||||
|
||||
Versione 2.6b4 (23/02/2024)
|
||||
- (MLDE-SIM-GEN) EgtAddToPackagePath spostato in mlde
|
||||
|
||||
Versione 2.6b3 (20/02/2024)
|
||||
- (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) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
|
||||
|
||||
Versione 2.6b2 (15/02/2024)
|
||||
- (SIM-GEN) Primo movimento in X per testa 2 a SafeX2 anziché a ParkX2
|
||||
|
||||
Versione 2.6b1 (07/02/2024)
|
||||
- (MLDE-SIM-GEN) Inserito parametro 'MinLengthLongCSaw' per gestione motosega molto lunga
|
||||
- (MLDE) funzione 'GetCurrChainSawingVirtualAxis' spostata in MLDE
|
||||
|
||||
Versione 2.6a5 (31/01/2024)
|
||||
- (SIM) Migliorata simulazione apertura/chiusura morse in caso di separazione
|
||||
- (SIM-GEN) Migliorata gestione movimenti con motosega e adeguato simulazione
|
||||
- (GEN) Corretta scrittura assi in caso di 'WriteAllCoordsOnFirstM101' per testa 2
|
||||
- (SIM-GEN) Caricamento BeamData come local
|
||||
|
||||
Versione 2.6a4 (25/01/2024)
|
||||
- (SIM-GEN) Corretto movimento in caso di cambio assi rotanti tra due lavorazioni
|
||||
- (GEN) Corretta emissione coordinate assi in caso di 'WriteAllCoordsOnFirstM101'
|
||||
|
||||
Versione 2.6a3 (22/01/2024)
|
||||
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale
|
||||
- (GEN) Modificato flag 'EmitRapidInG0' in 'EmitRapidInG1' per decidere se scrivere G1 anziché G0. Se flag a nil, scrive i rapidi in G0
|
||||
- (SIM) Correzione movimenti pinze prima di separazione
|
||||
|
||||
Versione 2.6a2 (19/01/2024)
|
||||
- (GEN) Corretta inversione coordinata X per Lama su aggregato da sotto
|
||||
- (SIM) Se modalità 'WriteAllCoordsOnFirstM101', oltre alla X si scive quota di parcheggio assi B2 e C2 come in generazione
|
||||
- (SIM-GEN) Tolta gestione rotazione pezzo (di derivazione PF), in macchina non è previsto ribaltamento
|
||||
- (GEN) Migliorata gestione preselezione utensile
|
||||
- (MLDE-GEN) Aggiunto flag 'EmitRapidInG0' per decidere se scrivere G0 anziché G1. Se flag a nil, scrive i rapidi in G1
|
||||
|
||||
Versione 2.6a1 (09/01/2024)
|
||||
- Prima versione post-proc comune tra macchine PF1250 e PF1500
|
||||
- (SIM-GEN) Corretto movimento testa 2 in ToolDesel e movimento controllo collisione
|
||||
- (GEN) Tolta testa H14 per utensili speciali. Si utilizza H11 per frese standard
|
||||
- (MLDE-GEN) Costanti 'MinForzaPinze' e 'MaxForzaPinze' portati in mlde/Ts3data (erano hardcoded)
|
||||
- (MLDE-SIM-GEN) Aggiunto parametro 'WriteAllCoordsOnFirstM101' per decidere se stampare tutti gli assi sulla prima M101
|
||||
|
||||
Versione 2.6a2 (09/01/2024)
|
||||
- (GEN) Corretta inversione coordinata X per Lama su aggregato da sotto
|
||||
- (SIM) Se modalità 'WriteAllCoordsOnFirstM101', oltre alla X si scive quota di parcheggio assi B2 e C2 come in generazione
|
||||
- (MLDE-SIM-GEN) Aggiunto parametro 'WriteAllCoordsOnFirstM101' per decidere se stampare tutti gli assi sulla prima M101
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
-- Version.lua by EgalWare s.r.l. 2023/11/28
|
||||
-- Version.lua by EgalWare s.r.l. 2024/01/22
|
||||
-- Gestione della versione dei file comuni post-processori macchine PF1250 e PF1500 di Essetre
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_PF1250', -- nome script PP standard
|
||||
VERSION = '2.6a2', -- versione script
|
||||
VERSION = '2.6c2', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ local WallData = {
|
||||
|
||||
-- Aggiornamento con dati da TechnoEssetre7
|
||||
local sTs3Data = EgtGetStringFromIni( 'Wall', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250.data"
|
||||
local sData = EgtGetSourceDir().."\\Ts3Data.lua"
|
||||
local sData = EgtGetCurrMachineDir().."\\Wall\\Ts3Data.lua"
|
||||
if EgtExistsFile( sTs3Data) then
|
||||
EgtCopyFile( sTs3Data, sData)
|
||||
local sTs3DataOld = sTs3Data..'.old'
|
||||
|
||||
Reference in New Issue
Block a user