Files
Homag-Venture16L/Homag-Venture16L.mlde
2025-04-10 10:09:39 +02:00

592 lines
17 KiB
Plaintext

-- Descrizione macchina Homag Venture16L 2025/04/02
-- by EgalWare s.r.l.
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.7d1'
MIN_MACH_VER = '2.7a1'
-- DATI MACCHINA --
NumericalControl = 'woodWOP'
-- DATI TAVOLA --
TabX = 0
TabY = 0
TabZ = 0
----------------------------------------------------
-------------------- CORSE ASSI --------------------
----------------------------------------------------
XAxisStroke = {-250, 4330}
XAxisHome = -250
YAxisStroke = {-445, 2000}
Z1AxisStroke = {-35, 670}
CAxisStroke = {-360, 720}
AAxisStroke = {-100, 100}
Z2AxisStroke = {-25, 400}
C2AxisStroke = {0, 90}
----------------------------------------------------
-------------------- DATI TESTE --------------------
----------------------------------------------------
-- testa 5 assi
H11Pos = Vector3d( 0, 0, 0)
-- gruppo forare
H21PosX = 159.860
H21PosY = -551.890
H21PosZ = 125.000
H21Pos = H11Pos + Vector3d( H21PosX, H21PosY, H21PosZ)
-- teste gruppo forare
MDRILL = { { Pos = H21Pos + Vector3d( 0, 0, 0), Ex=1, St=60}, -- uscita 1
{ Pos = H21Pos + Vector3d( -32, 0, 0), Ex=2, St=60}, -- uscita 2
{ Pos = H21Pos + Vector3d( -64, 0, 0), Ex=3, St=60}, -- uscita 3
{ Pos = H21Pos + Vector3d( -96, 0, 0), Ex=4, St=60}, -- uscita 4
{ Pos = H21Pos + Vector3d( -128, 0, 0), Ex=5, St=60}, -- uscita 5
{ Pos = H21Pos + Vector3d( -160, 0, 0), Ex=6, St=60}, -- uscita 6
{ Pos = H21Pos + Vector3d( -192, 0, 0), Ex=7, St=60}, -- uscita 7
{ Pos = H21Pos + Vector3d( -224, 0, 0), Ex=8, St=60}, -- uscita 8
{ Pos = H21Pos + Vector3d( -256, 0, 0), Ex=9, St=60}, -- uscita 9
{ Pos = H21Pos + Vector3d( -288, 0, 0), Ex=10, St=60}, -- uscita 10
{ Pos = H21Pos + Vector3d( -320, 0, 0), Ex=11, St=60}, -- uscita 11
{ Pos = H21Pos + Vector3d( -160, 32, 0), Ex=12, St=60}, -- uscita 12
{ Pos = H21Pos + Vector3d( -160, 64, 0), Ex=13, St=60}, -- uscita 13
{ Pos = H21Pos + Vector3d( -160, 96, 0), Ex=14, St=60}, -- uscita 14
{ Pos = H21Pos + Vector3d( -160, 128, 0), Ex=15, St=60}, -- uscita 15
{ Pos = H21Pos + Vector3d( -160, 160, 0), Ex=16, St=60}, -- uscita 16
{ Pos = H21Pos + Vector3d( -160, 192, 0), Ex=17, St=60} -- uscita 17
}
-- teste rinvio su gruppo a forare
H22Pos = H21Pos + Vector3d( -64, 96, -50)
MANGTR = { { Pos = H22Pos + Vector3d( 53.5, 0, 0), Ex=1, St=90}, -- uscita 1 X+ (dir X-)
{ Pos = H22Pos + Vector3d( 0, 55.5, 0), Ex=2, St=90}, -- uscita 2 Y+ (dir Y-)
{ Pos = H22Pos + Vector3d( -53.5, 0, 0), Ex=3, St=90}, -- uscita 3 X- (dir X+)
{ Pos = H22Pos + Vector3d( 0, -55.5, 0), Ex=4, St=90} -- uscita 4 Y- (dir Y+)
}
----------------------------------------------------
----------------- DATI BANCALETTI ------------------
----------------------------------------------------
----------------------------------------------------------------------
EmtGeneral {
File='Homag-Venture16L.nge',
Offset = Vector3d( -1317.5,28.47,-826.5),
AxisMaxAdjust = 10,
ExitMaxAdjust = 20,
Special = 'Homag-Venture16L.mlse',
Processor = 'Homag-Venture16L.mlpe'}
EmtBase {
Name = 'Base',
Geo= 'BASE/GEO',
Aux= { 'BASE/SOLID'}}
-- Testa e TC
EmtAxis {
Name = 'X',
Parent = 'Base',
Token = 'X',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = XAxisStroke,
Home = XAxisHome,
Geo = 'X_AXIS/GEO',
Aux = { 'X_AXIS/SOLID', 'X_AXIS/TC'}}
EmtAxis {
Name = 'Y',
Parent = 'X',
Token = 'Y',
Type = MCH_AT.LINEAR,
Dir = Y_AX(),
Pos = Point3d(0, 0, 0),
Stroke = YAxisStroke,
Home = 2000,
Geo = 'Y_AXIS/GEO',
Aux = 'Y_AXIS/SOLID'}
EmtAxis {
Name = 'Z1',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d(0, 0, 0),
Stroke = Z1AxisStroke,
Home = 650,
Geo = 'Z1_AXIS/GEO',
Aux = 'Z1_AXIS/SOLID'}
EmtAxis {
Name = 'C',
Parent = 'Z1',
Token = 'C',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = Point3d(0, 0, 244),
Stroke = CAxisStroke,
Home = 0,
Geo = 'C_AXIS/GEO',
Aux = {'C_AXIS/SOLID'}}
EmtAxis {
Name = 'A',
Parent = 'C',
Token = 'A',
Type = MCH_AT.ROTARY,
Dir = Y_AX(),
Pos = Point3d( 0, 0, 135),
Stroke = AAxisStroke,
Home = 0,
Geo = 'A_AXIS/GEO',
Aux = {'A_AXIS/SOLID'}}
EmtHead {
Name = 'H11',
Parent = 'A',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = H11Pos,
TDir = Z_AX(),
ADir = X_AX(),
OthColl = {'C/SOLID','A/SOLID'},
Geo = 'H11_HEAD/GEO'}
EmtAxis {
Name = 'Z2',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = Z2AxisStroke,
Home = 400,
Geo = 'Z2_AXIS/GEO',
Aux = 'Z2_AXIS/SOLID'}
EmtHead {
Name = 'H21',
Parent = 'Z2',
HSet = 'H21',
Type = MCH_HT.MULTI,
SelType = MCH_SLT.MULTIEXITS,
ExitNbr = 17,
Pos1 = MDRILL[1].Pos,
TDir1 = Z_AX(),
Pos2 = MDRILL[2].Pos,
TDir2 = Z_AX(),
Pos3 = MDRILL[3].Pos,
TDir3 = Z_AX(),
Pos4 = MDRILL[4].Pos,
TDir4 = Z_AX(),
Pos5 = MDRILL[5].Pos,
TDir5 = Z_AX(),
Pos6 = MDRILL[6].Pos,
TDir6 = Z_AX(),
Pos7 = MDRILL[7].Pos,
TDir7 = Z_AX(),
Pos8 = MDRILL[8].Pos,
TDir8 = Z_AX(),
Pos9 = MDRILL[9].Pos,
TDir9 = Z_AX(),
Pos10 = MDRILL[10].Pos,
TDir10 = Z_AX(),
Pos11 = MDRILL[11].Pos,
TDir11 = Z_AX(),
Pos12 = MDRILL[12].Pos,
TDir12 = Z_AX(),
Pos13 = MDRILL[13].Pos,
TDir13 = Z_AX(),
Pos14 = MDRILL[14].Pos,
TDir14 = Z_AX(),
Pos15 = MDRILL[15].Pos,
TDir15 = Z_AX(),
Pos16 = MDRILL[16].Pos,
TDir16 = Z_AX(),
Pos17 = MDRILL[17].Pos,
TDir17 = Z_AX(),
ADir = X_AX(),
Geo = 'H21_HEAD/GEO',
Aux = {'H21_HEAD/SOLID', 'H21_HEAD/SOL_T1', 'H21_HEAD/SOL_T2', 'H21_HEAD/SOL_T3', 'H21_HEAD/SOL_T4', 'H21_HEAD/SOL_T5',
'H21_HEAD/SOL_T6', 'H21_HEAD/SOL_T7', 'H21_HEAD/SOL_T8', 'H21_HEAD/SOL_T9', 'H21_HEAD/SOL_T10', 'H21_HEAD/SOL_T11',
'H21_HEAD/SOL_T12', 'H21_HEAD/SOL_T13', 'H21_HEAD/SOL_T14', 'H21_HEAD/SOL_T15', 'H21_HEAD/SOL_T16', 'H21_HEAD/SOL_T17'}}
EmtAxis {
Name = 'C2',
Parent = 'Z2',
Token = 'C',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = H22Pos,
Stroke = C2AxisStroke,
Home = 0,
Geo = 'C2_AXIS/GEO',
Aux = {'C2_AXIS/SOLID'}}
EmtHead {
Name = 'H22',
Parent = 'C2',
HSet = 'H22',
Type = MCH_HT.MULTI,
SelType = MCH_SLT.FIXEDEXITS,
ExitNbr = 4,
Pos1 = MANGTR[1].Pos,
TDir1 = -X_AX(),
Pos2 = MANGTR[2].Pos,
TDir2 = -Y_AX(),
Pos3 = MANGTR[3].Pos,
TDir3 = X_AX(),
Pos4 = MANGTR[4].Pos,
TDir4 = Y_AX(),
ADir = Z_AX(),
Geo = 'H22_HEAD/GEO',
Aux = {'H22_HEAD/SOLID'}}
-- Tool Changer
local ptTcR = Point3d( 0, 2850, 526)
EmtTcPos {
Name = 'T1',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 0),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T1'}
EmtTcPos {
Name = 'T2',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 1),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T2'}
EmtTcPos {
Name = 'T3',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 2),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T3'}
EmtTcPos {
Name = 'T4',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 3),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T4'}
EmtTcPos {
Name = 'T5',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 4),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T5'}
EmtTcPos {
Name = 'T6',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 5),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T6'}
EmtTcPos {
Name = 'T7',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 6),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T7'}
EmtTcPos {
Name = 'T8',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 7),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T8'}
EmtTcPos {
Name = 'T9',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 8),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T9'}
EmtTcPos {
Name = 'T10',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 9),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T10'}
EmtTcPos {
Name = 'T11',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 10),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T11'}
EmtTcPos {
Name = 'T12',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 11),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T12'}
EmtTcPos {
Name = 'T13',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 12),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T13'}
EmtTcPos {
Name = 'T14',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 13),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T14'}
EmtTcPos {
Name = 'T15',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 14),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T15'}
EmtTcPos {
Name = 'T16',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 15),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T16'}
EmtTcPos {
Name = 'T17',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 16),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T17'}
EmtTcPos {
Name = 'T18',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 17),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T18'}
-- Tavola
EmtTable {
Name = 'Tab',
Parent = 'Base',
Type = MCH_TT.FLAT,
Ref1 = {TabX, TabY, TabZ},
Geo = 'TABLE/GEO',
Aux = {'TABLE/SOLID', 'TABLE/FIXED1', 'TABLE/FIXED2'}}
-- bancaletti
local PL1Id = EmtAxis {
Name = 'PL1',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {80, 2755},
Home = 100,
Geo = 'PL1_AXIS/GEO',
Aux = {'PL1_AXIS/SOLID'}}
EgtSetInfo( PL1Id, 'MDist', 100)
EgtSetInfo( PL1Id, 'PDist', 100)
EgtSetInfo( PL1Id, 'Next', 'PL2')
EgtMove( PL1Id, Vector3d( -100, 0, 0), GDB_RT.GLOB)
local PL2Id = EmtAxis {
Name = 'PL2',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {280, 2955},
Home = 300,
Geo = 'PL2_AXIS/GEO',
Aux = {'PL2_AXIS/SOLID'}}
EgtSetInfo( PL2Id, 'MDist', 100)
EgtSetInfo( PL2Id, 'PDist', 100)
EgtSetInfo( PL2Id, 'Prev', 'PL1')
EgtSetInfo( PL2Id, 'Next', 'PL3')
EgtMove( PL2Id, Vector3d( -300, 0, 0), GDB_RT.GLOB)
local PL3Id = EmtAxis {
Name = 'PL3',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {480, 3155},
Home = 500,
Geo = 'PL3_AXIS/GEO',
Aux = {'PL3_AXIS/SOLID'}}
EgtSetInfo( PL3Id, 'MDist', 100)
EgtSetInfo( PL3Id, 'PDist', 100)
EgtSetInfo( PL3Id, 'Prev', 'PL2')
EgtSetInfo( PL3Id, 'Next', 'PL4')
EgtMove( PL3Id, Vector3d( -500, 0, 0), GDB_RT.GLOB)
local PL4Id = EmtAxis {
Name = 'PL4',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {680, 3355},
Home = 700,
Geo = 'PL4_AXIS/GEO',
Aux = {'PL4_AXIS/SOLID'}}
EgtSetInfo( PL4Id, 'MDist', 100)
EgtSetInfo( PL4Id, 'PDist', 100)
EgtSetInfo( PL4Id, 'Prev', 'PL3')
EgtSetInfo( PL4Id, 'Next', 'PL5')
EgtMove( PL4Id, Vector3d( -700, 0, 0), GDB_RT.GLOB)
local PL5Id = EmtAxis {
Name = 'PL5',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {880, 3555},
Home = 3535,
Geo = 'PL5_AXIS/GEO',
Aux = {'PL5_AXIS/SOLID'}}
EgtSetInfo( PL5Id, 'MDist', 100)
EgtSetInfo( PL5Id, 'PDist', 100)
EgtSetInfo( PL5Id, 'Prev', 'PL4')
EgtSetInfo( PL5Id, 'Next', 'PL6')
EgtMove( PL5Id, Vector3d( -900, 0, 0), GDB_RT.GLOB)
local PL6Id = EmtAxis {
Name = 'PL6',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {1080, 3755},
Home = 3735,
Geo = 'PL6_AXIS/GEO',
Aux = {'PL6_AXIS/SOLID'}}
EgtSetInfo( PL6Id, 'MDist', 100)
EgtSetInfo( PL6Id, 'PDist', 100)
EgtSetInfo( PL6Id, 'Prev', 'PL5')
EgtSetInfo( PL6Id, 'Next', 'PL7')
EgtMove( PL6Id, Vector3d( -1100, 0, 0), GDB_RT.GLOB)
local PL7Id = EmtAxis {
Name = 'PL7',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {1280, 3955},
Home = 3935,
Geo = 'PL7_AXIS/GEO',
Aux = {'PL7_AXIS/SOLID'}}
EgtSetInfo( PL7Id, 'MDist', 100)
EgtSetInfo( PL7Id, 'PDist', 100)
EgtSetInfo( PL7Id, 'Prev', 'PL6')
EgtSetInfo( PL7Id, 'Next', 'PL8')
EgtMove( PL7Id, Vector3d( -1300, 0, 0), GDB_RT.GLOB)
local PL8Id = EmtAxis {
Name = 'PL8',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {1480, 4155},
Home = 4135,
Geo = 'PL8_AXIS/GEO',
Aux = {'PL8_AXIS/SOLID'}}
EgtSetInfo( PL8Id, 'MDist', 100)
EgtSetInfo( PL8Id, 'PDist', 100)
EgtSetInfo( PL8Id, 'Prev', 'PL7')
EgtMove( PL8Id, Vector3d( -1500, 0, 0), GDB_RT.GLOB)
---------------------------------------------------------------------
-- Funzioni richiamate per modificare i dati macchina in casi particolari
---------------------------------------------------------------------
function OnSetTable()
EgtSetTableAreaOffset( 100, 100, 100, 100)
end
---------------------------------------------------------------------
local function MoveGroup( nGrpId, vtVers, dPos, bLoc)
local dVal = EgtGetInfo( nGrpId, 'Val')
if not dVal then return end
if abs( dPos - dVal) > GEO.EPS_SMALL then
local nRT = EgtIf( bLoc, GDB_RT.LOC, GDB_RT.GLOB)
EgtMove( nGrpId, ( dPos - dVal) * vtVers, nRT)
EgtSetInfo( nGrpId, 'Val', dPos)
end
end
---------------------------------------------------------------------
function OnActivateDrillingUnit()
-- assegno dati testa
local nHeadId = EMC.HEADID
-- sistemo dati uscite attive
local vbExit = {}
for i = 1, #( EMC.DRACEX or {}) do
vbExit[EMC.DRACEX[i]] = true
end
-- ciclo su tutte le uscite della testa
for nExit = 1, #MDRILL do
-- eventuale gemello
local nTwin = MDRILL[nExit].Tw or 0
-- nome e identificativo della geometria dell'uscita
local sExit = 'T' .. EgtNumToString( nExit, 0)
local nExitId = EgtGetFirstNameInGroup( nHeadId, sExit)
-- recupero la geometria associata all'uscita
local sStem = 'SOL_' .. sExit
local nStemId = EgtGetFirstNameInGroup( nHeadId, sStem)
-- determino la posizione
local dPos = EgtIf( vbExit[nExit] or vbExit[nTwin], 0, MDRILL[nExit].St)
-- eseguo posizionamento
if nStemId then
MoveGroup( nStemId, Z_AX(), dPos)
end
MoveGroup( nExitId, Z_AX(), dPos)
end
end
---------------------------------------------------------------------
function OnActivateAngTransm()
-- assegno dati testa
local nHeadId = EMC.HEADID
-- determino la posizione
local dPos = EgtIf( EMC.ACTIVE, 0, MANGTR[1].St)
local nSolidId = EgtGetFirstNameInGroup( nHeadId, 'SOLID')
if nSolidId then
MoveGroup( nSolidId, Z_AX(), dPos)
end
-- ciclo su tutte le uscite della testa
for nExit = 1, #MANGTR do
-- nome e identificativo della geometria dell'uscita
local sExit = 'T' .. EgtNumToString( nExit, 0)
local nExitId = EgtGetFirstNameInGroup( nHeadId, sExit)
-- eseguo posizionamento
MoveGroup( nExitId, Z_AX(), dPos)
end
end
---------------------------------------------------------------------
function OnSetHead()
EMC.HEADID = EgtGetHeadId( 'H21')
EMC.DRACEX = nil
OnActivateDrillingUnit()
EMC.HEADID = EgtGetHeadId( 'H22')
EMC.ACTIVE = ( EMC.HEAD == 'H22')
OnActivateAngTransm()
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine()
EmtUnlinkAllRawPartsFromGroups()
EmtUnlinkAllFixturesFromGroups()
-- nascondo Vmill
local nRawId = EgtGetFirstRawPart()
while nRawId do
local nVmId = EgtGetFirstNameInGroup( nRawId, 'VMill')
local nId = EgtGetFirstInGroup( nRawId)
while nId do
EgtSetStatus( nId, EgtIf( nId ~= nVmId, GDB_ST.ON, GDB_ST.OFF))
nId = EgtGetNext( nId)
end
nRawId = EgtGetNextRawPart( nRawId)
end
EgtSetStatus( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill') or GDB_ID.NULL, GDB_ST.OFF)
end