Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cfb454523 | |||
| bebe55b5a4 | |||
| ef1b08789e | |||
| e255118351 | |||
| 9673b21d05 | |||
| 20274fcfcd | |||
| c3c099db63 | |||
| 7214e4bd7d | |||
| 41bdfa5394 | |||
| b098b3620e | |||
| 8d116f7987 | |||
| 164097fe52 | |||
| 9cc0cdd379 | |||
| a8532d4c97 | |||
| cb9839b266 | |||
| 3c329adb0f | |||
| 05f4d9ab4c | |||
| 51c596ae82 | |||
| ae7be91567 | |||
| 232ffb4714 | |||
| 47b294fba4 | |||
| c8e322fbc9 | |||
| a4898227eb | |||
| d5fb783672 | |||
| 9321e8bc1f | |||
| 5ac91ab90e | |||
| dfbe14eb9f |
@@ -15,3 +15,4 @@
|
||||
/Wall/PocketingData.lua
|
||||
/Wall/SawingData.lua
|
||||
/Wall/Ts3Data.lua
|
||||
.vscode/settings.json
|
||||
|
||||
+31
-6
@@ -1,4 +1,4 @@
|
||||
-- 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')
|
||||
@@ -53,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
|
||||
@@ -78,11 +78,9 @@ local BeamData = {
|
||||
---------------------------------------------------------------------
|
||||
-- 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'
|
||||
local sDataBeam = EgtGetCurrMachineDir().."\\Beam\\Ts3Data.lua"
|
||||
if EgtExistsFile( sTs3Data) then
|
||||
EgtCopyFile( sTs3Data, sDataBeam)
|
||||
EgtCopyFile( sTs3Data, sDataWall)
|
||||
local sTs3DataOld = sTs3Data..'.old'
|
||||
EgtEraseFile( sTs3DataOld)
|
||||
EgtRenameFile( sTs3Data, sTs3DataOld)
|
||||
@@ -177,6 +175,33 @@ local function GetMinUnloadableRaw( dW, dH)
|
||||
end
|
||||
BeamData.GetMinUnloadableRaw = GetMinUnloadableRaw
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetBlockedAxis( sHead, nToolType, sBlockedAxis)
|
||||
-- lama
|
||||
if nToolType == MCH_TY.SAW_STD or nToolType == MCH_TY.SAW_FLAT then
|
||||
return ''
|
||||
-- sega a catena
|
||||
elseif nToolType == MCH_TY.MORTISE_STD then
|
||||
if sHead == 'H13' then
|
||||
if sBlockedAxis == 'parallel' then
|
||||
return 'A1=0'
|
||||
elseif sBlockedAxis == 'perpendicular' then
|
||||
return 'A1=90'
|
||||
end
|
||||
else
|
||||
return ''
|
||||
end
|
||||
-- fresa
|
||||
elseif nToolType == MCH_TY.MILL_STD or nToolType == MCH_TY.MILL_NOTIP then
|
||||
return ''
|
||||
-- punta
|
||||
elseif nToolType == MCH_TY.DRILL_STD or nToolType == MCH_TY.DRILL_LONG then
|
||||
return ''
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
BeamData.GetBlockedAxis = GetBlockedAxis
|
||||
---------------------------------------------------------------------
|
||||
|
||||
return BeamData
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,120 @@
|
||||
-- Special Operations macchina Essetre-PF1250 by EgalTech s.r.l. 2023/11/21
|
||||
-- Special Operations macchina Essetre-PF1250 by Egalware s.r.l. 2024/01/22
|
||||
-- Intestazioni
|
||||
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
-- Carico i dati globali
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
local BD = dofile( sBaseDir .. 'Beam\\BeamData.lua')
|
||||
-- Carico libreria
|
||||
local BD = require( 'BeamData')
|
||||
|
||||
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 +123,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 +252,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 +503,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 +684,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 +764,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 +798,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 +865,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 +987,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 +1077,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)
|
||||
|
||||
@@ -2065,8 +2142,8 @@ function SpecAdjustCarrB1( WorkTab)
|
||||
if not SpecTestSomeMoveInCmds( vCmd) then
|
||||
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
|
||||
end
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
-- imposto i nuovi parametri di aggancio
|
||||
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
|
||||
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
|
||||
@@ -2137,8 +2214,8 @@ function SpecAdjustCarrB2( WorkTab)
|
||||
if not SpecTestSomeMoveInCmds( vCmd) then
|
||||
table.insert( vCmd, { 3, 'Y1', dY1PosI, 'Y2', dY2PosI, 'T', WorkTab.dTPosI, EMC.CNT})
|
||||
end
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
table.insert( vCmd, { 12, 1}) -- Chiudo Y2
|
||||
table.insert( vCmd, { 11, 1}) -- chiudo Y1
|
||||
-- imposto i nuovi parametri di aggancio
|
||||
table.insert( vCmd, { 21, dY1DeltaF, dY2DeltaF})
|
||||
EgtOutLog( ' Y1DeltaF=' .. EgtNumToString( dY1DeltaF) .. ' Y2DeltaF=' .. EgtNumToString( dY2DeltaF), 1)
|
||||
@@ -2198,7 +2275,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à
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
|
||||
REM Compilazione degli script macchina Egaltech 2024.02.22
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 bit e copia file da non compilare
|
||||
|
||||
@echo off
|
||||
|
||||
REM chiedo all'utente la versione da assegnare alla macchina da compilare
|
||||
set /p "machineVersion=Inserisci versione: "
|
||||
|
||||
REM variabili per costruire i percorsi delle cartelle
|
||||
set "machineName=Essetre-PF1250"
|
||||
set "deployFolder=C:\MachinesDeploy"
|
||||
set "machinePath=%deployFolder%\%machineName%\"
|
||||
set "fullPathSource=%deployFolder%\%machineName%\%machineVersion%\%machineName%"
|
||||
set "fullPathZip=%deployFolder%\%machineName%\%machineVersion%"
|
||||
|
||||
REM elimino eventuale cartella esistente
|
||||
rmdir /s /Q %fullPathZip%
|
||||
|
||||
REM copio i sorgenti nel percorso di destinazione
|
||||
ROBOCOPY . %fullPathSource%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
|
||||
REM copio i sorgenti nel percorso temporaneo per i compilati
|
||||
ROBOCOPY . %fullPathSource%\bin\%machineName%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
|
||||
|
||||
REM copio i file compilati nel percorso temporaneo per i compilati
|
||||
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-PF1250.mlpe Common-PF1250.mlpe
|
||||
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-PF1250.mlse Common-PF1250.mlse
|
||||
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-PF1250.TPA.mlpe Common-PF1250.TPA.mlpe
|
||||
|
||||
REM comprimo i file compilati in uno zip pronto per essere distribuito
|
||||
tar.exe acvf %fullPathZip%\%machineName%.zip -C %fullPathSource%\bin\ %machineName%\*.*
|
||||
|
||||
REM elimino il percorso temporaneo
|
||||
rmdir /s /Q %fullPathSource%\bin\
|
||||
+192
-20
@@ -1,4 +1,4 @@
|
||||
-- Descrizione macchina Essetre-PF1250 by EgalTech s.r.l. 2023/12/05
|
||||
-- Descrizione macchina Essetre-PF1250 by Egalware s.r.l. 2024/02/07
|
||||
-- 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.
|
||||
@@ -33,14 +33,40 @@
|
||||
-- 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
|
||||
-- 2024/01/25 ver 2.6a3 Allineamento con common ver. 2.6a4
|
||||
-- 2024/02/07 ver 2.6b1 Allineamento con common ver. 2.6b1
|
||||
-- 2024/02/07 ver 2.6b2 Gestione motosega lunga in MLDE e nuova funzione calcolo asse A per nuovi script
|
||||
-- 2024/02/09 ver 2.6b3 In BeamData aggiunta funzione GetBlockedAxis che sostituisce la GetChainSawBlockedAxis.
|
||||
-- 2024/02/23 ver 2.6b4 Allineamento con common ver. 2.6b4; in mlde aggiunte chiamate EgtAddToPackagePath
|
||||
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.5l1'
|
||||
PP_VER = '2.6b4'
|
||||
MIN_MACH_VER = '2.5k1'
|
||||
|
||||
-- Carico i dati globali
|
||||
local sMachDir = EgtGetCurrMachineDir()
|
||||
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
|
||||
EgtRemoveBaseMachineDirFromPackagePath()
|
||||
EgtAddToPackagePath( sMachDir .. '\\Beam\\?.lua')
|
||||
EgtAddToPackagePath( sMachDir .. '\\?.lua')
|
||||
INFO_STD_PP = require( 'Version')
|
||||
-- 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
|
||||
@@ -98,7 +124,7 @@ MinB1b = -119
|
||||
MaxB1b = 119
|
||||
ParkX1 = 250
|
||||
ParkTc2X1 = 3100
|
||||
ParkZ1 = -535
|
||||
ParkZ1 = -545
|
||||
ParkC1 = -90
|
||||
ParkB1 = -90
|
||||
ParkCSawX1 = 1500
|
||||
@@ -107,6 +133,10 @@ ParkCSaw0Z1 = -400
|
||||
ParkCSawC1 = -90
|
||||
ParkCSaw0C1 = 0
|
||||
ParkCSawB1 = 0
|
||||
MinLengthLongCSaw = 580 -- gestione speciale per motosega molto lunga. Lunghezza al di sopra della quale è considerata motosega lunga
|
||||
ParkLongCSawZ1 = -50 -- gestione speciale per motosega molto lunga. Parcheggio asse Z
|
||||
ParkLongCSawC1 = 0 -- gestione speciale per motosega molto lunga. Parcheggio asse C
|
||||
ParkLongCSawB1 = -90 -- gestione speciale per motosega molto lunga. Parcheggio asse B
|
||||
LongTool = 400
|
||||
ParkLongTc1C1 = 0
|
||||
ParkLongTc2C1 = -180
|
||||
@@ -120,6 +150,7 @@ MaxC2 = 275
|
||||
MinB2 = -127
|
||||
MaxB2 = 127
|
||||
ParkX2 = -100
|
||||
SafeX2 = -400
|
||||
ParkZ2 = 0
|
||||
ParkC2 = -90
|
||||
ParkB2 = -90
|
||||
@@ -139,13 +170,20 @@ 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 sDataBeam = EgtGetSourceDir().."\\Beam\\Ts3Data.lua"
|
||||
local sDataWall = EgtGetSourceDir().."\\Wall\\Ts3Data.lua"
|
||||
local sDataBeam = sMachDir.."\\Beam\\Ts3Data.lua"
|
||||
local sDataWall = sMachDir.."\\Wall\\Ts3Data.lua"
|
||||
if EgtExistsFile( sTs3Data) then
|
||||
EgtCopyFile( sTs3Data, sDataBeam)
|
||||
EgtCopyFile( sTs3Data, sDataWall)
|
||||
@@ -160,6 +198,7 @@ if EgtExistsFile( sDataBeam) 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
|
||||
@@ -171,9 +210,11 @@ if EgtExistsFile( sDataBeam) 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
|
||||
@@ -210,6 +251,8 @@ if EgtExistsFile( sDataBeam) then
|
||||
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
|
||||
@@ -236,8 +279,8 @@ EmtGeneral {
|
||||
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 {
|
||||
@@ -338,7 +381,7 @@ if SecondSaw then
|
||||
end
|
||||
-- Sega a catena
|
||||
EmtAxis {
|
||||
Name = 'A',
|
||||
Name = 'A1',
|
||||
Parent = 'B1',
|
||||
Token = '**',
|
||||
Type = MCH_AT.ROTARY,
|
||||
@@ -346,10 +389,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),
|
||||
@@ -819,18 +862,18 @@ function OnSetHead()
|
||||
elseif EMC.HEAD == 'H13' then
|
||||
-- aggiustamenti per distanza
|
||||
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
|
||||
EMC.EXIT = EMC.EXIT or 1
|
||||
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)
|
||||
-- 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))
|
||||
EmtModifyAxisHome( 'Z1', GetChainSawZHomeFromVirtualAxis( CSawPosA, EMC.TOTLEN))
|
||||
EmtModifyAxisStroke( 'C1', {MinC1, MaxC1})
|
||||
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( CSawPosA))
|
||||
EmtModifyAxisHome( 'B1', ParkCSawB1)
|
||||
EmtModifyAxisHome( 'C1', GetChainSawCHomeFromVirtualAxis( CSawPosA, EMC.TOTLEN))
|
||||
EmtModifyAxisHome( 'B1', EgtIf( EMC.TOTLEN < MinLengthLongCSaw, ParkCSawB1, ParkLongCSawB1))
|
||||
EmtModifyAxisDirection( 'B1', X_AX())
|
||||
-- se testa H16 ( seconda lama)
|
||||
elseif EMC.HEAD == 'H16' then
|
||||
@@ -856,33 +899,162 @@ 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)
|
||||
return ( sHead == 'H13' or sHead == 'H15')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetCurrChainSawingVirtualAxis()
|
||||
-- recupero il valore dell'asse virtuale bloccato A
|
||||
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS)
|
||||
if not sVal or sVal == '' then
|
||||
if EMC then
|
||||
sVal = EMC.BLOCKEDAXIS or 'A1=0'
|
||||
else
|
||||
sVal = 'A1=0'
|
||||
end
|
||||
end
|
||||
local dPosA = tonumber( sVal:sub( 4)) or 0
|
||||
return dPosA
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione che calcola la posizione Home di Z per la sega a catena dal valore dell'asse virtuale
|
||||
function GetChainSawZHomeFromVirtualAxis( dPosA)
|
||||
function GetChainSawZHomeFromVirtualAxis( dPosA, dCSawLength)
|
||||
-- se A=0 -> T101 -> HomeZ = -400
|
||||
if abs( dPosA) < 0.1 then
|
||||
if dCSawLength >= MinLengthLongCSaw then
|
||||
EmtSetLastError( 1200, 'ChainSaw too long: orientation forbidden')
|
||||
end
|
||||
return ParkCSaw0Z1
|
||||
-- altrimenti A=-90 -> T102 o A=90 -> T104 -> HomeZ = -100
|
||||
else
|
||||
return ParkCSawZ1
|
||||
if dCSawLength >= MinLengthLongCSaw then
|
||||
return ParkLongCSawZ1
|
||||
else
|
||||
return ParkCSawZ1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione che calcola l'angolo Home di C per la sega a catena dal valore dell'asse virtuale
|
||||
function GetChainSawCHomeFromVirtualAxis( dPosA)
|
||||
---------------------------------------------------------------------
|
||||
function GetChainSawCHomeFromVirtualAxis( dPosA, dCSawLength)
|
||||
-- se A=0 -> T101 -> HomeC = 0
|
||||
if abs( dPosA) < 0.1 then
|
||||
return ParkCSaw0C1
|
||||
-- altrimenti A=90 -> T104 -> HomeC = -90
|
||||
else
|
||||
return ParkCSawC1
|
||||
if dCSawLength >= MinLengthLongCSaw then
|
||||
return ParkLongCSawC1
|
||||
else
|
||||
return ParkCSawC1
|
||||
end
|
||||
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
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,44 @@
|
||||
==== Common_PF1250 Update Log ====
|
||||
|
||||
Versione 2.6b4 (23/02/2024)
|
||||
- (MLDE-SIM-GEN) EgtAddToPackagePath spostato in mlde
|
||||
|
||||
Versione 2.6b3 (20/02/2024)
|
||||
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
|
||||
- (SIM-GEN) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
|
||||
|
||||
Versione 2.6b2 (15/02/2024)
|
||||
- (SIM-GEN) Primo movimento in X per testa 2 a SafeX2 anziché a ParkX2
|
||||
|
||||
Versione 2.6b1 (07/02/2024)
|
||||
- (MLDE-SIM-GEN) Inserito parametro 'MinLengthLongCSaw' per gestione motosega molto lunga
|
||||
- (MLDE) funzione 'GetCurrChainSawingVirtualAxis' spostata in MLDE
|
||||
|
||||
Versione 2.6a5 (31/01/2024)
|
||||
- (SIM) Migliorata simulazione apertura/chiusura morse in caso di separazione
|
||||
- (SIM-GEN) Migliorata gestione movimenti con motosega e adeguato simulazione
|
||||
- (GEN) Corretta scrittura assi in caso di 'WriteAllCoordsOnFirstM101' per testa 2
|
||||
- (SIM-GEN) Caricamento BeamData come local
|
||||
|
||||
Versione 2.6a4 (25/01/2024)
|
||||
- (SIM-GEN) Corretto movimento in caso di cambio assi rotanti tra due lavorazioni
|
||||
- (GEN) Corretta emissione coordinate assi in caso di 'WriteAllCoordsOnFirstM101'
|
||||
|
||||
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
|
||||
|
||||
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.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
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
-- Version.lua by EgalWare s.r.l. 2024/01/22
|
||||
-- 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.6b4', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
return InfoCommon_STD_PP
|
||||
+1
-1
@@ -37,7 +37,7 @@ local WallData = {
|
||||
|
||||
-- Aggiornamento con dati da TechnoEssetre7
|
||||
local sTs3Data = EgtGetStringFromIni( 'Wall', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250.data"
|
||||
local sData = EgtGetSourceDir().."\\Ts3Data.lua"
|
||||
local sData = EgtGetCurrMachineDir().."\\Wall\\Ts3Data.lua"
|
||||
if EgtExistsFile( sTs3Data) then
|
||||
EgtCopyFile( sTs3Data, sData)
|
||||
local sTs3DataOld = sTs3Data..'.old'
|
||||
|
||||
Reference in New Issue
Block a user