Compare commits

..

62 Commits

Author SHA1 Message Date
andrea.villa cae8ad1017 - Corretto generazione
- Alal fine si scarica sempre la motosega
2026-05-07 10:32:33 +02:00
andrea.villa d9b214042b Aggiunto controllo che sia effettivamente una lavorazione 2026-05-06 12:29:13 +02:00
andrea.villa 821da118d4 - In simulazione corretto movimento pinza 5
- Migliorato gestione risalita in Home
2026-05-06 12:20:52 +02:00
andrea.villa f4c4a1adcb Migliorato calcolo nuova Z soto traversa 2026-05-06 09:00:21 +02:00
andrea.villa c4ef266018 - aggiunto LinkAxesMoveOrder
- migliorato controllo per decidere tipo di link su lama
- migliorie varie in simulazione
2026-05-06 08:04:25 +02:00
andrea.villa a00081e735 Corretto movimento quando c'è lo split 2026-05-05 14:36:40 +02:00
andrea.villa c460211ce4 - Piccole correzioni in generazione
- Se richiesto di andare in Home, si muove anche la Y
- Migliorie varie in simulazione, gestione pinza 5
2026-05-05 10:21:52 +02:00
andrea.villa 31b11e5acc Prima versione configurazione macchian con NewLink 2026-05-04 09:44:21 +02:00
andrea.villa 893f695633 Allineamento a common ver. 3.1c2 2026-03-17 15:20:18 +01:00
daniele.nicoli 148c226479 Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 09:13:22 +01:00
daniele.nicoli 98ae212816 Aggiunto info "PreviewShow" per anteprima utensile/testa nel MACH 2026-03-09 08:42:31 +01:00
daniele.nicoli e246bd329f Aggiunti parametri letti da TS3Data.lua: MIN_JOIN_S, MIN_JOIN_L e MAX_ANGLE_DRILL_CUT 2026-03-05 14:55:17 +01:00
daniele.nicoli 4100624c08 Merge branch 'master' into develop 2026-03-05 14:51:11 +01:00
andrea.villa 91fb6887e2 Merge remote-tracking branch 'origin/develop' 2026-02-20 09:13:31 +01:00
andrea.villa 1f888528d1 Allineamento con common ver. 3.1b1 2026-02-20 09:13:20 +01:00
daniele.nicoli aba14fa0e4 Aggiunta la lettura da TS3Data.lua delle corse dell'asse W (MIN_W e MAX_W) 2026-02-03 11:07:45 +01:00
daniele.nicoli a3255c957b Merge branch 'master' into develop 2026-02-03 11:07:04 +01:00
andrea.villa 4a7fa2bfa8 Allineamento con common ver. 3.1a1 2026-01-16 15:47:46 +01:00
andrea.villa 3aba6374cf Merge commit '016ccf0224a276d854802fee27dddb969f34f12c' 2025-12-18 16:11:51 +01:00
andrea.villa 016ccf0224 - Allineamento a common ver. 2.7l1
- Aggiunto parametro MAX_ANGLE_DRILL_CUT a BeamData
- Recupero nome macchina da funzione EGT
2025-12-18 16:11:38 +01:00
daniele.nicoli b3e7cefd0c Aggiornati mlde e nge in attesa di aggiornamento Common per Controllo Pinzaggio VMILL 2025-12-15 10:49:51 +01:00
daniele.nicoli 5979f55c01 Merge branch 'master' into develop 2025-12-15 10:39:40 +01:00
andrea.villa 9d50af71c6 Corretto disegno porta utensile 2025-12-11 09:22:19 +01:00
andrea.villa f5d33f780a Merge remote-tracking branch 'origin/develop' 2025-11-28 15:43:18 +01:00
andrea.villa b771a537d6 - Nuovo ToolHolder
- Allineamento con common ver. 2.7k3
2025-11-28 15:43:07 +01:00
andrea.villa 19cd08c362 Merge branch 'AspettaScarico' into develop 2025-11-28 15:42:27 +01:00
andrea.villa 5fb8a51a25 Prima di andare allo scarico, fa un movimento intermedio per essere sicuro di aprire le paratie a rulli 2025-11-27 17:16:39 +01:00
andrea.villa 4c09b35eab Modifica al post per aspettare sempre lo scarico del pezzo prima di procedere con nuovo pezzo della barra 2025-11-27 14:52:06 +01:00
andrea.villa 7998af903c Merge branch 'develop' 2025-11-20 17:02:41 +01:00
andrea.villa 30d119fecf - Allineamento a common ver. 2.7k2
- Cambio versione per rilascio a cliente
2025-11-20 17:02:30 +01:00
daniele.nicoli cf698a25be Aggiunta gestione CUT_SIC impostabile da TS3Data.lua 2025-11-13 11:40:05 +01:00
daniele.nicoli 7db43a20e3 Merge branch 'master' into develop 2025-11-13 11:37:00 +01:00
andrea.villa 2374bbd96a Allineamento con common ver. 2.7k1 2025-11-05 13:25:17 +01:00
andrea.villa 9a6de02364 Allineamento con common ver. 2.7j3 2025-10-23 07:52:15 +02:00
andrea.villa 0ac498e17b #critical# Allineamento con common ver. 2.7j2 2025-10-21 10:48:43 +02:00
andrea.villa 0a24d14e8c Allineamento con common ver. 2.7j1 2025-10-08 13:15:32 +02:00
andrea.villa 9c6694d5ef Allineamento con common ver. 2.7i1, HOTFIX 2025-09-10 12:11:39 +02:00
andrea.villa ad46345b8e Merge remote-tracking branch 'origin/develop' 2025-09-10 10:32:41 +02:00
andrea.villa 0fc1fd89d1 - Allineamento common ver. 2.71
- Aggiunto solido collisione per tappeto
- Commit per versione
2025-09-10 10:32:23 +02:00
andrea.villa 09d5c3c152 Merge branch 'NewAggregateBH' into develop 2025-09-10 08:21:09 +02:00
andrea.villa cc9f676866 Merge branch 'develop' into NewAggregateBH 2025-08-28 15:16:53 +02:00
andrea.villa be9c6305fb Merge remote-tracking branch 'origin/master' into develop 2025-08-28 15:16:23 +02:00
andrea.villa f54320bf30 Allineamento con common ver. 2.7h2 2025-08-28 15:15:43 +02:00
andrea.villa 04c4b8f756 Cambio versione 2025-08-20 14:37:59 +02:00
andrea.villa 027094d67e Merge remote-tracking branch 'origin/master' into NewAggregateBH 2025-08-20 14:35:54 +02:00
andrea.villa f0385c5558 Merge remote-tracking branch 'origin/develop' 2025-08-20 14:34:45 +02:00
andrea.villa 4b35bf714e Allineamento con common ver. 2.7h1 2025-08-20 14:34:27 +02:00
andrea.villa c2d4489879 Merge branch 'V1OpenOnTailCut' into develop 2025-08-20 14:33:29 +02:00
luca.mazzoleni d0f062ab32 Cambio di versione 2025-08-05 15:14:33 +02:00
luca.mazzoleni 26b673fc83 Allineamento con common test V1OpenOnTailCut 2025-08-05 15:11:23 +02:00
luca.mazzoleni 5a681e3d60 Merge branch 'master' into develop 2025-08-05 09:27:22 +02:00
andrea.villa 948ea31698 Cambio di versione 2025-07-24 08:56:56 +02:00
andrea.villa 7ba2d56749 Gestione aggregato BH completato. da testare! 2025-07-24 08:17:29 +02:00
andrea.villa f2816185cd Proma versione funzionante aggregato BlockHaus 2025-07-23 16:02:22 +02:00
andrea.villa 205a44075d Merge remote-tracking branch 'origin/master' into NewAggregateBH 2025-07-23 12:42:39 +02:00
andrea.villa f876850772 - Allineamento con common ver. 2.7g4
- Aggiunto parametro MaxBackClamp5
2025-07-23 12:23:10 +02:00
andrea.villa 2a60d00f61 Gestione nuovo aggregato tipo BlockHaus 2025-07-23 12:21:57 +02:00
andrea.villa 4d7297c498 Allineamento con common ver. 2.7g3 2025-07-22 11:20:15 +02:00
andrea.villa 9c358734ba Allineamento con common ver. 2.7g2 2025-07-08 10:38:08 +02:00
andrea.villa 88691bddcc Nome macchian ricavata da percorso 2025-07-01 10:26:48 +02:00
andrea.villa b633dc4349 Allineamento con common ver. 2.7g1 2025-07-01 10:23:04 +02:00
andrea.villa c443adc95b Allineamento con Common ver. 2.7e1 2025-05-28 12:36:31 +02:00
15 changed files with 1610 additions and 1854 deletions
+8
View File
@@ -0,0 +1,8 @@
{
"Lua.diagnostics.globals": [
"EmtRemoveClimb",
"EmtAddClimb",
"EmtRemoveRise",
"EmtAddRise"
]
}
+15
View File
@@ -42,6 +42,7 @@ local BeamData = {
DRILL_TOL = 0.2, -- tolleranza tra diametro foro e diametro punta
DRILL_VZ_MIN = - 0.51, -- componente limite in Z del versore di un foro
DRILL_VX_MAX = 0.867, -- componente limite in X del versore di un foro sulle facce laterali
MAX_ANGLE_DRILL_CUT = 15, -- delta angolo massimo tra foro e taglio che lo attraversa
DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale
@@ -68,6 +69,9 @@ local BeamData = {
KIOTP = 5, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare
MAXDIAM_POCK_CORNER = 201, -- diametro massimo utensile ammesso per tasche con angoli interni
USE_LONGCUT = true, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut
HEAD_DIM_FOR_BH = 125, -- dimensione di ingombro della testa per block haus
MAX_LEN_BH_FROM_BOTTOM = 210, -- massima lunghezza lavorabile da un lato di block haus da sotto
MAX_DIST_BH_FROM_BOTTOM = 600, -- massima distanza tra naso mandrino e sopra della trave senza collisione
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta
ADVANCE_TAIL_OFFS = 10, -- accorciamento taglio di coda avanzato (minimo 1)
DOUBLE_HEAD_DOVETAIL = false, -- flag abilitazione lavorazione mortase a coda di rondine in doppio
@@ -108,6 +112,17 @@ if EgtExistsFile( sData) then
BeamData.DIM_STRIP_SMALL = Machine.Offsets.DIM_STRIP_SMALL or BeamData.DIM_STRIP_SMALL
BeamData.DIM_TO_CENTER_STRIP = Machine.Offsets.DIM_TO_CENTER_STRIP or BeamData.DIM_TO_CENTER_STRIP
BeamData.MAXDIAM_POCK_CORNER = Machine.Offsets.MAXDIAM_POCK_CORNER or BeamData.MAXDIAM_POCK_CORNER
BeamData.LONGCUT_ENDLEN = Machine.Offsets.LONGCUT_ENDLEN or BeamData.LONGCUT_ENDLEN
BeamData.LONGCUT_MAXLEN = Machine.Offsets.LONGCUT_MAXLEN or BeamData.LONGCUT_MAXLEN
BeamData.ADVANCE_TAIL_OFFS = Machine.Offsets.ADVANCE_TAIL_OFFS or BeamData.ADVANCE_TAIL_OFFS
BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
if Machine.Offsets.MAX_ANGLE_DRILL_CUT then BeamData.MAX_ANGLE_DRILL_CUT = EgtClamp( Machine.Offsets.MAX_ANGLE_DRILL_CUT, 1, 89) end
if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = Machine.Offsets.MIN_JOIN_S end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = Machine.Offsets.MIN_JOIN_L end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
+2
View File
@@ -36,6 +36,8 @@
22=Long2CutSide
23=SmallToolContour
24=AntiSplintMillCut
25=Prof_end
26=SideMillAsBlade
[Pocketing]
1=Pocket
+356 -982
View File
File diff suppressed because it is too large Load Diff
+558 -651
View File
File diff suppressed because it is too large Load Diff
+498 -200
View File
@@ -7,211 +7,409 @@ EgtEnableDebug( false)
-- Carico libreria
local BD = require( 'BeamData')
---------------------- 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)
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- *** Special GetPrevMachiningOffset ***
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
function OnSpecialGetPrevMachiningOffset()
-- Aggiorno posizione della testa della trave a seguito di movimenti delle pinze non previsti tra le fasi
local function TPosUpdate()
local nClId = EgtGetFirstNameInGroup( EMC.CURRMCHID, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
if not nPathId then
EMC.ERR = 12
EMC.MSG = ' Error : CL group path not found'
return
end
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
local dTRepos = nil
-- controlla ogni gruppo di movimenti ausiliari
for i = 1, dAuxMoveCount do
local aAuxMove = EgtGetInfo( nPathId, 'AS' .. tostring( i), 'vs') or {} -- array contenete i parametri di ogni gruppo
-- controlla solo i movimenti della testa trave e salva l'ultimo
if aAuxMove[1] == '2' or aAuxMove[1] == '3' then
for j = 2, #aAuxMove do
if aAuxMove[j] == 'T' then
dTRepos = aAuxMove[j+1]
break
end
end
end
end
return dTRepos
end
-- default
EMC.ERR = 0
EMC.PREVOFFSX = 0
-- se c'è cambio di fase tra le lavorazioni (quindi la precedente è l'ultima della sua fase e la corrente la prima)
if EMC.PREVPHASE ~= EMC.CURRPHASE then
-- se la fase corrente è di inizio lavorazione di nuova trave
if IsStartOrRestPhase( EMC.CURRPHASE) then
-- recupero la posizione finale della lavorazione precedente
local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID)
-- ricava se e quanto la trave viene spostata tra le due fasi dai movimenti ausiliari e corregge l'offset di fine fase
local dNewTPos = TPosUpdate()
-- se ci sono dei movimenti della testa trave tra le due fasi ricava il delta tra la vecchia e la nuova posizione
if dNewTPos then
EMC.PREVOFFSX = dNewTPos - vPrevAx[1]
-- oppure la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
else
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
end
-- sotto il minimo
return 0
end
---------------------------------------------------------------------
function OnSpecialGetMaxZ()
-- Inizializzazioni
EMC.ERR = 0
-- Gestione speciale per sega a catena su utesta 1
if EMC.HEAD == 'H13' or EMC.HEAD == 'H15' then
EMC.MAXZ = EgtGetAxisHomePos( 'Z1')
return
-- Gestione speciale per sega a catena su testa 2
elseif EMC.HEAD == 'H23' then
EMC.MAXZ = EgtGetAxisHomePos( 'Z2')
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 sHead_TC = GetHeadTCSet( EMC.HEAD, EMC.TCPOS)
local bFromZmax = false
if vtTp:isSmall() then
vtTp = X_AX()
bFromZmax = true
if sHead_TC == 'Head1_TC1' then
EMC.R1p = ParkC1
EMC.R2p = ParkB1
elseif sHead_TC == 'Head2_TC2' then
EMC.R1p = ParkC2
EMC.R2p = ParkB2
elseif sHead_TC == 'Head1_TC2' then
EMC.R1p = ParkFrnC1
EMC.R2p = ParkFrnB1
-----------------------------------------------------------------------------------------
local function IsLinkSafety( vtFinal, vtInit)
local bSafeMove = true
local DirectionsToTest = { {vtInit[3],vtInit[4], vtInit[5]}, {vtFinal[3],vtFinal[4], vtFinal[5]}}
-- aggiungo anche il punto medio
table.insert( DirectionsToTest, {(vtInit[3]+vtFinal[3])/2,(vtInit[4]+vtFinal[4])/2,(vtInit[5]+vtFinal[5])/2})
for t=1, #DirectionsToTest do
local vtToolDir = EgtGetCalcToolDirFromAngles( DirectionsToTest[t][2], DirectionsToTest[t][3])
-- se lama su aggregato
if EMC.HEAD == 'H12' then
-- se sotto la traversa
if vtToolDir:getX() < 0.342 then
local dLen = SawOffsZ - MillOffs
local dToolRadius = 275 -- leggere dall'utensile!!
local dNewOffZ = ( dLen * abs( cos( DirectionsToTest[t][3])) + dToolRadius * abs( sin( DirectionsToTest[t][3]))) - 275
local dMaxZ = ParkZ1 - dNewOffZ
if dMaxZ < DirectionsToTest[t][1] then
bSafeMove = false
break
end
end
end
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))
-- Calcolo in funzione della testa e dei parametri
return bSafeMove
end
-----------------------------------------------------------------------------------------
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}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
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, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
if abs( EMC.R1 - EMC.R1p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
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) or
( EMC.R1p > 179.9 and EMC.R1p < 330.1 and EMC.R1 > 179.9 and EMC.R1 < 330.1 and EMC.R2p < 10 and EMC.R2 < 10)) then
EMC.MAXZ = MaxZ1 - 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) or
( EMC.R1p > 179.9 and EMC.R1p < 360.1 and EMC.R1 > 179.9 and EMC.R1 < 360.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 == 'H12' and sHead_TC == 'Head1_TC2' then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
EMC.MAXZ = ParkZ1 + 200
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, 'FirstRise=1;')
if abs( EMC.R1 - EMC.R1p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
end
else
EMC.MAXZ = ParkZ1 + 1
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, 'FirstRise=1;')
end
elseif bBSameSign and
(( EMC.R1p > -180.1 and EMC.R1p < -29.9 and EMC.R1 > -180.1 and EMC.R1 < -29.9 and EMC.R2p < 10 and EMC.R2 < 10) or
( EMC.R1p > -330.1 and EMC.R1p < -179.9 and EMC.R1 > -330.1 and EMC.R1 < -179.9 and EMC.R2p > -10 and EMC.R2 > -10)) then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and
(( EMC.R1p > -180.1 and EMC.R1p < 0.1 and EMC.R1 > -180.1 and EMC.R1 < 0.1 and EMC.R2p < 10 and EMC.R2 < 10) or
( EMC.R1p > -360.1 and EMC.R1p < -179.9 and EMC.R1 > -360.1 and EMC.R1 < -179.9 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.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
local vMZ = {{ Tz=0.85, Ez=380}, { Tz=0.7, Ez=280}, { Tz=0.5, Ez=180}, { Tz=0.15, Ez=60}, { 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, EMC.PREVMAIN, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1, EMC.R1p, 0}, 30, 3, 2, 'UniqueRise=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, MaxZ1, EMC.R1, 0}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
end
end
-- se lama su rinvio standard o opposto di testa 1
elseif EMC.HEAD == 'H12' 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, EMC.NEXTMAIN)
-- altrimenti discesa diretta
if abs( EMC.R1 - EMC.R1p) < 10 and abs( EMC.R2 - EMC.R2p) < 90 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
-- se assi cambiano di molto
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
if abs( EMC.R2) > 75 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkZ1, EMC.R1, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 2)
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vtFinalAxLink = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vtInitAxLink = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
local bSafeMove = IsLinkSafety( vtFinalAxLink, vtInitAxLink)
-- se superata quota massima ammessa
if not bSafeMove then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R2) > 91 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1p, EMC.L2p, ParkZ1, EMC.R1p, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 2)
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'LastRise=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, MaxZ1Blade, EMC.R1, 0}, 30, 2, 2, 'FirstClimb=1;')
if abs( EMC.R2) > 91 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkZ1, EMC.R1, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 2)
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
end
end
-- se sega a catena su testa 1
elseif EMC.HEAD == 'H13' or EMC.HEAD == 'H15' 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, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2, EMC.R3p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 2, 'LastRise=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
end
-- se aggregato foratore multiplo su testa 1
elseif EMC.HEAD == 'H17' then
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2, 'LastClimb=1;')
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'UniqueClimb=1;')
end
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0, EMC.R3}, 30, 3, 2, 'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0, EMC.R3}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 30, 3, 2, 'LastRise=1;')
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 30, 3, 2, 'UniqueRise=1;')
end
end
-- se fresa su testa 2
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}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}}
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H22' then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ2 - 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 = ParkZ2 + 200
-- se inizio lavorazione con prelievo utensile
if EMC.LINKTYPE == 1 then
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
if abs( EMC.R1 - EMC.R1p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, 'FirstRise=1;')
if abs( EMC.R1 - EMC.R1p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
end
else
EMC.MAXZ = ParkZ2 + 1
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, 'FirstRise=1;')
end
elseif bBSameSign and
(( EMC.R1p > -180.1 and EMC.R1p < -29.9 and EMC.R1 > -180.1 and EMC.R1 < -29.9 and EMC.R2p < 10 and EMC.R2 < 10) or
( EMC.R1p > -330.1 and EMC.R1p < -179.9 and EMC.R1 > -330.1 and EMC.R1 < -179.9 and EMC.R2p > -10 and EMC.R2 > -10)) then
EMC.MAXZ = MaxZ2 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif bBSameSign and
(( EMC.R1p > -180.1 and EMC.R1p < 0.1 and EMC.R1 > -180.1 and EMC.R1 < 0.1 and EMC.R2p < 10 and EMC.R2 < 10) or
( EMC.R1p > -360.1 and EMC.R1p < -179.9 and EMC.R1 > -360.1 and EMC.R1 < -179.9 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 = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
-- se superata quota massima ammessa
if max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1, EMC.R1p, 0}, 30, 3, 2, 'UniqueRise=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, MaxZ1, EMC.R1, 0}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
end
end
-- se lama su testa 2
elseif EMC.HEAD == 'H22' 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, EMC.NEXTMAIN)
-- altrimenti discesa diretta
if abs( EMC.R1 - EMC.R1p) < 10 and abs( EMC.R2 - EMC.R2p) < 90 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
-- se assi cambiano di molto
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
if abs( EMC.R2) > 75 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkZ1, EMC.R1, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 2)
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
local vtFinalAxLink = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vtInitAxLink = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
local bSafeMove = IsLinkSafety( vtFinalAxLink, vtInitAxLink)
-- se superata quota massima ammessa
if not bSafeMove then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R2) > 91 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1p, EMC.L2p, ParkZ1, EMC.R1p, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 2)
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'LastRise=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, MaxZ1Blade, EMC.R1, 0}, 30, 2, 2, 'FirstClimb=1;')
if abs( EMC.R2) > 91 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkZ1, EMC.R1, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 2)
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
end
end
-- se sega a catena su testa 2
elseif EMC.HEAD == 'H23' 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, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2, EMC.R3p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3p}, 30, 3, 2, 'LastRise=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 = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
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)
-- Posizione nel TC
local sHead_TC = GetHeadTCSet( EMC.HEAD, EMC.TCPOS)
-- recupero Z1 home
local nHeadSet = GetHeadSet( EMC.HEAD)
local dZmax = EgtGetAxisHomePos( EgtIf( nHeadSet ~= 2, 'Z1', 'Z2'))
-- se fresa su testa1 o su testa 2
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' then
;
-- se lama posizionata su CU prossimo a testa 1
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- 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
end
-- se lama posizionata su CU prossimo a testa 2
elseif ( EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC2') or ( EMC.HEAD == 'H22' and sHead_TC == 'Head2_TC2') then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 < -87.9 and ( EMC.R1 < -180.0 or EMC.R1 > -15.0)) or ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 and EMC.R1 > 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- 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
end
end
end
---------- OnSpecialApplyDisposition & OnPostApplyMachining ---------
----------------------- Costanti ------------------------------------
local DELTA_SIC = 1
@@ -223,7 +421,7 @@ local MIN_BACK_ENG_V = 115 -- ingombro asse Z a sinistra
local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza
local MIN_CLAMP_5 = 150 -- minima presa con la pinza speciale (pinza 5)
local SIC_CLAMP_5 = 50 -- sicurezza testa da pinza speciale
local MAX_BACK_CLAMP_5 = 320 -- massima sporgenza posteriore del pezzo da pinza speciale
local MAX_BACK_CLAMP_5 = EgtClamp( MaxBackClamp5 or 320, 200, 380) -- massima sporgenza posteriore del pezzo da pinza speciale
----------------------- Variabili -----------------------------------
local Test = false
@@ -654,11 +852,43 @@ end
---------------------------------------------------------------------
function OnPostApplyMachining()
-- Inizializzo codice di errore
EMC.ERR = 0
-- Verifico se ultima lavorazione della fase
local nNextOpeId = EgtGetNextActiveOperation( EMC.MCHID)
local bMchLast = ( not nNextOpeId or EgtGetOperationPhase( nNextOpeId) ~= EMC.PHASE) -- Agisco sui diversi percorsi della lavorazione
local nPathId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( EMC.MCHID, 'CL') or GDB_ID.NULL)
while nPathId do
-- recupero id del successivo
nPathId = EgtGetNext( nPathId)
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
end
end
---------------------------------------------------------------------
function OnSpecialApplyMachining()
EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID), 1)
-- Inizializzo codice di errore
EMC.ERR = 0
EMC.ZMAX = false
EMC.ENDZMAX = false
-- Verifico flag di separazione e fase di scarico
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
local bZMaxForced = false
if EgtGetValInNotes( sNotes, 'StartZmax', 's') == 'FORCED' then
bZMaxForced = true
end
-- si cancella eventuale flag per risalita in ZMAX
sNotes = EgtSetValInNotes( sNotes, 'StartZmax')
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
local sPrevTool, dPrevValR3
-- Recupero la posizione della trave e dei carrelli al termine della precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
@@ -734,6 +964,18 @@ function OnPostApplyMachining()
EMC.V1POS = EgtIf( bAtZMax, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1)
EMC.V2POS = EgtIf( bAtZMax, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2)
EMC.CNT = SpecGetCNT( EMC.MCHID)
if vAxes[6] then
-- imposto lavorazione e utensile correnti
EgtSetCurrMachining( nPrevOpeId)
dPrevValR3 = vAxes[6]
local sTool = EgtGetMachiningParam( MCH_MP.TOOL)
if not sTool then
local sTuuid = EgtGetMachiningParam( MCH_MP.TUUID)
sTool = EgtTdbGetToolFromUUID( sTuuid) or ''
end
sPrevTool = sTool
EgtSetCurrMachining( EMC.MCHID)
end
end
-- Verifico se ultima lavorazione della fase
@@ -744,7 +986,6 @@ function OnPostApplyMachining()
local bPreRotMch = IsLastOperationBeforeRotation( EMC.MCHID)
-- Verifico flag di separazione e fase di scarico
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
local bPreSplit = ( false and sNotes:find( 'Presplit', 1, true) ~= nil)
local bSplitting = ( sNotes:find( 'Split', 1, true) ~= nil)
local bPreCut = ( sNotes:find( 'Precut', 1, true) ~= nil)
@@ -761,7 +1002,7 @@ function OnPostApplyMachining()
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- salvo lo stato dei carrelli
local OriTPos = EMC.TPOS
local OriY1Delta = EMC.Y1DELTA
@@ -818,8 +1059,30 @@ function OnPostApplyMachining()
local nLastEntId = EgtGetLastInGroup( EMC.PATHID)
local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
-- controllo se serve cambiare la presa
if vAxes[6] and dPrevValR3 then
local sTool = EgtGetMachiningParam( MCH_MP.TOOL)
if not sTool then
local sTuuid = EgtGetMachiningParam( MCH_MP.TUUID)
sTool = EgtTdbGetToolFromUUID( sTuuid) or ''
end
-- se stesso utensile ma cambia la presa dell'aggregato
if sTool == sPrevTool and abs( dPrevValR3 - vAxes[6]) > 10 * GEO.EPS_SMALL then
EMC.CHANGETAKE = true
end
end
end
-- Se richiesto movimento preliminare della testa a Zmax perchè c'è stato un riposizionamento delle pinze
if EMC.ZMAX or bZMaxForced then
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 11)
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
end
if EMC.CHANGETAKE then
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 12)
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
end
end
---------------------------------------------------------------------
@@ -1097,29 +1360,33 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end
-- Recupero testa
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
-- Recupero valore assi macchina
local nSecId = EgtGetNext( EgtGetFirstInGroup( nPathId))
local vAxes = EmtGetAxesPos( nSecId)
if not vAxes or #vAxes < 5 or (( sHead == 'H13' or sHead == 'H15' or sHead == 'H23') and #vAxes < 6) then
-- Recupero minimi e massimi degli assi macchina della lavorazione
local vAxMin = EgtGetInfo( nClId, 'MAXMIN', 'vd')
local vAxMax = EgtGetInfo( nClId, 'MAXMAX', 'vd')
if not vAxMin or not vAxMax or #vAxMin < 5 or ( ( sHead == 'H13' or sHead == 'H15' or sHead == 'H23') and #vAxMin < 6) then
EMC.ERR = 15
EMC.MSG = ' Error : machine axes values not found'
EMC.MSG = ' Error : machine axes Min or Max not found'
return
end
local vAxMid = {}
for i = 1, #vAxMin do
vAxMid[i] = ( vAxMin[i] + vAxMax[i]) / 2
end
-- Calcolo dell'ingombro della testa rispetto allo Zero Macchina
local b3Enc
if sHead ~= 'H21' and sHead ~= 'H22' and sHead ~= 'H23' then
EgtSetAxisPos( 'C1', vAxes[4])
EgtSetAxisPos( 'B1', vAxes[5])
EgtSetAxisPos( 'C1', vAxMid[4])
EgtSetAxisPos( 'B1', vAxMid[5])
if sHead == 'H13' or sHead == 'H15' then
EgtSetAxisPos( 'A', vAxes[6])
EgtSetAxisPos( 'A', vAxMid[6])
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C1'), GDB_BB.ONLY_VISIBLE)
else
EgtSetAxisPos( 'C2', vAxes[4])
EgtSetAxisPos( 'B2', vAxes[5])
EgtSetAxisPos( 'C2', vAxMid[4])
EgtSetAxisPos( 'B2', vAxMid[5])
if sHead == 'H23' then
EgtSetAxisPos( 'A', vAxes[6])
EgtSetAxisPos( 'A', vAxMid[6])
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
end
@@ -1132,7 +1399,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip
ptTip = EgtGetCalcTipFromPositions( 0, 0, 0, vAxes[4], vAxes[5], vAxes[6] or 0, false)
ptTip = EgtGetCalcTipFromPositions( 0, 0, 0, vAxMid[4], vAxMid[5], vAxMid[6] or 0, false)
EgtOutLog( ' ToolTip = ' .. tostring( ptTip), 5)
-- Calcolo dell'ingombro della testa rispetto alla Punta Utensile
local dHeadFront = dRollFront + AGG_V - ptTip:getX()
@@ -1553,8 +1820,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
@@ -1562,11 +1832,15 @@ function SpecCalcUnload()
table.insert( vCmd, { 11, 0})
EMC.CNT = nil
end
-- Sposto il pezzo in posizione di scarico
local dFinT = UnloadT - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
-- Se non supero la lunghezza massima di scarico, sposto il pezzo in posizione di scarico
if bStdUl then
local dFinT = UnloadT - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
else
table.insert( vCmd, { 1, 'Y2', MaxY2})
end
-- apro la morsa
table.insert( vCmd, { 12, 0})
-- riporto il carrello in home
@@ -2753,6 +3027,12 @@ function SpecOutputCmds( vCmd, bEnd)
elseif Cmd[1] == 4 then
local sInfo = '4,'..EgtNumToString( Cmd[2],0)
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- se chiusura rulli
if bEnd then
EMC.ENDZMAX = true
else
EMC.ZMAX = true
end
-- apertura/chiusura morsa Y
elseif Cmd[1] == 11 then
local sInfo = '11,'..EgtNumToString( Cmd[2],0)
@@ -2828,8 +3108,26 @@ function SpecOutputCmds( vCmd, bEnd)
EgtSetInfo( NextDispId, 'V1POS', EMC.V1POS)
EgtSetInfo( NextDispId, 'V2POS', EMC.V2POS)
end
-- se bisogna andare a ZMAX alla fine, si setta il parametro sulla lavorazione successiva in modo che la corrente vada in home
if EMC.ENDZMAX and EMC.MCHID then
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( EMC.MCHID, true)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
if EgtSetCurrMachining( nNextMchId) then
-- Verifico flag di separazione e fase di scarico
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- si cancella eventuale flag per risalita in ZMAX
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 'FORCED')
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
EgtSetCurrMachining( EMC.MCHID)
break
end
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId, true)
end
end
end
end
---------------------------------------------------------------------
+4
View File
@@ -103,6 +103,7 @@ Active=1
H11.1=Standard.nge
H11.1:MILL_NOTIP=MillNoTip.nge
H12.1=Saw.nge
H17.1=AngTransmBH.nge
H21.1=Standard.nge
H21.1:MILL_NOTIP=MillNoTip.nge
H22.1=Saw.nge
@@ -117,6 +118,7 @@ Mortising=1
Chiseling=0
SawRoughing=0
SawFinishing=0
DrillingDoubleNT=1
[Machining]
InitScript=InitMach.lua
@@ -130,6 +132,8 @@ ExitScript=ExitMach.lua
H11=6608
; 5 axis saw
H12=6615
; Angular transmission
H17=6617
; Second 5 axis head
H21=6620
; Second 5 axis saw
+82 -16
View File
@@ -32,10 +32,10 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.7d1'
PP_NVER = '2.7.4.1'
PP_VER = '3.1c1'
PP_NVER = '3.1.3.1'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PF'
MACH_NAME = EgtGetCurrMachineName()
-- Carico i dati globali
@@ -106,6 +106,7 @@ MinX1 = 700
MaxX1 = 2735
MinZ1 = -1550
MaxZ1 = 0
MaxZ1Blade = 0
MinC1 = -275
MaxC1 = 275
MinB1 = -127
@@ -123,6 +124,7 @@ MinX2 = 0
MaxX2 = 2035
MinZ2 = -1550
MaxZ2 = 0
MaxZ2Blade = 0
MinC2 = -275
MaxC2 = 275
MinB2 = -127
@@ -144,6 +146,8 @@ ParkCSaw0Z2 = -400
ParkCSawC2 = 90
ParkCSaw0C2 = 0
ParkCSawB2 = 0
AngTrBHOffs = 154.5
AngTrBHLen = 90
TurnerOffs = 120.0
AggLoad = 50
DeltaTabY = 1550.0
@@ -163,9 +167,11 @@ SecondSaw = false
AutomaticRotation = true
OptimizedLoadBeam = true
AutoRotMinLen = 0
CoeffVM = 0.5
EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false
AggreBlockHaus = false
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF.data"
@@ -192,6 +198,7 @@ if EgtExistsFile( sData) then
if Machine.Offsets.PARK_X1 then ParkX1 = -Machine.Offsets.PARK_X1 end
if Machine.Offsets.Z1_NEG then MinZ1 = Machine.Offsets.Z1_NEG end
if Machine.Offsets.Z1_POS then MaxZ1 = min( MaxZ1, Machine.Offsets.Z1_POS) end
if Machine.Offsets.Z1_POS_LAMA then MaxZ1Blade = min( MaxZ1Blade, Machine.Offsets.Z1_POS_LAMA) end
if Machine.Offsets.PARK_Z1 then ParkZ1 = Machine.Offsets.PARK_Z1 end
if Machine.Offsets.C1_NEG then MinC1 = Machine.Offsets.C1_NEG end
if Machine.Offsets.C1_POS then MaxC1 = Machine.Offsets.C1_POS end
@@ -204,6 +211,7 @@ if EgtExistsFile( sData) then
if Machine.Offsets.PARK_X2 then ParkX2 = -Machine.Offsets.PARK_X2 end
if Machine.Offsets.Z2_NEG then MinZ2 = Machine.Offsets.Z2_NEG end
if Machine.Offsets.Z2_POS then MaxZ2 = Machine.Offsets.Z2_POS end
if Machine.Offsets.Z2_POS_LAMA then MaxZ2Blade = min( MaxZ2Blade, Machine.Offsets.Z2_POS_LAMA) end
if Machine.Offsets.PARK_Z2 then ParkZ2 = Machine.Offsets.PARK_Z2 end
if Machine.Offsets.C2_NEG then MinC2 = Machine.Offsets.C2_NEG end
if Machine.Offsets.C2_POS then MaxC2 = Machine.Offsets.C2_POS end
@@ -222,6 +230,8 @@ if EgtExistsFile( sData) then
if Machine.Offsets.MIN_V2 then MinV2 = Machine.Offsets.MIN_V2 end
if Machine.Offsets.MAX_V2 then MaxV2 = Machine.Offsets.MAX_V2 end
if Machine.Offsets.CLAMP5 then Clamp5 = ( Machine.Offsets.CLAMP5 == 1) end
if Machine.Offsets.MIN_W then MinW = Machine.Offsets.MIN_W end
if Machine.Offsets.MAX_W then MaxW = Machine.Offsets.MAX_W end
if Machine.Offsets.MINWOPEN then MinWOpen = Machine.Offsets.MINWOPEN end
if Machine.Offsets.MAXWOPEN then MaxWOpen = Machine.Offsets.MAXWOPEN end
if Machine.Offsets.MAXWHEIGHT then MaxWHeight = Machine.Offsets.MAXWHEIGHT end
@@ -249,13 +259,23 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAW2OFFSZ then Saw2OffsZ = Machine.Offsets.SAW2OFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.DEFTCPOS2 then DefTcPos2 = ( 'T' .. Machine.Offsets.DEFTCPOS2) end
if Machine.Offsets.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.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
AngTrBHOffs = Machine.Offsets.OFFSETZ_RINV_BH or AngTrBHOffs
AngTrBHLen = Machine.Offsets.OFFSETX_RINV_BH or AngTrBHLen
if Machine.Offsets.MAX_BACK_CLAMP_5 then MaxBackClamp5 = Machine.Offsets.MAX_BACK_CLAMP_5 end
if Machine.Offsets.COEFF_CLAMP_CHECK then ClampingCoeffMin = Machine.Offsets.COEFF_CLAMP_CHECK end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1
ParkV1 = MaxV1
ParkV1 = MaxV1
ParkY1 = ParkV1 + MinDeltaYV
MinY2 = MinMchY2
MaxY2 = MaxV2 - MinDeltaYV
@@ -263,6 +283,8 @@ if EgtExistsFile( sData) then
ParkY2 = ParkV2 - MinDeltaYV
ParkX1 = min( ParkX1, MaxX1)
ParkX2 = max( ParkX2, MinX2)
MaxZ1Blade = min( MaxZ1Blade, MaxZ1)
MaxZ2Blade = min( MaxZ2Blade, MaxZ2)
Head2Y = DeltaTabY - Delta2TabY
Head2Z = DeltaTabZ - Delta2TabZ
ParkCSawX2S = ParkX2
@@ -280,6 +302,8 @@ EmtGeneral {
ExitMaxAdjust = 300,
ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 80,
LinkAxesMoveOrder = MCH_LKAMO.HEAD_BEFORE_IF_SAME_ANG,
NewLinkMgr = 1,
Special = 'Common_ONE-PF.mlse',
Processor = 'Common_ONE-PF.mlpe'}
local sBaseAux = {'BASE/SOLID', 'BASE/SIGN', 'BASE/CONVOYER', 'BASE/BELT', 'BASE/COLLISION', 'BASE/TC1', 'BASE/TC2', 'BASE/TC3'}
@@ -361,6 +385,23 @@ local H12Id = EmtHead {
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H12_HEAD/GEO'}
EgtSetInfo( H12Id, 'ZMAXONROT', '1,210,610')
-- Eventuale aggregato per lavorazioni BlockHaus
if AggreBlockHaus then
local H17Id = EmtHead {
Name = 'H17',
Parent = 'B1',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d( -AngTrBHLen, 0, -AngTrBHOffs),
TDir = X_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H17_HEAD/GEO',
Aux = {'H17_HEAD/SOLID', 'H17_HEAD/COLLISION'}}
end
-- *** Testa 2 ***
local X2Id = EmtAxis {
Name = 'X2',
@@ -491,7 +532,7 @@ local PY1Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY1_AXIS/GEO',
Aux = 'PY1_AXIS/SOLID'}
Aux = {'PY1_AXIS/SOLID', 'PY1_AXIS/CLAMP_CHECK'}}
local Y2Id = EmtAxis {
Name = 'Y2',
Parent = 'Base',
@@ -511,7 +552,7 @@ local PY2Id = EmtAxis {
Stroke = {0, MaxHoOpen},
Home = MaxHoOpen,
Geo = 'PY2_AXIS/GEO',
Aux = 'PY2_AXIS/SOLID'}
Aux = {'PY2_AXIS/SOLID', 'PY2_AXIS/CLAMP_CHECK'}}
-- Rulli
local V1Id = EmtAxis {
Name = 'V1',
@@ -622,6 +663,7 @@ EmtTable {
Parent = 'T',
Type = MCH_TT.FLAT,
Ref1 = Point3d( - DimTabX, DeltaTabY - DimTabY, DeltaTabZ),
Coll = 'Base/BELT',
Geo = 'TABLE/GEO',
Aux = 'TABLE/SOLID'}
-- *** ToolChanger ***
@@ -676,13 +718,24 @@ EmtTcPos {
TDir = -Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T8'}
EmtTcPos {
if AggreBlockHaus then
local TcpSsId = EmtTcPos {
Name = 'T9',
Parent = 'Base',
Pos = ptTc1 + 8 * vtDt1 + Vector3d( -AngTrBHLen, AngTrBHOffs, 0),
TDir = X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T9_BH',
Aux = 'BASE/T9_HS'}
else
EmtTcPos {
Name = 'T9',
Parent = 'Base',
Pos = ptTc1 + 8 * vtDt1,
TDir = -Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T9'}
end
EmtTcPos {
Name = 'T10',
Parent = 'Base',
@@ -789,9 +842,13 @@ EgtMove( EgtGetFirstNameInGroup( BaseId, 'SIGN') or GDB_ID.NULL, vtMovB, GDB_RT.
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC1') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC2') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC3') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
if Mortiser then
if Mortiser then
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC4') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end
-- sposto geometria aggiuntiva agrgegato BlockHaus
if AggreBlockHaus then
EgtMove( EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( BaseId, 'T9'), 'T9_HS') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end
EgtMove( EgtGetFirstNameInGroup( X1Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X1Id, 'COLLISION'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
@@ -802,8 +859,10 @@ local vtMove = Vector3d( 0, ( DeltaTabY - 1550.0), ( DeltaTabZ + 1010.0))
EgtMove( EgtGetFirstNameInGroup( BaseId, 'CONVOYER'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY1Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Y2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PY2Id, 'CLAMP_CHECK'), vtMove + Vector3d(0,0,DistZClampToTable), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( V1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( QV1Id, 'SOLID'), vtMove, GDB_RT.GLOB)
@@ -834,29 +893,36 @@ function OnSetHead()
if EMC.HEAD == 'H11' then
local dRawH = GetRawHeight()
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1 + EgtIf( dRawH > 650, EgtIf( EMC.TOTDIAM < 61, 235, 165), 0))
EmtModifyAxisHome( 'Z1', MaxZ1)
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', X_AX())
-- se testa H12 (lama)
elseif EMC.HEAD == 'H12' then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', Vector3d( cos( SawC1Offs), -sin( SawC1Offs), 0))
-- se testa H17 (aggregato BlockHaus)
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H17' then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', X_AX())
-- se testa H21 (fresa2)
elseif EMC.HEAD == 'H21' then
local dRawH = GetRawHeight()
EmtModifyAxisHome( 'X2', ParkX2)
EmtModifyAxisHome( 'Z2', ParkZ2 + EgtIf( dRawH > 650, EgtIf( EMC.TOTDIAM < 61, 235, 165), 0))
EmtModifyAxisHome( 'Z2', MaxZ2)
EmtModifyAxisHome( 'C2', ParkC2)
EmtModifyAxisHome( 'B2', ParkB2)
EmtModifyAxisDirection( 'B2', X_AX())
-- se testa H22 (lama)
elseif EMC.HEAD == 'H22' then
EmtModifyAxisHome( 'X2', ParkX2)
EmtModifyAxisHome( 'Z2', ParkZ2)
EmtModifyAxisHome( 'Z2', MaxZ2Blade)
EmtModifyAxisHome( 'C2', ParkC2)
EmtModifyAxisHome( 'B2', ParkB2)
EmtModifyAxisDirection( 'B2', Vector3d( cos( SawC2Offs), -sin( SawC2Offs), 0))
@@ -881,7 +947,7 @@ end
---------------------------------------------------------------------
function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
return 1
elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then
return 2
@@ -895,7 +961,7 @@ end
function GetHeadTCSet( sHead, sTcPos)
local nPos = tonumber( string.sub( sTcPos, 2)) or 0
-- testa 1
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
-- testa 1 su CU prossimo a testa 2
if nPos > 10 then
return 'Head1_TC2'
@@ -959,7 +1025,7 @@ end
---------------------------------------------------------------------
-- Funzione che ritorna ZExtra partendo dalla testa e dall'angolo verticale
function GetZExtra( sHead, dAngV)
if sHead == 'H11' or sHead == 'H21' then
if sHead == 'H11' or sHead == 'H21' or sHead == 'H17' then
if abs( dAngV) < 30.1 then
return 400
elseif abs( dAngV) < 45.1 then
BIN
View File
Binary file not shown.
+1
View File
@@ -20,6 +20,7 @@
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=l,MaxOptSize,0
5=b,AdjustFeed,1
[Mortising]
0=d,MaxElev,0
+4 -3
View File
@@ -30,6 +30,7 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2)
local PositionTable = {}
local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil)
local AggreBH = ( EgtGetHeadId( 'H17') ~= nil)
if SecondSaw then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
@@ -38,7 +39,7 @@ if SecondSaw then
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H22", Group = "G3"},
{Pos = "Pos11", TcPos = "T13", Head = "H21", Group = "G3"},
@@ -61,7 +62,7 @@ else
{Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T11", Head = "H21", Group = "G3"},
{Pos = "Pos11", TcPos = "T12", Head = "H21", Group = "G3"},
@@ -78,7 +79,7 @@ else
table.insert( PositionTable, {Pos = "Pos21", TcPos = "T211", Head = "H23", Group = "G2"})
end
end
local UsePositionHead = true
local UsePositionHead = false
local function IsInGeomSet( ToolHead, PosHead)
for GsIndex = 1, #GS do
Binary file not shown.
Binary file not shown.
+80
View File
@@ -1,5 +1,85 @@
==== Common_ONE-PF Update Log ====
Versione 3.1c2 (17/03/2026)
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
Versione 3.1c1 (04/03/2026)
- (GEN) Corretta chiamata di una variabile insesistente in caso di ONE
- (SIM) Allineata simulazione a generazione
Versione 3.1b1 (20/02/2026)
- (GEN) Aggiunta funzione ToolPreSelection() per la preselezione utensile. Ticket#2789
- (GEN) Funzione rinominata in ToolPreSelectionSingleHead(), ora utilizza funzione in MLDE per capire se è motosega
Versione 3.1a1 (16/01/2026)
- (SIM-GEN) Aggiunto controllo che evita collisioni durante lo svincolo in Z della sega a catena nelle funzioni ExecMoveZMax() e EmitZMax(). Ticket#2767
- (SIM-GEN) Piccola correzione modifiche fatte in precedenza
Versione 2.7l1 (18/12/2025)
- (SIM-GEN) Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset(). Ticket#2727
- (SIM-GEN) Divisione movimento B in approccio se > 90°. Ticket#2754
- (SIM) Aggiunta funzione CheckClamping
Versione 2.7k3 (28/11/2025)
- (GEN) Prima di andare allo scarico, si aggiunge movimento intermedio dove si aspetta che rulli scarico siano arrivati in posizione. Ticket#2716
Versione 2.7k2 (20/11/2025)
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
Versione 2.7k1 (05/11/2025)
- (SIM-GEN) Corretto calcolo per decidere se serve aprire i rulli
- (GEN) Aggiunta tolleranza in creazione piano di lavoro inclinato
- (SIM) Allo scarico si resetta Y2DELTA. Ticket#2687
Versione 2.7j3 (23/10/2025)
- (SIM) Corretta posizione parcheggio in caso di testa 1 su magazzino 2. Ticket#2660
Versione 2.7j2 (21/10/2025)
- (GEN) Se SPLIT con pinza 5, corretto salvataggio posizione pinza 2. Ticket#2654
Versione 2.7j1 (08/10/2025)
- (GEN) Salvataggio posizione Z su lavorazione precedente, sbagliava in caso di separazione. Ticket#2637
Versione 2.7i1 (10/09/2025)
- (SIM-GEN) Piccole correzioni per gestire secondo TC su ONE. Ticket#2563
- (SIM-GEN) Gestione aggregato BH completato. Ticket#2482
- (EST) Stima tempi considerando accelerazioni
- (SIM-GEN) Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto
- (GEN) Piccola correzione risalita ZMAX dopo RELOAD del pezzo. Generazione allineata a simulazione.
Versione 2.7h2 (28/08/2025)
- (GEN) Migliorata gestione spegnimento utensile e disattivazione piano
- (SIM-GEN) Corretto nome variabile e altre piccole modifiche per Progress
Versione 2.7h1 (20/08/2025)
- (SIM-GEN) Non si chiudono i rulli se tagli o pretagli di testa e coda
- (SIM) Corretto movimento pinza 5 in caso di riposizionamento pinza 1
- (GEN) Corretta quota assoluta posizione testa trave in caso di pinza 5 e testa rimasta bassa
- (GEN) Se ultima lavorazione pezzo precedente ha stesso utensile della prima lavorazione pezzo successivo, la speed resta accesa
Versione 2.7g4 (23/07/2025)
- (SIM-GEN) Aggiunto parametro configurabile da TS3 per massima sporgenza trave in coda per pinza 5. Ticket#2538
Versione 2.7g3 (22/07/2025)
- (SIM) Corretto lettura angolo di presa della motosega
Versione 2.7g2 (08/07/2025)
- (SIM) Corretto movimento a parcheggio sega a catena. Ticket#2517
Versione 2.7g1 (01/07/2025)
- (GEN) Rimossa gestione PROBE inserita per sbaglio
- (GEN) Corretto gestione accelerazioni
- (SIM-GEN) Aggiunta gestione massima lunghezza scarico
Versione 2.7f1 (04/06/2025)
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'.
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7e1 (28/05/2025)
- (SIM-GEN) Alla separazione si spostano i carrelli di 30mm aprendo il taglio. Ticket#2259,Ticket#2328
Versione 2.7d1 (16/04/2025)
- (SIM) Distanza di collisione portata a 3mm, qualità VMILL ridotta a 4mm. Ticket#2395
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.7d1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
VERSION = '3.1c2', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
}
return InfoCommon_STD_PP