Aggiunta gestione motosega opzionale
This commit is contained in:
@@ -12,6 +12,10 @@ local TEST_USE = false
|
||||
-- *** GENERATION ***
|
||||
---------------------------------------------------------------------
|
||||
function OnStart()
|
||||
-- controllo versione programma
|
||||
if not EMT.VER or EMT.VER < '2.5d1' then
|
||||
EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel 2.5d1)')
|
||||
end
|
||||
EMT.USETO1 = false -- abilitazione uso origine tavola
|
||||
EMT.MODAL = true -- abilitazione emissione modale
|
||||
EMT.INCHES = false -- unità di misura mm/inches
|
||||
@@ -109,8 +113,9 @@ function OnToolData()
|
||||
EmtOutput( sOut)
|
||||
-- emissione dati sega a catena
|
||||
elseif EMT.HEAD == 'H3' then
|
||||
local sData = ' P2=' .. EmtLenToString( ChSawLen, 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ChSawLen, 3)
|
||||
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
|
||||
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
|
||||
EmtOutput( 'M992 P1=101' .. sData)
|
||||
EmtOutput( 'M992 P1=102' .. sData)
|
||||
EmtOutput( 'M992 P1=103' .. sData)
|
||||
@@ -203,6 +208,8 @@ function OnToolSelect()
|
||||
EMT.TTOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
|
||||
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
if MCH_TP.DIST then EMT.TDIST = EgtTdbGetCurrToolParam( MCH_TP.DIST) end
|
||||
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -548,7 +555,7 @@ function MyAdjustLinearAxes()
|
||||
local vtTool = EgtGetCalcToolDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
|
||||
vtE = vtTool * Len - Z_AX() * LenRef
|
||||
elseif EMT.HEAD == 'H3' then
|
||||
local Len = ChSawLen + MillOffs
|
||||
local Len = ( EMT.TDIST or ChSawLen) + MillOffs
|
||||
local LenRef = MillOffs
|
||||
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
|
||||
vtE = vtAux * Len - Z_AX() * LenRef
|
||||
|
||||
@@ -25,6 +25,10 @@ local COLL_SAFE_DIST = 2
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulStart()
|
||||
-- controllo versione programma
|
||||
if not EMT.VER or EMT.VER < '2.5d1' then
|
||||
EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel 2.5d1)')
|
||||
end
|
||||
-- Carico gli utensili sulle barre portautensili
|
||||
local vTcPos = EgtGetAllTcPosNames()
|
||||
if vTcPos then
|
||||
@@ -155,7 +159,7 @@ function OnSimulDispositionStart()
|
||||
end
|
||||
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
|
||||
-- imposto eventuale utensile corrente
|
||||
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -218,7 +222,7 @@ function OnSimulToolSelect()
|
||||
ShowToolInTcPos( EMT.TCPOS, false)
|
||||
end
|
||||
-- se attivo Vmill
|
||||
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||
-- se attivo Collision Check
|
||||
EMT.SAFEDIST = COLL_SAFE_DIST
|
||||
if EMT.COLLOBJ then
|
||||
|
||||
+55
-33
@@ -8,8 +8,8 @@
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.6l2'
|
||||
PP_NVER = '2.6.12.2'
|
||||
PP_VER = '2.7g1'
|
||||
PP_NVER = '2.7.7.1'
|
||||
|
||||
-- Parametri macchina
|
||||
NumericalControl = 'TPA' -- NUM o TPA
|
||||
@@ -24,6 +24,7 @@ MaxB = 120.0
|
||||
MinC = -360.0
|
||||
MaxC = 360.0
|
||||
MillOffs = 92.5
|
||||
ChainSaw = 0
|
||||
SawOffsX = 0.0
|
||||
SawOffsY = 111.0
|
||||
SawOffsZ = -150.0
|
||||
@@ -76,6 +77,7 @@ if EgtExistsFile( sData) then
|
||||
if MchOffs.ZERO_Y then DeltaTabX = -MchOffs.ZERO_Y end
|
||||
if MchOffs.ZERO_X then DeltaTabY = MchOffs.ZERO_X - DimTabY end
|
||||
if MchOffs.ZERO_Z then DeltaTabZ = MchOffs.ZERO_Z + MillOffs end
|
||||
ChainSaw = ( MchOffs.CHAIN_SAW or 0)
|
||||
Nail11 = ( MchOffs.NAIL11 or 0)
|
||||
if Nail11 ~= 0 and MchOffs.ZERO_Y and MchOffs.ZERO_NAIL11_Y then Nail11DeltaX = - ( MchOffs.ZERO_Y - MchOffs.ZERO_NAIL11_Y) end
|
||||
if Nail11 ~= 0 and MchOffs.ZERO_X and MchOffs.ZERO_NAIL11_X then Nail11DeltaY = ( MchOffs.ZERO_X - MchOffs.ZERO_NAIL11_X) end
|
||||
@@ -229,31 +231,33 @@ local H2Id = EmtHead {
|
||||
Geo = 'H2_HEAD/GEO'}
|
||||
EgtSetInfo( H2Id, 'Gearbox', 1)
|
||||
-- Sega a catena
|
||||
--EmtAxis {
|
||||
-- Name = 'A1',
|
||||
-- Parent = 'B1',
|
||||
-- Token = '**',
|
||||
-- Type = MCH_AT.ROTARY,
|
||||
-- Dir = Z_AX(),
|
||||
-- Pos = Point3d( 0, 0, 0),
|
||||
-- Stroke = { 0, 270},
|
||||
-- Home = 180,
|
||||
-- Geo = 'A1_AXIS/GEO'}
|
||||
--local H3Id = EmtHead {
|
||||
-- Name = 'H3',
|
||||
-- Parent = 'A1',
|
||||
-- HSet = 'H1',
|
||||
-- Type = MCH_HT.STD,
|
||||
-- Pos = Point3d( 0, 0, -ChSawLen),
|
||||
-- TDir = Y_AX(),
|
||||
-- ADir = Z_AX(),
|
||||
-- Rot1W = 0.1,
|
||||
-- SolCh = MCH_SCC.ADIR_NEAR,
|
||||
-- OthColl = {'B1/SOLID', 'C1/SOLID'},
|
||||
-- Geo = 'H3_HEAD/GEO'}
|
||||
-- EgtSetInfo( H3Id, 'ZSAFEDELTA', 60)
|
||||
if ChainSaw ~= 0 then
|
||||
EmtAxis {
|
||||
Name = 'A1',
|
||||
Parent = 'B',
|
||||
Token = '**',
|
||||
Type = MCH_AT.ROTARY,
|
||||
Dir = Z_AX(),
|
||||
Pos = Point3d( 0, 0, 0),
|
||||
Stroke = { 0, 270},
|
||||
Home = 180,
|
||||
Geo = 'A_AXIS/GEO'}
|
||||
local H3Id = EmtHead {
|
||||
Name = 'H3',
|
||||
Parent = 'A1',
|
||||
HSet = 'H1',
|
||||
Type = MCH_HT.STD,
|
||||
Pos = Point3d( 0, 0, -ChSawLen),
|
||||
TDir = -X_AX(),
|
||||
ADir = Z_AX(),
|
||||
Rot1W = 0.1,
|
||||
SolCh = MCH_SCC.ADIR_NEAR,
|
||||
OthColl = {'B/SOLID', 'C/SOLID'},
|
||||
Geo = 'H3_HEAD/GEO'}
|
||||
EgtSetInfo( H3Id, 'ZSAFEDELTA', 60)
|
||||
end
|
||||
-- ToolChanger
|
||||
local ptTc1 = Point3d( -192.0 + ( DeltaTabX - 970.0), -3407.9 + ( DeltaTabY + 4410.0), -733.5 + ( DeltaTabZ + 593.5))
|
||||
local ptTc1 = Point3d( -192.0 + ( DeltaTabX - 970.0), -3407.9 + ( DeltaTabY + 4410.0), -733.5 + ( DeltaTabZ + 593.5)-80)
|
||||
local ptTc = ptTc1 + 22 * Z_AX()
|
||||
EmtTcPos {
|
||||
Name = 'T1',
|
||||
@@ -304,13 +308,23 @@ EmtTcPos {
|
||||
TDir = Z_AX(),
|
||||
ADir = X_AX(),
|
||||
Geo = 'BASE/T7'}
|
||||
EmtTcPos {
|
||||
Name = 'T8',
|
||||
Parent = 'Base',
|
||||
Pos = ptTc + 1800 * Y_AX(),
|
||||
TDir = Z_AX(),
|
||||
ADir = X_AX(),
|
||||
Geo = 'BASE/T8'}
|
||||
if ChainSaw ~= 0 then
|
||||
EmtTcPos {
|
||||
Name = 'T8',
|
||||
Parent = 'Base',
|
||||
Pos = ptTc + 1800 * Y_AX() - ChSawLen * Z_AX(),
|
||||
TDir = -X_AX(),
|
||||
ADir = Z_AX(),
|
||||
Geo = 'BASE/T8CS'}
|
||||
else
|
||||
EmtTcPos {
|
||||
Name = 'T8',
|
||||
Parent = 'Base',
|
||||
Pos = ptTc + 1800 * Y_AX(),
|
||||
TDir = Z_AX(),
|
||||
ADir = X_AX(),
|
||||
Geo = 'BASE/T8'}
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzioni richiamate per modificare i dati macchina in casi particolari
|
||||
@@ -344,6 +358,14 @@ function OnSetHead()
|
||||
EmtModifyAxisHome( 'B', 90)
|
||||
EgtResetAxisPos( 'B')
|
||||
else
|
||||
if EMC.HEAD == 'H3' then
|
||||
-- aggiustamenti per distanza da naso mandrino
|
||||
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
|
||||
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -dDist))
|
||||
local vtMove = Point3d( 0, 0, -dDist) - Point3d( EMC.EXITPOS)
|
||||
local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT))
|
||||
EgtMove( ExitId, vtMove)
|
||||
end
|
||||
EmtModifyAxisHome( 'B', 0)
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
+7
-3
@@ -27,6 +27,11 @@ local POS = "Pos"
|
||||
-- Geom Set
|
||||
local GS = {}
|
||||
|
||||
-- Flag presenza sega a catena e chiodatrici/graffettatrici
|
||||
local bChainSaw = ( EgtGetHeadId( 'H3') ~= nil)
|
||||
local bNail11 = ( EgtGetHeadId( 'H11') ~= nil)
|
||||
local bNail12 = ( EgtGetHeadId( 'H12') ~= nil)
|
||||
|
||||
-- Configurazione posizioni
|
||||
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H2", Group = "G1"},
|
||||
{Pos = "Pos2", TcPos = "T2", Head = "H1", Group = "G1"},
|
||||
@@ -35,9 +40,8 @@ local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H2", Group = "G1"},
|
||||
{Pos = "Pos5", TcPos = "T5", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos6", TcPos = "T6", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos7", TcPos = "T7", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos8", TcPos = "T8", Head = "H1", Group = "G1"}}
|
||||
local bNail11 = ( EgtGetHeadId( 'H11') ~= nil)
|
||||
local bNail12 = ( EgtGetHeadId( 'H12') ~= nil)
|
||||
{Pos = "Pos8", TcPos = "T8", Head = EgtIf( bChainSaw, "H3", "H1"), Group = EgtIf( bChainSaw, "G3", "G1")}}
|
||||
|
||||
if bNail11 then
|
||||
table.insert( PositionTable, {Pos = "Pos9", TcPos = "T11", Head = "H11", Group = "G2"})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user