Compare commits

..

20 Commits

Author SHA1 Message Date
daniele.nicoli 95867ec10f Tolto commento a M77, versione DEV1 da testare 2026-05-27 13:17:58 +02:00
daniele.nicoli 1c0cfdfd22 Forza scrittura di tutti gli assi lineari nel G142 2026-05-27 11:46:43 +02:00
daniele.nicoli 7e977d81cb Cambio versione 2026-05-27 08:31:19 +02:00
daniele.nicoli 6cdb3888a0 Aggiunto UniqueRise per l'emissione di Start e Wait Head( nHSet) 2026-05-26 17:19:36 +02:00
andrea.villa e0dfd45f1c Corretto comando allo split che muove entrambe le pinze 2026-05-26 11:23:07 +02:00
andrea.villa 799b5aead7 Corretto reset piano generico 2026-05-25 17:35:52 +02:00
andrea.villa b9c7989717 Modifica per scarico mascherato 2026-05-22 16:32:15 +02:00
andrea.villa 5d53f6b074 - In separazione si sposta di 150mm anziché 30
- Posizione parcheggio testa 2
2026-05-22 12:07:48 +02:00
andrea.villa 65460d7320 - Aggiunto controllo zona sicura èper testa H11 (da migliorare)
- mantenuto stesso piano con motosega, corretto problema controllo direzione piano
2026-05-22 09:19:21 +02:00
andrea.villa 423d02e67a - Sistemati movimenti lama e motosega
- Corretto comportamento motosega in simulazione
2026-05-21 12:51:15 +02:00
andrea.villa 8275f167eb Movimenti motosega migliorati
Scarico motosega alla fine del ISO
2026-05-21 09:39:44 +02:00
andrea.villa fd38235dfd Corretta gestione parametro MaxFeedPinze 2026-05-21 08:32:40 +02:00
andrea.villa bb609d7412 Merge branch 'NewLink' of https://gitlab.steamware.net/egalware-machines/essetre/Essetre-ONE into NewLink 2026-05-20 15:01:52 +02:00
andrea.villa f0a8cd93d4 - Si riporta trave in zona carico dopo una fase start partita con un riposizionamento
- Se split è ultima lavorazione della trave, si va allo scarico direttamente
- Gestione mantenere stesso piano in caso di lavorazioni con stesso utensile compatibili
- Prima gestione preselezione utensile
- Migliorie varie nuovi link
2026-05-20 15:01:49 +02:00
daniele.nicoli c2fbbfd6d9 Spostato EgtClamp della massima velocità pinze (MaxFeedPinze) nell'mlde. Aumentato il massimo da 102000 a 155000 2026-05-08 16:41:38 +02:00
andrea.villa 4f7b11c715 Cambio versione 2026-05-08 08:17:44 +02:00
andrea.villa 804002fc6e Deselezione motosega in caso di movimento in home (DA SISTEMARE) 2026-05-07 17:02:20 +02:00
andrea.villa dae3b89b4d Prima versione nuovi link 2026-05-07 10:51:13 +02:00
daniele.nicoli caeed11218 Aggiunto Clamp di sicurezza per lettura dei parametri MinJoin da Ts3Data 2026-04-23 12:25:31 +02:00
daniele.nicoli 9beb1ecb41 Merge branch 'master' into develop 2026-04-23 12:24:08 +02:00
7 changed files with 1410 additions and 2641 deletions
+2 -2
View File
@@ -110,8 +110,8 @@ if EgtExistsFile( sData) then
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.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.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.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_S then BeamData.MIN_JOIN_S = EgtClamp( Machine.Offsets.MIN_JOIN_S, 80, 150) end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = Machine.Offsets.MIN_JOIN_L end if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = EgtClamp( Machine.Offsets.MIN_JOIN_L, 300, 450) end
end end
if Machine.Trave then if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
+544 -1433
View File
File diff suppressed because it is too large Load Diff
+341 -912
View File
File diff suppressed because it is too large Load Diff
+505 -261
View File
@@ -4,12 +4,6 @@
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- Carico libreria -- Carico libreria
local BD = require( 'BeamData') local BD = require( 'BeamData')
@@ -72,218 +66,401 @@ function OnSpecialGetPrevMachiningOffset()
end end
end end
---------------------- OnSpecialGetMaxZ -----------------------------
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function CalcExtraZ( vtTp, vtT, vMZ) -- *** Special Link moves ***
-- 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 function IsPrevSplit()
local vtTz = min( vtTp:getZ(), vtT:getZ()) local sPrevUserNotes = ''
-- se oltre il massimo if EMC.LINKTYPE == 2 then
if vtTz > vMZ[1].Tz then return vMZ[1].Ez end sPrevUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- interpolo elseif EMC.LINKTYPE == 3 then
for i = 2, #vMZ do EgtSetCurrMachining( EMC.PREVMCHID)
if vtTz > vMZ[i].Tz then sPrevUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
local dCoeff = ( vtTz - vMZ[i-1].Tz) / ( vMZ[i].Tz - vMZ[i-1].Tz) EgtSetCurrMachining( EMC.NEXTMCHID)
return (( 1 - dCoeff) * vMZ[i-1].Ez + dCoeff * vMZ[i].Ez)
end
end end
-- sotto il minimo return ( sPrevUserNotes:find( 'Split;', 1, true) ~= nil)
return 0
end end
--------------------------------------------------------------------- -----------------------------------------------------------------------------------------
function OnSpecialGetMaxZ() local function IsLinkSafe( vPrec, vNext)
-- Inizializzazioni local bSafeMove = true
EMC.ERR = 0 local DirectionsToTest = { { Z=vPrec[3], C=vPrec[4], B=vPrec[5]}, { Z=vNext[3], C=vNext[4], B=vNext[5]}}
-- Gestione speciale per sega a catena su utesta 1 -- aggiungo anche il punto medio
if EMC.HEAD == 'H13' or EMC.HEAD == 'H15' then table.insert( DirectionsToTest, { Z=( vNext[3] + vPrec[3]) / 2, C=( vNext[4] + vPrec[4]) / 2, B=( vNext[5] + vPrec[5]) / 2})
EMC.MAXZ = EgtGetAxisHomePos( 'Z1')
return
-- Gestione speciale per sega a catena su testa 2
elseif EMC.HEAD == 'H23' then
EMC.MAXZ = EgtGetAxisHomePos( 'Z2')
return
end
-- Sistemazione dati di input for t=1, #DirectionsToTest do
local vtTp = Vector3d( EMC.TDIRp) local vtToolDir = EgtGetCalcToolDirFromAngles( DirectionsToTest[t].C, DirectionsToTest[t].B)
local sHead_TC = GetHeadTCSet( EMC.HEAD, EMC.TCPOS) -- se testa standard
local bFromZmax = false if EMC.HEAD == 'H11' then
if vtTp:isSmall() then -- TODO considerare caso sotto la traversa
vtTp = X_AX() -- se sotto la traversa
bFromZmax = true if vtToolDir:getX() > -0.1 then
if sHead_TC == 'Head1_TC1' then bSafeMove = true
EMC.R1p = ParkC1 end
EMC.R2p = ParkB1 -- se lama su aggregato
elseif sHead_TC == 'Head2_TC2' then elseif EMC.HEAD == 'H12' then
EMC.R1p = ParkC2 -- se sotto la traversa
EMC.R2p = ParkB2 if vtToolDir:getX() < 0.342 then
elseif sHead_TC == 'Head1_TC2' then local dLen = SawOffsZ - MillOffs
EMC.R1p = ParkFrnC1 local dToolRadius = 275 -- leggere dall'utensile!!
EMC.R2p = ParkFrnB1 local dNewOffZ = ( dLen * cos( DirectionsToTest[t].B) + dToolRadius * abs( sin( DirectionsToTest[t].B))) - dToolRadius
local dMaxZ = ParkZ1 - dNewOffZ
if dMaxZ < DirectionsToTest[t].Z then
bSafeMove = false
break
end
end
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 EMC.HEAD == 'H11' then
if bBSameSign and vtTp:getX() > -0.1 and vtT:getX() > -0.1 then -- se inizio lavorazione con prelievo utensile
EMC.MAXZ = MaxZ1 if EMC.LINKTYPE == 1 then
else -- approccio
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}} EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ) EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
end -- se asse B resta girato verso home e C resta vicino alla home
elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then if abs( EMC.R2 - EMC.R2p) < 90 and abs( EMC.R1 - EMC.R1p) < 5 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then ; -- discesa diretta
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then elseif abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130) EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then if abs( EMC.R1 - EMC.R1p) > 1 then
EMC.MAXZ = ParkZ1 + 200 EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
else end
EMC.MAXZ = ParkZ1 + 1
end end
elseif bBSameSign and EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
(( 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 -- se fine lavorazione con deposito utensile
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130) elseif EMC.LINKTYPE == 2 then
elseif bBSameSign and -- retrazione
(( 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 EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
( 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 if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}} EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, 'FirstRise=1;')
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ) if abs( EMC.R1 - EMC.R1p) > 1 then
else EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
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}} end
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
else 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 end
elseif bBSameSign and EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
(( 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 EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
( 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) -- altrimenti collegamento tra due lavorazioni (3)
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)
else 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}} -- recupero quota massima di collegamento
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ) local vFinalAxLink = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vInitAxLink = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
local bSafeMove = IsLinkSafe( vFinalAxLink, vInitAxLink)
-- se gli assi rotanti non sono cambiati e il collegamento è come ultimo punto della lavorazione
if abs( EMC.R1 - EMC.R1p) < 1 and abs( EMC.R2 - EMC.R2p) < 1 and abs( EMC.L3p - vFinalAxLink[3]) < 1 and abs( EMC.L3 - vInitAxLink[3]) < 1 then
bSafeMove = true
end
-- se superata quota massima ammessa
if not bSafeMove 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 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)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2p, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2)
-- se assi cambiano di molto
if abs( EMC.R1 - EMC.R1p) > 10 or abs( EMC.R2 - EMC.R2p) > 90 then
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;', '')..'FirstRise=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 vFinalAxLink = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vInitAxLink = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
local bSafeMove = IsLinkSafe( vFinalAxLink, vInitAxLink)
-- se gli assi rotanti non sono cambiati e il collegamento è come ultimo punto della lavorazione
if abs( EMC.R1 - EMC.R1p) < 1 and abs( EMC.R2 - EMC.R2p) < 1 and abs( EMC.L3p - vFinalAxLink[3]) < 1 and abs( EMC.L3 - vInitAxLink[3]) < 1 then
bSafeMove = true
end
-- se superata quota massima ammessa
if not bSafeMove then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R2) > 91 then
EmtAddRise( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1p, EMC.L2p, ParkZ1, EMC.R1p, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 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;')
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'UniqueRise=1;')
end
-- 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.L2p, EMC.L3p, EMC.R1p, EMC.R2p, EMC.R3}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3}, 30, 2, 2)
if abs( EMC.R3) < 0.1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z1, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, 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
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 elseif EMC.HEAD == 'H21' then
if bBSameSign and vtTp:getX() > -0.1 and vtT:getX() > -0.1 then -- se inizio lavorazione con prelievo utensile
EMC.MAXZ = MaxZ2 if EMC.LINKTYPE == 1 then
else -- approccio
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}} EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ) EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
end -- se asse B resta girato verso home e C resta vicino alla home
elseif EMC.HEAD == 'H22' then if abs( EMC.R2 - EMC.R2p) < 90 and abs( EMC.R1 - EMC.R1p) < 5 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then ; -- discesa diretta
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then elseif abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EMC.MAXZ = MaxZ2 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130) EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then if abs( EMC.R1 - EMC.R1p) > 1 then
EMC.MAXZ = ParkZ2 + 200 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 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 end
elseif bBSameSign and EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
(( 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 EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
( 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) -- altrimenti collegamento tra due lavorazioni (3)
elseif bBSameSign and else
(( 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 -- recupero quota massima di collegamento
( 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 vLFiAx = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vMZ = {{ Tz=0.85, Ez=440}, { Tz=0.5, Ez=200}, { Tz=-0.01, Ez=5}, { Tz=-0.5, Ez=1}} local vLInAx = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ) -- 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)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2p, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2)
-- se assi cambiano di molto
if abs( EMC.R1 - EMC.R1p) > 10 or abs( EMC.R2 - EMC.R2p) > 90 then
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;', '')..'FirstRise=1;')
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=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 vFinalAxLink = EmtGetFinalAxesPos( EMC.PREVMCHID, EMC.PREVMAIN, false)
local vInitAxLink = EmtGetInitialAxesPos( EMC.NEXTMCHID, EMC.NEXTMAIN, false)
local bSafeMove = IsLinkSafe( vFinalAxLink, vInitAxLink)
-- se gli assi rotanti non sono cambiati e il collegamento è come ultimo punto della lavorazione
if abs( EMC.R1 - EMC.R1p) < 1 and abs( EMC.R2 - EMC.R2p) < 1 and abs( EMC.L3p - vFinalAxLink[3]) < 1 and abs( EMC.L3 - vInitAxLink[3]) < 1 then
bSafeMove = true
end
-- se superata quota massima ammessa
if not bSafeMove then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R2) > 91 then
EmtAddRise( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1p, EMC.L2p, ParkZ1, EMC.R1p, EgtClamp( EMC.R2, -90, 90)}, 30, 2, 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;')
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, MaxZ1Blade, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'UniqueRise=1;')
end
-- 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.L2p, EMC.L3p, EMC.R1p, EMC.R2p, EMC.R3}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3}, 30, 2, 2)
if abs( EMC.R3) < 0.1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z1, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, 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 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 end
end
---------------------- OnSpecialMoveZup -----------------------------
---------------------------------------------------------------------
function OnSpecialMoveZup()
--EgtOutLog( 'OnSpecialMoveZup : ' .. EMC.HEAD .. '.' .. tostring( EMC.EXIT))
-- Inizializzazioni
EMC.ERR = 0 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' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
-- 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
elseif HeadIsChainSaw( EMC.HEAD) then
EMC.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if EMC.TDIR[3] < -0.15 and EMC.L3 > - EMC.TTOTLEN then
EMC.L3 = EMC.TTOTLEN * EMC.TDIR[3]
-- dichiaro modificato
EMC.MODIF = true
end
end
end end
---------- OnSpecialApplyDisposition & OnPostApplyMachining --------- ---------- OnSpecialApplyDisposition & OnPostApplyMachining ---------
----------------------- Costanti ------------------------------------ ----------------------- Costanti ------------------------------------
local DELTA_SIC = 1 local DELTA_SIC = 1
@@ -749,49 +926,23 @@ function OnSpecialApplyMachining()
-- Inizializzo codice di errore -- Inizializzo codice di errore
EMC.ERR = 0 EMC.ERR = 0
EMC.ZMAX = false
-- Recupero la precedente operazione EMC.ENDZMAX = false
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- Se esiste lavorazione precedente ed è una tastatura -- Verifico flag di separazione e fase di scarico
if nPrevOpeId and EgtGetOperationType( nPrevOpeId) == MCH_OY.PROBING then local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- se stessa testa e montato già utensile corretto local bZMaxForced = false
-- recupero valori assi alla fine della lavorazione precedente e all'inizio della corrente if EgtGetValInNotes( sNotes, 'StartZmax', 's') == 'FORCED' then
local vPrevAxes = EmtGetFinalAxesPos( nPrevOpeId, true) bZMaxForced = true
local vCurrAxes = EmtGetInitialAxesPos( EMC.MCHID, true)
-- info lavorazione precedente
EgtSetCurrMachining( nPrevOpeId)
local sPrevTool = EgtGetMachiningParam( MCH_MP.TOOL)
local sPrevHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local nSetHead = GetHeadSet( sPrevHead)
local bPrevIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- info lavorazione corrente
EgtSetCurrMachining( EMC.MCHID)
local sCurrTool = EgtGetMachiningParam( MCH_MP.TOOL)
local sCurrHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
nSetHead = GetHeadSet( sCurrHead)
local bCurrIsFirstHead = ( nSetHead == 1 or nSetHead == 11)
-- se utensile corrente è compatibile (significa che è già stato precaricato) se stessa testa e con stessa configurazioen assi rotanti, annullo risalita
if IsToolCompatibleWithProbe( sCurrTool, sPrevTool) and bPrevIsFirstHead == bCurrIsFirstHead and abs( vCurrAxes[4] - vPrevAxes[4]) < 1 and abs( vCurrAxes[5] - vPrevAxes[5]) < 1 then
-- in lavorazione precedente elimino eventuale retrazione a Zmax
EmtRemoveRise( nPrevOpeId)
-- in lavorazione corrente elimino eventuale approccio da Zmax
EmtRemoveClimb( EMC.MCHID)
-- prendo sempre la Z massima tra le due
local vClimbPoint
if vCurrAxes[3] - 1.0 < vPrevAxes[3] then
vClimbPoint = vCurrAxes
vCurrAxes[3] = vPrevAxes[3]
elseif vPrevAxes[3] - 1.0 < vCurrAxes[3] then
vClimbPoint = vPrevAxes
vPrevAxes[3] = vCurrAxes[3]
end
EmtAddClimb( EMC.MCHID, vClimbPoint, 4, 1, 0)
end
end 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 -- Recupero la posizione della trave e dei carrelli al termine della precedente operazione
local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID)
-- se precedente operazione non esiste, errore -- se precedente operazione non esiste, errore
if not nPrevOpeId then if not nPrevOpeId then
EMC.ERR = 1 EMC.ERR = 1
@@ -864,6 +1015,18 @@ function OnSpecialApplyMachining()
EMC.V1POS = EgtIf( bAtZMax, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1) EMC.V1POS = EgtIf( bAtZMax, ParkV1, EgtGetInfo( nLastPathId, 'V1POS', 'd') or ParkV1)
EMC.V2POS = EgtIf( bAtZMax, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2) EMC.V2POS = EgtIf( bAtZMax, ParkV2, EgtGetInfo( nLastPathId, 'V2POS', 'd') or ParkV2)
EMC.CNT = SpecGetCNT( EMC.MCHID) 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 end
-- Verifico se ultima lavorazione della fase -- Verifico se ultima lavorazione della fase
@@ -874,7 +1037,6 @@ function OnSpecialApplyMachining()
local bPreRotMch = IsLastOperationBeforeRotation( EMC.MCHID) local bPreRotMch = IsLastOperationBeforeRotation( EMC.MCHID)
-- Verifico flag di separazione e fase di scarico -- 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 bPreSplit = ( false and sNotes:find( 'Presplit', 1, true) ~= nil)
local bSplitting = ( sNotes:find( 'Split', 1, true) ~= nil) local bSplitting = ( sNotes:find( 'Split', 1, true) ~= nil)
local bPreCut = ( sNotes:find( 'Precut', 1, true) ~= nil) local bPreCut = ( sNotes:find( 'Precut', 1, true) ~= nil)
@@ -948,6 +1110,29 @@ function OnSpecialApplyMachining()
local nLastEntId = EgtGetLastInGroup( EMC.PATHID) local nLastEntId = EgtGetLastInGroup( EMC.PATHID)
local vAxes = EmtGetAxesPos( nLastEntId) local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end 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
end end
@@ -1071,8 +1256,17 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
-- Se altrimenti carri entrambi diponibili, eseguo calcoli per carrelli -- Se altrimenti carri entrambi diponibili, eseguo calcoli per carrelli
elseif not IsEndPhase( EMC.PHASE) then elseif not IsEndPhase( EMC.PHASE) then
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach) local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
-- se fase iniziale e ci sono stati movimenti di carrelli
if IsStartPhase( EMC.PHASE) and #vCmd > 0 and IsFirstMachiningOfStart( EMC.MCHID) and
not bPreSplit and not bSplitting and not bPreCut and not bCutting then
local dLastTPos, dLastY1Delta = GetLastTPos( vCmd)
-- se testa oltre lo zero
if dLastTPos and dLastTPos < 0 then
-- si sposta testa in posizione carico
table.insert( vCmd, { 24, 'T', ParkV1, 'Y1', ParkV1 + dLastY1Delta})
end
-- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller -- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller
if SpecTestOnlyRemarkInCmds( vCmd) then elseif SpecTestOnlyRemarkInCmds( vCmd) then
table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)}) table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)})
table.insert( vCmd, { 22, dRollBack, -dRollFront}) table.insert( vCmd, { 22, dRollBack, -dRollFront})
end end
@@ -1226,40 +1420,33 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end end
-- Recupero testa -- Recupero testa
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local sToolName = EgtTdbGetCurrToolParam( MCH_TP.NAME) -- Recupero minimi e massimi degli assi macchina della lavorazione
local nSetHead = GetHeadSet( sHead) local vAxMin = EgtGetInfo( nClId, 'MAXMIN', 'vd')
local bIsFirstHead = ( nSetHead == 1 or nSetHead == 11) 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
-- se lavorazione di tastatura, si considera montato utensile di default
if HeadIsProbe( sHead) then
local sOtherToolName = GetToolNameFromTcPos( EgtIf( bIsFirstHead, DefTcPos1, DefTcPos2))
local sOtherHeadTool, _ = GetToolHead( sOtherToolName)
EgtLoadTool( sOtherHeadTool, 1, sOtherToolName)
end
-- 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
EMC.ERR = 15 EMC.ERR = 15
EMC.MSG = ' Error : machine axes values not found' EMC.MSG = ' Error : machine axes Min or Max not found'
return return
end 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 -- Calcolo dell'ingombro della testa rispetto allo Zero Macchina
local b3Enc local b3Enc
if bIsFirstHead then if sHead ~= 'H21' and sHead ~= 'H22' and sHead ~= 'H23' then
EgtSetAxisPos( 'C1', vAxes[4]) EgtSetAxisPos( 'C1', vAxMid[4])
EgtSetAxisPos( 'B1', vAxes[5]) EgtSetAxisPos( 'B1', vAxMid[5])
if sHead == 'H13' or sHead == 'H15' then if sHead == 'H13' or sHead == 'H15' then
EgtSetAxisPos( 'A', vAxes[6]) EgtSetAxisPos( 'A', vAxMid[6])
end end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C1'), GDB_BB.ONLY_VISIBLE) b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C1'), GDB_BB.ONLY_VISIBLE)
else else
EgtSetAxisPos( 'C2', vAxes[4]) EgtSetAxisPos( 'C2', vAxMid[4])
EgtSetAxisPos( 'B2', vAxes[5]) EgtSetAxisPos( 'B2', vAxMid[5])
if sHead == 'H23' then if sHead == 'H23' then
EgtSetAxisPos( 'A', vAxes[6]) EgtSetAxisPos( 'A', vAxMid[6])
end end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE) b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
end end
@@ -1272,7 +1459,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3) EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina -- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip 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) EgtOutLog( ' ToolTip = ' .. tostring( ptTip), 5)
-- Calcolo dell'ingombro della testa rispetto alla Punta Utensile -- Calcolo dell'ingombro della testa rispetto alla Punta Utensile
local dHeadFront = dRollFront + AGG_V - ptTip:getX() local dHeadFront = dRollFront + AGG_V - ptTip:getX()
@@ -1282,7 +1469,6 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
local dDistFront = - ptMax:getX() - LoadT - dHeadFront local dDistFront = - ptMax:getX() - LoadT - dHeadFront
local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack
EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3) EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3)
return dDistFront, dDistBack, dRollFront, dRollBack return dDistFront, dDistBack, dRollFront, dRollBack
end end
@@ -1359,6 +1545,34 @@ function VerifyPartLength()
return true return true
end end
---------------------------------------------------------------------
function GetLastTPos( vCmd)
-- se esiste tabella comandi, si cerca l'ultima posizione della trave
if vCmd and #vCmd > 0 then
local dTRepos = nil
local dLastY1Delta = nil
-- controlla ogni gruppo di movimenti ausiliari
for i = 1, #vCmd do
local Command = vCmd[i]
-- controlla solo i movimenti della testa trave e salva l'ultimo
if Command[1] == 2 or Command[1] == 3 then
for j = 2, #Command-1 do
if Command[j] == 'T' then
dTRepos = Command[j+1]
break
end
end
elseif Command[1] == 21 then
dLastY1Delta = Command[2]
end
end
return dTRepos, dLastY1Delta
else
return nil, nil
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function SpecCalcLoad( dPosT, dDistFront, dDistBack) function SpecCalcLoad( dPosT, dDistFront, dDistBack)
--[L] --[L]
@@ -2901,6 +3115,14 @@ function SpecOutputCmds( vCmd, bEnd)
elseif Cmd[1] == 4 then elseif Cmd[1] == 4 then
local sInfo = '4,'..EgtNumToString( Cmd[2],0) local sInfo = '4,'..EgtNumToString( Cmd[2],0)
EgtSetInfo( EMC.PATHID, sKey, sInfo) EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- se chiusura rulli
if Cmd[2] == 1 then
if bEnd then
EMC.ENDZMAX = true
else
EMC.ZMAX = true
end
end
-- apertura/chiusura morsa Y -- apertura/chiusura morsa Y
elseif Cmd[1] == 11 then elseif Cmd[1] == 11 then
local sInfo = '11,'..EgtNumToString( Cmd[2],0) local sInfo = '11,'..EgtNumToString( Cmd[2],0)
@@ -2937,6 +3159,10 @@ function SpecOutputCmds( vCmd, bEnd)
local sInfo = '23,'..EgtNumToString( Cmd[2],3) local sInfo = '23,'..EgtNumToString( Cmd[2],3)
EgtSetInfo( EMC.PATHID, sKey, sInfo) EgtSetInfo( EMC.PATHID, sKey, sInfo)
EMC.W2DELTA = Cmd[2] EMC.W2DELTA = Cmd[2]
-- riporta trave in zona carico dopo una fase start partita con un riposizionam,ento
elseif Cmd[1] == 24 then
local sInfo = '24,'..Cmd[2]..','..EgtNumToString( Cmd[3],3)..','..Cmd[4]..','..EgtNumToString( Cmd[5],3)..EgtIf( Cmd[6], ',*', '')
EgtSetInfo( EMC.PATHID, sKey, sInfo)
-- aggancio grezzo a carrello -- aggancio grezzo a carrello
elseif Cmd[1] == 31 then elseif Cmd[1] == 31 then
local sInfo = '31,'..EgtNumToString( Cmd[2],0)..','..Cmd[3] local sInfo = '31,'..EgtNumToString( Cmd[2],0)..','..Cmd[3]
@@ -2976,8 +3202,26 @@ function SpecOutputCmds( vCmd, bEnd)
EgtSetInfo( NextDispId, 'V1POS', EMC.V1POS) EgtSetInfo( NextDispId, 'V1POS', EMC.V1POS)
EgtSetInfo( NextDispId, 'V2POS', EMC.V2POS) EgtSetInfo( NextDispId, 'V2POS', EMC.V2POS)
end 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
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
+16 -23
View File
@@ -32,8 +32,8 @@
require( 'EmtGenerator') require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
PP_VER = '3.1f3' PP_VER = '3.1e1_NL9_DEV1'
PP_NVER = '3.1.6.3' PP_NVER = '3.1.3.2'
MIN_MACH_VER = '2.5k1' MIN_MACH_VER = '2.5k1'
MACH_NAME = EgtGetCurrMachineName() MACH_NAME = EgtGetCurrMachineName()
@@ -99,6 +99,7 @@ MinX1 = 0
MaxX1 = 2735 MaxX1 = 2735
MinZ1 = -1550 MinZ1 = -1550
MaxZ1 = -20 -- per evitare problemi con striscia led MaxZ1 = -20 -- per evitare problemi con striscia led
MaxZ1Blade = 0
MinC1 = -275 MinC1 = -275
MaxC1 = 275 MaxC1 = 275
MinB1 = -127 MinB1 = -127
@@ -140,6 +141,7 @@ ForceToCloseRollersGate = false
SecondToolChanger = false SecondToolChanger = false
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa 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 ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
MaxFeedPinze = 102000
-- Aggiornamento con dati da TechnoEssetre7 -- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-ONE.data" local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-ONE.data"
@@ -163,10 +165,10 @@ if EgtExistsFile( sData) then
end end
if Machine.Offsets.X1_POS then MinX1 = -Machine.Offsets.X1_POS end if Machine.Offsets.X1_POS then MinX1 = -Machine.Offsets.X1_POS end
if Machine.Offsets.X1_NEG then MaxX1 = -Machine.Offsets.X1_NEG end if Machine.Offsets.X1_NEG then MaxX1 = -Machine.Offsets.X1_NEG end
if Machine.Offsets.PARK_X1POS then ParkFrnX1 = -Machine.Offsets.PARK_X1POS end if Machine.Offsets.PARK_X1 then ParkX1 = -Machine.Offsets.PARK_X1 end
if Machine.Offsets.PARK_X1NEG then ParkX1 = -Machine.Offsets.PARK_X1NEG end
if Machine.Offsets.Z1_NEG then MinZ1 = Machine.Offsets.Z1_NEG 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 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.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_NEG then MinC1 = Machine.Offsets.C1_NEG end
if Machine.Offsets.C1_POS then MaxC1 = Machine.Offsets.C1_POS end if Machine.Offsets.C1_POS then MaxC1 = Machine.Offsets.C1_POS end
@@ -208,7 +210,7 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end if Machine.Offsets.MAXFEEDPINZE then MaxFeedPinze = EgtClamp( Machine.Offsets.MAXFEEDPINZE, 20000, 155000) end
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC 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.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
@@ -221,14 +223,14 @@ if EgtExistsFile( sData) then
-- aggiustamenti -- aggiustamenti
MinY1 = MinV1 + MinDeltaYV MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1 MaxY1 = MaxMchY1
ParkV1 = MaxV1 ParkV1 = MaxV1
ParkY1 = ParkV1 + MinDeltaYV ParkY1 = ParkV1 + MinDeltaYV
MinY2 = MinMchY2 MinY2 = MinMchY2
MaxY2 = MaxV2 - MinDeltaYV MaxY2 = MaxV2 - MinDeltaYV
ParkV2 = MinV2 ParkV2 = MinV2
ParkY2 = ParkV2 - MinDeltaYV ParkY2 = ParkV2 - MinDeltaYV
ParkX1 = min( ParkX1, MaxX1) ParkX1 = min( ParkX1, MaxX1)
ParkFrnX1 = max( ParkFrnX1, MinX1) MaxZ1Blade = min( MaxZ1Blade, MaxZ1)
ParkCSawZ1 = min( ParkCSawZ1, MaxZ1) ParkCSawZ1 = min( ParkCSawZ1, MaxZ1)
ParkCSaw0Z1 = min( ParkCSaw0Z1, MaxZ1) ParkCSaw0Z1 = min( ParkCSaw0Z1, MaxZ1)
Mortiser = ( Mortiser and not Progress) Mortiser = ( Mortiser and not Progress)
@@ -245,6 +247,8 @@ EmtGeneral {
ExitMaxAdjust = 300, ExitMaxAdjust = 300,
ExitMaxRotAdj = 0.5, ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 80, AngDeltaMinForHome = 80,
LinkAxesMoveOrder = MCH_LKAMO.HEAD_BEFORE_IF_SAME_ANG,
NewLinkMgr = 1,
Special = 'Common_ONE-PF.mlse', Special = 'Common_ONE-PF.mlse',
Processor = 'Common_ONE-PF.mlpe'} Processor = 'Common_ONE-PF.mlpe'}
local sBaseAux = {'BASE/SOLID', 'BASE/SIGN', 'BASE/CONVOYER', 'BASE/BELT', 'BASE/COLLISION', 'BASE/TC1'} local sBaseAux = {'BASE/SOLID', 'BASE/SIGN', 'BASE/CONVOYER', 'BASE/BELT', 'BASE/COLLISION', 'BASE/TC1'}
@@ -802,10 +806,10 @@ function OnSetHead()
if EMC.HEAD == 'H11' or EMC.HEAD == 'H12' then if EMC.HEAD == 'H11' or EMC.HEAD == 'H12' then
if EMC.HEAD == 'H11' then if EMC.HEAD == 'H11' then
local dRawH = GetRawHeight() local dRawH = GetRawHeight()
EmtModifyAxisHome( 'Z1', ParkZ1 + EgtIf( dRawH > 650, EgtIf( EMC.TOTDIAM < 61, 235, 165), 0)) EmtModifyAxisHome( 'Z1', MaxZ1)
EmtModifyAxisDirection( 'B1', X_AX()) EmtModifyAxisDirection( 'B1', X_AX())
else else
EmtModifyAxisHome( 'Z1', ParkZ1) EmtModifyAxisHome( 'Z1', MaxZ1Blade)
EmtModifyAxisDirection( 'B1', Vector3d( cos( SawC1Offs), -sin( SawC1Offs), 0)) EmtModifyAxisDirection( 'B1', Vector3d( cos( SawC1Offs), -sin( SawC1Offs), 0))
end end
local nPos = tonumber( string.sub( EMC.TCPOS, 2)) or 0 local nPos = tonumber( string.sub( EMC.TCPOS, 2)) or 0
@@ -854,14 +858,10 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-------------------------- Testa utilizzata ------------------------- -------------------------- Testa utilizzata -------------------------
function GetHeadSet( sHead) function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then
return 1 return 1
elseif sHead == 'H19' then
return 11
elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then
return 2 return 2
elseif sHead == 'H29' then
return 21
else else
return 0 return 0
end end
@@ -890,7 +890,6 @@ function GetHeadTCSet( sHead, sTcPos)
return 0 return 0
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione che restituisce l'altezza del pezzo in lavorazione -- Funzione che restituisce l'altezza del pezzo in lavorazione
function GetRawHeight() function GetRawHeight()
@@ -910,18 +909,12 @@ function HeadIsChainSaw( sHead)
return ( sHead == 'H13' or sHead == 'H15') return ( sHead == 'H13' or sHead == 'H15')
end end
---------------------------------------------------------------------
-- Funzione che riconosce testa per tastatore
function HeadIsProbe( sHead)
return ( sHead == 'H19' or sHead == 'H29')
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale -- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
function GetChainSawZHomeFromVirtualAxis( dPosA) function GetChainSawZHomeFromVirtualAxis( dPosA)
-- se A=0 -> T101 -> HomeZ = -400 -- se A=0 -> T101 -> HomeZ = -400
if abs( dPosA) < 0.1 then if abs( dPosA) < 0.1 then
return ParkCSaw0Z1 return ParkCSawZ1
-- altrimenti A=-90 -> T102 o A=90 -> T104 -> HomeZ = -100 -- altrimenti A=-90 -> T102 o A=90 -> T104 -> HomeZ = -100
else else
return ParkCSawZ1 return ParkCSawZ1
@@ -979,7 +972,7 @@ end
-- Funzione per impostare spia stato morsa carrello Y1 -- Funzione per impostare spia stato morsa carrello Y1
function SetPY1Light( bClosed) function SetPY1Light( bClosed)
if not PY1LightId then return end if not PY1LightId then return end
EgtSetColor( PY1LightId, EgtIf( bClosed, 'RED', 'LIME')) EgtSetColor( PY1LightId, EgtIf( bClosed, 'RED', 'LIME'))
if bClosed then if bClosed then
EgtSetInfo( PY1LightId, 'On', '1') EgtSetInfo( PY1LightId, 'On', '1')
else else
+1 -9
View File
@@ -1,18 +1,10 @@
==== Common_ONE-PF Update Log ==== ==== Common_ONE-PF Update Log ====
Versione 3.1f3 (08/06/2026)
- (GEN) M77 viene ora eseguita, prima era commentata.
Versione 3.1f2 (05/06/2026)
- (MLDE-GEN) Aggiunti parametri di limite asse X per decidere se fare preselezione su altra testa. Serve modifica MLDE
Versione 3.1f1 (03/06/2026)
- (NGE-MLDE-GEN-SIM) Versione unificata con predisposizione per gestione tastatori. Serve modificare anche la macchina, per ora gestione completa solo su PFrl.
Versione 3.1c2 (17/03/2026) Versione 3.1c2 (17/03/2026)
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito - (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2 - Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
Versione 3.1c1 (04/03/2026) Versione 3.1c1 (04/03/2026)
- (GEN) Corretta chiamata di una variabile insesistente in caso di ONE - (GEN) Corretta chiamata di una variabile insesistente in caso di ONE
- (SIM) Allineata simulazione a generazione - (SIM) Allineata simulazione a generazione
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = { local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '3.1f3', -- versione script VERSION = '3.1c2', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
} }