Compare commits

..

44 Commits

Author SHA1 Message Date
daniele.nicoli 64d0a46970 Aggiunto Clamp di sicurezza per lettura dei parametri MinJoin da Ts3Data 2026-04-23 12:22:39 +02:00
daniele.nicoli 58db14bc02 Merge remote-tracking branch 'origin/master' into develop 2026-04-23 12:21:55 +02:00
andrea.villa 87d240b49f Merge remote-tracking branch 'origin/develop' 2026-03-17 15:22:53 +01:00
andrea.villa 14b225a4b0 Allineamento a common ver. 3.1c2 2026-03-17 15:22:40 +01:00
daniele.nicoli d7aa89fad5 Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 09:16:54 +01:00
daniele.nicoli 11459ac20b Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 08:45:06 +01:00
daniele.nicoli ecfae285f3 Aggiunti parametri letti da TS3Data.lua: MIN_JOIN_S, MIN_JOIN_L e MAX_ANGLE_DRILL_CUT 2026-03-05 14:58:47 +01:00
daniele.nicoli db78493a2a Merge remote-tracking branch 'origin/master' into develop 2026-03-05 14:55:54 +01:00
andrea.villa 88d53d6195 Merge remote-tracking branch 'origin/develop' 2026-02-20 09:16:45 +01:00
andrea.villa 81ee9426c1 Allineamento con common ver. 3.1b1 2026-02-20 09:16:32 +01:00
daniele.nicoli c578b2c03d Aggiunta la lettura da TS3Data.lua delle corse dell'asse W (MIN_W e MAX_W) 2026-02-03 11:10:19 +01:00
daniele.nicoli 8ccbe8263e Merge branch 'master' into develop 2026-02-03 11:09:54 +01:00
andrea.villa 1f9a271e7b Allineamento con common ver. 3.1a1 2026-01-16 15:49:36 +01:00
andrea.villa 72cf8717b2 Merge branch 'develop' 2025-12-18 16:17:03 +01:00
andrea.villa af58e92003 - Allineamento a common ver. 2.7l1
- Aggiunto parametro MAX_ANGLE_DRILL_CUT a BeamData
- Recupero nome macchina da funzione EGT
2025-12-18 16:16:47 +01:00
daniele.nicoli 232d5a36c7 Aggiornati mlde e nge in attesa di aggiornamento Common per Controllo Pinzaggio VMILL 2025-12-15 11:39:19 +01:00
daniele.nicoli 957942b623 Merge branch 'master' into develop 2025-12-15 10:57:37 +01:00
andrea.villa 5970cd61c1 Corretto disegno porta utensile 2025-12-11 09:29:16 +01:00
andrea.villa e6a6169f45 - Nuovo ToolHolder
- Allineamento con common ver. 2.7k3
2025-11-28 15:45:30 +01:00
andrea.villa 860e1fc5c1 Merge branch 'develop' 2025-11-20 17:01:24 +01:00
andrea.villa b4b11607e4 - Allineamento a common ver. 2.7k2
- Cambio versione per rilascio a cliente
2025-11-20 17:01:15 +01:00
daniele.nicoli eef2c16193 Aggiunta gestione CUT_SIC impostabile da TS3Data.lua 2025-11-13 12:39:22 +01:00
daniele.nicoli ce72052463 Merge branch 'master' into develop 2025-11-13 12:38:46 +01:00
andrea.villa f9b4eab0c9 Allineamento con common ver. 2.7k1 2025-11-05 13:27:09 +01:00
andrea.villa 7b4293688d Allineamento con common ver. 2.7j3 2025-10-23 07:54:10 +02:00
andrea.villa 09baa44e02 #critical# Allineamento con common ver. 2.7j2 2025-10-21 10:51:45 +02:00
andrea.villa 0dea456d13 Allineamento con common ver. 2.7j1 2025-10-08 13:17:42 +02:00
andrea.villa 24d88cde41 Allineamento con common ver. 2.7i1, HOTFIX 2025-09-10 12:13:11 +02:00
andrea.villa e5ee956c8e Merge remote-tracking branch 'origin/develop' 2025-09-10 10:40:42 +02:00
andrea.villa 5e1c975ef7 - Allineamento common ver. 2.7i1
- Aggiunto solido collisione per tappeto
2025-09-10 10:40:28 +02:00
andrea.villa 842c491713 Merge branch 'NewAggregateBH' into develop 2025-09-10 10:38:33 +02:00
andrea.villa d49127232e Merge branch 'develop' into NewAggregateBH 2025-08-28 15:21:27 +02:00
andrea.villa 6627aae2de Merge branch 'master' into develop 2025-08-28 15:20:55 +02:00
andrea.villa 1b613a97a4 Allineamento con common ver. 2.7h2 2025-08-28 15:20:17 +02:00
andrea.villa 53e583b9d2 Merge branch 'master' into NewAggregateBH 2025-08-20 14:41:31 +02:00
andrea.villa 12e7ee1e0e Allineamento con common ver. 2.7h1 2025-08-20 14:40:41 +02:00
andrea.villa 8c31dbcf51 Prima versione funzionante aggregato BH. Da testare in macchina! 2025-07-24 08:55:08 +02:00
andrea.villa 4cc33e3b95 - Allineamento con common ver. 2.7g4
- Aggiunto parametro MaxBackClamp5
2025-07-23 12:25:52 +02:00
andrea.villa a4b6a9c93f Allineamento con common ver. 2.7g3 2025-07-22 11:22:06 +02:00
andrea.villa dc4bf6f405 Aggiunta nuovo tipo di lavorazione 2025-07-21 09:00:48 +02:00
andrea.villa fbea0da2dd Allineamento con common ver. 2.7g2 2025-07-08 10:39:13 +02:00
andrea.villa 7284b417a9 Allineamento con common ver. 2.7g1 2025-07-01 10:41:34 +02:00
luca.mazzoleni 28c911ebe1 Merge branch 'master' of https://gitlab.steamware.net/egalware-machines/essetre/Essetre-PFrl 2025-06-23 15:03:33 +02:00
luca.mazzoleni a613078e3f update BeamData.GetSetupInfo per nuovo automatismo 2025-06-23 15:03:25 +02:00
17 changed files with 969 additions and 775 deletions
+28 -4
View File
@@ -42,6 +42,7 @@ local BeamData = {
DRILL_TOL = 0.2, -- tolleranza tra diametro foro e diametro punta
DRILL_VZ_MIN = - 0.51, -- componente limite in Z del versore di un foro
DRILL_VX_MAX = 0.867, -- componente limite in X del versore di un foro sulle facce laterali
MAX_ANGLE_DRILL_CUT = 15, -- delta angolo massimo tra foro e taglio che lo attraversa
DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale
@@ -68,13 +69,16 @@ local BeamData = {
KIOTP = 5, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare
MAXDIAM_POCK_CORNER = 31, -- diametro massimo utensile ammesso per tasche con angoli interni
USE_LONGCUT = true, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
HEAD_DIM_FOR_BH = 125, -- dimensione di ingombro della testa per block haus
MAX_LEN_BH_FROM_BOTTOM = 210, -- massima lunghezza lavorabile da un lato di block haus da sotto
MAX_DIST_BH_FROM_BOTTOM = 600, -- massima distanza tra naso mandrino e sopra della trave senza collisione
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta
ADVANCE_TAIL_OFFS = 10, -- accorciamento taglio di coda avanzato (minimo 1)
DOUBLE_HEAD_DOVETAIL = false, -- flag abilitazione lavorazione mortase a coda di rondine in doppio
DOUBLE_HEAD_MORTISE = false, -- flag abilitazione lavorazione mortase in doppio
DOUBLE_HEAD_DRILLING = false, -- flag abilitazione forature in doppio
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
CLAMP5 = false -- presenza pinza speciale per pezzi piccoli
}
@@ -99,6 +103,8 @@ if EgtExistsFile( sData) then
if Machine.Offsets.DOUBLE_HEAD_DOVETAIL then BeamData.DOUBLE_HEAD_DOVETAIL = ( Machine.Offsets.DOUBLE_HEAD_DOVETAIL == 1) end
if Machine.Offsets.DOUBLE_HEAD_MORTISE then BeamData.DOUBLE_HEAD_MORTISE = ( Machine.Offsets.DOUBLE_HEAD_MORTISE == 1) end
if Machine.Offsets.DOUBLE_HEAD_DRILLING then BeamData.DOUBLE_HEAD_DRILLING = ( Machine.Offsets.DOUBLE_HEAD_DRILLING == 1) end
if Machine.Offsets.PRECUT_HEAD_DISABLE then BeamData.PRECUT_HEAD = ( Machine.Offsets.PRECUT_HEAD_DISABLE == 0) end
if Machine.Offsets.PRECUT_TAIL_DISABLE then BeamData.PRECUT_TAIL = ( Machine.Offsets.PRECUT_TAIL_DISABLE == 0) end
BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S)
BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L)
BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA
@@ -106,8 +112,17 @@ if EgtExistsFile( sData) then
BeamData.DIM_STRIP_SMALL = Machine.Offsets.DIM_STRIP_SMALL or BeamData.DIM_STRIP_SMALL
BeamData.DIM_TO_CENTER_STRIP = Machine.Offsets.DIM_TO_CENTER_STRIP or BeamData.DIM_TO_CENTER_STRIP
BeamData.MAXDIAM_POCK_CORNER = Machine.Offsets.MAXDIAM_POCK_CORNER or BeamData.MAXDIAM_POCK_CORNER
if Machine.Offsets.PRECUT_HEAD_DISABLE then BeamData.PRECUT_HEAD = ( Machine.Offsets.PRECUT_HEAD_DISABLE == 0) end
if Machine.Offsets.PRECUT_TAIL_DISABLE then BeamData.PRECUT_TAIL = ( Machine.Offsets.PRECUT_TAIL_DISABLE == 0) end
BeamData.LONGCUT_ENDLEN = Machine.Offsets.LONGCUT_ENDLEN or BeamData.LONGCUT_ENDLEN
BeamData.LONGCUT_MAXLEN = Machine.Offsets.LONGCUT_MAXLEN or BeamData.LONGCUT_MAXLEN
BeamData.ADVANCE_TAIL_OFFS = Machine.Offsets.ADVANCE_TAIL_OFFS or BeamData.ADVANCE_TAIL_OFFS
BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
if Machine.Offsets.MAX_ANGLE_DRILL_CUT then BeamData.MAX_ANGLE_DRILL_CUT = EgtClamp( Machine.Offsets.MAX_ANGLE_DRILL_CUT, 1, 89) end
if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = EgtClamp( Machine.Offsets.MIN_JOIN_S, 80, 150) end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = EgtClamp( Machine.Offsets.MIN_JOIN_L, 300, 450) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
@@ -219,6 +234,7 @@ local function GetSetupInfo( sHead)
SetupInfo.bIsCSymmetrical = true
SetupInfo.dCAxisEncumbrance = 180
SetupInfo.bToolOnAggregate = false
SetupInfo.Head = {}
-- testa 5 assi da sopra, dietro
if sHead == 'H11' then
@@ -235,11 +251,19 @@ local function GetSetupInfo( sHead)
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = { bFront = false, bBack = true}
SetupInfo.dMinNz = sin( -45)
-- se con aggregato si considera non simmetrico
SetupInfo.bIsCSymmetrical = false
-- riduzione massimo materiale se usato in tagli orizzontali con affondamento verticale
SetupInfo.dMaxMatDecrease = 20
-- lama su testa 5 assi da sopra, davanti
elseif sHead == 'H22' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = { bFront = true, bBack = false}
SetupInfo.dMinNz = sin( -45)
-- se con aggregato si considera non simmetrico
SetupInfo.bIsCSymmetrical = false
-- riduzione massimo materiale se usato in tagli orizzontali con affondamento verticale
SetupInfo.dMaxMatDecrease = 20
-- motosega 1
elseif sHead == 'H13' or sHead == 'H23' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
+2
View File
@@ -36,6 +36,8 @@
22=Long2CutSide
23=SmallToolContour
24=AntiSplintMillCut
25=Prof_end
26=SideMillAsBlade
[Pocketing]
1=Pocket
+350 -381
View File
File diff suppressed because it is too large Load Diff
+347 -257
View File
@@ -79,6 +79,14 @@ function OnSimulStart()
if vTools and vTools[1] and #(vTools[1]) > 0 then
EgtLoadTool( vTcPos[i], 1, vTools[1])
ShowToolInTcPos( vTcPos[i], true)
-- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL
if EgtTdbSetCurrTool(vTools[1]) then -- set utensile corrente
if EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_STD or EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_FLAT then -- controllo tipo utensile sega
local dCurrSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) * 0.9
-- se non definito o minore del valore precedente aggiorna la tolleranza
EMT.VMILLTOL = EgtIf( not EMT.VMILLTOL or dCurrSawLen < EMT.VMILLTOL, dCurrSawLen, EMT.VMILLTOL)
end
end
end
end
end
@@ -88,10 +96,6 @@ function OnSimulStart()
if DefTcPos2 then
LoadFirstTool( 2, DefTcPos2)
end
-- se presenti, nascondo i tastatori
DeactivateProbeTool()
ExecStartHome()
-- Se reset o home, esco
if EMT.SIM1ST then return end
@@ -133,7 +137,7 @@ function OnSimulStart()
end
-- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF
if Progress or Mortiser or EgtGetHeadId( 'H21') then
if Progress or Mortiser or EgtGetHeadId( 'H21') or SecondToolChanger then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'})
end
-- gruppo MORTISER si attiva solo se PF con BIT mortiser attivo
@@ -241,9 +245,9 @@ function OnSimulDispositionStart()
end
end
-- determino la risoluzione dello Zmap
local dTol = 4.00
local dTol = 4.71
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.00)
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then
@@ -260,6 +264,7 @@ function OnSimulDispositionStart()
dTol = 3.77
end
end
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
-- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
if VMillId then
@@ -476,6 +481,7 @@ function OnSimulDispositionEnd()
EMT.UNLOADING = false
EMT.FALL = false
EMT.TO_FALL = false
EMT.Y2DELTA = nil
end
-- se disposizione intermedia
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
@@ -507,11 +513,9 @@ function OnSimulToolSelect( dPosA)
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
local nSetHead = GetHeadSet( EMT.HEAD)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
EMT.ISPROBING = HeadIsProbe( EMT.HEAD)
-- se ho due teste, verifico che l'altra sia dalla parte opposta
if EgtGetHeadId( 'H21') then
if bIsFirstHead then
if nSetHead == 1 then
EgtSetAxisPos( 'X2', MinX2)
else
EgtSetAxisPos( 'X1', MaxX1)
@@ -519,10 +523,8 @@ function OnSimulToolSelect( dPosA)
end
-- se sega a catena, imposto subito angolo scelto per asse virtuale A
if HeadIsChainSaw( EMT.HEAD) then
-- se non Progress, apro le paratie
if not Progress then
ExecParkRoller( nil, nil, nil, nil, false, IsStartPhase( EMT.PHASE))
end
-- apro le paratie
ExecParkRoller( nil, nil, nil, nil, false, IsStartPhase( EMT.PHASE))
-- valore dell'asse virtuale
dPosA = dPosA or GetNextChainSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A
@@ -549,69 +551,6 @@ function OnSimulToolSelect( dPosA)
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end
-- se tastatore
if HeadIsProbe( EMT.HEAD) then
local bChanged = true
if bIsFirstHead then
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H1) then
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
EgtLoadTool( EMT.PROBENEXTHEAD_H1, 1, EMT.PROBENEXTTOOL_H1)
EMT.TCPOS = EMT.PROBENEXTTCPOS_H1
EMT.HEAD = EMT.PROBENEXTHEAD_H1
EMT.TOOL = EMT.PROBENEXTTOOL_H1
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H1) then
bChanged = false
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos1
EMT.TOOL = GetToolNameFromTcPos( DefTcPos1)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
end
else
-- se prossimo utensile compatibile, lo prelevo
if IsToolCompatibleWithProbe( EMT.PROBENEXTTOOL_H2) then
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
EgtLoadTool( EMT.PROBENEXTHEAD_H2, 1, EMT.PROBENEXTTOOL_H2)
EMT.TCPOS = EMT.PROBENEXTTCPOS_H2
EMT.HEAD = EMT.PROBENEXTHEAD_H2
EMT.TOOL = EMT.PROBENEXTTOOL_H2
else
-- se vecchio utensile compatibile, tengo quello caricato
if IsToolCompatibleWithProbe( EMT.PREVTOOL_H2) then
bChanged = false
-- altrimenti si seleziona utensile di default
else
ExecMoveZmax( EMT.MCHSPLIT, true)
EMT.TCPOS = DefTcPos2
EMT.TOOL = GetToolNameFromTcPos( DefTcPos2)
EMT.HEAD, _ = GetToolHead( EMT.TOOL)
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
end
end
-- se cambiato utensile, si setta subito nome precedente
if bChanged then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
-- carico utensile, con breve pausa
EgtPause( 100)
EgtOutText( '')
@@ -680,57 +619,10 @@ function OnSimulToolDeselect( dPrevA)
LoadNextTool( 2, DefTcPos2)
end
end
-- se presenti, nascondo i tastatori
DeactivateProbeTool()
local bSkipToolChange = false
-- se prossima lavorazione è tastatura, si controlla compatibilità con utensile successivo
if HeadIsProbe( EMT.NEXTHEAD) then
local idProbeMachining = EgtGetNextActiveOperation( EMT.MCHID)
local bFound = false
local nProbeHead = GetHeadSet( EMT.NEXTHEAD)
local idProbeNextMachining = EgtGetNextActiveOperation( idProbeMachining)
while not bFound do
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
local sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
if sToolNameNextProbe then
local sToolHeadNextProbe, sToolTcPosNextProbe = GetToolHead( sToolNameNextProbe)
local nToolHead = GetHeadSet( sToolHeadNextProbe)
-- se sono sulla stessa testa
if nToolHead == 1 and nProbeHead == 11 then
EMT.PROBENEXTTOOL_H1 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H1 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H1 = sToolTcPosNextProbe
bFound = true
elseif nToolHead == 2 and nProbeHead == 21 then
EMT.PROBENEXTTOOL_H2 = sToolNameNextProbe
EMT.PROBENEXTHEAD_H2 = sToolHeadNextProbe
EMT.PROBENEXTTCPOS_H2 = sToolTcPosNextProbe
bFound = true
end
end
else
break
end
idProbeNextMachining = EgtGetNextActiveOperation( idProbeNextMachining)
end
-- ripristino lavorazione corrente
EgtSetCurrMachining( EMT.MCHID)
if nProbeHead == 11 and not( IsToolCompatibleWithProbe( EMT.PREVTOOL_H1)) then
;
elseif nProbeHead == 21 and not( IsToolCompatibleWithProbe( EMT.PREVTOOL_H2)) then
;
else
bSkipToolChange = true
end
end
-- reset flag sega a catena già depositata
EMT.CHSAW_OUT = nil
-- se utensile non cambia e non è sega a catena, esco
if bSkipToolChange or ( ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD)) then return end
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end
-- deposito utensile
EgtOutText( 'Tool change in progress...')
-- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa
@@ -739,7 +631,7 @@ function OnSimulToolDeselect( dPrevA)
-- se ci sono due teste
if EgtGetHeadId( 'H21') then
local nSetHead = GetHeadSet( EMT.NEXTHEAD)
if nSetHead == 1 or nSetHead == 11 then
if nSetHead == 1 then
-- porto in home testa 1
SimulMoveAxis( 'X1', MaxX1, MCH_SIM_STEP.RAPID)
-- deposito utensile fresa
@@ -764,7 +656,7 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
-- deposito utensile lama
elseif EMT.PREVHEAD_H1 == 'H12' then
elseif EMT.PREVHEAD_H1 == 'H12' or EMT.PREVHEAD_H1 == 'H17' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
@@ -795,7 +687,7 @@ function OnSimulToolDeselect( dPrevA)
if nSetHead == 1 and EMT.PREVHEAD_H1 then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID)
elseif nSetHead == 2 and EMT.PREVHEAD_H2 then
elseif EMT.PREVHEAD_H2 then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
end
@@ -826,18 +718,18 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end
-- per prossima testa gruppo 1
elseif nNextSetHead == 1 then
else
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
-- prendo utensile fresa o lama
if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' then
if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' or EMT.NEXTHEAD == 'H17' then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
local MyParkB1 = ParkB1
local MyParkC1 = ParkC1
-- se ho due teste oppure è progress, significa che ho CU verticale
if EgtGetHeadId('H21') or bProgress then
if EgtGetHeadId('H21') or Progress or SecondToolChanger then
MyParkB1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkB1, ParkFrnB1)
MyParkC1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkC1, ParkFrnC1)
-- altrimenti su one CU speciale motosega-utensile lungo
@@ -888,6 +780,7 @@ function OnSimulMachiningStart()
EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and not EMT.MCHUSERNOTES:find( 'VMRS=0;', 1, true))
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- recupero TASKID della feature lavorata
local vId = EgtGetMachiningGeometry()
if vId and #vId > 0 and #vId[1] > 0 then
@@ -958,7 +851,6 @@ function OnSimulMachiningEnd()
EMT.DOU_TOOL = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- se non ho già tolto la sega a catena, aggiorno valori
if not EMT.CHSAW_OUT then
-- per gruppo testa 1
@@ -1082,7 +974,12 @@ function OnSimulMoveStart()
-- pinza 5
if EMT.W2DELTA then
EMT.A5n = 'W'
EMT.A5m = 'T'
local dPosQW = EgtGetAxisPos( 'QW') or 0
if dPosQW < 1 then
EMT.A5m = nil
else
EMT.A5m = 'T'
end
EMT.A5 = EMT.L1 + EMT.W2DELTA - EMT.A4
VerifyWStroke( EMT.A5)
end
@@ -1154,7 +1051,15 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
@@ -1170,9 +1075,9 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1201,13 +1106,13 @@ function OnSimulMoveStart()
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then
-- se movimento iniziale da Zmax con lama o fresa
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H17' then
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( -EMT.L2 < -LimX1RotSaw or EMT.R2 > 91) then
if EMT.HEAD == 'H12' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
@@ -1223,7 +1128,15 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
@@ -1236,9 +1149,9 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena (H13 o H15)
else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1295,7 +1208,15 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
@@ -1312,9 +1233,9 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1460,7 +1381,7 @@ function OnSimulMoveEnd()
-- eventuale rimozione sfridi
ExecRemoveScraps()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
local sNextTool = GetNextTool( EMT.MCHID, true)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
@@ -1594,7 +1515,7 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
elseif Cmd[1] == '11' then
local bClose = Cmd[2] ~= '0'
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
if bPathStart and EMT.MCHSPLIT and not ( EMT.FALL or EMT.TO_FALL) and GetPY2Light() then bClose = false end
ExecMovePY1( bClose)
elseif Cmd[1] == '12' then
ExecMovePY2( Cmd[2] ~= '0')
@@ -1712,7 +1633,15 @@ function ExecMoveHome( bNearV, bMchSplit)
EMT.CHSAW_OUT = true
end
-- porto le teste in home
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID, 'X2', ParkX2, MCH_SIM_STEP.RAPID)
if EgtGetHeadId( 'H21') then
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID, 'X2', ParkX2, MCH_SIM_STEP.RAPID)
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'X1', ParkFrnX1, MCH_SIM_STEP.RAPID)
end
end
-- sistemo i rulli
ExecOpenRoller( 1)
ExecOpenRoller( 2)
@@ -1728,50 +1657,16 @@ function ExecMoveZmax( bMchSplit, btoXHome)
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 0 then return end
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
if EMT.ISPROBING then
-- se lavorazione successiva con stessa testa non si va a Z massima
local sToolNameNextProbe
local idProbeNextMachining = EgtGetNextActiveOperation( EMT.MCHID)
if idProbeNextMachining then
EgtSetCurrMachining( idProbeNextMachining)
sToolNameNextProbe = EgtGetMachiningParam( MCH_MP.TOOL)
EgtSetCurrMachining( EMT.MCHID)
end
local bMoveToZMax = true
if sToolNameNextProbe and bIsFirstHead and EMT.PREVTOOL_H1 == sToolNameNextProbe then
bMoveToZMax = false
elseif sToolNameNextProbe and not bIsFirstHead and EMT.PREVTOOL_H2 == sToolNameNextProbe then
bMoveToZMax = false
end
-- se non serve alzarsi
if not bMoveToZMax then
local vtE = Vector3d( EMT.EXTR)
local ProbePosZ
-- ci si riporta in posizione fuori ingombro pezzo
if AreSameVectorApprox( vtE, Y_AX()) or AreSameVectorApprox( vtE, -Y_AX()) then
ProbePosZ = EMT.TABORI1[3] + EMT.SB
if nSetHead == 1 then
SimulMoveAxis( 'Z1', ProbePosZ, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'Z2', ProbePosZ, MCH_SIM_STEP.RAPID)
end
end
return
end
end
-- posizioni correnti degli assi testa
local CurrX = EgtGetAxisPos( EgtIf( bIsFirstHead, 'X1', 'X2'))
local CurrZ = EgtGetAxisPos( EgtIf( bIsFirstHead, 'Z1', 'Z2'))
local CurrC = EgtGetAxisPos( EgtIf( bIsFirstHead, 'C1', 'C2'))
local CurrB = EgtGetAxisPos( EgtIf( bIsFirstHead, 'B1', 'B2'))
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'))
-- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'X1', 'X2'))
local HomeZ = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'Z1', 'Z2'))
local HomeC = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'C1', 'C2'))
local HomeB = EgtGetAxisHomePos( EgtIf( bIsFirstHead, 'B1', 'B2'))
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'))
-- 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
@@ -1782,7 +1677,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
ExecParkRoller( nil, nil, nil, nil, bMchSplit, bAgg)
end
-- se testa 1
if bIsFirstHead then
if nSetHead == 1 then
-- se fresa o lama
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
if not HeadIsChainSaw( EMT.HEAD) then
@@ -1826,24 +1721,40 @@ function ExecMoveZmax( bMchSplit, btoXHome)
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
else
-- se sega a catena
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
if EMT.HEAD == 'H12' and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) or not( bProgress) then
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
EMT.XHOME = true
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X1', HomeX, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
else
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN), 2) + pow( ChSawLen + MillOffs, 2))
if EMT.ADIR and EMT.TDIR then
-- direzione versore sega a catena X- (copre anche eventuali inclinazioni in Y)
if EMT.TDIR[1] <= 0 then
-- ingombro massimo di quota Z (senza pivot) + ingombro massimo sega + altezza pezzo + altezza sicurezza
local dEncumbranceTot = EMT.L3p + MillOffs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3p + ( DeltaTabZ - dEncumbranceTot)
-- se la nuova quota è minore della quota di parcheggio
if dZUp <= ParkCSawZ1 then
-- se B è oltre il punto di massimo ingombro (con l'inclinazione attuale non ha il massimo ingombro)
if asin( EMT.TDIR[3] / 1) > asin( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) / dChSawEncumbrance) and ( dEncumbranceTot < DeltaTabZ) then
SimulMoveAxis( 'Z1', dZUp, MCH_SIM_STEP.RAPID)
end
end
end
end
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
@@ -1851,6 +1762,8 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if btoXHome then
EgtUnloadTool( EMT.HEAD, 1)
ShowToolInTcPos( EMT.TCPOS, true)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.HEAD or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
EMT.PREVTOOL_H1 = nil
EMT.PREVHEAD_H1 = nil
EMT.PREVTCPOS_H1 = nil
@@ -1879,13 +1792,31 @@ function ExecMoveZmax( bMchSplit, btoXHome)
EMT.XHOME = true
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
-- altrimenti sega a catena
else
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN), 2) + pow( ChSawLen + Mill2Offs, 2))
if EMT.ADIR and EMT.TDIR then
-- direzione versore sega a catena X- (copre anche eventuali inclinazioni in Y)
if EMT.TDIR[1] <= 0 then
-- ingombro massimo di quota Z (senza pivot) + ingombro massimo sega + altezza pezzo + altezza sicurezza
local dEncumbranceTot = EMT.L3p + Mill2Offs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3p + ( DeltaTabZ - dEncumbranceTot)
-- se la nuova quota è minore della quota di parcheggio
if dZUp <= ParkCSawZ2 then
-- se B è oltre il punto di massimo ingombro (con l'inclinazione attuale non ha il massimo ingombro)
if asin( EMT.TDIR[3] / 1) > asin( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) / dChSawEncumbrance) and ( dEncumbranceTot < DeltaTabZ) then
SimulMoveAxis( 'Z2', dZUp, MCH_SIM_STEP.RAPID)
end
end
end
end
SimulMoveAxes( 'Z2', HomeZ, MCH_SIM_STEP.RAPID, 'B2', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'X2', ParkCSawX2, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
end
end
EMT.ZMAX = true
@@ -1960,16 +1891,163 @@ function ExecUnloading()
end
end
---------------------------------------------------------------------
function CheckClamping( sClampName)
nIndexClamp = EgtGetAxisId( sClampName)
local idClampPath = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nIndexClamp, 'CLAMP_CHECK') or GDB_ID.NULL)
local b3ClampingArea = EgtGetBBoxGlob( idClampPath or GDB_ID.NULL, GDB_BB.STANDARD)
-- se non trovo percorso area di clamping, esco subito
if not idClampPath or not EMT.VMILL or not ClampingCoeffMin then
return
end
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
local idCurveList = {}
local vtIntersPlane
-- piano di interpolazione
if sIntersPlane == 'X' then
vtIntersPlane = X_AX()
elseif sIntersPlane == 'Y' then
vtIntersPlane = Y_AX()
elseif sIntersPlane == 'Z' then
vtIntersPlane = Z_AX()
end
for i = 1, #EMT.VMILL do
local b3VMill = EgtGetBBoxGlob( EMT.VMILL[i], GDB_BB.EXACT)
local ptPosIntersPlane
if sPosIntersPlane == 'MIN' then
ptPosIntersPlane = b3VMill:getMin() + dDepth * vtIntersPlane
elseif sPosIntersPlane == 'MAX' then
ptPosIntersPlane = b3VMill:getMax() - dDepth * vtIntersPlane
end
local idLoop, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
-- se c'è almeno una curva
if idLoop then
for j = 1, nLoopCnt do
local idLoopTemp = idLoop + j - 1
table.insert( idCurveList, idLoopTemp)
end
end
end
return idCurveList
end
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
-- test piano frontale
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
-- si copia curva intersezione e curva pinza in gruppo di confronto
local idFlatSurf, nFlatSurfCnt = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idCurveList)
local idClampSurf = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idClampPath)
if idFlatSurf then
local dTotalArea = 0
local dTotalXLenght = 0
for k = 1, nFlatSurfCnt do
local idTempSurf = idFlatSurf + k - 1
EgtSurfFrIntersect( idTempSurf, idClampSurf)
if idTempSurf then
dTotalArea = dTotalArea + ceil( EgtSurfArea( idTempSurf) or 0)
local b3BoxIntersectionBox = EgtGetBBoxGlob( idTempSurf, GDB_BB.STANDARD)
if b3BoxIntersectionBox then
dTotalXLenght = dTotalXLenght + ceil( b3BoxIntersectionBox:getDimX()) -- somma lunghezze (x) delle aree pinzate
end
end
end
return dTotalArea, dTotalXLenght
end
return 0
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
local MinJoin = BD.GetMinJoin( EMT.HB, EMT.SB, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinZClamping = min( b3ClampingArea:getDimZ() + DistZClampToTable, EMT.SB) - DistZClampToTable
-- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio
ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1)
local dMinClampingAreaWarn = ( MinJoin * MinZClamping) * ClampingCoeffMin
local dMinClampingAreaErr = ( MinJoin * MinZClamping) * ( ClampingCoeffMin / 3)
local bError = true
local sWrn, sErr
local bWriteWarnMessage = false
local bWriteErrMessage = false
-- controllo faccia frontale
local dArea, dXClampedLenght = CalculateIntersectionArea( 'MIN', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteErrMessage = true
end
end
-- WARNING: pinza meno del minimo richiesto
if dArea and dArea < dMinClampingAreaWarn and not bWriteErrMessage then
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteWarnMessage = true
end
EgtEmptyGroup( CLAMP_CHECK_GROUP)
EgtEmptyGroup( CLAMP_CHECK_INTERS)
-- controllo altro lato solo se non sono già in errore
if not bWriteErrMessage then
-- controllo faccia posteriore
dArea = CalculateIntersectionArea( 'MAX', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteErrMessage = true
end
end
-- WARNING: pinza meno del minimo richiesto
if dArea and dArea < dMinClampingAreaWarn and not bWriteWarnMessage and not bWriteErrMessage then
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteWarnMessage = true
end
EgtEmptyGroup( CLAMP_CHECK_GROUP)
EgtEmptyGroup( CLAMP_CHECK_INTERS)
end
if bWriteErrMessage then
EmtSetLastError( 1213, sErr, EgtGetEnableUI())
EgtOutBox( sErr, 'CLAMPING', 'ERROR', 'OK')
EmtSetSimulPause()
elseif bWriteWarnMessage then
EgtOutLog( sWrn)
EgtOutBox( sWrn, 'CLAMPING', 'WARNING', 'OK')
EmtSetSimulPause()
end
end
---------------------------------------------------------------------
function ExecMovePY1( bClose)
SimulMoveAxis( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( bClose)
if bClose then
CheckClamping( 'PY1')
end
end
---------------------------------------------------------------------
function ExecMovePY2( bClose)
SimulMoveAxis( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( bClose)
if bClose then
CheckClamping( 'PY2')
end
end
---------------------------------------------------------------------
@@ -2357,6 +2435,9 @@ end
---------------------------------------------------------------------
function GetV1ToClose()
if EMT.MCHPRECUT or EMT.MCHCUT then
return false
end
--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.LT or 0))
return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax)
@@ -2371,11 +2452,17 @@ end
---------------------------------------------------------------------
function ShowToolInTcPos( sTcPos, bShow)
-- recupero identificativo della posizione sul TC
local TcPosId = EgtGetTcPosId( sTcPos or '')
if not TcPosId then return end
-- recupero il gruppo dell'utensile
local TcExitId = EgtGetFirstNameInGroup( EgtGetTcPosId( sTcPos or '') or GDB_ID.NULL, 'T1')
local TcExitId = EgtGetFirstNameInGroup( TcPosId or GDB_ID.NULL, 'T1')
if not TcExitId then return end
-- imposto lo stato di visualizzazione
EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
-- recupero eventuale gruppo ausiliario da visualizzare/nascondere
local TcHSId = EgtGetFirstNameInGroup( TcPosId, sTcPos .. '_HS')
if TcHSId then EgtSetStatus( TcHSId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) end
end
---------------------------------------------------------------------
@@ -2396,7 +2483,7 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
if vTools and vTools[1] and #(vTools[1]) > 0 then
sTool = vTools[1]
sTcPos = sTcPosDef
if Progress then
if Progress or SecondToolChanger then
sHead = EgtIf( sTcPos == 'T11', 'H12', 'H11')
elseif nHSet == 1 then
sHead = EgtIf( sTcPos == 'T1', 'H12', 'H11')
@@ -2433,56 +2520,6 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
return sTool
end
---------------------------------------------------------------------
function IsToolCompatibleWithProbe( sToolName)
local bToolIsCompatible = false
if sToolName then
EgtTdbSetCurrTool( sToolName)
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
local dToolLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if dToolDiam < 100 and dToolLen < 160 then
bToolIsCompatible = true
end
EgtTdbSetCurrTool( EMT.TOOL)
end
return bToolIsCompatible
end
---------------------------------------------------------------------
function GetToolNameFromTcPos( sTcPos)
local sToolName
-- Carico gli utensili sulle barre portautensili
local vTcPos = EgtGetAllTcPosNames()
if vTcPos then
for i = 1, #vTcPos do
if vTcPos[i] == sTcPos then
local sToolsName = EgtGetToolsInCurrSetupPos( vTcPos[i])
sToolName = sToolsName[1]
end
end
end
return sToolName
end
---------------------------------------------------------------------
function GetToolHead( sToolName)
local sHead
local sCurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
EgtTdbSetCurrTool( sToolName)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
EgtTdbSetCurrTool( sCurrTool)
return sHead, sTcPos
end
---------------------------------------------------------------------
function DeactivateProbeTool()
if Probe then
EgtSetMode( EgtGetHeadId( 'H19') or GDB_ID.NULL, GDB_MD.HIDDEN)
EgtSetMode( EgtGetHeadId( 'H29') or GDB_ID.NULL, GDB_MD.HIDDEN)
end
end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
@@ -2503,6 +2540,9 @@ local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 102000, 20000, 102000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end
---------------------------------------------------------------------
@@ -2588,6 +2628,15 @@ function OnEstimDispositionEnd()
EMT.OPEISDISP = false
end
---------------------------------------------------------------------
function OnEstimRawMoveData()
-- se start del pezzo
if IsStartOrRestPhase( EMT.PHASE) then
EMT.SPLIT = false
end
OnRawMoveData()
end
---------------------------------------------------------------------
function OnEstimToolSelect()
-- reset indice utensile in tabella lunghezze
@@ -2644,6 +2693,12 @@ function OnEstimMachiningEnd()
EMT.TLE_NAME = nil
EMT.TLE_TIME = nil
end
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
if EMT.MCHSPLIT then
EMT.SPLIT = true
end
end
---------------------------------------------------------------------
@@ -2769,11 +2824,11 @@ function OnEstimRapid()
EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen
-- calcolo tempo
local dTime = RAPID_MIN_T
local dT1 = abs( dL1) / RAPID_X_FEED * 60
local dT1 = CalcMoveTime( abs( dL1), RAPID_X_FEED, EMT.SPLIT)
if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60
local dT2 = CalcMoveTime( abs( dL2), EMT.FMAXPINZE, EMT.SPLIT)
if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60
local dT3 = CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT)
if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60
if dT4 > dTime then dTime = dT4 end
@@ -2795,7 +2850,7 @@ function OnEstimLinear()
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo
local dTime = dLen / EMT.F * 60
local dTime = CalcMoveTime( dLen, EMT.F, EMT.SPLIT)
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti
@@ -2889,7 +2944,7 @@ function GetHeadSetFromTcPos( sTcPos)
local TCPOS_2A = {}
local TCPOS_2B = {}
if EgtGetHeadId( 'H21') then
TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', '501'}
TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'}
TCPOS_1B = { 'T101'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'}
TCPOS_2B = { 'T111'}
@@ -2897,7 +2952,7 @@ function GetHeadSetFromTcPos( sTcPos)
TCPOS_1A = { 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'}
TCPOS_1B = { 'T101', 'T201'}
TCPOS_1C = { 'T301'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20', '502'}
TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'}
end
for _, sVal in ipairs( TCPOS_1A) do
if sVal == sTcPos then return 1, 1 end
@@ -3016,7 +3071,7 @@ function GetNextChainSawingVirtualAxis( MchId)
end
---------------------------------------------------------------------
function GetNextTool( nMchId)
function GetNextTool( nMchId, bResetOnStart)
-- inizializzo prossimo utensile
local sNextTool
-- recupero lavorazione successiva
@@ -3024,7 +3079,7 @@ function GetNextTool( nMchId)
while nNextMchId do
-- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali
if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then
if IsStartOrRestPhase( EMT.PHASE+1) then
if IsStartOrRestPhase( EMT.PHASE+1) and bResetOnStart then
return nil
end
else
@@ -3049,10 +3104,10 @@ end
---------------------------------------------------------------------
function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2)
if sHead == 'H11' or sHead == 'H12' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
if sHead == 'H11' or sHead == 'H12' or sHead == 'H17' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1) % 180.0 > 1))
elseif sHead == 'H21' or sHead == 'H22' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1) % 180.0 > 1))
end
end
@@ -3067,5 +3122,40 @@ function GetCmdAxMove( Cmd, sAx)
end
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
local AccMaxPinze = EMT.MAXACC
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
local dAcc, _, _ = CalcDinamicaPinze( EMT.HB, EMT.SB, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
-- Caso 1: dFeed raggiunta
if dPathLen >= ( dFeedInSec ^ 2) / dAcc then
dTime = ( dFeedInSec / dAcc) + ( dPathLen / dFeedInSec)
-- Caso 2: dFeed non raggiunta
else
dTime = 2 * sqrt( dPathLen / dAcc)
end
return dTime
end
---------------------------------------------------------------------
-- *** END GENERAL ***
+93 -17
View File
@@ -4,14 +4,67 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Carico libreria
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- Carico libreria
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Special GetPrevMachiningOffset ***
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
function OnSpecialGetPrevMachiningOffset()
-- Aggiorno posizione della testa della trave a seguito di movimenti delle pinze non previsti tra le fasi
local function TPosUpdate()
local nClId = EgtGetFirstNameInGroup( EMC.CURRMCHID, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
if not nPathId then
EMC.ERR = 12
EMC.MSG = ' Error : CL group path not found'
return
end
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
local dTRepos = nil
-- controlla ogni gruppo di movimenti ausiliari
for i = 1, dAuxMoveCount do
local aAuxMove = EgtGetInfo( nPathId, 'AS' .. tostring( i), 'vs') or {} -- array contenete i parametri di ogni gruppo
-- controlla solo i movimenti della testa trave e salva l'ultimo
if aAuxMove[1] == '2' or aAuxMove[1] == '3' then
for j = 2, #aAuxMove do
if aAuxMove[j] == 'T' then
dTRepos = aAuxMove[j+1]
break
end
end
end
end
return dTRepos
end
-- default
EMC.ERR = 0
EMC.PREVOFFSX = 0
-- se c'è cambio di fase tra le lavorazioni (quindi la precedente è l'ultima della sua fase e la corrente la prima)
if EMC.PREVPHASE ~= EMC.CURRPHASE then
-- se la fase corrente è di inizio lavorazione di nuova trave
if IsStartOrRestPhase( EMC.CURRPHASE) then
-- recupero la posizione finale della lavorazione precedente
local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID)
-- ricava se e quanto la trave viene spostata tra le due fasi dai movimenti ausiliari e corregge l'offset di fine fase
local dNewTPos = TPosUpdate()
-- se ci sono dei movimenti della testa trave tra le due fasi ricava il delta tra la vecchia e la nuova posizione
if dNewTPos then
EMC.PREVOFFSX = dNewTPos - vPrevAx[1]
-- oppure la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
else
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
end
end
---------------------- OnSpecialGetMaxZ -----------------------------
---------------------------------------------------------------------
@@ -78,7 +131,7 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
@@ -179,7 +232,7 @@ function OnSpecialMoveZup()
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' then
;
-- se lama posizionata su CU prossimo a testa 1
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
@@ -229,7 +282,7 @@ local MIN_BACK_ENG_V = 115 -- ingombro asse Z a sinistra
local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza
local MIN_CLAMP_5 = 150 -- minima presa con la pinza speciale (pinza 5)
local SIC_CLAMP_5 = 50 -- sicurezza testa da pinza speciale
local MAX_BACK_CLAMP_5 = 320 -- massima sporgenza posteriore del pezzo da pinza speciale
local MAX_BACK_CLAMP_5 = EgtClamp( MaxBackClamp5 or 320, 200, 380) -- massima sporgenza posteriore del pezzo da pinza speciale
----------------------- Variabili -----------------------------------
local Test = false
@@ -660,6 +713,24 @@ end
---------------------------------------------------------------------
function OnPostApplyMachining()
-- Inizializzo codice di errore
EMC.ERR = 0
-- Verifico se ultima lavorazione della fase
local nNextOpeId = EgtGetNextActiveOperation( EMC.MCHID)
local bMchLast = ( not nNextOpeId or EgtGetOperationPhase( nNextOpeId) ~= EMC.PHASE) -- Agisco sui diversi percorsi della lavorazione
local nPathId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( EMC.MCHID, 'CL') or GDB_ID.NULL)
while nPathId do
-- recupero id del successivo
nPathId = EgtGetNext( nPathId)
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
end
end
---------------------------------------------------------------------
function OnSpecialApplyMachining()
EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID), 1)
@@ -767,7 +838,7 @@ function OnPostApplyMachining()
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- salvo lo stato dei carrelli
local OriTPos = EMC.TPOS
local OriY1Delta = EMC.Y1DELTA
@@ -1113,10 +1184,8 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end
-- Calcolo dell'ingombro della testa rispetto allo Zero Macchina
local b3Enc
local nSetHead = GetHeadSet( sHead)
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
if bIsFirstHead then
if sHead ~= 'H21' and sHead ~= 'H22' and sHead ~= 'H23' then
EgtSetAxisPos( 'C1', vAxes[4])
EgtSetAxisPos( 'B1', vAxes[5])
if sHead == 'H13' or sHead == 'H15' then
@@ -1561,8 +1630,11 @@ function SpecCalcUnload()
EgtOutLog( ' *[U1]', 1)
end
local vCmd = {}
-- Tipo di scarico
local bStdUl = ( not MaxUnloadLen or MaxUnloadLen < 1 or EMC.LB - EMC.HOVM < MaxUnloadLen + 1)
-- Commento
table.insert( vCmd, { 0, 'Unloading'})
table.insert( vCmd, { 0, 'Unloading', EgtIf( bStdUl, 'Unloading', 'Manual Unloading')})
-- posizionamento sicuro teste e rulli (non serve ?)
--table.insert( vCmd, { 4, 0})
-- Se pinza Y chiusa, la apro
@@ -1570,11 +1642,15 @@ function SpecCalcUnload()
table.insert( vCmd, { 11, 0})
EMC.CNT = nil
end
-- Sposto il pezzo in posizione di scarico
local dFinT = UnloadT - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
-- Se non supero la lunghezza massima di scarico, sposto il pezzo in posizione di scarico
if bStdUl then
local dFinT = UnloadT - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
else
table.insert( vCmd, { 1, 'Y2', MaxY2})
end
-- apro la morsa
table.insert( vCmd, { 12, 0})
-- riporto il carrello in home
BIN
View File
Binary file not shown.
+3 -11
View File
@@ -91,13 +91,11 @@ Language1=Italiano,Ita.txt
Language2=English,Eng.txt
[Tools]
Probe=1
Drillbit=1
Sawblade=1
Mill=1
Mortise=1
Chisel=0
ProbeMaker=MakeProbe.lua
DrillMaker=MakeWoodDrill.lua
SawbladeMaker=MakeSawblade.lua
MillMaker=MakeWoodCylMill.lua
@@ -110,12 +108,12 @@ H11.1=Standard.nge
H11.1:MILL_NOTIP=MillNoTip.nge
H12.1=Saw.nge
H13.1=ChainSaw.nge
H17.1=AngTransmBH.nge
H21.1=Standard.nge
H21.1:MILL_NOTIP=MillNoTip.nge
H22.1=Saw.nge
[Machinings]
Probing=1
Drilling=1
Sawing=1
Milling=1
@@ -128,8 +126,6 @@ SawFinishing=0
[Machining]
InitScript=InitMach.lua
ExitScript=ExitMach.lua
[Probing]
PrbScript1=StdProbe
[Disposition]
;InitScript=InitDisp.lua
@@ -141,14 +137,12 @@ H11=6608
H12=6615
; Chainsaw
H13=6616
; Probe
H19=6618
; Angular transmission
H17=6617
; Second 5 axis head
H21=6620
; Second 5 axis saw
H22=6623
; Probe
H29=6618
[SetUp]
Default=Standard
@@ -161,5 +155,3 @@ WinPlace=0,514,138,628,810
Enable=1
Save=0
[ToolTrace]
Enable=1
+63 -77
View File
@@ -44,10 +44,10 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.7f1_DEV13'
PP_NVER = '2.7.6.1'
PP_VER = '3.1c1'
PP_NVER = '3.1.3.1'
MIN_MACH_VER = '2.5k1'
MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio
MACH_NAME = EgtGetCurrMachineName()
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -155,6 +155,8 @@ ParkB2 = -90
MinDeltaX1X2 = 650
MinDistToolX1X2 = 40
LimX2RotSaw = 800
AngTrBHOffs = 154.5
AngTrBHLen = 90
TurnerOffs = 120.0
AggLoad = 50
DeltaTabY = 1170.0
@@ -174,10 +176,11 @@ SecondSaw = false
AutomaticRotation = true
OptimizedLoadBeam = true
AutoRotMinLen = 0
CoeffVM = 0.5
EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false
Probe = nil
AggreBlockHaus = false
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
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PFrl.data"
@@ -234,6 +237,8 @@ if EgtExistsFile( sData) then
if Machine.Offsets.MIN_V2 then MinV2 = Machine.Offsets.MIN_V2 end
if Machine.Offsets.MAX_V2 then MaxV2 = Machine.Offsets.MAX_V2 end
if Machine.Offsets.CLAMP5 then Clamp5 = ( Machine.Offsets.CLAMP5 == 1) end
if Machine.Offsets.MIN_W then MinW = Machine.Offsets.MIN_W end
if Machine.Offsets.MAX_W then MaxW = Machine.Offsets.MAX_W end
if Machine.Offsets.MINWOPEN then MinWOpen = Machine.Offsets.MINWOPEN end
if Machine.Offsets.MAXWOPEN then MaxWOpen = Machine.Offsets.MAXWOPEN end
if Machine.Offsets.MAXWHEIGHT then MaxWHeight = Machine.Offsets.MAXWHEIGHT end
@@ -261,13 +266,18 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAW2OFFSZ then Saw2OffsZ = Machine.Offsets.SAW2OFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.DEFTCPOS2 then DefTcPos2 = ( 'T' .. Machine.Offsets.DEFTCPOS2) end
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC end
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI 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.PROBE then Probe = Machine.Offsets.PROBE end -- Tastatore su entrembe le teste. 1 = solo testa 1, 2 = solo testa 2, 3 = entrambe le teste
if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
AngTrBHOffs = Machine.Offsets.OFFSETZ_RINV_BH or AngTrBHOffs
AngTrBHLen = Machine.Offsets.OFFSETX_RINV_BH or AngTrBHLen
if Machine.Offsets.MAX_BACK_CLAMP_5 then MaxBackClamp5 = Machine.Offsets.MAX_BACK_CLAMP_5 end
if Machine.Offsets.COEFF_CLAMP_CHECK then ClampingCoeffMin = Machine.Offsets.COEFF_CLAMP_CHECK end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1
@@ -339,13 +349,6 @@ EmtAxis {
Home = ParkC1,
Geo = 'C1_AXIS/GEO',
Aux = {'C1_AXIS/SOLID', 'C1_AXIS/COLLISION'}}
-- se tastatore presente
local sBAxisAuxGeom
if Probe == 1 or Probe == 3 then
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION', 'PROBE_B1/SOLID_PROBE', 'PROBE_B1/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}
end
EmtAxis {
Name = 'B1',
Parent = 'C1',
@@ -356,7 +359,7 @@ EmtAxis {
Stroke = {MinB1, MaxB1},
Home = ParkB1,
Geo = 'B1_AXIS/GEO',
Aux = sBAxisAuxGeom }
Aux = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}}
-- Frese
local H11Id = EmtHead {
Name = 'H11',
@@ -384,22 +387,6 @@ local H12Id = EmtHead {
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H12_HEAD/GEO'}
--EgtSetInfo( H12Id, 'ZMAXONROT', '1,190')
-- Tastatore su testa 1
local H19Id
if Probe == 1 or Probe == 3 then
H19Id = EmtHead {
Name = 'H19',
Parent = 'B1',
HSet = 'H19',
Type = MCH_HT.STD,
Pos = Point3d( -60, -81, 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.2,
Rot2Stroke = { MinB1, MaxB1},
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H19_HEAD/GEO'}
end
-- Sega a catena
EmtAxis {
Name = 'A',
@@ -426,6 +413,24 @@ local H13Id = EmtHead {
Geo = 'H13_HEAD/GEO'}
EgtSetInfo( H13Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H13Id, 'ZMAXONROT', '1,80')
-- Eventuale aggregato per lavorazioni BlockHaus
if AggreBlockHaus then
local H17Id = EmtHead {
Name = 'H17',
Parent = 'B1',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d( -AngTrBHLen, 0, -AngTrBHOffs),
TDir = X_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H17_HEAD/GEO',
Aux = {'H17_HEAD/SOLID', 'H17_HEAD/COLLISION'}}
end
-- *** Testa 2 ***
local X2Id = EmtAxis {
Name = 'X2',
@@ -461,12 +466,6 @@ local C2Id = EmtAxis {
Home = ParkC2,
Geo = 'C2_AXIS/GEO',
Aux = {'C2_AXIS/SOLID', 'C2_AXIS/COLLISION'}}
-- se presente tastatore
if Probe == 2 or Probe == 3 then
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION', 'PROBE_B2/SOLID_PROBE', 'PROBE_B2/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}
end
local B2Id = EmtAxis {
Name = 'B2',
Parent = 'C2',
@@ -477,7 +476,7 @@ local B2Id = EmtAxis {
Stroke = {MinB2, MaxB2},
Home = ParkB2,
Geo = 'B2_AXIS/GEO',
Aux = sBAxisAuxGeom}
Aux = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}}
local vtMove2 = Vector3d( 0, Head2Y, Head2Z)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
@@ -487,10 +486,6 @@ EgtMove( EgtGetFirstNameInGroup( C2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
if Probe == 2 or Probe == 3 then
EgtMove( EgtGetFirstNameInGroup( B2Id, 'SOLID_PROBE'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( B2Id, 'COLLISION_PROBE'), vtMove2, GDB_RT.GLOB)
end
-- Frese
local H21Id = EmtHead {
Name = 'H21',
@@ -519,22 +514,6 @@ if SecondSaw then
Geo = 'H22_HEAD/GEO'}
--EgtSetInfo( H22Id, 'ZMAXONROT', '1,190')
end
-- Tastatore su testa 2
local H29Id
if Probe == 2 or Probe == 3 then
H29Id = EmtHead {
Name = 'H29',
Parent = 'B2',
HSet = 'H29',
Type = MCH_HT.STD,
Pos = Point3d( Head2X - 60, Head2Y - 81, Head2Z + 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.2,
Rot2Stroke = { MinB2, MaxB2},
OthColl = {'B2/SOLID', 'C2/SOLID'},
Geo = 'H29_HEAD/GEO'}
end
-- *** Carrelli ***
-- Morse
local Y1Id = EmtAxis {
@@ -556,7 +535,7 @@ local PY1Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY1_AXIS/GEO',
Aux = 'PY1_AXIS/SOLID'}
Aux = {'PY1_AXIS/SOLID', 'PY1_AXIS/CLAMP_CHECK'}}
local Y2Id = EmtAxis {
Name = 'Y2',
Parent = 'Base',
@@ -576,7 +555,7 @@ local PY2Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY2_AXIS/GEO',
Aux = 'PY2_AXIS/SOLID'}
Aux = {'PY2_AXIS/SOLID', 'PY2_AXIS/CLAMP_CHECK'}}
-- Rulli
local V1Id = EmtAxis {
Name = 'V1',
@@ -687,6 +666,7 @@ EmtTable {
Parent = 'T',
Type = MCH_TT.FLAT,
Ref1 = Point3d( -DimTabX, DeltaTabY, DeltaTabZ),
Coll = 'Base/BELT',
Geo = 'TABLE/GEO',
Aux = 'TABLE/SOLID'}
-- *** ToolChanger ***
@@ -741,13 +721,24 @@ EmtTcPos {
TDir = -Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T8'}
EmtTcPos {
if AggreBlockHaus then
local TcpSsId = EmtTcPos {
Name = 'T9',
Parent = 'Base',
Pos = ptTc1 + 8 * vtDt1 + Vector3d( -AngTrBHLen, AngTrBHOffs, 0),
TDir = X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T9_BH',
Aux = 'BASE/T9_HS'}
else
EmtTcPos {
Name = 'T9',
Parent = 'Base',
Pos = ptTc1 + 8 * vtDt1,
TDir = -Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T9'}
end
EmtTcPos {
Name = 'T10',
Parent = 'Base',
@@ -857,6 +848,10 @@ EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC3') or GDB_ID.NULL, vtMovB, GDB_RT.G
if Mortiser then
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC4') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end
-- sposto geometria aggiuntiva agrgegato BlockHaus
if AggreBlockHaus then
EgtMove( EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( BaseId, 'T9'), 'T9_HS') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end
EgtMove( EgtGetFirstNameInGroup( X1Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X1Id, 'COLLISION'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
@@ -867,8 +862,10 @@ local vtMove = Vector3d( 0, ( DeltaTabY - 1170.0), ( DeltaTabZ + 1010.0))
EgtMove( EgtGetFirstNameInGroup( BaseId, 'CONVOYER'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( V1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( QV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
@@ -904,7 +901,7 @@ function OnSetHead()
EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', X_AX())
-- se testa H12 (lama)
elseif EMC.HEAD == 'H12' then
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H17' then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisHome( 'C1', ParkC1)
@@ -946,14 +943,10 @@ end
---------------------------------------------------------------------
function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' then
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
return 1
elseif sHead == 'H19' then
return 11
elseif sHead == 'H21' or sHead == 'H22' then
elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then
return 2
elseif sHead == 'H29' then
return 21
else
return 0
end
@@ -964,7 +957,7 @@ end
function GetHeadTCSet( sHead, sTcPos)
local nPos = tonumber( string.sub( sTcPos, 2)) or 0
-- testa 1
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
-- testa 1 su CU prossimo a testa 2
if nPos > 10 then
return 'Head1_TC2'
@@ -1001,12 +994,6 @@ function HeadIsChainSaw( sHead)
return ( sHead == 'H13')
end
---------------------------------------------------------------------
-- Funzione che riconosce testa per tastatore
function HeadIsProbe( sHead)
return ( sHead == 'H19' or sHead == 'H29')
end
---------------------------------------------------------------------
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
function GetChainSawZHomeFromVirtualAxis( dPosA)
@@ -1034,7 +1021,7 @@ end
---------------------------------------------------------------------
-- Funzione che ritorna ZExtra partendo dalla testa e dall'angolo verticale
function GetZExtra( sHead, dAngV)
if sHead == 'H11' or sHead == 'H21' then
if sHead == 'H11' or sHead == 'H21' or sHead == 'H17' then
if abs( dAngV) < 30.1 then
return 400
elseif abs( dAngV) < 45.1 then
@@ -1061,7 +1048,6 @@ function GetZExtra( sHead, dAngV)
return 0
end
end
return 0
end
---------------------------------------------------------------------
+1 -6
View File
@@ -2,9 +2,6 @@
;Index = Type, Description, Default Value
; Type : b=boolean, d=double, l=lenght, s=string
[Probing]
0=s,Type,Head
[Drilling]
[Sawing]
@@ -16,9 +13,6 @@
3=d,TrimExt,0
4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0
6=b,PROBE,0
7=b,START-PROBE,0
8=b,END-PROBE,0
[Pocketing]
0=l,MaxElev,0
@@ -26,6 +20,7 @@
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=l,MaxOptSize,0
5=b,AdjustFeed,1
[Mortising]
0=d,MaxElev,0
+4 -15
View File
@@ -30,8 +30,7 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2)
local PositionTable = {}
local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil)
local ProbeFirstHead = ( EgtGetHeadId( 'H19') ~= nil)
local ProbeSecondHead = ( EgtGetHeadId( 'H29') ~= nil)
local AggreBH = ( EgtGetHeadId( 'H17') ~= nil)
if SecondSaw then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
@@ -40,7 +39,7 @@ if SecondSaw then
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H22", Group = "G3"},
{Pos = "Pos11", TcPos = "T13", Head = "H21", Group = "G3"},
@@ -63,7 +62,7 @@ else
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H21", Group = "G3"},
{Pos = "Pos11", TcPos = "T12", Head = "H21", Group = "G3"},
@@ -80,17 +79,7 @@ else
table.insert( PositionTable, {Pos = "Pos21", TcPos = "T201", Head = "H13", Group = "G2"})
end
end
-- aggiunta tastatori
if ProbeFirstHead then
local sIndex = EgtNumToString( #PositionTable + 1)
table.insert( PositionTable, {Pos = "Pos"..sIndex, TcPos = "T501", Head = "H19", Group = "G4"})
end
if ProbeSecondHead then
local sIndex = EgtNumToString( #PositionTable + 1)
table.insert( PositionTable, {Pos = "Pos"..sIndex, TcPos = "T502", Head = "H29", Group = "G4"})
end
local UsePositionHead = true
local UsePositionHead = false
local function IsInGeomSet( ToolHead, PosHead)
for GsIndex = 1, #GS do
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -4
View File
@@ -36,7 +36,6 @@
4=s,DOUBLE
[MORTISE_STD]
0=th,TH,
1=b,MORTISE
2=d,STEP
3=d,SIDESTEP
0=b,MORTISE
1=d,STEP
2=d,SIDESTEP
+73 -1
View File
@@ -1,8 +1,80 @@
==== Common_ONE-PF Update Log ====
Versione 3.1c2 (17/03/2026)
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
Versione 3.1c1 (04/03/2026)
- (GEN) Corretta chiamata di una variabile insesistente in caso di ONE
- (SIM) Allineata simulazione a generazione
Versione 3.1b1 (20/02/2026)
- (GEN) Aggiunta funzione ToolPreSelection() per la preselezione utensile. Ticket#2789
- (GEN) Funzione rinominata in ToolPreSelectionSingleHead(), ora utilizza funzione in MLDE per capire se è motosega
Versione 3.1a1 (16/01/2026)
- (SIM-GEN) Aggiunto controllo che evita collisioni durante lo svincolo in Z della sega a catena nelle funzioni ExecMoveZMax() e EmitZMax(). Ticket#2767
- (SIM-GEN) Piccola correzione modifiche fatte in precedenza
Versione 2.7l1 (18/12/2025)
- (SIM-GEN) Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset(). Ticket#2727
- (SIM-GEN) Divisione movimento B in approccio se > 90°. Ticket#2754
- (SIM) Aggiunta funzione CheckClamping
Versione 2.7k3 (28/11/2025)
- (GEN) Prima di andare allo scarico, si aggiunge movimento intermedio dove si aspetta che rulli scarico siano arrivati in posizione. Ticket#2716
Versione 2.7k2 (20/11/2025)
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
Versione 2.7k1 (05/11/2025)
- (SIM-GEN) Corretto calcolo per decidere se serve aprire i rulli
- (GEN) Aggiunta tolleranza in creazione piano di lavoro inclinato
- (SIM) Allo scarico si resetta Y2DELTA. Ticket#2687
Versione 2.7j3 (23/10/2025)
- (SIM) Corretta posizione parcheggio in caso di testa 1 su magazzino 2. Ticket#2660
Versione 2.7j2 (21/10/2025)
- (GEN) Se SPLIT con pinza 5, corretto salvataggio posizione pinza 2. Ticket#2654
Versione 2.7j1 (08/10/2025)
- (GEN) Salvataggio posizione Z su lavorazione precedente, sbagliava in caso di separazione. Ticket#2637
Versione 2.7i1 (10/09/2025)
- (SIM-GEN) Piccole correzioni per gestire secondo TC su ONE. Ticket#2563
- (SIM-GEN) Gestione aggregato BH completato. Ticket#2482
- (EST) Stima tempi considerando accelerazioni
- (SIM-GEN) Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto
- (GEN) Piccola correzione risalita ZMAX dopo RELOAD del pezzo. Generazione allineata a simulazione.
Versione 2.7h2 (28/08/2025)
- (GEN) Migliorata gestione spegnimento utensile e disattivazione piano
- (SIM-GEN) Corretto nome variabile e altre piccole modifiche per Progress
Versione 2.7h1 (20/08/2025)
- (SIM-GEN) Non si chiudono i rulli se tagli o pretagli di testa e coda
- (SIM) Corretto movimento pinza 5 in caso di riposizionamento pinza 1
- (GEN) Corretta quota assoluta posizione testa trave in caso di pinza 5 e testa rimasta bassa
- (GEN) Se ultima lavorazione pezzo precedente ha stesso utensile della prima lavorazione pezzo successivo, la speed resta accesa
Versione 2.7g4 (23/07/2025)
- (SIM-GEN) Aggiunto parametro configurabile da TS3 per massima sporgenza trave in coda per pinza 5. Ticket#2538
Versione 2.7g3 (22/07/2025)
- (SIM) Corretto lettura angolo di presa della motosega
Versione 2.7g2 (08/07/2025)
- (SIM) Corretto movimento a parcheggio sega a catena. Ticket#2517
Versione 2.7g1 (01/07/2025)
- (GEN) Rimossa gestione PROBE inserita per sbaglio
- (GEN) Corretto gestione accelerazioni
- (SIM-GEN) Aggiunta gestione massima lunghezza scarico
Versione 2.7f1 (04/06/2025)
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'.
- (GEN) Prima versione gestione tastatore
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7e1 (28/05/2025)
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.7f1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
VERSION = '3.1c2', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
}
return InfoCommon_STD_PP