Compare commits

..

2 Commits

Author SHA1 Message Date
andrea.villa 5ee93e4461 - Corretto parametro posizione zero motosega per H23
- Corretto calcolo posizione assi lineari
2026-06-26 08:40:57 +02:00
andrea.villa c8342f5b8d Corretta gestione pinze 2026-06-23 16:49:22 +02:00
3 changed files with 26 additions and 17 deletions
+22 -10
View File
@@ -315,7 +315,7 @@ function OnDispositionEnd()
if #EMT.MDCHAR > 0 then
MyOutputNoNum( '(PART UNLOAD)')
-- movimento intermedio di apertura pinza-rulli per evitare di trovare delle collisioni
EmitParkRoller( EMT.TPOS, false, false)
EmitParkRoller( EMT.TPOS, false)
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
if EMT.MDCHAR[i].V1 then EMT.V1POS = EMT.MDCHAR[i].V1 end
@@ -530,7 +530,7 @@ function OnMachiningEnd()
elseif EMT.AUXTYPE == 'U' then
EmtOutput( '(PART UNLOAD)')
-- movimento intermedio di apertura pinza-rulli per evitare di trovare delle collisioni
EmitParkRoller( EMT.TPOS, false, false)
EmitParkRoller( EMT.TPOS, false)
EMT.V1POS = EMT.V1NEXTPOS
EMT.V2POS = EMT.V2NEXTPOS
elseif EMT.AUXTYPE == 'P' then
@@ -927,6 +927,11 @@ function OnRapid()
-- eventuale movimento carrelli
for i = 1, #EMT.AUXCMD do
ProcessPathStartAux( EMT.AUXCMD[i], i)
-- se ultimo comando e lavorazione di split, sgancio il carro Y1
if i == #EMT.AUXCMD and EMT.MCHSPLIT and not EMT.TO_SPECSPLIT and not EMT.TO_FALL then
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
EMT.Y1DELTA = nil
end
end
EMT.AUXCMD = {}
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
@@ -966,10 +971,13 @@ function OnRapid()
end
if bParkV or bNlhParkV then
local bMchSplit = bSplitMach
local bMchSplit = ( bNlhParkV and EMT.MCHSPLIT and bSplit)
local bAgg = EgtExistsInfo( EMT.PATHID, 'CNT')
if EMT.SPLIT_Y1DELTA and not EMT.MCHSPLIT then EMT.Y1DELTA = EMT.SPLIT_Y1DELTA end
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, bMchSplit)
EmitParkRoller( dPosT, bMchSplit, bAgg)
end
if EMT.SPLIT_Y1DELTA then EMT.Y1DELTA = EMT.SPLIT_Y1DELTA end
-- se era stato lanciata la preselezione di un utensile, prima di muovere la testa asopetto che sia finito
if EMT.START_PRESEL then
@@ -1180,6 +1188,7 @@ function OnRapid()
EMT.POSTROT = false
EMT.RELOAD = false
EMT.RELOAD2 = nil
EMT.SPLIT_Y1DELTA = nil
end
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
@@ -2092,11 +2101,11 @@ function MyAdjustLinearAxes()
local Len = EMT.TLEN + dAddLen + Mill2Offs
local LenRef = Mill2Offs
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H13' then
elseif EMT.HEAD == 'H13' or EMT.HEAD == 'H15' then
local Len = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
vtE = Vector3d( EMT.ADIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H15' or EMT.HEAD == 'H23' then
elseif EMT.HEAD == 'H23' then
local Len = ( EMT.TDIST or ChSawLen) + Mill2Offs
local LenRef = Mill2Offs
vtE = Vector3d( EMT.ADIR) * Len - Z_AX() * LenRef
@@ -2358,14 +2367,14 @@ function EmitResetMachining( bNextTool)
end
---------------------------------------------------------------------
function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
function EmitParkRoller( dPosT, bSplitCut, bAgg)
-- se entrambe già parcheggiate, non devo fare alcunché
if ( EMT.V1POS - ParkV1) > -0.1 and ( EMT.V2POS - ParkV2) < 0.1 then return end
-- Assegno quote pinze correnti
local dY1Delta = EgtIf( bUsePrevDelta, EMT.Y1PREVDELTA, EMT.Y1DELTA)
local dY2Delta = EgtIf( bUsePrevDelta, EMT.Y2PREVDELTA, EMT.Y2DELTA)
local dY1Delta = EMT.Y1DELTA
local dY2Delta = EMT.Y2DELTA
-- Parcheggi pinze
local MyParkY1 = ParkY1 + AggLoad
local MyParkY1 = ParkY1 + EgtIf( bAgg, AggLoad, 0)
local MyParkY2 = ParkY2
-- le parcheggio
local MDChar = {}
@@ -2438,6 +2447,9 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
MDChar.IniStatV2 = 3
MDChar.MovType = MDChar.MovType | 2
end
if EMT.SPLIT_Y1DELTA and EMT.SPLIT_Y1DELTA + dPosT < MyParkY1 then
MDChar.Y1 = MyParkY1
end
EmitMoveDataChars( MDChar)
EmitMoveStartChars( MDChar.MovType)
EmitMoveWaitChars( MDChar.MovType)
+1 -1
View File
@@ -477,7 +477,7 @@ function OnSpecialLink()
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)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z2, 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
+3 -6
View File
@@ -32,9 +32,9 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1f1_RC5'
PP_VER = '3.1f1_RC8'
PP_NVER = '3.1.6.1'
MIN_MACH_VER = '2.5k1'
MIN_MACH_VER = '2.7a1'
MACH_NAME = EgtGetCurrMachineName()
@@ -938,9 +938,6 @@ function OnSetHead()
-- aggiustamenti per distanza
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, Head2Z - dDist))
local vtMove = Point3d( 0, 0, Head2Z - dDist) - Point3d( EMC.EXITPOS)
local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT))
EgtMove( ExitId, vtMove)
-- recupero valore asse A bloccato
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
local CSawPosA = tonumber( sVal:sub( 3) or '')
@@ -983,7 +980,7 @@ function GetHeadTCSet( sHead, sTcPos)
-- testa 2 su CU prossimo a testa 2
elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then
return 'Head2_TC2'
-- testa 2 su CU prossimo a testa 1 (non esiste una condfigurazione fatta in questo modo)
-- testa 2 su CU prossimo a testa 1 (non esiste una configurazione fatta in questo modo)
elseif nPos < 10 then
return 'Head2_TC1'
else