Compare commits

...

51 Commits

Author SHA1 Message Date
andrea.villa 5a0344dc5d Merge remote-tracking branch 'origin/main' into NewLink 2025-11-19 08:22:19 +01:00
andrea.villa 0de6db7c3d Allineamento con common ver. 2.7k1 2025-11-19 08:04:21 +01:00
andrea.villa 1963f8dfdf Merge remote-tracking branch 'origin/develop' 2025-11-19 08:03:22 +01:00
andrea.villa 9ee74ac85d Aggiunto presenza lama su TC1 2025-11-18 16:47:25 +01:00
daniele.nicoli 618e1b6cce Aggiunta gestione CUT_SIC impostabile da TS3Data.lua 2025-11-13 12:26:34 +01:00
daniele.nicoli ef69d65b5b Merge branch 'main' into develop 2025-11-13 12:25:23 +01:00
andrea.villa e531a137bd Quota home per testa 1 settata al massimo della Z. 2025-09-08 12:40:14 +02:00
andrea.villa b0de62890f Merge remote-tracking branch 'origin/main' into NewLink 2025-09-08 10:46:20 +02:00
andrea.villa 835b644aa7 Merge branch 'develop' 2025-09-08 10:35:50 +02:00
andrea.villa a9c4faeb15 Allineamento con common ver. 2.7i1 2025-09-08 10:35:33 +02:00
andrea.villa 1630d18db4 Se testa 3 deve salire a ZMAX, sale alla X dove si trova e non torna in home 2025-09-02 10:27:33 +02:00
andrea.villa 2b1d0b6821 Allineamento con versione 2.7i1 dei common non ancora rilasciata. 2025-09-02 09:14:02 +02:00
andrea.villa 77f0d4d14c Merge remote-tracking branch 'origin/main' into develop 2025-09-02 09:12:43 +02:00
andrea.villa 7e926f00bf Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto 2025-08-26 08:33:34 +02:00
andrea.villa c9d73227a3 Merge remote-tracking branch 'origin/main' into NewLink 2025-08-21 18:00:47 +02:00
andrea.villa 8055ed70f0 Allineamento con common ver. 2.7h2 2025-08-21 17:59:59 +02:00
andrea.villa c323605e9e Gestione accelerazioni in calcolo tempi 2025-08-21 17:53:09 +02:00
andrea.villa 236480d2d8 Merge remote-tracking branch 'origin/main' into NewLink 2025-08-20 16:50:00 +02:00
andrea.villa 94c0729630 Tavola portata a 34m 2025-08-20 16:48:17 +02:00
andrea.villa 6c176ee8f7 Cambio versione 2025-08-20 16:38:49 +02:00
andrea.villa 23bf122c9c - Allineamento con common ver. 2.7h1
- Dimensione tavola portata a 34m
- Aggiunto lettura coefficiente stima tempi
2025-08-20 16:37:41 +02:00
andrea.villa b96009933a - La funzione MoveToZMax non è più chiamata
- Se chiusura rulli, si prepara la tabella per poi chiamare la OnSpecialLink
2025-07-24 12:49:37 +02:00
andrea.villa 689fab0c05 Prima versione nuovi link di collegamento per lavorazioni 2025-07-16 12:26:53 +02:00
andrea.villa 6fc2d92d67 Lunghezza massima grezzo caricabile portata a 26000mm 2025-07-09 17:43:37 +02:00
andrea.villa 6d57ff79f3 Allineamento con common ver. 2.7g1 2025-07-01 09:56:47 +02:00
andrea.villa 0b06642c58 - Allineamento con common 2.7d2
- Aggiunto parametro LinkAxesMoveOrder
2025-04-24 12:55:30 +02:00
andrea.villa 08016494e0 Allineamento con common ver. 2.7d1 2025-04-01 10:03:29 +02:00
andrea.villa 23d4f09653 - Possibilità di montare motosega in posizione T101
- Piccole migliorie varie derivanti da modifica
2025-03-05 09:05:32 +01:00
andrea.villa f5276d9952 - Allineamento con common ver. 2.7b5
- Aggiunta lettura parametro MAXFEEDPINZE
2025-02-27 09:41:25 +01:00
andrea.villa d5ec8a4300 Merge remote-tracking branch 'origin/develop' 2025-02-21 09:25:18 +01:00
andrea.villa bfa7f6076e - Allineamento common ver. 2.7b4
- Gestione aggregato flottante
2025-02-21 09:25:08 +01:00
andrea.villa 3c37ddfcd5 Cambio nome versione 2025-02-06 11:42:58 +01:00
andrea.villa 2c8ddc8613 Ripristinato comportamento precedente calcolo posizione dei rulli di pinzaggio fatto con 2.7b2. 2025-02-06 11:42:34 +01:00
andrea.villa f875534370 Merge remote-tracking branch 'origin/main' into develop 2025-02-06 11:42:06 +01:00
andrea.villa b2d607cb14 Allineamento con common ver. 2.7b3 2025-02-06 08:37:13 +01:00
andrea.villa da6216fdfd Allineamento con common ver. 2.7b2 2025-02-04 12:32:19 +01:00
andrea.villa a8f069616e Allineamento con common ver. 2.7b1 2025-02-03 09:03:23 +01:00
andrea.villa d363591acf Allineamento con common ver. 2.7a2 2025-01-28 12:46:39 +01:00
andrea.villa b005447490 Allineamento con common ver 2.7a1 2025-01-17 09:34:23 +01:00
andrea.villa 274c807a01 Hotfix - Aggiunto nuovo ToolHolder per testa H3 con lama fissa 2025-01-09 11:56:13 +01:00
andrea.villa 93d536ffda Allineamento con common ver.2.6l7 2024-12-19 10:31:31 +01:00
andrea.villa 25e3b36d1b Allineamento con common ver.2.6l6 2024-12-18 17:06:43 +01:00
andrea.villa 4fb3d46beb Allineamento con common ver. 2.6l5 2024-12-17 11:46:59 +01:00
andrea.villa 28e0d89a15 Allineamento con common ver.2.6l2 2024-12-13 17:47:28 +01:00
andrea.villa 2300b6a148 Prima versione ufficiale pubblicata 2024-12-13 17:20:51 +01:00
andrea.villa fd58976c44 Merge remote-tracking branch 'origin/develop' 2024-12-13 17:20:16 +01:00
andrea.villa 6bbd572b5b - Versione utilizzata per accettazione del 12/12
- Allineamento con common ver. 2.6l1
2024-12-13 17:19:49 +01:00
andrea.villa 36636a9d80 Controllo esistenza terzo asse ausiliario 2024-12-11 17:07:48 +01:00
andrea.villa 97da4097f5 Corretta gestione asse ausiliario per posizione 121, non esiste più in quanto si montano utensili normali e nmon aggregati 2024-12-11 15:59:09 +01:00
andrea.villa f139552971 - Corretto segno coordinata rotazione in sicurezza testa 3
- Testa 3 in home a fine barra
- ToolHolders
2024-12-11 09:27:54 +01:00
andrea.villa 49f6658943 - Modificata posizioen zero lama testa 3
- Aggiunti offset lama testa 3
- Corretta posizione parcheggio
- Foratore multiplo spostato su TC3
2024-12-10 17:12:03 +01:00
18 changed files with 1514 additions and 1140 deletions
+26 -4
View File
@@ -12,7 +12,8 @@ local BeamData = {
MAX_WIDTH = 1505, -- larghezza massima del grezzo
MAX_HEIGHT = 605, -- altezza massima del grezzo
LEN_SHORT_PART = 1200, -- lunghezza massima pezzo piccolo
MAX_RAW = 20000, -- massima lunghezza grezzo (deve essere minore di LenTable - RAW_OFFSET)
LEN_VERY_SHORT_PART = 800, -- lunghezza massima pezzo molto corto (molto probabile lo scarico a caduta)
MAX_RAW = 26000, -- massima lunghezza grezzo (deve essere minore di LenTable - RAW_OFFSET)
STD_RAW = 14000, -- lunghezza standard della barra di grezzo
OVM_HEAD = 10, -- sovramateriale testa
OVM_MID = 5.4, -- sovramateriale intermedio (spessore lama)
@@ -74,12 +75,15 @@ local BeamData = {
DOUBLE_HEAD_DOVETAIL = true, -- flag abilitazione lavorazione mortase a coda di rondine in doppio
DOUBLE_HEAD_MORTISE = true, -- flag abilitazione lavorazione mortase in doppio
DOUBLE_HEAD_DRILLING = true, -- flag abilitazione forature in doppio
USE_MULTI_DRILL = false, -- flag abilitazione gruppo a forare
USE_MULTI_DRILL = false, -- flag abilitazione gruppo a forare
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
MIN_HEIGHT_ADDED_CUTS = 400 -- altezza minima pezzo per effettuare tagli orizzontali aggiuntivi in testa e coda
}
---------------------------------------------------------------------
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1500rl.data"
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1500MAXrl-3T.data"
local sDataBeam = EgtGetCurrMachineDir().."\\Beam\\Ts3Data.lua"
if EgtExistsFile( sTs3Data) then
EgtCopyFile( sTs3Data, sDataBeam)
@@ -94,6 +98,9 @@ if EgtExistsFile( sDataBeam) 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
if Machine.Offsets.MIN_HEIGHT_ADDED_CUTS then BeamData.MIN_HEIGHT_ADDED_CUTS = min( Machine.Offsets.MIN_HEIGHT_ADDED_CUTS, BeamData.MIN_HEIGHT_ADDED_CUTS) 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
@@ -101,6 +108,13 @@ if EgtExistsFile( sDataBeam) 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
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.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
@@ -176,7 +190,15 @@ BeamData.GetMinUnloadableRaw = GetMinUnloadableRaw
local function GetBlockedAxis( sHead, nToolType, sBlockedAxis)
-- lama
if nToolType == MCH_TY.SAW_STD or nToolType == MCH_TY.SAW_FLAT then
return ''
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
+1
View File
@@ -50,6 +50,7 @@
33=AntiSplintMillCut_H2
34=SideMillAsBlade
35=SideMillAsBlade_H2
36=Prof_end
[Pocketing]
1=Pocket
+438 -657
View File
File diff suppressed because it is too large Load Diff
+406 -213
View File
@@ -163,6 +163,29 @@ function OnSimulStart()
end
-- Preparo lista collisioni vuota
EMT.COLLIDE = {}
-- si crea gruppo temporaneo appoggio controllo clamping
CLAMP_CHECK_GROUP = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'CLAMP_CHECK')
CLAMP_CHECK_INTERS = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'CLAMP_INTERS')
if CLAMP_CHECK_GROUP then
EgtEmptyGroup( CLAMP_CHECK_GROUP)
else
local frClampCheckGroup = Frame3d( ORIG(), GDB_FR.FRONT)
CLAMP_CHECK_GROUP = EgtGroup( GDB_ID.ROOT, frClampCheckGroup)
EgtSetName( CLAMP_CHECK_GROUP, 'CLAMP_CHECK')
EgtSetLevel( CLAMP_CHECK_GROUP, GDB_LV.TEMP)
EgtSetStatus( CLAMP_CHECK_GROUP, GDB_ST.OFF)
end
if CLAMP_CHECK_INTERS then
EgtEmptyGroup( CLAMP_CHECK_INTERS)
else
CLAMP_CHECK_INTERS = EgtGroup( GDB_ID.ROOT)
EgtSetName( CLAMP_CHECK_INTERS, 'CLAMP_INTERS')
EgtSetLevel( CLAMP_CHECK_INTERS, GDB_LV.TEMP)
EgtSetStatus( CLAMP_CHECK_INTERS, GDB_ST.OFF)
end
end
---------------------------------------------------------------------
@@ -224,18 +247,24 @@ function OnSimulDispositionStart()
end
end
-- determino la risoluzione dello Zmap
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
local dTol = 4.51
if dArea < CoeffVM * 0.5e6 then
dTol = 1.01
elseif dArea < CoeffVM * 1.2e6 then
dTol = 1.51
elseif dArea < CoeffVM * 2.5e6 then
dTol = 1.97
elseif dArea < CoeffVM * 5.0e6 then
dTol = 2.81
elseif dArea < CoeffVM * 10.0e6 then
dTol = 3.77
local dTol = 4.71
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.71)
else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then
dTol = 0.71
elseif dArea < 0.15e6 then
dTol = 1.01
elseif dArea < 0.3e6 then
dTol = 1.51
elseif dArea < 0.6e6 then
dTol = 1.97
elseif dArea < 1.2e6 then
dTol = 2.81
elseif dArea < 2.4e6 then
dTol = 3.77
end
end
-- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
@@ -463,6 +492,8 @@ function OnSimulToolSelect( dPosA)
end
if EMT.HEAD == 'H12' or EMT.HEAD == 'H16' then
EgtSetAxisPos( 'Z1', MaxZ1Blade)
elseif EMT.HEAD == 'H13' then
EgtSetAxisPos( 'Z1', ParkCSawZ1)
else
EgtSetAxisPos( 'Z1', MaxZ1)
end
@@ -528,8 +559,10 @@ function OnSimulToolSelect( dPosA)
EMT.A2n = 'Y2'
EMT.A3n = 'V1'
EMT.A4n = 'V2'
-- se attivo Vmill
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
-- se utensile non flottante, abilito per Vmill
if not EMT.TFLOAT then
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
end
-- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then
@@ -573,7 +606,7 @@ function OnSimulToolDeselect( dPrevA)
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
-- nascondo l'utensile sulla testa
EgtSetStatus( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_ST.OFF)
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
-- se testa gruppo 1
elseif nNextSetHead == 1 and EMT.PREVTCPOS_H1 then
-- deposito utensile fresa
@@ -633,14 +666,28 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
end
-- se passo da testa 1 a 3 o viceversa
-- se passo da testa 1 a 3 scarico aggregato
if nNextSetHead == 3 then
-- deposito eventuale sega a catena
if EMT.PREVHEAD_H1 == 'H13' then
-- deposito utensile prelevato da posizioni speciali
if EMT.PREVTCPOS_H1 == 'T101' or EMT.PREVTCPOS_H1 == 'T111' or EMT.PREVTCPOS_H1 == 'T121' then
-- 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)
local sTool, sTcPos, sHead
local vTools = EgtGetToolsInCurrSetupPos( DefTcPos1)
if vTools and vTools[1] then
sTool = vTools[1]
sTcPos = DefTcPos1
sHead = GetAdjHeadFromTcPos( 1, sTcPos)
-- carico l'utensile
EgtLoadTool( sHead, 1, sTool)
ShowToolInTcPos( DefTcPos1, false)
end
EMT.PREVTOOL_H1 = sTool
EMT.PREVHEAD_H1 = sHead
EMT.PREVTCPOS_H1 = DefTcPos1
end
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
@@ -825,7 +872,9 @@ function OnSimulMachiningStart()
end
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
if not IsNewLinkHead( EMT.HEAD) then
EMT.MCHFIRST = true
end
end
---------------------------------------------------------------------
@@ -890,7 +939,7 @@ function OnSimulPathEnd()
EMT.Y1DELTA = nil
ExecMovePY1( false)
end
ExecMoveZmax( EMT.MCHSPLIT)
-- ExecMoveZmax( EMT.MCHSPLIT)
EMT.TO_ZMAX = nil
end
end
@@ -913,7 +962,7 @@ function OnSimulPathEndAux()
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)
-- ExecMoveZmax( EMT.MCHSPLIT)
EMT.TO_ZMAX = nil
end
end
@@ -921,6 +970,8 @@ end
---------------------------------------------------------------------
function OnSimulMoveStart()
if EMT.MCHFIRST then EgtOutText( '') end
-- recupero eventuali flag da Info del movimento
local bSplit = EgtGetInfo( EMT.MOVEID, 'Split', 'b')
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
-- Posizioni correnti
@@ -937,7 +988,7 @@ function OnSimulMoveStart()
EMT.A1 = EMT.L1 + EMT.Y1DELTA
else
EMT.A1m = nil
EMT.A1 = EgtIf( EMT.Y1SPEC, EgtGetAxisPos( 'Y1'), ParkY1)
EMT.A1 = EgtIf( EMT.Y1SPEC or Y1Pos > ParkY1, Y1Pos, ParkY1)
end
EMT.A2n = 'Y2'
if EMT.Y2DELTA then
@@ -947,8 +998,9 @@ function OnSimulMoveStart()
EMT.A2m = nil
EMT.A2 = ParkY2
end
-- Controllo scorrimento pinze chiuse Y1 e Y2
if EMT.Y1DELTA then
if EMT.Y1DELTA and ( EMT.MOVE ~= 0 or ( EMT.MASK & 1) == 1) then
local dY1DeltaP = Y1Pos - EMT.L1p
if abs( EMT.Y1DELTA - dY1DeltaP) > 0.1 then
EMT.ERR = 2
@@ -956,7 +1008,7 @@ function OnSimulMoveStart()
EmtSetLastError( 1202, sErr)
end
end
if EMT.Y2DELTA then
if EMT.Y2DELTA and ( EMT.MOVE ~= 0 or ( EMT.MASK & 1) == 1) then
local dY2DeltaP = Y2Pos - EMT.L1p
if abs( EMT.Y2DELTA - dY2DeltaP) > 0.1 then
EMT.ERR = 2
@@ -964,13 +1016,14 @@ function OnSimulMoveStart()
EmtSetLastError( 1202, sErr)
end
end
-- rulli
EMT.A3n = 'V1'
EMT.A3 = EgtIf( GetV1ToClose(), EMT.V1NEXTPOS, ParkV1)
EMT.A4n = 'V2'
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
local bParkV = false
if EMT.MCHFIRST then
if EMT.MCHFIRST or ( EMT.MOVE == 0 and IsNewLinkHead( EMT.HEAD)) then
-- se rulli più chiusi del richiesto o cambio direzione utensile (tranne solo asse B con C0 o equivalenti) devo mettere i rulli in parcheggio
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) then
bParkV = true
@@ -978,6 +1031,12 @@ function OnSimulMoveStart()
EMT.A4 = ParkV2
end
end
local bNlhParkV = ( EMT.MOVE == 0 and IsNewLinkHead( EMT.HEAD) and ( EMT.FLAG2 == 1 or EMT.FLAG2 == 2))
if bNlhParkV then
bParkV = ( EMT.FLAG == 2 and bParkV) or ( not EMT.MCHSPLIT or bSplit)
EMT.A3 = ParkV1
EMT.A4 = ParkV2
end
-- Controllo corse assi ausiliari
VerifyY1Stroke( EMT.A1)
VerifyY2Stroke( EMT.A2)
@@ -986,166 +1045,17 @@ function OnSimulMoveStart()
-- se devo subito parcheggiare i rulli
local nRes = 0
if bParkV then
local bMchSplit = ( bNlhParkV and EMT.MCHSPLIT and bSplit)
local bAgg = EgtExistsInfo( EMT.PATHID, 'CNT')
nRes = ExecParkRoller( Y1Pos, Y2Pos, V1Pos, V2Pos, false, bAgg)
end
-- se movimento in rapido
if EMT.MOVE == 0 then
-- se testa 1
if nSetHead == 1 then
-- Dati
local B1Pos = EgtGetAxisPos( 'B1')
local B1Home = EgtGetAxisHomePos( 'B1')
local C1Pos = EgtGetAxisPos( 'C1')
local C1Home = EgtGetAxisHomePos( 'C1')
local Z1Pos = EgtGetAxisPos( 'Z1')
local Z1Home = EgtGetAxisHomePos( 'Z1')
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
-- se fresa o lama
if EMT.HEAD ~= 'H13' then
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
local bXSpec = EgtIf( BD.RIGHT_LOAD, EMT.L2 < DeltaTabY, EMT.L2 > DeltaTabY)
-- 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)
SimulMoveAxes( 'Z1', MyMaxZ1, 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)
-- caso standard
else
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
SimulMoveAxis( 'X1', EgtIf( bXSpec, DeltaTabY, EMT.L2), MCH_SIM_STEP.RAPID)
end
-- se ero in posizione speciale, prima ruoto poi scendo
if bXSpec then
local dZPos = max( Z1Home, EMT.L3)
SimulMoveAxis( 'Z1', dZPos, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT, 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
if abs( dZPos - EMT.L3) > 1 then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
else
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
end
-- altrimenti sega a catena
else
-- Porto la Z alla giusta quota
if Z1Pos > Z1Home + 1 and abs( B1Pos) > 89.9 then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z1', Z1Home, MCH_SIM_STEP.RAPID)
end
-- 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
elseif nSetHead == 2 then
local B2Home = EgtGetAxisHomePos( 'B2')
local C2Home = EgtGetAxisHomePos( 'C2')
local Z2Home = EgtGetAxisHomePos( 'Z2')
local X2Home = EgtGetAxisHomePos( 'X2')
local X2Pos = EgtGetAxisPos( 'X2')
local B2Pos = EgtGetAxisPos( 'B2')
local C2Pos = EgtGetAxisPos( 'C2')
-- calcolo posizione reale
EMT.TCPOSREAL = 'T' .. AdjustTcPos( false, EMT.TCPOS, EMT.R3)
-- se utensile cambiato (controllo il reale perchè per aggregato dipende come è stato caricato)
if EMT.PREVTCPOSREAL_H2 ~= EMT.TCPOSREAL then
if EMT.ZMAX then
-- se bisogna scrivere tutti gli assi
if WriteAllCoordsOnFirstM101 then
if EMT.HEAD == 'H22' then
SimulMoveAxes( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID, 'B2', 0, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
X2Pos = ParkSawX2
else
SimulMoveAxes( 'X2', SafeX2, MCH_SIM_STEP.RAPID, 'B2', B2Home, MCH_SIM_STEP.COLLROT, 'C2', C2Home, MCH_SIM_STEP.COLLROT)
X2Pos = SafeX2
end
else
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
X2Pos = ParkSawX2
else
SimulMoveAxis( 'X2', SafeX2, MCH_SIM_STEP.RAPID)
X2Pos = SafeX2
end
end
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
-- Porto la X alla giusta quota
if X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
end
end
else
-- solo se è macchina a 3 teste con gruppo truciolatore 4 assi, devo andare prima in Z0
if EgtGetHeadId( 'H39') then
SimulMoveAxis( 'Z2', Z2Home, MCH_SIM_STEP.RAPID)
end
-- Porto la X alla giusta quota
if EMT.ZMAX and X2Pos > ParkMchY2 and ( B2Pos ~= EMT.R2 or C2Pos ~= EMT.R1) then
SimulMoveAxis( 'X2', ParkMchY2, MCH_SIM_STEP.RAPID)
end
end
if EMT.HEAD == 'H22' then
SimulMoveAxes( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- se ero a ZMAX, mi sposto in posizione a Z home. Ultimo movimento muove in Z
if EMT.ZMAX then
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
end
-- altrimenti testa 3
else
-- testa 4 assi dedicata truciolatore
if EgtGetHeadId( 'H39') then
if EMT.ZMAX then
local MaxZ3 = EgtGetAxisMax( 'Z3')
SimulMoveAxes( 'X3', EMT.L2, MCH_SIM_STEP.RAPID, 'Z3', MaxZ3, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
-- testa 5 assi dedicata lama
elseif EgtGetHeadId( 'H38') then
if EMT.ZMAX then
local B3Home = EgtGetAxisHomePos( 'B3')
local C3Home = EgtGetAxisHomePos( 'C3')
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
-- se non sono esattamente in home, devo ruotare in zona sicura
if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then
EMT.L3 = min( EMT.L3, SafeZ3RotAxis)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B3', EMT.R2, MCH_SIM_STEP.COLLROT, 'C3', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z3', EMT.L3, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X3', EMT.L2, MCH_SIM_STEP.RAPID)
end
end
-- si muovono tutti gli assi assieme
-- altre configurazioni
else
EmtSetLastError( 1212, "HEAD not managed")
end
end
nRes = ExecParkRoller( Y1Pos, Y2Pos, V1Pos, V2Pos, bMchSplit, bAgg)
end
-- se lavorazione split, muovo per riaggancio del carro Y1
if EMT.SPLIT_Y1DELTA then
if EMT.SPLIT_Y1DELTA and ( not IsNewLinkHead( EMT.HEAD) or IsL1Enabled( EMT.MASK)) then
EMT.Y1DELTA = EMT.SPLIT_Y1DELTA
EMT.A1 = EMT.L1 + EMT.Y1DELTA
end
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
if EMT.MOVE == 0 and EMT.FLAG == 3 and not IsNewLinkHead( EMT.HEAD) then
-- demando movimento completo a MoveEnd
EMT.EnabAxes = false
EMT.ShowAxes = true
@@ -1171,6 +1081,12 @@ function OnSimulMoveStart()
EMT.A6n = 'Z2'
local Z2 = -Head2Z + MillOffs + Mill2Offs + EMT.L3
EMT.A6 = EgtClamp( Z2, MinZ2, MaxZ2)
-- dato che la testa 2 è slave, bisogna controllare eventuale extra-corsa da post
if not( EMT.MOVE == 0 and EMT.FLAG == 2) and Z2 > MaxZ2 then
local sErr = EMT.MCHNAME..' ==> Out of Stroke: Z2 : '.. EgtNumToString( dZ2-MaxZ2, 2)
EmtSetLastError( 1220, sErr, true)
EgtOutBox( sErr, 'ERROR')
end
EMT.A6m = EgtIf( ( EMT.MOVE == 2 or EMT.MOVE == 3), 'Z1', nil)
EMT.A7n = 'C2'
EMT.A7 = EMT.R1
@@ -1201,6 +1117,12 @@ function OnSimulMoveStart()
EMT.DOU_DRILL_END = EMT.L3p - EMT.L3
Z2 = Z2 - 2 * EMT.DOU_DRILL_END
end
-- dato che la testa 2 è slave, bisogna controllare eventuale extra-corsa da post
if not( EMT.MOVE == 0 and EMT.FLAG == 2) and Z2 < MinZ2 then
local sErr = EMT.MCHNAME..' ==> Out of Stroke: Z2 : '.. EgtNumToString( MinZ2-Z2, 2)
EmtSetLastError( 1220, sErr, true)
EgtOutBox( sErr, 'ERROR')
end
EMT.A6 = EgtClamp( Z2, MinZ2, MaxZ2)
EMT.A6m = nil
EMT.A7n = 'C2'
@@ -1217,7 +1139,7 @@ function OnSimulMoveStart()
end
end
-- se necessario ...
if EMT.MCHFIRST and EMT.EnabAxes ~= false then
if ( EMT.MCHFIRST or ( EMT.MOVE == 0 and IsNewLinkHead( EMT.HEAD))) and EMT.EnabAxes ~= false then
if nSetHead == 1 then
SimulMoveAxes( 'X1', EMT.L2, MCH_SIM_STEP.RAPID,
'Z1', EMT.L3, MCH_SIM_STEP.RAPID,
@@ -1234,29 +1156,42 @@ function OnSimulMoveStart()
'Z2', EMT.L3, MCH_SIM_STEP.RAPID,
'C2', EMT.R1, MCH_SIM_STEP.COLLROT,
'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
else
elseif not IsNewLinkHead( EMT.HEAD) or ( bParkV and not bNlhParkV) then
SimulMoveAxes( 'X3', EMT.L2, MCH_SIM_STEP.RAPID,
'Z3', EMT.L3, MCH_SIM_STEP.RAPID,
'C3', EMT.R1, MCH_SIM_STEP.COLLROT,
'B3', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
if nRes ~= 0 then
if nRes ~= 0 and not bNlhParkV then
EMT.A3 = EgtIf( GetV1ToClose(), EMT.V1NEXTPOS, ParkV1)
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
end
EMT.ZMAX = nil
EMT.TO_ZMAX = nil
-- se aggregato flottante su inizio attacco va compresso
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
-- recupero lunghezza
local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL)
-- imposto compressione della parte flottante
SetFloatPos( EMT.HEAD, dOffsL)
-- imposto dati utensile in posizione compressa
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL)
-- dichiaro che è compresso (assegnando Id entità di movimento)
EMT.TFLOAT_CMP = EMT.MOVEID
end
end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- rimozione eventuali sfridi
if EMT.FLAG == 301 then
ExecRemoveScraps()
end
-- se primo rapido della lavorazione
if EMT.MCHFIRST and EMT.MOVE == 0 then
if EMT.MOVE == 0 and ( EMT.MCHFIRST or ( IsNewLinkHead( EMT.HEAD) and IsL1Enabled( EMT.MASK))) then
-- se lavorazione split, dichiaro carro Y1 riagganciato
if EMT.SPLIT_Y1DELTA then
EMT.SPLIT_Y1DELTA = nil
@@ -1292,19 +1227,49 @@ function OnSimulMoveEnd()
end
end
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
if EMT.MOVE == 0 and EMT.FLAG == 3 and not IsNewLinkHead( EMT.HEAD) then
-- eventuale rimozione sfridi
ExecRemoveScraps()
-- ricavo prossimo utensile
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) or ( nHSet == 1 and EMT.TTOTLEN > LongTool)
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT)
--ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
EMT.TO_ZMAX = nil
end
-- se utensile flottante e movimento di compressione
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
if not EMT.TFLOAT_TH_COMPR_COLL then
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach'
EmtSetLastError( 1222, sErr)
EgtOutLog( 'Error : ' .. sErr, 1)
else
EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1)
end
EMT.TFLOAT_TH_COMPR_COLL = nil
end
-- se aggregato flottante su fine uscita va rilasciato
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then
-- reset compressione della parte flottante
SetFloatPos( EMT.HEAD, 0)
-- dichiaro che è rilasciato
EMT.TFLOAT_CMP = nil
end
end
---------------------------------------------------------------------
function OnSimulCollision()
-- se prima collisione della lavorazione, la segnalo
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
-- speciale per utensile flottante (suo holder contro il grezzo)
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then
if EMT.MOVEID == EMT.TFLOAT_CMP then
EMT.TFLOAT_TH_COMPR_COLL = true
end
return
end
local Class = ''
if EMT.SIMCOBIND == 1001 or EMT.SIMCOBIND == 1011 then
Class = 'T_'..EMT.HEAD
@@ -1465,7 +1430,9 @@ function ExecStartHome()
EgtResetAxisPos( 'C1')
EgtResetAxisPos( 'B1')
-- Testa 2
EgtSetAxisPos( 'X2', SafeX2)
local _, sHead, _, _, _, _ = FindFirstToolOnHeadSet( 2)
local PosXStart = EgtIf( sHead == 'H22', SafeX2, ParkX2)
EgtSetAxisPos( 'X2', PosXStart)
EgtSetAxisPos( 'Z2', MinZ2)
EgtResetAxisPos( 'C2')
EgtResetAxisPos( 'B2')
@@ -1474,15 +1441,16 @@ end
---------------------------------------------------------------------
function ExecMoveHome( bNearV, bMchSplit)
-- risalita a Zmax
ExecMoveZmax( bMchSplit)
-- se testa sotto e macchian a 3 teste e gruppo truciolatore a 4 assi
-- ExecMoveZmax( bMchSplit, true)
-- se testa sotto e macchina a 3 teste e gruppo truciolatore a 4 assi
if GetHeadSet( EMT.HEAD) == 2 and IsHeadExisting( 3) then
if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then
if not SimulMoveAxis( 'X2', EgtIf( EMT.HEAD == 'H22', SafeX2, ParkX2), MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : X2')
end
-- se gruppo truciolatore a 4 assi
if EgtGetHeadId( 'H39') then
if not SimulMoveAxis( 'Z2', ParkInLavZ2, MCH_SIM_STEP.RAPID) then
EgtOutLog( 'Error on MoveHome : Z2')
EgtOutLog( 'Error on MoveHome : Z2')
end
end
end
@@ -1499,7 +1467,7 @@ function ExecMoveHome( bNearV, bMchSplit)
end
---------------------------------------------------------------------
function ExecMoveZmax( bMchSplit)
function ExecMoveZmax( bMchSplit, bGoToHome)
-- set della testa
local nSetHead = GetHeadSet( EMT.HEAD)
-- posizioni correnti degli assi testa
@@ -1539,6 +1507,9 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MyMaxZ1, MCH_SIM_STEP.RAPID)
if bGoToHome then
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
else
-- salgo in Z sicurezza raddrizzando la B
@@ -1579,13 +1550,16 @@ function ExecMoveZmax( bMchSplit)
SimulMoveAxes( 'B3', ParkB3, MCH_SIM_STEP.COLLROT)
elseif EgtGetHeadId( 'H38') then
local MyMaxZ3 = EgtGetAxisMax( 'Z3')
-- se non sono esattamente in home, devo ruotare in zona sicura
-- se non sono esattamente in home, ruoto dove sono
if abs( HomeC - CurrC) > 1 or abs( HomeB - CurrB) > 1 then
SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
-- SimulMoveAxis( 'X3', SafeX3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Z3', SafeZ3RotAxis, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'C3', HomeC, MCH_SIM_STEP.COLLROT, 'B3', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z3', MyMaxZ3, MCH_SIM_STEP.RAPID)
if bGoToHome then
SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID)
end
else
EmtSetLastError( 1212, "HEAD not managed")
end
@@ -1608,7 +1582,7 @@ function ExecUnloading()
-- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 1600, -1600), 0)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 1900, -1900), 0)
if EMT.FALL then vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 3200, -2600), -1150) end
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
@@ -1645,16 +1619,162 @@ 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
function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, vtOffset)
local idCurveList = {}
local vtIntersPlane
-- piano di interpolazione
if 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.STANDARD)
local ptPosIntersPlane
if sPosIntersPlane == 'MIN' then
ptPosIntersPlane = b3VMill:getMin() + vtOffset
elseif sPosIntersPlane == 'MAX' then
ptPosIntersPlane = b3VMill:getMax() + vtOffset
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
function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, vtOffset)
-- test piano frontale
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, vtOffset)
-- 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
for k = 1, nFlatSurfCnt do
local idTempSurf = idFlatSurf + k - 1
EgtSurfFrIntersect( idTempSurf, idClampSurf)
if idTempSurf then
dTotalArea = dTotalArea + ceil( EgtSurfArea( idTempSurf) or 0)
end
end
return dTotalArea
end
return 0
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
local MinJoin = BD.GetMinJoin( EMT.SB, EMT.HB, 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 = CalculateIntersectionArea( 'MIN', 'Y', Vector3d( 0, 1, 0))
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, si prova un altro slice 5mm più all'interno, se aumenta al doppio non c'è errore (probabilmente siamo in presenza di un displuvio)
if dArea > 1000 then
local dNewArea = CalculateIntersectionArea( 'MIN', 'Y', Vector3d( 0, 5, 0))
if dNewArea > dArea * 2 then
bError = false
end
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', Vector3d( 0, -1, 0))
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, si prova un altro slice 5mm più all'interno, se aumenta al doppio non c'è errore (probabilmente siamo in presenza di un displuvio)
if dArea > 1000 then
local dNewArea = CalculateIntersectionArea( 'MAX', 'Y', Vector3d( 0, -5, 0))
if dNewArea > dArea * 2 then
bError = false
end
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)
SimulMoveAxes( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( bClose)
if bClose then
CheckClamping( 'PY1')
end
end
---------------------------------------------------------------------
function ExecMovePY2( bClose)
SimulMoveAxes( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( bClose)
if bClose then
CheckClamping( 'PY2')
end
end
---------------------------------------------------------------------
@@ -1706,6 +1826,8 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
EMT.ERR = 2
EmtSetLastError( 1202, 'Error on MoveAxes in ParkRoller (12A)')
end
EMT.Y1DELTA = nil
EMT.Y1SPEC = true
return 32
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EMT.ERR = 2
@@ -2087,25 +2209,40 @@ function LoadFirstTool( nHSet, sTcPosDef)
return sTool
end
---------------------------------------------------------------------
function IsNewLinkHead( sHead)
--return ( sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H14' or sHead == 'H16' or sHead == 'H38')
return true
end
---------------------------------------------------------------------
function IsL1Enabled( nMask)
return ( ( nMask & 1) ~= 0)
end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 70000 -- mm/min
local RAPID_Y_FEED = 100000 -- mm/min
local RAPID_Z_FEED = 32000 -- mm/min
local RAPID_C_FEED = 15000 -- deg/min
local RAPID_B_FEED = 15000 -- deg/min
local RAPID_MIN_T = 0.1 -- s
local LOAD_T = 2 -- s
local CHAR_ONE_MOVE_T = 1 -- s
local ROTATION_T = 40 -- s
local SPLIT_T = 6 -- s
local UNLOAD_T = 4 -- s
local FALL_T = 2 -- s
local ESTIMATION_RAPID_COEFF = EstimationRapidMultiplier or 1
local RAPID_X_FEED = 70000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 32000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_C_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_B_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_MIN_T = 0.1 * ESTIMATION_RAPID_COEFF -- s
local LOAD_T = 2 * ESTIMATION_RAPID_COEFF -- s
local CHAR_ONE_MOVE_T = 1 * ESTIMATION_RAPID_COEFF -- s
local ROTATION_T = 40 * ESTIMATION_RAPID_COEFF -- s
local SPLIT_T = 6 * ESTIMATION_RAPID_COEFF -- s
local UNLOAD_T = 4 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 116000, 20000, 130000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 6000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 600 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
end
---------------------------------------------------------------------
@@ -2191,6 +2328,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
@@ -2247,6 +2393,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
---------------------------------------------------------------------
@@ -2372,17 +2524,20 @@ 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
local dT5 = abs( dR2) / RAPID_B_FEED * 60
if dT5 > dTime then dTime = dT5 end
EMT.MCHEXTTIME = EMT.MCHEXTTIME + dTime
EgtOutLog( string.format( ' G0 Len=%.0f Rot=%.0f° Time=%.2f', dLen, abs( dR1) + abs( dR2), dTime), 5)
-- aggiorno valori come precedenti
EmtUpdatePrev()
@@ -2398,7 +2553,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
@@ -2564,7 +2719,7 @@ function GetNextChainSawingVirtualAxis( MchId)
-- la imposto come lavorazione corrente
EgtSetCurrMachining( NextMchId)
-- recupero il valore dell'asse virtuale bloccato A
local dPosA = GetCurrMultiDrillVirtualAxis()
local dPosA = GetCurrChainSawingVirtualAxis()
-- ripristino la lavorazione corrente
if MchId then
EgtSetCurrMachining( MchId)
@@ -2591,7 +2746,7 @@ function GetNextMultiDrillVirtualAxis( MchId)
-- la imposto come lavorazione corrente
EgtSetCurrMachining( NextMchId)
-- recupero il valore dell'asse virtuale bloccato A
local dPosA = GetCurrChainSawingVirtualAxis()
local dPosA = GetCurrMultiDrillVirtualAxis()
-- ripristino la lavorazione corrente
if MchId then
EgtSetCurrMachining( MchId)
@@ -2645,12 +2800,17 @@ function GetStartMachiningXaxis( nMchId)
end
end
---------------------------------------------------------------------
function IsLastPath( nPathId)
return not EgtGetNext( nPathId)
end
---------------------------------------------------------------------
function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H16' 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))
elseif sHead == 'H21' or sHead == 'H22' 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))
elseif sHead == 'H38' then
return ( abs( dAng1 - dAng1p) > 1 or abs( dAng2 - dAng2p) > 1)
end
@@ -2667,5 +2827,38 @@ function GetCmdAxMove( Cmd, sAx)
end
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = EMT.MINACC -- [ms] ~600
local MaxTempoAcc = EMT.MAXACC -- [ms] ~6000
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 = EgtClamp( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito), MinTempoAcc, MaxTempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc, MinTempoAcc, RidFeed
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
local dTempoAcc, _, _ = CalcDinamicaPinze( EMT.HB, EMT.SB, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
dTempoAcc = dTempoAcc / 1000
-- se si raggiunge la velocità massima
if dPathLen >= dFeedInSec * dTempoAcc then
dTime = dTempoAcc * 2 + ( ( dPathLen - dFeedInSec * dTempoAcc) / dFeedInSec)
else
dTime = 2 * sqrt( (dPathLen * dTempoAcc) / dFeedInSec)
end
return dTime
end
---------------------------------------------------------------------
-- *** END GENERAL ***
+341 -171
View File
@@ -1,4 +1,4 @@
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/04/09
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2025/08/25
-- Intestazioni
require( 'EmtGenerator')
@@ -8,190 +8,291 @@ EgtEnableDebug( false)
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Special Z moves ***
-- *** Generic Machinings ***
---------------------------------------------------------------------
---------------------- OnSpecialGetMaxZ -----------------------------
local function CalcExtraZ( vtTp, vtT, vMZ)
-- la tabella deve esistere ed essere non vuota
if not vMZ or #vMZ == 0 then return 0 end
-- componente Z di riferimento è la minima
local vtTz = min( vtTp:getZ(), vtT:getZ())
-- se oltre il massimo
if vtTz > vMZ[1].Tz then return vMZ[1].Ez end
-- interpolo
for i = 2, #vMZ do
if vtTz > vMZ[i].Tz then
local dCoeff = ( vtTz - vMZ[i-1].Tz) / ( vMZ[i].Tz - vMZ[i-1].Tz)
return (( 1 - dCoeff) * vMZ[i-1].Ez + dCoeff * vMZ[i].Ez)
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- *** Special GetPrevMachiningOffset ***
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
function OnSpecialGetPrevMachiningOffset()
-- 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)
-- la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
-- sotto il minimo
return 0
end
---------------------------------------------------------------------
function OnSpecialGetMaxZ()
-- Inizializzazioni
EMC.ERR = 0
-- Gestione speciale per sega a catena
if EMC.HEAD == 'H13' then
EMC.MAXZ = EgtGetAxisHomePos( 'Z1')
return
-- *** Special Link moves ***
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
local function IsPrevSplit()
local sPrevUserNotes = ''
if EMC.LINKTYPE == 2 then
sPrevUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
elseif EMC.LINKTYPE == 3 then
EgtSetCurrMachining( EMC.PREVMCHID)
sPrevUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
EgtSetCurrMachining( EMC.NEXTMCHID)
end
return ( sPrevUserNotes:find( 'Split;', 1, true) ~= nil)
end
-- Sistemazione dati di input
local vtTp = Vector3d( EMC.TDIRp)
local bFromZmax = false
-- recupero il gruppo
local nSetHead = GetHeadSet( EMC.HEAD)
if vtTp:isSmall() then
vtTp = X_AX()
bFromZmax = true
if nSetHead == 1 then
EMC.R1p = ParkC1
EMC.R2p = ParkB1
elseif nSetHead == 2 then
EMC.R1p = ParkC2
EMC.R2p = ParkB2
elseif nSetHead == 3 then
EMC.R1p = ParkC3
EMC.R2p = ParkB3
-----------------------------------------------------------------------------------------
local function GetActiveRawBBox()
local b3Raw = BBox3d()
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtVerifyRawPartPhase( nRawId, EMC.PHASE) then
b3Raw = EgtGetRawPartBBox( nRawId)
break
end
nRawId = EgtGetNextRawPart( nRawId)
end
local vtT = Vector3d( EMC.TDIR)
local vtTpZm = EgtIf( bFromZmax, vtT, vtTp)
local bBSameSign = (( EMC.R2p < 10 and EMC.R2 < 10) or ( EMC.R2p > -10 and EMC.R2 > -10))
return b3Raw
end
-- Calcolo in funzione della testa e dei parametri
-----------------------------------------------------------------------------------------
function OnSpecialLink()
-- se fresa su testa 1
if EMC.HEAD == 'H11' then
if bBSameSign and vtTp:getX() > -0.1 and vtT:getX() > -0.1 then
EMC.MAXZ = MaxZ1
else
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
else
EMC.MAXZ = ParkZ1 + 1
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
elseif bBSameSign and EMC.R1p > 29.9 and EMC.R1p < 180.1 and EMC.R1 > 29.9 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and EMC.R1p > -0.1 and EMC.R1p < 180.1 and EMC.R1 > -0.1 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
else
local vMZ = {{ Tz=0.85, Ez=400}, { Tz=0.7, Ez=300}, { Tz=0.5, Ez=195}, { Tz=0.15, Ez=70}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H16' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1)
else
EMC.MAXZ = ParkZ1 + 1
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2)
end
elseif bBSameSign and EMC.R1p > 29.9 and EMC.R1p < 180.1 and EMC.R1 > 29.9 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
EMC.MAXZ = MaxZ1Blade - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and EMC.R1p > -0.1 and EMC.R1p < 180.1 and EMC.R1 > -0.1 and EMC.R1 < 180.1 and EMC.R2p > -10 and EMC.R2 > -10 then
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1, 'LastRapid=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
local vMZ = {{ Tz=0.85, Ez=400}, { Tz=0.7, Ez=300}, { Tz=0.5, Ez=195}, { Tz=0.15, Ez=70}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, MaxZ1, EMC.R1p, 0}, 30, 3, 1)
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, MaxZ1, EMC.R1, 0}, 30, 2, 1)
end
end
elseif EMC.HEAD == 'H21' then
if bBSameSign and vtTp:getX() > -0.1 and vtT:getX() > -0.1 then
EMC.MAXZ = MaxZ2
else
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}}
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H38' then
EMC.MAXZ = SafeZ3RotAxis
end
end
---------------------- OnSpecialMoveZup -----------------------------
function OnSpecialMoveZup()
--EgtOutLog( 'OnSpecialMoveZup : ' .. EMC.HEAD .. '.' .. tostring( EMC.EXIT))
-- Inizializzazioni
EMC.ERR = 0
EMC.MODIF = false
-- Direzione utensile
local vtT = Vector3d( EMC.TDIR)
-- recupero Z1 home
local nHeadSet = GetHeadSet( EMC.HEAD)
local dZmax = EgtGetAxisHomePos( EgtIf( nHeadSet ~= 2, 'Z1', 'Z2'))
-- se fresa su testa1 o testa 2
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' or EMC.HEAD == 'H22' then
;
-- se lama
-- se lama su rinvio standard o opposto di testa 1
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H16' then
-- riporto i valori tra -179 e + 180
local dCheckAxR1 = EMC.R1
if dCheckAxR1 < -180 then
dCheckAxR1 = dCheckAxR1 + 360
elseif dCheckAxR1 > 180 then
dCheckAxR1 = dCheckAxR1 - 360
end
-- se lama su testa1
if EMC.HEAD == 'H12' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( dCheckAxR1 < 15.0 or dCheckAxR1 > 180.0)) or ( EMC.R2 < -87.9 and ( dCheckAxR1 > -15.0 and dCheckAxR1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- se troppo in alto
if EMC.L3 > dZref + 1 then
---- sistemo asse rotante
--EMC.R2 = EgtIf( ( EMC.R2 > 0), 90, -90)
---- ricalcolo versore utensile
--EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2)
---- porto alla giusta quota
--EMC.L3 = dZmax
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- recupero se split da note utente di lavorazione precedente
local bSplit = IsPrevSplit()
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
-- se seconda lama su testa1
elseif EMC.HEAD == 'H16' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( dCheckAxR1 < 15.0 or dCheckAxR1 > 180.0)) or ( EMC.R2 < -87.9 and ( dCheckAxR1 > -15.0 and dCheckAxR1< 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- se troppo in alto
if EMC.L3 > dZref + 1 then
---- sistemo asse rotante
--EMC.R2 = EgtIf( ( EMC.R2 > 0), 90, -90)
---- ricalcolo versore utensile
--EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2)
---- porto alla giusta quota
--EMC.L3 = dZmax
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1)
else
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
end
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1, 'LastRapid=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 1, EgtIf( bSplit, 'Split=1;', ''))
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, MaxZ1Blade, EMC.R1, 0}, 30, 2, 1)
end
end
-- se sega a catena su testa 1
elseif EMC.HEAD == 'H13' then
-- recupero se split da note utente di lavorazione precedente
local bSplit = IsPrevSplit()
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkCSawZ1, EMC.R1p, EMC.R2p, EMC.R3p}, 30, 2, 1)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3p}, 30, 2, 0)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3p}, 30, 2, 0)
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2, EMC.R3p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkCSawZ1, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 1, 'LastRapid=1;')
end
-- se aggregato foratore multiplo su testa 1
elseif EMC.HEAD == 'H14' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0, EMC.R3}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0, EMC.R3}, 30, 3, 2)
end
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 30, 3, 1, 'LastRapid=1;')
end
-- se fresa su testa 2
elseif EMC.HEAD == 'H21' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, ParkC2, ParkB2}, 30, 2, 1)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, EMC.R1, EMC.R2}, 30, 2, 2)
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, EMC.R1p, EMC.R2p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, ParkC2, ParkB2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, ParkX2, ParkZ2, ParkC2, ParkB2}, 30, 3, 1, 'LastRapid=1;')
end
-- se lama su testa 2
elseif EMC.HEAD == 'H22' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, ParkC2, ParkB2}, 30, 2, 1)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, ParkZ2, EMC.R1, EMC.R2}, 30, 2, 2)
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, EMC.R1p, EMC.R2p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, ParkZ2, ParkC2, ParkB2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, SafeX2, ParkZ2, ParkC2, ParkB2}, 30, 3, 1, 'LastRapid=1;')
end
-- se lama su testa 3
elseif EMC.HEAD == 'H38' then
EMC.L3 = SafeZ3RotAxis
-- dichiaro modificato
EMC.MODIF = true
else
; -- non si fa nulla
-- sicurezza aggiuntiva
local SAFE_DIST = 50
local dExtraDist = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) / 2 + SAFE_DIST
-- recupero se split da note utente di lavorazione precedente
local bSplit = IsPrevSplit()
-- recupero ingombro del primo grezzo in lavoro
local b3Raw = GetActiveRawBBox()
local dMinRawX3 = b3Raw:getMin():getY() - Head3Y
local dMaxRawX3 = b3Raw:getMax():getY() - Head3Y
local dMidRawX3 = ( dMinRawX3 + dMaxRawX3) / 2
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
local dSafeX3 = EgtIf( EMC.L2 < dMidRawX3, dMinRawX3 - dExtraDist, dMaxRawX3 + dExtraDist)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, dSafeX3, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 1)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, dSafeX3, SafeZ3RotAxis, EMC.R1p, EMC.R2p}, 30, 2, 2)
-- deve muoversi anche la trave (la lama non è abbastanza alta in Z) quindi Mask = 31
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, dSafeX3, SafeZ3RotAxis, EMC.R1, EMC.R2}, 31, 2, 2)
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
local dSafeX3 = EgtIf( EMC.L2p < dMidRawX3, dMinRawX3 - dExtraDist, dMaxRawX3 + dExtraDist)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, dSafeX3, SafeZ3RotAxis, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, dSafeX3, SafeZ3RotAxis, EMC.R1, EMC.R2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, dSafeX3, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1)
end
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 1, 'LastRapid=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > SafeZ3RotAxis + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, SafeZ3RotAxis, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, SafeZ3RotAxis, EMC.R1p, 0}, 30, 3, 2, 'LastRapid=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, SafeZ3RotAxis, EMC.R1, 0}, 30, 2, 2)
-- se non split deve muoversi anche la trave (la lama non è abbastanza alta in Z) quindi Mask = 31
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, SafeZ3RotAxis, EMC.R1, EMC.R2}, EgtIf( bSplit, 30, 31), 2, 2)
end
end
-- testa con truciolatore su testa 3
elseif EMC.HEAD == 'H39' then
;
end
EMC.ERR = 0
end
---------------------------------------------------------------------
@@ -205,7 +306,7 @@ local SIC_V = 50 -- sicurezza da testa
local MIN_ENG_V = 115 -- ingombro asse Z
local MIN_ENG_RACK_V = 161 -- ingombro asse Z con cremagliera
local MIN_ENG_XZ2_V = 180 -- ingombro assi XZ sotto
local MIN_Z2_FOR_ENG_XZ2_V = 270 -- quota Z2 da cui considerare ingombro assi XZ sotto
local MIN_Z2_FOR_ENG_XZ2_V = 250 -- quota Z2 da cui considerare ingombro assi XZ sotto
local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza
local MaxLenSmT = 1500 -- massima lunghezza pezzo scaricato con nastri verdi
local DIST_Y1MAX_LOAD = 100 -- distanza carrello Y1 da massimo asse al carico
@@ -342,6 +443,57 @@ local function EmitComment( vCmd, sOut)
end
end
-----------------------------------------------------------------------
local function CallSpecialLink()
-- cerco la lavorazione attiva precedente
local nPrevMchId = EgtGetPrevActiveOperation( EMC.MCHID)
while nPrevMchId and EgtGetOperationType( nPrevMchId) == MCH_OY.DISP do
nPrevMchId = EgtGetPrevActiveOperation( nPrevMchId)
end
-- se non esiste lavorazione precedente, non devo fare alcunché
if not nPrevMchId then return end
-- salvo nome utensile corrente
local sTool = EgtGetMachiningParam( MCH_MP.TOOL)
-- recupero utensile, testa, uscita e TcPos della lavorazione precedente
EgtSetCurrMachining( nPrevMchId)
local sPrevTool = EgtGetMachiningParam( MCH_MP.TOOL)
-- se utensili cambiati, non devo fare alcunché
if sTool ~= sPrevTool then
EgtSetCurrMachining( EMC.MCHID)
return
end
-- recupero altri dati lavorazione precedente
EgtTdbSetCurrTool( sPrevTool)
local sPrevHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sPrevExit = EgtTdbGetCurrToolParam( MCH_TP.EXIT)
local _, sPrevTcPos = EgtFindToolInCurrSetup( sPrevTool)
local nPrevPhase = EgtGetOperationPhase( nPrevMchId)
local vPrevAxIni = EmtGetFinalAxesPos( nPrevMchId)
local vPrevAxFin = EmtGetCurrAxesHomePos()
-- lancio risalita al termine della lavorazione precedente
local OrigEMC = EMC
EMC = { TOOL = sPrevTool, HEAD = sPrevHead, EXIT = sPrevExit, TCPOS = sPrevTcPos, PREVMCHID = nPrevMchId, PREVPHASE = nPrevPhase, LINKTYPE = 2,
L1p = vPrevAxIni[1], L2p = vPrevAxIni[2], L3p = vPrevAxIni[3], R1p = vPrevAxIni[4], R2p = vPrevAxIni[5], R3p = vPrevAxIni[6],
L1 = vPrevAxFin[1], L2 = vPrevAxFin[2], L3 = vPrevAxFin[3], R1 = vPrevAxFin[4], R2 = vPrevAxFin[5], R3 = vPrevAxFin[6]}
OnSpecialLink()
EMC = OrigEMC
-- recupero dati lavorazione corrente
EgtSetCurrMachining( EMC.MCHID)
EgtTdbSetCurrTool( sTool)
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sExit = EgtTdbGetCurrToolParam( MCH_TP.EXIT)
local _, sTcPos = EgtFindToolInCurrSetup( sTool)
local vAxIni = EmtGetCurrAxesHomePos()
local vAxFin = EmtGetInitialAxesPos( EMC.MCHID)
-- lancio discesa all'inizio della lavorazione corrente
OrigEMC = EMC
EMC = { TOOL = sTool, HEAD = sHead, EXIT = sExit, TCPOS = sTcPos, NEXTMCHID = OrigEMC.MCHID, NEXTPHASE = OrigEMC.PHASE, LINKTYPE = 1,
L1p = vAxIni[1], L2p = vAxIni[2], L3p = vAxIni[3], R1p = vAxIni[4], R2p = vAxIni[5], R3p = vAxIni[6],
L1 = vAxFin[1], L2 = vAxFin[2], L3 = vAxFin[3], R1 = vAxFin[4], R2 = vAxFin[5], R3 = vAxFin[6]}
OnSpecialLink()
EMC = OrigEMC
end
---------------------------------------------------------------------
function OnSpecialApplyDisposition()
@@ -519,6 +671,8 @@ function OnPostApplyMachining()
-- Inizializzo codice di errore
EMC.ERR = 0
EMC.ZMAX = false
-- Recupero la posizione della trave e dei carrelli al termine della precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- se precedente operazione non esiste, errore
@@ -569,13 +723,14 @@ function OnPostApplyMachining()
-- aggiornamento posizioni
local nLastPathId = EgtGetLastInGroup( EgtGetFirstNameInGroup( nPrevOpeId, 'CL') or GDB_ID.NULL)
local nLastEntId = EgtGetLastInGroup( nLastPathId)
local bAtZMax = ( EgtGetClEntMove( nLastEntId) == 0 and EgtGetClEntFlag( nLastEntId) == 3)
local nFlag, nFlag2 = EgtGetClEntFlag( nLastEntId)
local bVParked = ( EgtGetClEntMove( nLastEntId) == 0 and ( nFlag == 3 or nFlag2 == 1 or nFlag2 == 2))
local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
EMC.Y1DELTA = EgtGetInfo( nLastPathId, 'Y1DELTA', 'd')
EMC.Y2DELTA = EgtGetInfo( nLastPathId, 'Y2DELTA', 'd')
EMC.V1POS = EgtIf( bAtZMax, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1)
EMC.V2POS = EgtIf( bAtZMax, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2)
EMC.V1POS = EgtIf( bVParked, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1)
EMC.V2POS = EgtIf( bVParked, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2)
EMC.CNT = SpecGetCNT( EMC.MCHID)
end
@@ -662,6 +817,11 @@ function OnPostApplyMachining()
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
end
-- Se richiesto movimento preliminare della testa a Zmax
if EMC.ZMAX then
CallSpecialLink()
end
end
---------------------------------------------------------------------
@@ -1297,8 +1457,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
@@ -1306,11 +1469,15 @@ function SpecCalcUnload()
table.insert( vCmd, { 11, 0})
EMC.CNT = nil
end
-- Sposto il pezzo in posizione di scarico
local dFinT = EgtIf( EMC.LB < MaxLenSmT, UnloadSmT, 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 = EgtIf( EMC.LB < MaxLenSmT, UnloadSmT, 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
@@ -2454,6 +2621,9 @@ function SpecOutputCmds( vCmd, bEnd)
elseif Cmd[1] == 4 then
local sInfo = '4,'..EgtNumToString( Cmd[2],0)
EgtSetInfo( EMC.PATHID, sKey, sInfo)
if not bEnd and Cmd[2] == 1 then
EMC.ZMAX = true
end
-- apertura/chiusura morsa Y
elseif Cmd[1] == 11 then
local sInfo = '11,'..EgtNumToString( Cmd[2],0)
+1
View File
@@ -26,6 +26,7 @@ H21.1:MILL_NOTIP=MillNoTip.nge
H21.1:SAW_STD=SawH2Std.nge
H21.1:SAW_FLAT=SawH2Flat.nge
H22.1=Saw.nge
H38.1=SawH3Std.nge
[Machinings]
Drilling=1
+135 -72
View File
@@ -3,12 +3,12 @@
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
EgtEnableDebug( true)
PP_VER = '2.6k2_DEV7'
PP_NVER = '2.6.11.2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PF1500MAXrl-3T'
PP_VER = '2.7k1_DEV1'
PP_NVER = '2.7.11.1'
MIN_MACH_VER = '2.7d2'
MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -69,13 +69,15 @@ SawUnderOffsY = -111
SawUnderOffsZ = 150.25
SawUnderC2Offs = 0
SawUnderB2Offs = 0
SawC3Offs = 0
SawB3Offs = 0
ChSawLen = 91.0
Mill2Offs = 170.0
SawC2Offs = 0
SawB2Offs = 0
Mill3Offs = 163.0
MinX1 = 0
MaxX1 = 4750
MaxX1 = 4850
MinZ1 = -1850
MaxZ1 = 0
MaxZ1Blade = -100
@@ -116,20 +118,20 @@ ParkMultiDrill0C1 = -90 -- posizione parcheggio asse C per aggregato forat
ParkMultiDrillB1 = 0 -- posizione parcheggio asse B per aggregato forature multiplo
ParkMultiDrillZ1 = 0 -- posizione parcheggio asse Z per aggregato forature multiplo
MinZ3 = -1550
MaxZ3 = 0
MaxZ3 = -200
MinX3 = 0
MaxX3 = 4000
MinC3 = -181
MaxC3 = 181
MinB3 = 0
MaxB3 = 180
MinB3 = -91
MaxB3 = 91
ParkX3 = 0
ParkZ3 = 0
ParkC3 = 0
ParkB3 = 0
SafeX3RotAxis = 1600
SafeZ3RotAxis = -530
MinX2 = -3060
ParkZ3 = -200
ParkC3 = -90
ParkB3 = -75
SafeX3RotAxis = 1550
SafeZ3RotAxis = -655
MinX2 = -3800
MaxX2 = 0
MinZ2 = 0
MaxZ2 = 1450
@@ -140,7 +142,8 @@ MaxB2 = 127
MinB2b = -119
MaxB2b = 119
ParkX2 = -100
SafeX2 = -400
SafeX2 = -200
SafeX2RotAxis = -1000
ParkZ2 = 0
ParkInLavZ2 = 200
ParkC2 = -90
@@ -158,12 +161,12 @@ DeltaTabY = 2065.5
DeltaTabZ = -1491.0 + MillOffs -- per TPA : -1228.0 + MillOffs -- per NUM : -1058.0
DeltaRulliTraveZ = -1266
DimTabY = 1600
DimTabX = 30000
DimTabX = 34000
Delta2TabY = -2907.4
Delta2TabZ = 693.0 - Mill2Offs -- per TPA : 543.0 - Mill2Offs -- per NUM : 373.0
Delta3TabY = 2065.5
Delta3TabZ = -1430.25
Head3X = -163
Delta3TabZ = -1430 + Mill3Offs
Head3X = 0
Head3Y = DeltaTabY - Delta3TabY
Head3Z = DeltaTabZ - Delta3TabZ
Head2X = 0
@@ -171,7 +174,6 @@ Head2Y = DeltaTabY - Delta2TabY
Head2Z = DeltaTabZ - Delta2TabZ
DefTcPos1 = 'T1'
DefTcPos2 = 'T220'
CoeffVM = 0.5
MinForzaPinze = 400 -- [Kgf]
MaxForzaPinze = 1000 -- [Kgf]
Tc2Active = true
@@ -179,12 +181,13 @@ FirstSaw = false
SecondSaw = true
SecondChain = true -- magazzino seconda sega a catena
TcSpecialTools = true -- magazzino per utensili speciali. In genere truciolatore
DrillingAggregate = true -- aggregato foratura multipla dipende dal magazzino utensili speciali. Viene montato li
DrillingAggregate = false -- aggregato foratura multipla dipende dal magazzino utensili speciali. Viene montato li
TcAggreBladeUnder = true -- lama su aggregato per testa da sotto
EmitAccClamps = true
WriteAllCoordsOnFirstM101 = true
ForceToCloseRollersGate = false
Motors23KW = true
EstimationRapidMultiplier = 1
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1500MAXrl-3T.data"
@@ -246,9 +249,9 @@ if EgtExistsFile( sDataBeam) then
if Machine.Offsets.PARK_Y2 then ParkMchY2 = Machine.Offsets.PARK_Y2 end
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.MIN_DELTAVY then MinDeltaYV = Machine.Offsets.MIN_DELTAVY + 0.1 end
if Machine.Offsets.DIST_FTZERO then LoadT = Machine.Offsets.DIST_FTZERO end
if Machine.Offsets.DELTA_CARICZERO then TurnerOffs = Machine.Offsets.DELTA_CARICZERO end
if Machine.Offsets.MIN_DELTAVY then MinDeltaYV = Machine.Offsets.MIN_DELTAVY + 0.1 end
if Machine.Offsets.DIST_UNLOAD then UnloadT = Machine.Offsets.DIST_UNLOAD end
if Machine.Offsets.PIVOT_T1 then MillOffs = Machine.Offsets.PIVOT_T1 end
if Machine.Offsets.PIVOT_T2 then Mill2Offs = Machine.Offsets.PIVOT_T2 end
@@ -259,6 +262,8 @@ if EgtExistsFile( sDataBeam) then
if Machine.Offsets.OFFSETBLAMAT2 then Saw2B1Offs= Machine.Offsets.OFFSETBLAMAT2 end
if Machine.Offsets.OFFSETCLAMAUNDER then SawUnderC2Offs= Machine.Offsets.OFFSETCLAMAUNDER end
if Machine.Offsets.OFFSETBLAMAUNDER then SawUnderB2Offs= Machine.Offsets.OFFSETBLAMAUNDER end
if Machine.Offsets.OFFSETCLAMAT3 then SawC3Offs= Machine.Offsets.OFFSETCLAMAT3 end
if Machine.Offsets.OFFSETBLAMAT3 then SawB3Offs= Machine.Offsets.OFFSETBLAMAT3 end
if Machine.Offsets.OFFSETXT1 then DeltaTabY = -Machine.Offsets.OFFSETXT1 end
if Machine.Offsets.OFFSETZT1 then DeltaTabZ = Machine.Offsets.OFFSETZT1 + MillOffs end
if Machine.Offsets.OFFSETXT2 then Delta2TabY = Machine.Offsets.OFFSETXT2 end
@@ -277,6 +282,11 @@ if EgtExistsFile( sDataBeam) then
if Machine.Offsets.DEFTCPOS2 then DefTcPos2 = ( 'T' .. Machine.Offsets.DEFTCPOS2) end
if Machine.Offsets.MINPRESS then MinForzaPinze = Machine.Offsets.MINPRESS end
if Machine.Offsets.MAXPRESS then MaxForzaPinze = Machine.Offsets.MAXPRESS 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.MOTORS23KW then Motors23KW = Machine.Offsets.MOTORS23KW == 1 end
@@ -318,6 +328,7 @@ EmtGeneral {
ExitMaxAdjust = 300,
ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 80,
NewLinkMgr = 1,
Special = 'Common_PF1250.mlse',
Processor = 'Common_PF1250.mlpe'}
-- in base alla corsa macchina, si carica la rulliera di carico/scarico appropriata
@@ -475,7 +486,7 @@ if DrillingAggregate then
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H14_HEAD/GEO',
Aux = {'H14_HEAD/SOLID', 'H14_HEAD/COLLISION'}}
end
end
-- *** Testa 3 ***
local X3Id = EmtAxis {
@@ -507,9 +518,9 @@ local C3Id = EmtAxis {
Token = 'C',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = Point3d( Head3X+163, Head3Y, 503.0),
Pos = Point3d( Head3X, Head3Y, 503.0),
Stroke = {MinC3, MaxC3},
Home = 0,
Home = ParkC3,
Geo = 'C3_AXIS/GEO',
Aux = {'C3_AXIS/SOLID', 'C3_AXIS/COLLISION'}}
local B3Id = EmtAxis {
@@ -517,15 +528,15 @@ local B3Id = EmtAxis {
Parent = 'C3',
Token = 'B',
Type = MCH_AT.ROTARY,
Dir = -Y_AX(),
Pos = Point3d( 0, -163, Head3Z),
Dir = X_AX(),
Pos = Point3d( -163.5, Head3Y, Head3Z+Mill3Offs),
Stroke = {MinB3, MaxB3},
Home = ParkB3,
Geo = 'B3_AXIS/GEO',
Aux = {'B3_AXIS/SOLID', 'B3_AXIS/COLLISION'}}
local vtMoveX3 = Vector3d( 0, Head3Y, 0)
EgtMove( EgtGetFirstNameInGroup( X3Id, 'SOLID'), vtMoveX3, GDB_RT.GLOB)
local vtMoveZ3 = Vector3d( 0, Head3Y, Head3Z -109.25)
local vtMoveZ3 = Vector3d( Head3X, Head3Y, Head3Z + 54)
EgtMove( EgtGetFirstNameInGroup( Z3Id, 'SOLID'), vtMoveZ3, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Z3Id, 'COLLISION'), vtMoveZ3, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C3Id, 'SOLID'), vtMoveZ3, GDB_RT.GLOB)
@@ -539,8 +550,8 @@ local H31Id = EmtHead {
HSet = 'H38',
Type = MCH_HT.STD,
Pos = Point3d( Head3X, Head3Y, Head3Z),
TDir = X_AX(),
ADir = -Y_AX(),
TDir = Vector3d( 0, sin( SawB3Offs), cos( SawB3Offs)),
ADir = X_AX(),
Rot1W = 0.2,
Rot2Stroke = {MinB3, MaxB3},
OthColl = {'B3/SOLID', 'C3/SOLID'},
@@ -765,7 +776,7 @@ EmtTable {
Geo = 'TABLE/GEO',
Aux = 'TABLE/SOLID'}
-- *** ToolChanger ***
local ptTc1 = Point3d( 150, 501, -221 + ( DeltaTabZ - DeltaRulliTraveZ + 55))
local ptTc1 = Point3d( 150, 501, -271 + ( DeltaTabZ - DeltaRulliTraveZ + 55))
local vtDt1 = Vector3d( 0, 0, - 102.5)
EmtTcPos {
Name = 'T1',
@@ -860,7 +871,7 @@ EmtTcPos {
Geo = 'BASE/T13'}
if Tc2Active then
local ptTc2 = Point3d( 150, 5168.75, -221 + ( DeltaTabZ - DeltaRulliTraveZ + 55))
local ptTc2 = Point3d( 150, 5168.75, -271 + ( DeltaTabZ - DeltaRulliTraveZ + 55))
local vtDt2 = Vector3d( 0, 0, - 102.5)
EmtTcPos {
Name = 'T21',
@@ -933,15 +944,40 @@ if Tc2Active then
ADir = X_AX(),
Geo = 'BASE/T30'}
end
local ptTc3 = Point3d( 600, 1181, -150.8)
EmtTcPos {
Name = 'T101',
Parent = 'Base',
Pos = ptTc3,
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101'}
local ptTc4 = Point3d( 750, 1561, -150.8)
if DrillingAggregate then
local ptTc3 = Point3d( 600, 1181, -321)
EmtTcPos {
Name = 'T101',
Parent = 'Base',
Type = MCH_HT.MULTI,
ExitNbr = 6,
Pos1 = ptTc3 + Vector3d( 0, 0, 0),
TDir1 = Z_AX(),
Pos2 = ptTc3 + Vector3d( -40, 0, 0),
TDir2 = Z_AX(),
Pos3 = ptTc3 + Vector3d( -80, 0, 0),
TDir3 = Z_AX(),
Pos4 = ptTc3 + Vector3d( 40, 0, 0),
TDir4 = Z_AX(),
Pos5 = ptTc3 + Vector3d( 80, 0, 0),
TDir5 = Z_AX(),
Pos6 = ptTc3 + Vector3d( 120, 0, 0),
TDir6 = Z_AX(),
ADir = X_AX(),
Geo = 'BASE/T101_MULTIDRILL',
Aux = 'BASE/T101_HS_MULTIDRILL'}
else
local ptTc3 = Point3d( 600, 1181, -180.8)
EmtTcPos {
Name = 'T101',
Parent = 'Base',
Pos = ptTc3,
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101'}
end
local ptTc4 = Point3d( 750, 1561, -180.8)
EmtTcPos {
Name = 'T111',
Parent = 'Base',
@@ -949,27 +985,14 @@ EmtTcPos {
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T111'}
local ptTc5 = Point3d( 750, 1961, -321)
local ptTc5 = Point3d( 750, 1961, -110.8)
EmtTcPos {
Name = 'T121',
Parent = 'Base',
Type = MCH_HT.MULTI,
ExitNbr = 6,
Pos1 = ptTc5 + Vector3d( 0, 0, 0),
TDir1 = Z_AX(),
Pos2 = ptTc5 + Vector3d( -40, 0, 0),
TDir2 = Z_AX(),
Pos3 = ptTc5 + Vector3d( -80, 0, 0),
TDir3 = Z_AX(),
Pos4 = ptTc5 + Vector3d( 40, 0, 0),
TDir4 = Z_AX(),
Pos5 = ptTc5 + Vector3d( 80, 0, 0),
TDir5 = Z_AX(),
Pos6 = ptTc5 + Vector3d( 120, 0, 0),
TDir6 = Z_AX(),
Pos = ptTc5,
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'BASE/T121',
Aux = 'BASE/T121_HS'}
Geo = 'BASE/T121'}
local ptTcS = Point3d( -1, 620.75, -1825.25 + ( DeltaTabZ - DeltaRulliTraveZ + 55))
EmtTcPos {
Name = 'T201',
@@ -1068,8 +1091,9 @@ EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC3') or GDB_ID.NULL, vtMovB, GDB_RT.G
if TcSpecialTools then EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC4') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB) end
if SecondChain then EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC5') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB) end
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TCR') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
if TcSpecialTools then EgtMove( EgtGetFirstNameInGroup( BaseId, 'TCS') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB) end
if TcAggreBladeUnder then EgtMove( EgtGetFirstNameInGroup( BaseId, 'TCS') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB) end
if TcSpecialTools then EgtMove( EgtGetFirstNameInGroup( BaseId, 'T121') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB) end
if DrillingAggregate then EgtMove( EgtGetFirstNameInGroup( BaseId, 'T101') 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( Z1Id, 'SOLID'), vtOffset23KW, GDB_RT.GLOB)
@@ -1108,13 +1132,13 @@ function OnSetHead()
if EMC.HEAD == 'H11' then
local nTc = GetTcForTopHeadTool( EMC.TCPOS)
if nTc ~= 2 then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'X1', ParkTc1X1)
else
EmtModifyAxisHome( 'X1', ParkTc2X1)
end
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1})
if EMC.TOTLEN and EMC.TOTLEN < LongTool then
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisHome( 'Z1', MaxZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
@@ -1133,8 +1157,8 @@ function OnSetHead()
-- se testa H12 (lama)
elseif EMC.HEAD == 'H12' then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1Blade})
EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
@@ -1162,8 +1186,8 @@ function OnSetHead()
-- recupero il valore dell'asse virtuale bloccato A
local MultiDrillPosA = GetCurrMultiDrillVirtualAxis()
EmtModifyAxisHome( 'X1', ParkMultiDrillX1)
EmtModifyAxisHome( 'Z1', ParkMultiDrillZ1)
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1})
EmtModifyAxisHome( 'Z1', ParkMultiDrillZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', GetMultiDrillCHomeFromVirtualAxis( MultiDrillPosA, EMC.TOTLEN))
EmtModifyAxisHome( 'B1', EgtIf( EMC.TOTLEN < MinLengthLongCSaw, ParkCSawB1, ParkLongCSawB1))
@@ -1171,8 +1195,8 @@ function OnSetHead()
-- se testa H16 ( seconda lama)
elseif EMC.HEAD == 'H16' then
EmtModifyAxisHome( 'X1', ParkTc2X1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'Z1', {MinZ1, MaxZ1Blade})
EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
@@ -1183,8 +1207,17 @@ function OnSetHead()
else
EmtModifyAxisStroke( 'B2', {MinB2, MaxB2})
end
EmtModifyAxisHome( 'C2', ParkC2)
EmtModifyAxisDirection( 'B2', X_AX())
elseif EMC.HEAD == 'H22' then
-- recupero valore asse A2 bloccato
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A2=0'
local SawUnderPosA2 = tonumber( sVal:sub( 4) or '') or 0
EmtModifyAxisHome( 'C2', GetSawCHomeFromVirtualAxis( SawUnderPosA2))
EmtModifyAxisDirection( 'B2', Vector3d( cos( SawUnderC2Offs), -sin( SawUnderC2Offs), 0))
elseif EMC.HEAD == 'H38' then
;
EmtModifyAxisDirection( 'B3', Vector3d( cos( SawC3Offs), -sin( SawC3Offs), 0))
end
end
@@ -1268,12 +1301,8 @@ function GetAdjHeadFromTcPos( nHeadSet, sTcPos)
if SecondSaw and sTcPos == 'T21' then
return 'H16'
-- utensili speciali
elseif TcSpecialTools and sTcPos == 'T121' then
if DrillingAggregate then
return 'H14'
else
return 'H11'
end
elseif DrillingAggregate and sTcPos == 'T101' then
return 'H14'
-- motoseghe
elseif sTcPos == 'T101' or sTcPos == 'T111' then
return 'H13'
@@ -1298,7 +1327,7 @@ end
---------------------------------------------------------------------
-- Funzione che riconosce testa per sega a catena
function HeadIsChainSaw( sHead)
return ( sHead == 'H13' or sHead == 'H15')
return ( sHead == 'H13')
end
---------------------------------------------------------------------
@@ -1483,6 +1512,37 @@ function GetPY2Light()
return ( EgtGetInfo( PY2LightId, 'On') == '1')
end
---------------------------------------------------------------------
-- Funzione per impostare la posizione del rinvio flottante
function SetFloatPos( sHead, dPos)
-- recupero Id testa
local nHeadId = EgtGetHeadId( sHead)
if not nHeadId then return false end
-- se ci sono entità flottanti nel ToolHolder
local nRefId = EgtGetFirstNameInGroup( nHeadId, '_T1')
local vtTool = EgtFR( nRefId, GDB_ID.ROOT):getVersZ()
local nObjId = EgtGetFirstGroupInGroup( EgtGetFirstNameInGroup( nHeadId, 'T1'))
local FloatEntities = EgtGetInfoInGroup( nObjId, 'Float')
if FloatEntities and #FloatEntities > 0 then
-- il porta-utensile flottante non può comprimersi più di 10mm
if dPos > 10 then
local sErr = 'Floating Ring compressed more than 10mm'
EmtSetLastError( 1222, sErr)
EgtOutLog( 'Error : ' .. sErr, 1)
end
local dFloat = EgtGetInfo( FloatEntities[1], 'Float', 'd')
if abs( dPos - dFloat) > 10 * GEO.EPS_SMALL then
local vtMove = ( dPos - dFloat) * vtTool
-- sposto tutte le entità flottanti
for i = 1, #FloatEntities do
EgtMove( FloatEntities[i], vtMove, GDB_RT.GLOB)
EgtSetInfo( FloatEntities[i], 'Float', dPos)
end
end
return true
end
return false
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
@@ -1491,6 +1551,9 @@ function OnResetMachine()
EmtUnlinkAllFixturesFromGroups()
SetPY1Light( false)
SetPY2Light( false)
--resetto eventuale flottante
SetFloatPos( 'H11', 0)
SetFloatPos( 'H21', 0)
-- nascondo Vmill
local nRawId = EgtGetFirstRawPart()
while nRawId do
Binary file not shown.
+27 -19
View File
@@ -7,18 +7,19 @@
[Sawing]
[Milling]
0=d,MaxElev,0
0=l,MaxElev,0
1=d,OutRaw,0
2=d,SideElev,0
2=l,SideElev,0
3=d,TrimExt,0
4=sr,VtFaceUse,0,0,0
4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0
[Pocketing]
0=d,MaxElev,0
0=l,MaxElev,0
1=b,Open,0
2=d,OpenMinSave,0
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=d,MaxOptSize,0
4=l,MaxOptSize,0
[Mortising]
0=d,MaxElev,0
@@ -30,21 +31,28 @@
[SawFinishing]
[GenMachining]
0=l,LinTol,0.1
1=l,MaxLen,2
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=l,OffsProj,0
6=l,LiTang,0
7=l,LiOrth,0
8=l,LiElev,0
9=l,LoTang,0
10=l,LoOrth,0
11=l,LoElev,0
12=b,DirFromGuide,1
[SurfRoughing]
0=l,MaxElev,1000
1=b,PlaneZ,0
[SurfFinishing]
0=b,SkipMaxDown,1
[5AxMilling]
0=l,LinTol,0.01
1=l,MaxLen,10
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=d,AngIni,-90
6=d,AngFin,90
7=l,LiTang,0
8=l,LiOrth,0
9=l,LiElev,0
10=l,LoTang,0
11=l,LoOrth,0
12=l,LoElev,0
13=b,DirFromGuide,0
14=b,SurfAvoid,0
+44 -3
View File
@@ -30,6 +30,7 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2)
local PositionTable = {}
local bTc2Active = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2') ~= nil)
local FirstSaw = ( EgtGetHeadId( 'H12') ~= nil)
local SecondSaw = ( EgtGetHeadId( 'H16') ~= nil)
local SecondChain = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC4') ~= nil)
local TcSpecialTools = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC5') ~= nil)
@@ -91,9 +92,49 @@ elseif bTc2Active and SecondSaw and SecondChain and TcSpecialTools and TcAggreBl
{Pos = "Pos11", TcPos = "T11", Head = "H11", Group = "G1"},
{Pos = "Pos12", TcPos = "T12", Head = "H11", Group = "G1"},
{Pos = "Pos13", TcPos = "T13", Head = "H11", Group = "G1"},
{Pos = "Pos14", TcPos = "T101", Head = "H13", Group = "G2"}, -- motosega
{Pos = "Pos15", TcPos = "T111", Head = "H13", Group = "G2"}, -- motosega 2
{Pos = "Pos16", TcPos = "T121", Head = "H14", Group = "G2"}, -- utensile speciale
{Pos = "Pos14", TcPos = "T101", Head = "H14", Group = "G2"}, -- utensile speciale
{Pos = "Pos15", TcPos = "T111", Head = "H13", Group = "G2"}, -- motosega
{Pos = "Pos16", TcPos = "T121", Head = "H11", Group = "G2"}, -- truciolatore
{Pos = "Pos17", TcPos = "T21", Head = "H16", Group = "G3"}, -- TC 2
{Pos = "Pos18", TcPos = "T22", Head = "H11", Group = "G3"},
{Pos = "Pos19", TcPos = "T23", Head = "H11", Group = "G3"},
{Pos = "Pos20", TcPos = "T24", Head = "H11", Group = "G3"},
{Pos = "Pos21", TcPos = "T25", Head = "H11", Group = "G3"},
{Pos = "Pos22", TcPos = "T26", Head = "H11", Group = "G3"},
{Pos = "Pos23", TcPos = "T27", Head = "H11", Group = "G3"},
{Pos = "Pos24", TcPos = "T28", Head = "H11", Group = "G3"},
{Pos = "Pos25", TcPos = "T29", Head = "H11", Group = "G3"},
{Pos = "Pos26", TcPos = "T30", Head = "H11", Group = "G3"},
{Pos = "Pos27", TcPos = "T201", Head = "H22", Group = "G4"}, -- lama con aggregatop da sotto
{Pos = "Pos28", TcPos = "T220", Head = "H21", Group = "G4"}, -- TC margherita
{Pos = "Pos29", TcPos = "T221", Head = "H21", Group = "G4"},
{Pos = "Pos30", TcPos = "T222", Head = "H21", Group = "G4"},
{Pos = "Pos31", TcPos = "T223", Head = "H21", Group = "G4"},
{Pos = "Pos32", TcPos = "T224", Head = "H21", Group = "G4"},
{Pos = "Pos33", TcPos = "T225", Head = "H21", Group = "G4"},
{Pos = "Pos34", TcPos = "T226", Head = "H21", Group = "G4"},
{Pos = "Pos35", TcPos = "T227", Head = "H21", Group = "G4"},
{Pos = "Pos36", TcPos = "T228", Head = "H21", Group = "G4"},
{Pos = "Pos37", TcPos = "T229", Head = "H21", Group = "G4"},
{Pos = "Pos38", TcPos = "T230", Head = "H21", Group = "G4"},
{Pos = "Pos39", TcPos = "T301", Head = "H38", Group = "G5"}}
elseif bTc2Active and SecondSaw and SecondChain and TcSpecialTools and TcAggreBladeUnder then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H11", Group = "G1"}, -- TC 1
{Pos = "Pos2", TcPos = "T2", Head = "H11", Group = "G1"},
{Pos = "Pos3", TcPos = "T3", Head = "H11", Group = "G1"},
{Pos = "Pos4", TcPos = "T4", Head = "H11", Group = "G1"},
{Pos = "Pos5", TcPos = "T5", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos9", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos11", TcPos = "T11", Head = "H11", Group = "G1"},
{Pos = "Pos12", TcPos = "T12", Head = "H11", Group = "G1"},
{Pos = "Pos13", TcPos = "T13", Head = "H11", Group = "G1"},
{Pos = "Pos14", TcPos = "T101", Head = "H13", Group = "G2"}, -- utensile speciale
{Pos = "Pos15", TcPos = "T111", Head = "H13", Group = "G2"}, -- motosega
{Pos = "Pos16", TcPos = "T121", Head = "H11", Group = "G2"}, -- truciolatore
{Pos = "Pos17", TcPos = "T21", Head = "H16", Group = "G3"}, -- TC 2
{Pos = "Pos18", TcPos = "T22", Head = "H11", Group = "G3"},
{Pos = "Pos19", TcPos = "T23", Head = "H11", Group = "G3"},
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
View File
@@ -27,6 +27,7 @@
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
5=dr,TOOL_OVERHANG
[MILL_NOTIP]
0=th,TH,
@@ -34,6 +35,7 @@
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
5=dr,TOOL_OVERHANG
[MORTISE_STD]
0=b,MORTISE
+92
View File
@@ -1,5 +1,97 @@
==== Common_PF1250 Update Log ====
Versione 2.7k1 (19/11/2025)
- (GEN) Preselzione testa 1 spostata prima della selezione testa 3. Ticket#2513
- (SIM-GEN) Corretto calcolo per decidere se serve aprire i rulli
- (SIM) Aggiunto controllo Extra-Corsa testa 2 in caso di lavorazione in doppio. Ticket#2201
- (SIM) Prima versione controllo pinzaggio su VMILL. Per attivarlo serve modifica della macchina a MLDE e NGE.
- (GEN) Simulazione non allineata a generazione. Se testa H38 e si chiudono i rulli, si deve andare in home. Ticket#2703
Versione 2.7i1 (08/09/2025)
- (GEN) Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto. Serve CAM5 2.7h1 (facoltativo)
- (EST) La stima tempi considera ora le accelerazoni degli assi
- (SIM) Corretto controllo ultimo utensile utilizzato su testa 1, prima si controllava il precedente, ma poteva essere la testa 2
- (SIM-GEN) Se testa 3 deve salire a ZMAX, sale alla X dove si trova e non torna in home
Versione 2.7h2 (21/08/2025)
- (GEN) Se la testa rimane bassa, corretto caso di reset del piano generico a fine lavorazione
- (GEN) Corretto movimento in Z massima dopo scarico pezzo
Versione 2.7h1 (20/08/2025)
- (GEN) Per posizione T111 e T121, se non è presente asse rotante per presa aggregato (es. se si mette una fresa normale) viene settato a zero.
- (MLDE-SIM) Aggiunta variabile FACOLTATIVA 'EstimationRapidMultiplier' in mlde per regolare il tempo stimato di rapido su macchine vecchie. Se non presente default 1.
Versione 2.7g1 (01/07/2025)
- (GEN) Lettura parametri accelerazioni da TS3. Ticket#2052
- (SIM-GEN) Aggiunta gestione massima lunghezza scarico
Versione 2.7d2 (24/04/2025)
- (SIM) Modifica qualità VMILL. Da ora si può impostare da impostazioni CAM5
Versione 2.7d1 (01/04/2025)
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
Versione 2.7b5 (26/02/2025)
- (MLDE-GEN) Gestione lettura feed massima pinze da Ts3.
Versione 2.7b4 (21/02/2025)
- (SIM-GEN) Ripristinato comportamento precedente calcolo posizione dei rulli di pinzaggio fatto con 2.7b2.
- (MLDE-SIM) Gestione aggregato flottante. Serve modifica MLDE. Ticket#2297
Versione 2.7b3 (06/02/2025)
- (SIM) Dopo aver scaricato utensile, si setta nota "HIDDEN" per dichiarare utensile non più sulla testa e non considerare le collisioni.
Versione 2.7b2 (04/02/2025)
- (SIM-GEN) Piccola modifica nel calcolo posizione dei rulli di pinzaggio.
Versione 2.7b1 (03/02/2025)
- (SIM) Corretta simulazione che non mandava testa in home in caso di utensile lungo. Generazione era già ok. Ticket#2280
Versione 2.7a2 (28/01/2025)
- (SIM-GEN) In MLSE aggiunta piccola correzione quota Z in caso di direzione Z tra 0.5 e 0.707.
Versione 2.7a1 (17/01/2025)
- (GEN) Piccola correzione posizione X in preselezione utensile
- (GEN) Corretto primo punto X preselezione utensile. Ticket#2183 e #2250
Versione 2.6l7 (19/12/2024)
- (SIM) HOTFIX : corretto posizione Z zero alla selezione dell'utensile in caso di motosega. Ticket#2235
Versione 2.6l6 (18/12/2024)
- (MLDE-SIM-GEN) Aggiunta variabile 'SafeX2RotAxis' in sostituzione della 'ParkMchY2' che era usata impropriamente
Versione 2.6l5 (17/12/2024)
- (SIM) Corretta posizione iniziale testa 2. Ticket#2228
Versione 2.6l4 (16/12/2024)
- (SIM-GEN) In MLSE ripristinati vecchi valori indici calcolo Z massima. In alcuni casi peggioravano la situazione.
Versione 2.6l3 (16/12/2024)
- (SIM) Corretto scarico utensile se aggregato. Se non presente utensile di default, non seleziona nulla.
- (SIM-GEN) In MLSE ritoccati indici calcolo Z massima. Ticket#2210
Versione 2.6l2 (13/12/2024)
- (SIM) Corretta chiamata calcolo asse virtuale
Versione 2.6l1 (13/12/2024)
- (SIM) Gestione caricamento utensili in caso di testa con uscita multipla.
- (SIM) Corretto errore di collisione per errata simulazione cambio utensile da lama a motosega.
- (SIM-GEN) Corretta gestione in caso di prima lavorazione con motosega.
- (GEN) Non si fa preselezione della testa 3
- (GEN) Corretta emissione coordinata rotazione testa 3 in zona sicura
- (SIM-GEN) A fine barra, testa 3 sempre in home
- (GEN) Controllo esistenza terzo asse ausiliario
- (GEN) Corretto primo movimento in X quando si parte con testa 3. Ticket#2216
- (GEN) Se su testa 1 c'è un aggregato e si utilizzerà la testa 3, si scarica aggregato e si prende utensile di default. Ticket#2222
- (GEN) Durante utilizzo della testa 3, non si preselezionano altre teste. Ticket#2220
- (SIM-GEN) Se lavorazione con testa dedicata lama e su testa 1 c'era aggregato, viene scaricato. Ticket#2216
Versione 2.6k3 (26/11/2024)
- (GEN) Corretta modifica fatta in versione 2.6k2. Ticket#2183
Versione 2.6k2 (25/11/2024)
- (GEN) Se si preseleziona su testa 1 un utensile lungo, non si va alla X successiva di lavoro ma si resta in home. Infatti potrebbe toccare le paratie in caso di scambio pezzo. Ticket#2183
Versione 2.6k1 (04/11/2024)
- (SIM-GEN) Gestione terza testa 5 assi dedicata lama (H38)
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6k1', -- versione script
VERSION = '2.7k1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}