Compare commits

..

9 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
4 changed files with 63 additions and 24 deletions
+43 -18
View File
@@ -485,6 +485,7 @@ end
---------------------------------------------------------------------
function OnMachiningEnd()
--EmtOutput( ';Mach End')
local bMoveBothClampsOnSplit = false
if #EMT.MDCHAR > 0 then
-- Emissione split
if EMT.AUXTYPE == 'S' then
@@ -515,6 +516,7 @@ function OnMachiningEnd()
EMT.MDCHAR[1].MovType = nil
EMT.MDCHAR[1].Y2 = ParkV2 - EMT.LT + EMT.Y2DELTA
EMT.MDCHAR[1].V2 = ParkV2
bMoveBothClampsOnSplit = true
end
end
@@ -558,8 +560,13 @@ function OnMachiningEnd()
end
if #EMT.MDCHAR > 0 then
if EMT.AUXTYPE == 'S' then
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
if bMoveBothClampsOnSplit then
EmitMoveStartChars( 3)
EmitMoveWaitChars( 3)
else
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
end
elseif EMT.AUXTYPE == 'U' then
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
@@ -568,6 +575,7 @@ function OnMachiningEnd()
EmitMoveWaitChars( nMoveType)
else
EmitMoveWaitChars( nMoveType, EMT.CHY_ON or TEST_USE)
EMT.LASTOPEISUNLOAD = true
end
-- emissione conclusione pezzo precedente (se non in modalità test)
if not TEST_USE and EMT.PRODID then
@@ -585,7 +593,7 @@ function OnMachiningEnd()
EmtOutput( sOut)
end
elseif not EMT.PREROT then
EmtOutput( '(M77)')
EmtOutput( 'M77')
end
end
end
@@ -637,7 +645,11 @@ function OnPathStart()
EMT.MCHFIRST = true
EMT.MCHFIRSTFEED = true
-- se piano locale compatibile
local vtExtr = Vector3d( EMT.EXTR)
if not HeadIsChainSaw( EMT.HEAD) then
vtExtr = Vector3d( EMT.EXTR)
else
vtExtr = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
end
if EMT.REFLOC and AreSameVectorApprox( vtExtr, EMT.IPLGLFR:getVersZ()) then
;
-- altrimenti primo posizionamento sempre in globale
@@ -885,11 +897,6 @@ function OnRapid()
-- dichiaro che è un movimento standard
bStdMachRapid = true
else
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
if bStdMachRapid then
bStdMachRapid = false
bStdClimb = true
@@ -899,6 +906,11 @@ function OnRapid()
if EMT.PLANEACTIVE then
EmitResetMachining( false)
end
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
EmtOutput( '( *** '..EMT.MCHNAME..'/'..EMT.TOOL..' *** )')
-- eventuale movimento carrelli
for i = 1, #EMT.AUXCMD do
@@ -977,10 +989,10 @@ function OnRapid()
end
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- se ultimo rapido e motosega, si va in home
EmitMoveDataHead( nHSet, { X=EMT.L2, Z=EMT.L3, C=EMT.R1, B=EMT.R2})
-- su ultimo rapido in uscita, comandi di attesa movimenti
if bLastRise or bStdRise then
if bLastRise or bUniqueRise or bStdRise then
EmitMoveStartHead( nHSet)
-- se lavorazione in doppio
if nHSet == 1 and EMT.DOU_TYPE == 2 then
@@ -1145,14 +1157,15 @@ function OnRapid()
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- annullo precedenti per forzare scrittura
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
EMT.PLANEACTIVE = true
-- EMT.L1p = nil
-- EMT.L2p = nil
-- EMT.L3p = nil
-- annullo precedenti per forzare scrittura
EMT.R1p = nil
EMT.R2p = nil
@@ -2291,6 +2304,8 @@ function EmitResetMachining( bNextTool)
EmtOutput( 'G157 EA1')
-- piano non più attivo
EMT.PLANEACTIVE = false
EMT.REFLOC = nil
EMT.IPLGL = false
end
end
@@ -2331,8 +2346,8 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
end
-- se anche solo una morsa è restata in posizione, le sposto comunque entrambe di 5mm per distanziare i pezzi separati
if bYNoMove or bVNoMove then
MDChar.Y1 = MDChar.Y1 + 30
MDChar.Y2 = MDChar.Y2 - 30
MDChar.Y1 = MDChar.Y1 + 150
MDChar.Y2 = MDChar.Y2 - 150
end
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EmtSetLastError( 1201, 'Error Collision in ParkRoller')
@@ -2445,9 +2460,19 @@ function ToolPreSelectionSingleHead( nMchId)
if bCarrMove then
-- se è stato trovato utensile, emetto preselezione
if sToolChangePos and sToolChange and sToolChangeHead then
local MyParkX1 = EgtIf( GetHeadTCSet( sToolChangeHead, sToolChangePos) == 'Head1_TC2', ParkFrnX1, ParkX1)
local MyParkX1, MyParkB1, MyParkC1
if GetHeadTCSet( sToolChangeHead, sToolChangePos) == 'Head1_TC2' then
MyParkX1 = ParkFrnX1
MyParkB1 = ParkFrnB1
MyParkC1 = ParkFrnC1
else
MyParkX1 = ParkX1
MyParkB1 = ParkB1
MyParkC1 = ParkC1
end
EmtOutput( '( *** TOOL PRE-SEL *** )')
EmitMoveDataHead( 1, { X=-MyParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sToolChangePos)})
EmitMoveDataHead( 1, { X=-MyParkX1, Z=MaxZ1, B=MyParkB1, C=MyParkC1, TPos=AdjustTcPos( false, sToolChangePos)})
-- comincio i movimenti di preselezione
EmitMoveStartHead( 1)
-- se preselezione e c'era montata motosega, si aspetta fine della preselezione prima di andare avanti
+1 -1
View File
@@ -1667,7 +1667,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
dAddMove = 0
-- se almeno una è rimasta ferma in posizione, allontano comunque di 30mm ulteriori
else
dAddMove = 30
dAddMove = 150
end
local MoveY1 = max( DiffY1, 0.0)
local MoveY2 = min( DiffY2, 0.0)
+18 -4
View File
@@ -92,8 +92,15 @@ local function IsLinkSafe( vPrec, vNext)
for t=1, #DirectionsToTest do
local vtToolDir = EgtGetCalcToolDirFromAngles( DirectionsToTest[t].C, DirectionsToTest[t].B)
-- se testa standard
if EMC.HEAD == 'H11' then
-- TODO considerare caso sotto la traversa
-- se sotto la traversa
if vtToolDir:getX() > -0.1 then
bSafeMove = true
end
-- se lama su aggregato
if EMC.HEAD == 'H12' then
elseif EMC.HEAD == 'H12' then
-- se sotto la traversa
if vtToolDir:getX() < 0.342 then
local dLen = SawOffsZ - MillOffs
@@ -150,10 +157,17 @@ function OnSpecialLink()
-- 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)
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 max( vLFiAx[3], vLInAx[3]) > ParkZ1 + 1 then
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;')
+1 -1
View File
@@ -32,7 +32,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1e1_NL3'
PP_VER = '3.1e1_NL9_DEV1'
PP_NVER = '3.1.3.2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = EgtGetCurrMachineName()