Compare commits

...

5 Commits

3 changed files with 43 additions and 39 deletions
+35 -24
View File
@@ -864,8 +864,10 @@ function OnRapid()
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
else
-- se stesso utensile, e c'è ancora piano attivo dalla lavorazione precedente, allora questo è un climb
if EMT.TOOL == EMT.PREVTOOL and EMT.PLANEACTIVE and ( abs( EMT.R1prec - EMT.R1) < 0.1 and abs( EMT.R2prec - EMT.R2) < 0.1) then
-- controllo se ci sono spostamenti dei carrelli programmati
local bChangeCarriageClamping = CheckChangeCarriageClamping()
-- se non ci sono riposizionamenti dei carrelli, se stesso utensile, e c'è ancora piano attivo dalla lavorazione precedente, allora questo è un climb
if not bChangeCarriageClamping and EMT.TOOL == EMT.PREVTOOL and EMT.PLANEACTIVE and ( abs( EMT.R1prec - EMT.R1) < GEO.EPS_SMALL and abs( EMT.R2prec - EMT.R2) < GEO.EPS_SMALL) then
-- dichiaro finita lavorazione precedente
local sOut = 'G157 EA1'
EmtOutput( sOut)
@@ -903,7 +905,7 @@ function OnRapid()
end
-- si disattiva piano a meno che non sia lavorazione con stesso utensile e stesso orientamento assi
if EMT.PLANEACTIVE then
if EMT.PLANEACTIVE then
EmitResetMachining( false)
end
@@ -1378,6 +1380,28 @@ function CalcCharStatusN( sCmd)
end
end
---------------------------------------------------------------------
-- controlla se nella tabella AUX sono presenti dei movimenti dei carrelli
function CheckChangeCarriageClamping()
local ChangeCarriagesParam = {
'1', -- movimento singolo carro
'2', -- movimento carro e trave
'3', -- movimento 2 carri e trave
'4', -- risalita a Z max
'11', -- comando pinza 1
'12' -- comando pinza 2
}
for i=1, #EMT.AUXCMD do
local Cmd = EgtSplitString( EMT.AUXCMD[i])
for j=1, #ChangeCarriagesParam do
if Cmd[1] == ChangeCarriagesParam[j] then
return true
end
end
end
return false
end
---------------------------------------------------------------------
function PrepareLoad( sCmd, nInd, bStart)
local Cmd = EgtSplitString( sCmd)
@@ -2328,27 +2352,14 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
local DiffY2 = MyParkY2 - dPosY2
--EmtOutput( string.format( 'PosT=%.3f DiffY1=%.3f DiffY2=%.3f', dPosT, DiffY1, DiffY2))
if bSplitCut then
local bYNoMove, bVNoMove
if DiffY1 > 0.1 then
bYNoMove = false
MDChar.Y1 = dPosY1 + DiffY1
else
bYNoMove = true
MDChar.Y1 = dPosY1
end
if DiffY2 < -0.1 then
bVNoMove = false
MDChar.Y2 = dPosY2 + DiffY2
dPosT = dPosT + DiffY2
else
bVNoMove = true
MDChar.Y2 = dPosY2
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 + 150
MDChar.Y2 = MDChar.Y2 - 150
end
local dAddMoveY1 = ParkV1 + ( -dPosT - EMT.LT)
local dAddMoveY2 = ParkV2 + ( -dPosT - EMT.LT)
local MoveY1 = max( DiffY1, dAddMoveY1, 30.0)
local MoveY2 = min( DiffY2, dAddMoveY2, -30.0)
MDChar.Y1 = dPosY1 + MoveY1
MDChar.Y2 = dPosY2 + MoveY2
dPosT = dPosT + MoveY2
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EmtSetLastError( 1201, 'Error Collision in ParkRoller')
elseif DiffY1 > 0.1 then
+4 -13
View File
@@ -1661,19 +1661,10 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local DiffY2 = MyParkY2 - PosY2
-- se appena eseguito taglio di separazione
if bSpliCut then
local dAddMove
-- se entrambe le morse si spostano vado in posizione calcolata
if DiffY1 > 0.1 and DiffY2 < -0.1 then
dAddMove = 0
-- se almeno una è rimasta ferma in posizione, allontano comunque di 30mm ulteriori
else
dAddMove = 150
end
local MoveY1 = max( DiffY1, 0.0)
local MoveY2 = min( DiffY2, 0.0)
MoveY1 = MoveY1 + dAddMove
MoveY2 = MoveY2 - dAddMove
local dAddMoveY1 = ParkV1 + ( -PosT - EMT.LR)
local dAddMoveY2 = ParkV2 + ( -PosT - EMT.LR)
local MoveY1 = max( DiffY1, dAddMoveY1, 30.0)
local MoveY2 = min( DiffY2, dAddMoveY2, -30.0)
-- aggancio i pezzi rimanenti all'asse Y1
LinkRemainingPartsToY1()
+4 -2
View File
@@ -32,7 +32,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1e1_NL9_DEV1'
PP_VER = '3.1e1_NL13'
PP_NVER = '3.1.3.2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = EgtGetCurrMachineName()
@@ -165,7 +165,8 @@ if EgtExistsFile( sData) then
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.PARK_X1 then ParkX1 = -Machine.Offsets.PARK_X1 end
if Machine.Offsets.PARK_X1POS then ParkFrnX1 = -Machine.Offsets.PARK_X1POS 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_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
@@ -230,6 +231,7 @@ if EgtExistsFile( sData) then
ParkV2 = MinV2
ParkY2 = ParkV2 - MinDeltaYV
ParkX1 = min( ParkX1, MaxX1)
ParkFrnX1 = max( ParkFrnX1, MinX1)
MaxZ1Blade = min( MaxZ1Blade, MaxZ1)
ParkCSawZ1 = min( ParkCSawZ1, MaxZ1)
ParkCSaw0Z1 = min( ParkCSaw0Z1, MaxZ1)