Compare commits

...

34 Commits

Author SHA1 Message Date
andrea.villa 164097fe52 Merge branch 'develop' 2024-01-22 10:12:59 +01:00
andrea.villa 9cc0cdd379 Essetre-PF1250 ver 2.6a2
- Prima versione post common PF1250
- Allineamento con common ver. 2.6a3
2024-01-22 10:09:29 +01:00
andrea.villa a8532d4c97 Merge branch 'master' into develop 2024-01-22 10:06:12 +01:00
Dario Sassi cb9839b266 Essetre-PF1250 :
- altezza minima pinze coincide con massima altezza pezzo (400)
- migliorie per scambio pinze dopo pezzi a caduta.
2024-01-19 16:30:09 +01:00
Dario Sassi 3c329adb0f Essetre-PF1250 :
- corretta simulazione nei casi di split con pinza Y1 da allontanare.
2024-01-19 11:55:21 +01:00
Dario Sassi 05f4d9ab4c Essetre-PF1250 2.6a1 :
- Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale.
2024-01-18 20:25:16 +01:00
andrea.villa 51c596ae82 Merge branch 'develop' of https://gitlab.steamware.net/egalware-machines/essetre/Essetre-PF1250 into develop 2023-12-14 15:59:10 +01:00
andrea.villa ae7be91567 Merge branch 'master' into develop 2023-12-14 15:59:04 +01:00
luca.mazzoleni 232ffb4714 Merge branch 'master' into develop 2023-12-11 15:41:16 +01:00
andrea.villa 47b294fba4 Merge branch 'develop' 2023-12-11 13:09:02 +01:00
andrea.villa c8e322fbc9 2.5l5 Allineamento movimento in zmax come PF1250rl 2023-12-11 13:08:36 +01:00
andrea.villa a4898227eb Merge branch 'master' into develop 2023-12-11 13:08:18 +01:00
andrea.villa d5fb783672 Merge branch 'develop' 2023-12-05 16:59:39 +01:00
andrea.villa 9321e8bc1f 2.5l4 : Corretto segno calcolo posizione seconda testa in lavorazioni in doppio 2023-12-05 16:59:02 +01:00
andrea.villa 5ac91ab90e Piccola modifica: in M111 si scrive il DeltaY (distanza testa trave - pinzaY1) come commento 2023-12-05 14:10:16 +01:00
luca.mazzoleni dfbe14eb9f Merge branch 'master' into develop 2023-12-05 10:04:12 +01:00
luca.mazzoleni 8e9534f527 Merge branch 'develop' 2023-12-05 10:03:43 +01:00
luca.mazzoleni 8c33d513e2 In dinamica pinze corretto typo in nomi variabili. 2023-12-05 10:03:32 +01:00
andrea.villa c3db81b4c1 Merge branch 'master' into develop 2023-12-04 12:42:17 +01:00
andrea.villa 0d007337a3 Merge branch 'develop' 2023-12-04 12:42:03 +01:00
andrea.villa 92a10ef4a4 Corretto vista allineata per carico sinistro in simulazione 2023-12-04 12:41:22 +01:00
andrea.villa 9b72bc9b83 Merge branch 'master' into develop 2023-12-04 12:34:19 +01:00
andrea.villa ba4193739a Merge branch 'develop' 2023-12-04 12:33:18 +01:00
andrea.villa 4c8aee0bd0 2.5l1 : In dinamica pinze risultati finali non più accelerazioni ma tempi rampa in ms (P7, P8 e P9 di M115). 2023-12-04 12:32:29 +01:00
luca.mazzoleni f4f5f637b3 Merge branch 'master' into develop 2023-11-28 12:11:42 +01:00
luca.mazzoleni abf8834a18 Merge branch 'develop' 2023-11-28 12:11:08 +01:00
andrea.villa a835aad6f7 2.5k1 Piccola correzione variabile non definita 2023-11-23 12:51:26 +01:00
andrea.villa de7478b404 2.5k1 Correzioni varie per gestione lama doppia 2023-11-22 10:39:28 +01:00
andrea.villa 57f8e764ef 2.5k1 Inserito costanti lav. doppie in BeamData 2023-11-22 09:23:14 +01:00
andrea.villa e317e20d93 PF1250 : - Gestione lavorazione in doppio da PF1250rl
- Gestione seconda lama da PF1250rl
              - Piccole modifiche per allineamento a PF1250rl
2023-11-21 13:05:14 +01:00
luca.mazzoleni d09943365a Merge remote-tracking branch 'origin/master' into develop 2023-10-30 09:14:38 +01:00
Dario Sassi ad83451849 Essetre-PF1250 2.5j2:
- correzione a calcolo se V1 e V2 vanno lasciati aperti e quindi in parcheggio (GetVnToCloseTPA) #1490.
2023-10-29 18:37:27 +01:00
Dario Sassi 38d78c8fe9 Essetre-PF1250 2.5j1 :
- modifiche per gestire testa sotto più bassa quando in home.
2023-10-12 12:13:13 +02:00
luca.mazzoleni e9e7e7473f - in BeamData aggiunti ai parametri letti da ts3data: MINRAW_S, MINRAW_L, CUT_EXTRA, CUT_EXTRA_MIN, DIM_STRIP_SMALL, DIM_TO_CENTER_STRIP, MAXDIAM_POCK_CORNER
- in mlde aggiunti ai parametri letti da ts3data: SAWOFFSX, SAWOFFSZ, DEFTCPOS1, DEFTCPOS2
2023-09-29 15:46:00 +02:00
10 changed files with 1936 additions and 698 deletions
+64 -23
View File
@@ -1,10 +1,12 @@
-- BeamData.lua by Egaltech s.r.l. 2023/06/28
-- BeamData.lua by Egaltech s.r.l. 2024/01/19
-- Raccolta dati generali per Travi
EgtOutLog( ' PF1250-BeamData started')
-- Tabella per definizione modulo
local BeamData = {
RIGHT_LOAD = false, -- flag carico da destra
SIMUL_VIEW_DIR = 2, -- direzione di vista predefinita per la simulazione (1=NW, 2=SW, 3=NE, 4=SE)
MIN_WIDTH = 40, -- larghezza minima del grezzo
MIN_HEIGHT = 40, -- altezza minima del grezzo
MAX_WIDTH = 1250, -- larghezza massima del grezzo
@@ -24,6 +26,7 @@ local BeamData = {
MAX_DIM_HTCUT = 201.1, -- larghezza massima taglio di testa o coda
MAX_DIM_HTCUT_HBEAM = 201.1, -- larghezza massima taglio di testa o coda con trave alta
MIN_DIM_HBEAM = 410, -- altezza minima di trave alta
OVM_CHAIN_HBEAM = 8, -- sovramateriale per split con sega a catena
MAX_DIM_DICE = 135, -- dimensione trasversale massima cubetto
MAX_LEN_DICE = 400, -- lunghezza massima cubetto 400
DECR_VERT_CUT = 25, -- riduzione profondità per affondamento verticale in taglio orizzontale
@@ -50,7 +53,7 @@ local BeamData = {
DIM_STRIP_SMALL = 1.5, -- dimensione codolo piccolo (quando le parti sostenute sono sicuramente sulla parte sopra del pezzo)
RAWCOL = { 255, 160, 32, 30}, -- colore del grezzo
RAW_OFFSET = 2000, -- spostamento grezzo rimanente dopo split
VICE_MINH = 110, -- altezza minima della morsa
VICE_MINH = 400, -- altezza minima della morsa
OFFSET_DRILL_TENON = 0, -- offset fori su tenoni verso base degli stessi (0=non fare)
USER_HOLE_DIAM = 0, -- diametro foro per L20
MAX_TOOL_LEN_FOR_HOR_MACH = 500, -- massima lunghezza ingombro per poter fare forature (fresature) oltre i 10 gradi dalla verticale
@@ -59,15 +62,70 @@ local BeamData = {
MIN_LEN_LAMELLO = 1000, -- lunghezza minima di fessura longitudinale per lavorazione tipo lamello (SideMillAsBlade)
PRESS_ROLLER = true, -- dichiarazione presenza rulli pressori
C_SIMM = true, -- dichiarazione simmetria mensola asse C
C_SIMM_ENC = 180, -- ingombro semi-forcella in X da naso mandrino (compresa sicurezza)
DOWN_HEAD = true, -- dichiarazione presenza seconda testa dal basso
DH_MAX_TOP = 370, -- quota massima raggiungibile dalla testa da sotto dal sotto del pezzo
KIOTP = 2, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare
MAXDIAM_POCK_CORNER = 30, -- diametro massimo utensile ammesso per tasche con angoli interni
USE_LONGCUT = false, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta
ADVANCE_TAIL_OFFS = 5 -- accorciamento taglio di coda avanzato (minimo 1)
ADVANCE_TAIL_OFFS = 5, -- accorciamento taglio di coda avanzato (minimo 1)
DOUBLE_HEAD_DOVETAIL = true, -- flag abilitazione lavorazione mortase a coda di rondine in doppio
DOUBLE_HEAD_MORTISE = true, -- flag abilitazione lavorazione mortase in doppio
DOUBLE_HEAD_DRILLING = true -- flag abilitazione forature in doppio
}
---------------------------------------------------------------------
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250.data"
local sDataBeam = EgtGetSourceDir().."\\Ts3Data.lua"
local sDataWall = EgtGetCurrMachineDir()..'\\Wall\\Ts3Data.lua'
if EgtExistsFile( sTs3Data) then
EgtCopyFile( sTs3Data, sDataBeam)
EgtCopyFile( sTs3Data, sDataWall)
local sTs3DataOld = sTs3Data..'.old'
EgtEraseFile( sTs3DataOld)
EgtRenameFile( sTs3Data, sTs3DataOld)
end
if EgtExistsFile( sDataBeam) then
local Machine = dofile( sDataBeam)
if Machine then
if Machine.Offsets then
if Machine.Offsets.DOUBLE_HEAD_DOVETAIL then BeamData.DOUBLE_HEAD_DOVETAIL = ( Machine.Offsets.DOUBLE_HEAD_DOVETAIL == 1) end
if Machine.Offsets.DOUBLE_HEAD_POCKET then BeamData.DOUBLE_HEAD_MORTISE = ( Machine.Offsets.DOUBLE_HEAD_POCKET == 1) end
if Machine.Offsets.DOUBLE_HEAD_DRILLING then BeamData.DOUBLE_HEAD_DRILLING = ( Machine.Offsets.DOUBLE_HEAD_DRILLING == 1) end
BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S)
BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L)
BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA
BeamData.CUT_EXTRA_MIN = Machine.Offsets.CUT_EXTRA_MIN or BeamData.CUT_EXTRA_MIN
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
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
BeamData.MIN_HEIGHT = Machine.Trave.ZMIN or BeamData.MIN_HEIGHT
BeamData.MAX_WIDTH = Machine.Trave.XMAX or BeamData.MAX_WIDTH
BeamData.MAX_HEIGHT = Machine.Trave.ZMAX or BeamData.MAX_HEIGHT
end
if Machine.User then
BeamData.OFFSET_DRILL_TENON = Machine.User.L040_OFFSET_P1 or BeamData.OFFSET_DRILL_TENON
if Machine.User.OPTIMIZATIONS_ENABLE_SLICES_F5 == 1 then
BeamData.MAX_LEN_SCRAP = Machine.User.OPTIMIZATIONS_LENGTH_SLICES or BeamData.MAX_LEN_SCRAP
else
BeamData.MAX_LEN_SCRAP = 100000
end
if Machine.User.OPTIMIZATIONS_ENABLE_SLICES_F6 == 1 then
BeamData.MAX_LEN_SCRAP_START = Machine.User.OPTIMIZATIONS_LENGTH_SLICES or BeamData.MAX_LEN_SCRAP_START
else
BeamData.MAX_LEN_SCRAP_START = 100000
end
BeamData.USER_HOLE_DIAM = Machine.User.L020_DIAM_HOLE or BeamData.USER_HOLE_DIAM
end
end
end
---------------------------------------------------------------------
local function GetMaxLenRidgeLapFromBottom( dHRaw)
if dHRaw < BeamData.MIN_DIM_HBEAM then
return BeamData.MAX_LEN_RIDGELAP_FROM_BOTTOM + 0.01
@@ -77,6 +135,7 @@ local function GetMaxLenRidgeLapFromBottom( dHRaw)
end
BeamData.GetMaxLenRidgeLapFromBottom = GetMaxLenRidgeLapFromBottom
---------------------------------------------------------------------
local function GetBottomToolMaxTotLen( vtDir)
if not vtDir or vtDir:getZ() < -0.867 then
return 240
@@ -88,6 +147,7 @@ local function GetBottomToolMaxTotLen( vtDir)
end
BeamData.GetBottomToolMaxTotLen = GetBottomToolMaxTotLen
---------------------------------------------------------------------
local function GetSectionCoeff( dW, dH, dL)
local SEZ_L = 80000
local SEZ_S = 20000
@@ -104,6 +164,7 @@ local function GetSectionCoeff( dW, dH, dL)
end
end
---------------------------------------------------------------------
local function GetMinJoin( dW, dH, dL)
local dCoeff = GetSectionCoeff( dW, dH, dL)
return ( 1 - dCoeff) * BeamData.MIN_JOIN_S + dCoeff * BeamData.MIN_JOIN_L
@@ -116,26 +177,6 @@ local function GetMinUnloadableRaw( dW, dH)
end
BeamData.GetMinUnloadableRaw = GetMinUnloadableRaw
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250.data"
local sData = EgtGetSourceDir().."\\Ts3Data.lua"
if EgtExistsFile( sTs3Data) then
EgtCopyFile( sTs3Data, sData)
local sTs3DataOld = sTs3Data..'.old'
EgtEraseFile( sTs3DataOld)
EgtRenameFile( sTs3Data, sTs3DataOld)
end
if EgtExistsFile( sData) then
local Machine = dofile( sData)
if Machine then
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
BeamData.MIN_HEIGHT = Machine.Trave.ZMIN or BeamData.MIN_HEIGHT
BeamData.MAX_WIDTH = Machine.Trave.XMAX or BeamData.MAX_WIDTH
BeamData.MAX_HEIGHT = Machine.Trave.ZMAX or BeamData.MAX_HEIGHT
end
end
end
---------------------------------------------------------------------
return BeamData
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+193 -115
View File
@@ -1,17 +1,121 @@
-- Special Operations macchina Essetre-PF1250 by EgalTech s.r.l. 2023/06/28
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/18
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Carico i dati globali
local sBaseDir = EgtGetSourceDir()
local BD = dofile( sBaseDir .. 'Beam\\BeamData.lua')
BD = dofile( sBaseDir .. 'Beam\\BeamData.lua')
EgtOutLog ( '** Essetre-PF1250 '..PP_VER..' **', 1)
---------------------------------------------------------------------
-- *** Special Z moves ***
---------------------------------------------------------------------
---------------------- 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)
end
end
-- sotto il minimo
return 0
end
---------------------------------------------------------------------
function OnSpecialGetMaxZ()
-- Inizializzazioni
EMC.ERR = 0
-- Gestione speciale per sega a catena
if EMC.HEAD == 'H13' then
EMC.MAXZ = EgtGetAxisHomePos( 'Z1')
return
end
-- Sistemazione dati di input
local vtTp = Vector3d( EMC.TDIRp)
local bFromZmax = false
-- recupero il gruppo
local nSetHead = GetHeadSet( EMC.HEAD)
if vtTp:isSmall() then
vtTp = X_AX()
bFromZmax = true
if nSetHead == 1 then
EMC.R1p = ParkC1
EMC.R2p = ParkB1
elseif nSetHead == 2 then
EMC.R1p = ParkC2
EMC.R2p = ParkB2
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
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}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 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
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 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 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 == 'H16' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 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
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 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 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 == '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}}
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
end
end
---------------------- OnSpecialMoveZup -----------------------------
---------------------------------------------------------------------
function OnSpecialMoveZup()
--EgtOutLog( 'OnSpecialMoveZup : ' .. EMC.HEAD .. '.' .. tostring( EMC.EXIT))
@@ -20,122 +124,69 @@ function OnSpecialMoveZup()
EMC.ERR = 0
EMC.MODIF = false
-- Direzione utensile
local vtT = Vector3d( EMC.TDIR)
-- recupero Z1 home
local dZmax = EgtGetAxisHomePos( 'Z1')
local nHeadSet = GetHeadSet( EMC.HEAD)
local dZmax = EgtGetAxisHomePos( EgtIf( nHeadSet ~= 2, 'Z1', 'Z2'))
--EgtOutLog( string.format( 'Zhome=%.3f L3=%.3f R2=%.3f Flag=%i', dZmax, EMC.L3, EMC.R2, EMC.FLAG))
-- se fresa su testa1
if EMC.HEAD == 'H11' then
local Z_EXTRA = 250
-- se inclinata oltre 90 gradi
if abs( EMC.R2) > 89.9 then
-- se troppo in alto
if EMC.L3 > dZmax - 30 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
-- dichiaro modificato
EMC.MODIF = true
end
-- se inclinata oltre i 60 gradi
elseif abs( EMC.R2) > 60 then
local dZref = min( dZmax + Z_EXTRA * ( 90 - abs( EMC.R2)) / 30, MaxZ1)
-- se troppo in basso
if EMC.L3 < dZref - 0.1 then
if ( EMC.FLAG == 2 or EMC.FLAG == 3) and EMC.FLAG2 == 1 then
-- porto alla giusta quota
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- se troppo alto
elseif EMC.L3 > dZref + 0.1 then
-- porto alla giusta quota
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- altrimenti inclinata meno di 60 gradi
else
local dZref = min( dZmax + Z_EXTRA, MaxZ1)
-- se troppo in basso
if EMC.L3 < dZref - 0.1 then
if ( EMC.FLAG == 2 or EMC.FLAG == 3) and EMC.FLAG2 == 1 then
-- porto alla giusta quota
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- se troppo alto
elseif EMC.L3 > dZref + 0.1 then
-- porto alla giusta quota
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
-- se fresa su testa1 o testa 2
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' or EMC.HEAD == 'H22' then
;
-- se lama
else
-- riporto i valori tra -179 e + 180
local dCheckAxR1 = EMC.R1
if dCheckAxR1 < -180 then
dCheckAxR1 = dCheckAxR1 + 360
elseif dCheckAxR1 > 180 then
dCheckAxR1 = dCheckAxR1 - 360
end
-- se lama su testa1
elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H16' then
local Z_EXTRA = 160
-- se inclinata oltre 90 gradi
if abs( EMC.R2) > 89.9 then
-- se troppo in alto
if EMC.L3 > dZmax - 100 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
-- dichiaro modificato
EMC.MODIF = true
end
-- se inclinata oltre i 60 gradi
elseif abs( EMC.R2) > 60 then
local dZref = dZmax + Z_EXTRA * ( 90 - abs( EMC.R2)) / 30
-- se troppo in basso
if EMC.L3 < dZref - 0.1 then
--if ( EMC.FLAG == 2 or EMC.FLAG == 3) and EMC.FLAG2 == 1 then
-- porto alla giusta quota
-- se lama su testa1
if EMC.HEAD == 'H12' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( dCheckAxR1 < 15.0 or dCheckAxR1 > 180.0)) or ( EMC.R2 < -87.9 and ( dCheckAxR1 > -15.0 and dCheckAxR1 < 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
-- se troppo alto
elseif EMC.L3 > dZref + 0.1 then
-- porto alla giusta quota
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
end
-- altrimenti inclinata meno di 60 gradi
else
local dZref = dZmax + Z_EXTRA
-- se troppo in basso
if EMC.L3 < dZref - 0.1 then
--if ( EMC.FLAG == 2 or EMC.FLAG == 3) and EMC.FLAG2 == 1 then
-- porto alla giusta quota
-- se seconda lama su testa1
elseif EMC.HEAD == 'H16' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( dCheckAxR1 < 15.0 or dCheckAxR1 > 180.0)) or ( EMC.R2 < -87.9 and ( dCheckAxR1 > -15.0 and dCheckAxR1< 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
-- se troppo alto
elseif EMC.L3 > dZref + 0.1 then
-- porto alla giusta quota
EMC.L3 = dZref
-- dichiaro modificato
EMC.MODIF = true
end
end
end
end
end
---------- OnSpecialApplyDisposition & OnPostApplyMachining ---------
---------------------------------------------------------------------
-- *** OnSpecialApplyDisposition & OnPostApplyMachining ***
---------------------------------------------------------------------
----------------------- Costanti ------------------------------------
local DELTA_SIC = 1
local MinJoin = BD.MIN_JOIN_S
@@ -202,6 +253,22 @@ local function GetNextStartOrRestPhase( nPhase)
return nNextPhase
end
---------------------------------------------------------------------
local function IsFirstMachiningOfStart( nMchId)
-- se non è fase inizio di pezzo, ritorno risultato negativo
if not IsStartOrRestPhase( EMC.PHASE) then
return false
end
-- recupero la precedente operazione attiva
local nPrevOperId = EgtGetPrevActiveOperation( nMchId)
-- se non esiste o non è una disposizione, ritorno risultato negativo
if not nPrevOperId or EgtGetOperationType( nPrevOperId) ~= MCH_OY.DISP then
return false
end
-- è la prima
return true
end
---------------------------------------------------------------------
local function UpdateMinJoin()
MinJoin = BD.GetMinJoin( EMC.SB, EMC.HB, EMC.LB)
@@ -437,7 +504,7 @@ end
---------------------------------------------------------------------
function OnPostApplyMachining()
EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID), 1)
EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID) .. ' (' .. tostring( EMC.MCHID) .. ')')
-- Inizializzo codice di errore
EMC.ERR = 0
@@ -618,6 +685,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
EMC.SB = b3Tot:getDimY()
EMC.HB = b3Tot:getDimZ()
EMC.LT = b3Raw:getDimX()
EgtOutLog( ' BarLen='..EgtNumToString( EMC.LB, 1), 3)
-- Aggiorno limiti di presa
UpdateMinJoin()
@@ -697,6 +765,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
-- Altrimenti, non muovo i carrelli rispetto alla trave ma impongo la posizione dei rulli
else
SpecOutputCNT()
local vCmd = {}
table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)})
table.insert( vCmd, { 22, dRollBack, -dRollFront})
@@ -730,7 +799,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
return false
end
-- eseguo la separazione
EgtOutLog( 'MaxLenLeft=' .. EgtNumToString( dMaxLenLeft, 1))
EgtOutLog( 'MaxLenLeft=' .. EgtNumToString( dMaxLenLeft, 1), 1)
vCmd = SpecCalcSplit( b3Raw:getDimX(), dMaxLenLeft)
end
-- Se taglio finale di grezzo a perdere
@@ -797,23 +866,32 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
for i = 1, #vAxMin do
vAxMid[i] = ( vAxMin[i] + vAxMax[i]) / 2
end
-- recupero il gruppo
local nSetHead = GetHeadSet( sHead)
-- Calcolo dell'ingombro della testa rispetto allo Zero Macchina (assi rotanti fissi, C=4, B=5, A=6)
local b3Enc
if sHead ~= 'H21' then
if nSetHead == 1 then
EgtSetAxisPos( 'C1', vAxMid[4])
EgtSetAxisPos( 'B1', vAxMid[5])
if sHead == 'H13' then
EgtSetAxisPos( 'A', vAxMid[6])
EgtSetAxisPos( 'A1', vAxMid[6])
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C1'), GDB_BB.ONLY_VISIBLE)
else
elseif nSetHead == 2 then
EgtSetAxisPos( 'C2', vAxMid[4])
EgtSetAxisPos( 'B2', vAxMid[5])
if sHead == 'H22' then
EgtSetAxisPos( 'A2', vAxMid[6])
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
else -- 'H31'
EgtSetAxisPos( 'C3', vAxMid[4])
EgtSetAxisPos( 'B3', vAxMid[5])
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C3'), GDB_BB.ONLY_VISIBLE)
end
local dMinFrontEng = EgtIf( sHead ~= 'H21', MIN_ENG_RACK_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dMinFrontEng = EgtIf( nSetHead ~= 2, MIN_ENG_RACK_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dRollFront = max( b3Enc:getMax():getX(), dMinFrontEng) + SIC_V
local dMinBackEng = EgtIf( sHead ~= 'H21', MIN_ENG_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dMinBackEng = EgtIf( nSetHead ~= 2, MIN_ENG_V, EgtIf( vAxMax[3] < MIN_Z2_FOR_ENG_XZ2_V, MIN_ENG_V, MIN_ENG_XZ2_V))
local dRollBack = max( -b3Enc:getMin():getX(), dMinBackEng) + SIC_V
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
@@ -910,7 +988,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
local dNewY1min = max( EMC.LB - dDistBack, MinOther + AggLoad + EMC.HCING + EMC.HOVM)
local dNewY1max = min( ( MaxY1 - MinY1) - 5, EMC.LB - MinJoin)
if dNewY1min > dNewY1max then return nil end
local dNewY1Delta = dNewY1max
local dNewY1Delta = EgtClamp( BD.CHAR_LOAD_DIST or 3000, 0.75 * dNewY1min + 0.25 * dNewY1max, 0.25 * dNewY1min + 0.75 * dNewY1max)
local dNewY2Delta = nil
local dNewY1 = dPosT + dNewY1Delta
local vCmd = {}
@@ -1000,8 +1078,8 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
return {}
end
-- al carico si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
if EMC.LOAD then EMC.HCING = 0 end
-- al carico o con prima lavorazione di un pezzo si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
if EMC.LOAD or IsFirstMachiningOfStart( EMC.MCHID) then EMC.HCING = 0 end
return SpecAdjustCarriages( WorkTab)
@@ -2198,7 +2276,7 @@ function SpecAdjustCarrC( WorkTab)
WorkTab.dY1DeltaMaxF = EMC.LB - ( MinJoin + MyTCING)
-- se Y1 deve accentrarsi
if WorkTab.dY1DeltaI > WorkTab.dY1DeltaMaxF then
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin + MyTCING
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin - MyTCING
end
end
-- posizioni obiettivo dei carrelli al centro dei rispettivi intervalli di validità
+5 -1
View File
@@ -20,9 +20,11 @@ H11.1=Standard.nge
H11.1:MILL_NOTIP=MillNoTip.nge
H12.1=Saw.nge
H13.1=ChainSaw.nge
H16.1=Saw.nge
H21.1=Standard.nge
H21.1:MILL_NOTIP=MillNoTip.nge
H21.1:SAW_FLAT=SawH2.nge
H21.1:SAW_STD=SawH2Std.nge
H21.1:SAW_FLAT=SawH2Flat.nge
[Machinings]
Drilling=1
@@ -46,6 +48,8 @@ ExitScript=ExitMach.lua
H11=6608
; 5 axis saw
H12=6615
; Second 5 axis saw
H16=6623
; Chainsaw
H13=6616
; Second 5 axis head
+238 -44
View File
@@ -1,4 +1,4 @@
-- Descrizione macchina Essetre-PF1250 by EgalTech s.r.l. 2023/06/28
-- Descrizione macchina Essetre-PF1250 by EgalTech s.r.l. 2024/01/18
-- 2021/08/03 ver 2.3h1 Prima versione.
-- 2021/09/14 ver 2.3i9 Estesa gestione sega a catena.
-- 2021/09/15 ver 2.3i10 Correzione gestione posizione rimanenza.
@@ -25,12 +25,37 @@
-- 2023/05/09 ver 2.5e2 Correzione riposizionamento carrelli su split con pezzi a caduta.
-- 2023/05/18 ver 2.5e3 Corretta gestione TC vari.
-- 2023/06/28 ver 2.5f1 Migliorie e correzioni nel posizionamento carrelli per feature di coda lunghe (Rossini).
-- 2023/09/29 ver 2.5i1 In BeamData e mlde aggiunta la lettura di alcuni parametri da Ts3Data.
-- 2023/10/12 ver 2.5j1 Sistemazioni per testa sotto più bassa quando in home.
-- 2023/10/29 ver 2.5j2 Correzione per calcolo se V1 e V2 vanno lasciati aperti e quindi in parcheggio (GetVnToCloseTPA).
-- 2023/11/21 ver 2.5k1 Gestione lavorazione in doppio da PF1250rl
-- Gestione seconda lama da PF1250rl
-- Piccole modifiche per allineamento a PF1250rl
-- 2023/12/04 ver 2.5l1 In dinamica pinze risultati finali non più accelerazioni ma tempi rampa in ms (P7, P8 e P9 di M115).
-- 2023/12/05 ver 2.5l2 In dinamica pinze corretto typo in nomi variabili.
-- 2023/12/05 ver 2.5l3 In M111 si scrive il DeltaY (distanza testa trave - pinzaY1) come commento
-- 2023/12/05 ver 2.5l4 Corretto segno calcolo posizione seconda testa in lavorazioni in doppio
-- 2023/12/11 ver 2.5l5 Allineamento movimento in zmax come PF1250rl
-- 2024/01/18 ver 2.6a1 Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale.
-- 2024/01/22 ver 2.6a2 Modificato solido collisionee asse Z
-- Prima versione post common PF1250
-- Allineamento con common ver. 2.6a3
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.5f1'
PP_VER = '2.6a2'
MIN_MACH_VER = '2.5k1'
local sBaseDir = EgtGetSourceDir()
INFO_STD_PP = dofile( sBaseDir .. 'Version.lua')
-- prendo la versione kernel minima necessaria piu' nuova tra macchina e script comuni
if INFO_STD_PP.MIN_MACH_VER_PP_COMMON > MIN_MACH_VER then
MIN_MACH_VER = INFO_STD_PP.MIN_MACH_VER_PP_COMMON
end
EgtOutLog ( '** Essetre-PF1250 '..PP_VER..' (MinMach '.. MIN_MACH_VER ..') **', 1)
-- Parametri macchina
NumericalControl = 'TPA' -- NUM o TPA
@@ -67,6 +92,11 @@ SawOffsY = 0
SawOffsZ = -150.25
SawC1Offs = 0
SawB1Offs = 0
Saw2OffsX = -111.0
Saw2OffsY = 0
Saw2OffsZ = -150.25
Saw2C1Offs = 0
Saw2B1Offs = 0
ChSawLen = 91.0
Mill2Offs = 170.0
SawC2Offs = 0
@@ -83,7 +113,7 @@ MinB1b = -119
MaxB1b = 119
ParkX1 = 250
ParkTc2X1 = 3100
ParkZ1 = -535
ParkZ1 = -545
ParkC1 = -90
ParkB1 = -90
ParkCSawX1 = 1500
@@ -92,6 +122,9 @@ ParkCSaw0Z1 = -400
ParkCSawC1 = -90
ParkCSaw0C1 = 0
ParkCSawB1 = 0
LongTool = 400
ParkLongTc1C1 = 0
ParkLongTc2C1 = -180
MinZ1ToChangeH2 = -1400
MinX2 = -2760
MaxX2 = 0
@@ -102,9 +135,11 @@ MaxC2 = 275
MinB2 = -127
MaxB2 = 127
ParkX2 = -100
SafeX2 = -400
ParkZ2 = 0
ParkC2 = -90
ParkB2 = -90
MinDistToolX1X2 = 40
TurnerOffs = 120.0
AggLoad = 50
DeltaTabY = 2467.0
@@ -120,24 +155,35 @@ Head2Z = DeltaTabZ - Delta2TabZ
DefTcPos1 = 'T1'
DefTcPos2 = 'T30'
CoeffVM = 0.5
MinForzaPinze = 400 -- [Kgf]
MaxForzaPinze = 1000 -- [Kgf]
Tc2Active = true
SecondSaw = true
SecondChain = false -- magazzino seconda sega a catena
TcSpecialTools = false -- magarzzino per utensili speciali. In genere truciolatore
TcAggreBladeUnder = false -- lama su aggregato per testa da sotto
EmitAccClamps = true
WriteAllCoordsOnFirstM101 = true
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250.data"
local sData = EgtGetSourceDir().."\\Beam\\Ts3Data.lua"
local sDataBeam = EgtGetSourceDir().."\\Beam\\Ts3Data.lua"
local sDataWall = EgtGetSourceDir().."\\Wall\\Ts3Data.lua"
if EgtExistsFile( sTs3Data) then
EgtCopyFile( sTs3Data, sData)
EgtCopyFile( sTs3Data, sDataBeam)
EgtCopyFile( sTs3Data, sDataWall)
local sTs3DataOld = sTs3Data..'.old'
EgtEraseFile( sTs3DataOld)
EgtRenameFile( sTs3Data, sTs3DataOld)
end
if EgtExistsFile( sData) then
local Machine = dofile( sData)
if EgtExistsFile( sDataBeam) then
local Machine = dofile( sDataBeam)
if Machine then
if Machine.Offsets then
--NumericalControl = EgtIf( Machine.Offsets.TIPO_CN == 0, 'NUM', 'TPA')
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.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.PARK_Z1 then ParkZ1 = Machine.Offsets.PARK_Z1 end
@@ -149,9 +195,11 @@ if EgtExistsFile( sData) then
if Machine.Offsets.B1_POS1 then MaxB1b = Machine.Offsets.B1_POS1 end
if Machine.Offsets.X2_NEG then MinX2 = Machine.Offsets.X2_NEG end
if Machine.Offsets.X2_POS then MaxX2 = Machine.Offsets.X2_POS end
if Machine.Offsets.PARK_X2 then ParkX2 = Machine.Offsets.PARK_X2 end
if Machine.Offsets.Z2_POS then MinZ2 = -Machine.Offsets.Z2_POS end
if Machine.Offsets.Z2_NEG then MaxZ2 = -Machine.Offsets.Z2_NEG end
if Machine.Offsets.PARK_Z2 then ParkZ2 = -Machine.Offsets.PARK_Z2 end
if Machine.Offsets.PARK_Z2_INLAV then ParkInLavZ2 = -Machine.Offsets.PARK_Z2_INLAV 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
if Machine.Offsets.B2_NEG then MinB2 = Machine.Offsets.B2_NEG end
@@ -166,25 +214,34 @@ if EgtExistsFile( sData) then
if Machine.Offsets.PARK_Y2 then ParkMchY2 = Machine.Offsets.PARK_Y2 end
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.MIN_DELTAVY then MinDeltaYV = Machine.Offsets.MIN_DELTAVY + 0.1 end
if Machine.Offsets.DIST_FTZERO then LoadT = Machine.Offsets.DIST_FTZERO end
if Machine.Offsets.DELTA_CARICZERO then TurnerOffs = Machine.Offsets.DELTA_CARICZERO end
if Machine.Offsets.MIN_DELTAVY then MinDeltaYV = Machine.Offsets.MIN_DELTAVY + 0.1 end
if Machine.Offsets.DIST_UNLOAD then UnloadT = Machine.Offsets.DIST_UNLOAD end
if Machine.Offsets.PIVOT_T1 then MillOffs = Machine.Offsets.PIVOT_T1 end
if Machine.Offsets.PIVOT_T2 then Mill2Offs = Machine.Offsets.PIVOT_T2 end
if Machine.Offsets.OFFSETCLAMAT1 then SawC1Offs= Machine.Offsets.OFFSETCLAMAT1 end
if Machine.Offsets.OFFSETBLAMAT1 then SawB1Offs= Machine.Offsets.OFFSETBLAMAT1 end
if Machine.Offsets.OFFSETCLAMAT2 then SawC2Offs= Machine.Offsets.OFFSETCLAMAT2 end
if Machine.Offsets.OFFSETBLAMAT2 then SawB2Offs= Machine.Offsets.OFFSETBLAMAT2 end
if Machine.Offsets.OFFSETCLAMAT2 then Saw2C1Offs= Machine.Offsets.OFFSETCLAMAT2 end
if Machine.Offsets.OFFSETBLAMAT2 then Saw2B1Offs= Machine.Offsets.OFFSETBLAMAT2 end
if Machine.Offsets.OFFSETXT1 then DeltaTabY = -Machine.Offsets.OFFSETXT1 end
if Machine.Offsets.OFFSETZT1 then DeltaTabZ = Machine.Offsets.OFFSETZT1 + MillOffs end
if Machine.Offsets.OFFSETXT2 then Delta2TabY = Machine.Offsets.OFFSETXT2 end
if Machine.Offsets.OFFSETZT2 then Delta2TabZ = -Machine.Offsets.OFFSETZT2 - Mill2Offs end
if Machine.Offsets.OFFSETZSOTTOTRAVE then DeltaRulliTraveZ = -abs( Machine.Offsets.OFFSETZSOTTOTRAVE) end
if Machine.Offsets.OFFSETZSOTTOTRAVE then DeltaRulliTraveZ = -abs( Machine.Offsets.OFFSETZSOTTOTRAVE) end
if Machine.Offsets.SECONDSAW then SecondSaw = ( Machine.Offsets.SECONDSAW == 1) end
if Machine.Offsets.SAWOFFSX then SawOffsX = Machine.Offsets.SAWOFFSX end
if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end
if Machine.Offsets.SAW2OFFSX then Saw2OffsX = Machine.Offsets.SAW2OFFSX end
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.MINPRESS then MinForzaPinze = Machine.Offsets.MINPRESS end
if Machine.Offsets.MAXPRESS then MaxForzaPinze = Machine.Offsets.MAXPRESS end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1
ParkV1 = MaxV1
ParkV1 = MaxV1
ParkY1 = ParkV1 + MinDeltaYV
MinY2 = MinMchY2
MaxY2 = MaxV2 - MinDeltaYV
@@ -197,15 +254,18 @@ if EgtExistsFile( sData) then
end
end
end
SecondSaw = ( SecondSaw and Tc2Active)
EmtGeneral {
File='Essetre-PF1250.nge',
Offset = Vector3d(0.0,1360.0,-2130.0),
AxisMaxAdjust = 300,
AxisMaxRotAdj = 0.5,
ExitMaxAdjust = 300,
ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 80,
Special = 'Essetre-PF1250.mlse',
Processor = 'Essetre-PF1250.mlpe'}
Special = 'Common-PF1250.mlse',
Processor = 'Common-PF1250.mlpe'}
local sBaseAux = {'BASE/SOLID', 'BASE/CONVOYER', 'BASE/COLLISION', 'BASE/TC1', 'BASE/TCR', 'BASE/TC3'}
if Tc2Active then table.insert( sBaseAux, 5, 'BASE/TC2') end
local BaseId = EmtBase {
@@ -278,8 +338,8 @@ local H12Id = EmtHead {
Parent = 'B1',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d(SawOffsX,SawOffsY,SawOffsZ),
TDir = Z_AX(),
Pos = Point3d( SawOffsX, SawOffsY, SawOffsZ),
TDir = Vector3d( 0, sin( SawB1Offs), cos( SawB1Offs)),
ADir = -X_AX(),
Rot1W = 0.5,
Rot2Stroke = { MinB1b, MaxB1b},
@@ -287,9 +347,26 @@ local H12Id = EmtHead {
Geo = 'H12_HEAD/GEO'}
EgtSetInfo( H12Id, 'ZEXTRA', '160,60')
EgtSetInfo( H12Id, 'ZMAXONROT', '1,190')
-- Lama 2
if SecondSaw then
local H16Id = EmtHead {
Name = 'H16',
Parent = 'B1',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d( Saw2OffsX, Saw2OffsY, Saw2OffsZ),
TDir = Vector3d( 0, -sin( Saw2B1Offs), cos( Saw2B1Offs)),
ADir = X_AX(),
Rot1W = 0.5,
Rot2Stroke = { MinB1b, MaxB1b},
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H16_HEAD/GEO'}
EgtSetInfo( H16Id, 'ZEXTRA', '160,60')
EgtSetInfo( H16Id, 'ZMAXONROT', '1,190')
end
-- Sega a catena
EmtAxis {
Name = 'A',
Name = 'A1',
Parent = 'B1',
Token = '**',
Type = MCH_AT.ROTARY,
@@ -297,10 +374,10 @@ EmtAxis {
Pos = Point3d( 0, 0, 0),
Stroke = { 0, 270},
Home = 0,
Geo = 'A_AXIS/GEO'}
Geo = 'A1_AXIS/GEO'}
local H13Id = EmtHead {
Name = 'H13',
Parent = 'A',
Parent = 'A1',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d(0,0,-ChSawLen),
@@ -314,17 +391,6 @@ local H13Id = EmtHead {
EgtSetInfo( H13Id, 'ZEXTRA', '200')
EgtSetInfo( H13Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H13Id, 'ZMAXONROT', '1,80')
-- Dummy
EmtHead {
Name = 'H14',
Parent = 'B1',
HSet = 'H14',
Type = MCH_HT.STD,
Pos = Point3d(0,0,0),
TDir = Z_AX(),
ADir = X_AX(),
Rot1W = 0.2,
Geo = 'H14_HEAD/GEO'}
-- *** Testa 2 ***
local Z2Id = EmtAxis {
Name = 'Z2',
@@ -374,7 +440,7 @@ local B2Id = EmtAxis {
local vtMoveZ2 = Vector3d( 0, 0, Head2Z + 1181.0)
EgtMove( EgtGetFirstNameInGroup( Z2Id, 'SOLID'), vtMoveZ2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Z2Id, 'COLLISION'), vtMoveZ2, GDB_RT.GLOB)
local vtMoveX2 = Vector3d( 0, Head2Y - 3435.9, Head2Z + 1181.0)
local vtMoveX2 = Vector3d( 0, Head2Y - 3635.9, Head2Z + 1181.0)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMoveX2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMoveX2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C2Id, 'SOLID'), vtMoveX2, GDB_RT.GLOB)
@@ -595,9 +661,9 @@ if Tc2Active then
EmtTcPos {
Name = 'T12',
Parent = 'Base',
Pos = ptTc2 + 1 * vtDt2,
Pos = ptTc2 + 1 * vtDt2 + EgtIf( SecondSaw, Vector3d( -Saw2OffsX, -Saw2OffsZ, 0), V_NULL()),
TDir = -Y_AX(),
ADir = X_AX(),
ADir = -X_AX(),
Geo = 'BASE/T12'}
EmtTcPos {
Name = 'T13',
@@ -746,20 +812,37 @@ PY2LightId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( Y2Id, 'SOLID') or G
function OnSetHead()
-- se testa H11 (fresa)
if EMC.HEAD == 'H11' then
if GetTcForTopHeadTool( EMC.TCPOS) ~= 2 then
local nTc = GetTcForTopHeadTool( EMC.TCPOS)
if nTc ~= 2 then
EmtModifyAxisHome( 'X1', ParkX1)
else
EmtModifyAxisHome( 'X1', ParkTc2X1)
end
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
if EMC.TOTLEN < LongTool then
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
else
EmtModifyAxisHome( 'Z1', MaxZ1)
if nTc ~= 2 then
EmtModifyAxisStroke( 'C1', { ParkLongTc1C1 - 20, ParkLongTc1C1 + 20})
EmtModifyAxisHome( 'C1', ParkLongTc1C1)
else
EmtModifyAxisStroke( 'C1', { ParkLongTc2C1 - 20, ParkLongTc2C1 + 20})
EmtModifyAxisHome( 'C1', ParkLongTc2C1)
end
EmtModifyAxisHome( 'B1', ParkB1)
end
EmtModifyAxisDirection( 'B1', X_AX())
-- se testa H12 (lama)
elseif EMC.HEAD == 'H12' then
EmtModifyAxisHome( 'X1', ParkX1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', Vector3d( cos( SawC1Offs), -sin( SawC1Offs), 0))
-- se testa H13 (sega a catena)
elseif EMC.HEAD == 'H13' then
-- aggiustamenti per distanza
@@ -768,13 +851,22 @@ function OnSetHead()
local vtMove = Point3d( 0, 0, -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)
CSawPosA = tonumber( sVal:sub( 3) or '')
-- recupero il valore dell'asse virtuale bloccato A
local CSawPosA = GetCurrChainSawingVirtualAxis()
EmtModifyAxisHome( 'X1', ParkCSawX1)
EmtModifyAxisHome( 'Z1', GetChainSawZHomeFromVirtualAxis( CSawPosA))
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( CSawPosA))
EmtModifyAxisHome( 'B1', ParkCSawB1)
EmtModifyAxisDirection( 'B1', X_AX())
-- se testa H16 ( seconda lama)
elseif EMC.HEAD == 'H16' then
EmtModifyAxisHome( 'X1', ParkTc2X1)
EmtModifyAxisHome( 'Z1', ParkZ1)
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
EmtModifyAxisHome( 'C1', ParkC1)
EmtModifyAxisHome( 'B1', ParkB1)
EmtModifyAxisDirection( 'B1', Vector3d( cos( Saw2C1Offs), sin( Saw2C1Offs), 0))
end
end
@@ -791,6 +883,64 @@ function GetTcForTopHeadTool( sTcPos)
end
end
---------------------------------------------------------------------
function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H16' then
return 1
elseif sHead == 'H21' or sHead == 'H22' then
return 2
else
return 0
end
end
---------------------------------------------------------------------
function GetHeadSetFromTcPos( sTcPos)
local TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} -- CU montante DX
local TCPOS_1B = { 'T101'} -- CU sotto traversa
local TCPOS_1C = { 'T11', 'T12', 'T13', 'T14', 'T15'} -- CU montante sinistro
local TCPOS_2A = { 'T20', 'T21', 'T22', 'T23', 'T24', 'T25', 'T26', 'T27', 'T28', 'T29', 'T30'} -- CU margherita testa 2
local TCPOS_2B = {} -- CU lama su aggregato testa 2
for _, sVal in ipairs( TCPOS_1A) do
if sVal == sTcPos then return 1, 1 end
end
for _, sVal in ipairs( TCPOS_1B) do
if sVal == sTcPos then return 1, 2 end
end
for _, sVal in ipairs( TCPOS_1C) do
if sVal == sTcPos then return 1, 3 end
end
for _, sVal in ipairs( TCPOS_2A) do
if sVal == sTcPos then return 2, 1 end
end
for _, sVal in ipairs( TCPOS_2B) do
if sVal == sTcPos then return 2, 2 end
end
return 0, 0
end
---------------------------------------------------------------------
-- Funzione che ritorna il nome della testa in base alla posizione utensile (ATT: deve rispecchiare il setup)
function GetAdjHeadFromTcPos( nHeadSet, sTcPos)
if nHeadSet == 1 then
-- seconda lama
if SecondSaw and sTcPos == 'T12' then
return 'H16'
-- motoseghe
elseif sTcPos == 'T101' then
return 'H13'
-- utensili standard o prima lama
else
return EgtIf( sTcPos == 'T1', 'H12', 'H11')
end
elseif nHeadSet == 2 then
return 'H21'
else
return ''
end
end
---------------------------------------------------------------------
-- Funzione che riconosce testa per sega a catena
function HeadIsChainSaw( sHead)
@@ -800,10 +950,10 @@ end
---------------------------------------------------------------------
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
function GetChainSawZHomeFromVirtualAxis( dPosA)
-- se A=0 -> T101 -> HomeZ = -400
-- se A1=0 -> T101 -> HomeZ = -400
if abs( dPosA) < 0.1 then
return ParkCSaw0Z1
-- altrimenti A=-90 -> T102 o A=90 -> T104 -> HomeZ = -100
-- altrimenti A1=-90 -> T102 o A=90 -> T104 -> HomeZ = -100
else
return ParkCSawZ1
end
@@ -812,15 +962,59 @@ end
---------------------------------------------------------------------
-- Funzione che calcola l'angolo Home di C per la sega a catena dal valore dell'asse virtuale
function GetChainSawCHomeFromVirtualAxis( dPosA)
-- se A=0 -> T101 -> HomeC = 0
-- se A1=0 -> T101 -> HomeC = 0
if abs( dPosA) < 0.1 then
return ParkCSaw0C1
-- altrimenti A=90 -> T104 -> HomeC = -90
-- altrimenti A1=90 -> T104 -> HomeC = -90
else
return ParkCSawC1
end
end
---------------------------------------------------------------------
-- Funzione che calcola l'angolo Home di C per la lama su aggregato dal valore dell'asse virtuale
function GetSawCHomeFromVirtualAxis( dPosA)
-- se A2=0 -> 201 -> HomeC = -90
if abs( dPosA) < 0.1 then
return ParkSaw0C2
-- altrimenti A2=90 -> T204 -> HomeC = -90
else
return ParkSawC2
end
end
---------------------------------------------------------------------
-- Funzione che ritorna ZExtra partendo dalla testa e dall'angolo verticale
function GetZExtra( sHead, dAngV)
-- se testa standard
if sHead == 'H11' then
if abs( dAngV) < 30.1 then
return 400
elseif abs( dAngV) < 45.1 then
return 300
elseif abs( dAngV) < 60.1 then
return 200
elseif abs( dAngV) < 90.1 then
return 10
else
return 0
end
-- se aggregato lama
elseif sHead == 'H12' or sHead == 'H16' then
if abs( dAngV) < 30.1 then
return 400
elseif abs( dAngV) < 45.1 then
return 300
elseif abs( dAngV) < 60.1 then
return 200
elseif abs( dAngV) < 90.1 then
return 10
else
return 0
end
end
end
---------------------------------------------------------------------
-- Funzione per impostare spia stato morsa carrello Y1
function SetPY1Light( bClosed)
Binary file not shown.
+31 -5
View File
@@ -1,4 +1,4 @@
-- 2020/12/10
-- 2023/02/20
-- Gestione attrezzaggio per Essetre-PF1250
-- Intestazioni
@@ -29,8 +29,9 @@ local GS = {}
-- Configurazione posizioni (con o senza TC2)
local PositionTable = {}
local bTc2Active = EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2')
if bTc2Active then
local bTc2Active = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2') ~= nil)
local SecondSaw = ( EgtGetHeadId( 'H16') ~= nil)
if bTc2Active and SecondSaw then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
{Pos = "Pos3", TcPos = "T4", Head = "H11", Group = "G1"},
@@ -40,7 +41,32 @@ if bTc2Active then
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T101", Head = "H13", Group = "G2"},
{Pos = "Pos10", TcPos = "T101",Head = "H13", Group = "G2"},
{Pos = "Pos11", TcPos = "T12", Head = "H16", Group = "G3"},
{Pos = "Pos12", TcPos = "T14", Head = "H11", Group = "G3"},
{Pos = "Pos13", TcPos = "T15", Head = "H11", Group = "G3"},
{Pos = "Pos14", TcPos = "T20", Head = "H21", Group = "G4"},
{Pos = "Pos15", TcPos = "T21", Head = "H21", Group = "G4"},
{Pos = "Pos16", TcPos = "T22", Head = "H21", Group = "G4"},
{Pos = "Pos17", TcPos = "T23", Head = "H21", Group = "G4"},
{Pos = "Pos18", TcPos = "T24", Head = "H21", Group = "G4"},
{Pos = "Pos19", TcPos = "T25", Head = "H21", Group = "G4"},
{Pos = "Pos20", TcPos = "T26", Head = "H21", Group = "G4"},
{Pos = "Pos21", TcPos = "T27", Head = "H21", Group = "G4"},
{Pos = "Pos22", TcPos = "T28", Head = "H21", Group = "G4"},
{Pos = "Pos23", TcPos = "T29", Head = "H21", Group = "G4"},
{Pos = "Pos24", TcPos = "T30", Head = "H21", Group = "G4"}}
elseif bTc2Active then
PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"},
{Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"},
{Pos = "Pos3", TcPos = "T4", Head = "H11", Group = "G1"},
{Pos = "Pos4", TcPos = "T5", Head = "H11", Group = "G1"},
{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 = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T101",Head = "H13", Group = "G2"},
{Pos = "Pos11", TcPos = "T11", Head = "H11", Group = "G3"},
{Pos = "Pos12", TcPos = "T12", Head = "H11", Group = "G3"},
{Pos = "Pos13", TcPos = "T13", Head = "H11", Group = "G3"},
@@ -67,7 +93,7 @@ else
{Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T101", Head = "H13", Group = "G2"},
{Pos = "Pos10", TcPos = "T101",Head = "H13", Group = "G2"},
{Pos = "Pos11", TcPos = "T20", Head = "H21", Group = "G3"},
{Pos = "Pos12", TcPos = "T21", Head = "H21", Group = "G3"},
{Pos = "Pos13", TcPos = "T22", Head = "H21", Group = "G3"},
+20
View File
@@ -0,0 +1,20 @@
==== Common_PF1250 Update Log ====
Versione 2.6a1 (09/01/2024)
- Prima versione post-proc comune tra macchine PF1250 e PF1500
- (SIM-GEN) Corretto movimento testa 2 in ToolDesel e movimento controllo collisione
- (GEN) Tolta testa H14 per utensili speciali. Si utilizza H11 per frese standard
- (MLDE-GEN) Costanti 'MinForzaPinze' e 'MaxForzaPinze' portati in mlde/Ts3data (erano hardcoded)
- (MLDE-SIM-GEN) Aggiunto parametro 'WriteAllCoordsOnFirstM101' per decidere se stampare tutti gli assi sulla prima M101
Versione 2.6a2 (19/01/2024)
- (GEN) Corretta inversione coordinata X per Lama su aggregato da sotto
- (SIM) Se modalità 'WriteAllCoordsOnFirstM101', oltre alla X si scive quota di parcheggio assi B2 e C2 come in generazione
- (SIM-GEN) Tolta gestione rotazione pezzo (di derivazione PF), in macchina non è previsto ribaltamento
- (GEN) Migliorata gestione preselezione utensile
- (MLDE-GEN) Aggiunto flag 'EmitRapidInG0' per decidere se scrivere G0 anziché G1. Se flag a nil, scrive i rapidi in G1
Versione 2.6a3 (22/01/2024)
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra (#1630) e in generale
- (GEN) Modificato flag 'EmitRapidInG0' in 'EmitRapidInG1' per decidere se scrivere G1 anziché G0. Se flag a nil, scrive i rapidi in G0
- (SIM) Correzione movimenti pinze prima di separazione
+10
View File
@@ -0,0 +1,10 @@
-- Version.lua by EgalWare s.r.l. 2024/01/19
-- Gestione della versione dei file comuni post-processori macchine PF1250 e PF1500 di Essetre
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '2.6a3', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}
return InfoCommon_STD_PP