diff --git a/Beam/BeamData.lua b/Beam/BeamData.lua index c9bdcf4..b9f7626 100644 --- a/Beam/BeamData.lua +++ b/Beam/BeamData.lua @@ -64,6 +64,10 @@ local BeamData = { MAXDIAM_POCK_CORNER = 30, -- diametro massimo utensile ammesso per tasche con angoli interni 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) + HEAD_DIM_FOR_BH = 190, -- dimensione di ingombro della testa per block haus + MAX_LEN_BH_FROM_BOTTOM = 195, -- massima lunghezza lavorabile da un lato di block haus da sotto + MAX_DIST_BH_FROM_BOTTOM = 395, -- massima distanza tra naso mandrino e sopra della trave senza collisione + BH_MACHINE = false, -- flag che indica la tipologia di macchina configurata BlockHaus } -- Aggiornamento con dati da TechnoEssetre7 @@ -79,13 +83,15 @@ if EgtExistsFile( sData) then local Machine = dofile( sData) if Machine then if Machine.Offsets then - 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 + BeamData.ANG_TRASM = ( Machine.Offsets.SECSUP and Machine.Offsets.SECSUP >= 3) + BeamData.BH_MACHINE = ( Machine.Offsets.BLOCKHAUS == 1) + 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 @@ -120,6 +126,16 @@ local function GetMaxLenRidgeLapFromBottom( dHRaw) end BeamData.GetMaxLenRidgeLapFromBottom = GetMaxLenRidgeLapFromBottom +--------------------------------------------------------------------- +local function GetChainSawBlockedAxis( nInd) + if nInd == 1 then + return 'A=90' + else + return 'A=0' + end +end +BeamData.GetChainSawBlockedAxis = GetChainSawBlockedAxis + --------------------------------------------------------------------- local function GetChainSawInitAngs( vtN, vtO) if vtN:getY() > 0 and vtO:getX() > 0 then diff --git a/Beam/MachiningTypes.ini b/Beam/MachiningTypes.ini index b85d3df..874dada 100644 --- a/Beam/MachiningTypes.ini +++ b/Beam/MachiningTypes.ini @@ -5,6 +5,7 @@ [Drill] 1=Drill 2=Pocket +3=AngleDrill [Milling] 1=Prof @@ -34,3 +35,4 @@ [Sawing] 1=Sawing +2=Mortising diff --git a/Essetre-FASTrl.NUM.mlpe b/Essetre-FASTrl.NUM.mlpe index 7484f04..9376ee4 100644 --- a/Essetre-FASTrl.NUM.mlpe +++ b/Essetre-FASTrl.NUM.mlpe @@ -1,4 +1,4 @@ --- Processore macchina Essetre-FAST by EgalTech s.r.l. 2023/07/26 +-- Processore macchina Essetre-FAST by EgalTech s.r.l. 2024/01/17 -- Con controllo numerico NUM -- 2021/04/23 DS ver 2.3d3 Se non c'è BtlInfo cerco il gruppo di lavoro corrente. -- 2021/07/21 DS ver 2.3g5 Modifiche varie da TPA. @@ -22,6 +22,10 @@ local TEST_USE = false -- *** GENERATION *** --------------------------------------------------------------------- function OnStart() + -- controllo versione programma + if not EMT.VER or EMT.VER < MIN_MACH_VER then + EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel '..MIN_MACH_VER..')') + end EMT.USETO1 = false -- abilitazione uso origine tavola EMT.MODAL = true -- abilitazione emissione modale EMT.INCHES = false -- unità di misura mm/inches @@ -629,7 +633,7 @@ function OnRapid() local sES = ' ES'..EgtNumToString( EMT.S, 0) local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') .. EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES - if EMT.ST > BeamHeightForFixRot then + if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then sOut = sOut .. ' EH1' end if EMT.LOAD or bHeadFirst then @@ -1256,6 +1260,7 @@ function PreparePreRotation( sCmd) EMT.PREROT = true elseif Cmd[2] == 'SplitRot' then EMT.SPLITROT = true + EMT.SE = ' EE2' end elseif Cmd[1] == '1' then local sMsg = Cmd[2] .. Cmd[3] @@ -1503,7 +1508,8 @@ function VerifyEmitRotation() -- determino quanto ruotare local nDeltaRot = nRot - nPrevRot -- se rotazione automatica richiesta e possibile - if AutomaticRotation and EMT.LB >= AutoRotMinLen then + local dRefLen = EgtIf( IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE), EMT.LT, EMT.LB) + if AutomaticRotation and dRefLen >= AutoRotMinLen then local sOut = 'M180 L0=' .. tostring( nDeltaRot) EmtOutput( sOut) else diff --git a/Essetre-FASTrl.TPA.mlpe b/Essetre-FASTrl.TPA.mlpe index b1e5caf..f003af4 100644 --- a/Essetre-FASTrl.TPA.mlpe +++ b/Essetre-FASTrl.TPA.mlpe @@ -1,4 +1,4 @@ --- Processore macchina Essetre-FASTrl by EgalTech s.r.l. 2023/04/19 +-- Processore macchina Essetre-FASTrl by EgalTech s.r.l. 2024/01/17 -- Con controllo numerico TPA -- 2023/04/19 DS ver 2.5d1 Al carico dopo rotazione su linea con P4=75 messo P5=110 invece di 112 (come FAST). @@ -10,6 +10,10 @@ local TEST_USE = false -- *** GENERATION *** --------------------------------------------------------------------- function OnStart() + -- controllo versione programma + if not EMT.VER or EMT.VER < MIN_MACH_VER then + EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel '..MIN_MACH_VER..')') + end EMT.USETO1 = false -- abilitazione uso origine tavola EMT.MODAL = true -- abilitazione emissione modale EMT.INCHES = false -- unità di misura mm/inches @@ -387,6 +391,7 @@ function OnToolSelect() 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 @@ -623,7 +628,7 @@ function OnRapid() ' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') - if EMT.ST > BeamHeightForFixRot then + if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then sOut = sOut .. ' P12=1' end if EMT.LOAD then @@ -1296,6 +1301,7 @@ function PreparePreRotation( sCmd) EMT.PREROT = true elseif Cmd[2] == 'SplitRot' then EMT.SPLITROT = true + EMT.SE = ' P8=2' end elseif Cmd[1] == '1' then local sMsg = Cmd[2] .. Cmd[3] @@ -1538,7 +1544,7 @@ end --------------------------------------------------------------------- function AdjustTcPos( bLen3) local sPos = EMT.TCPOS:gsub( 'T', '') - if sPos == '101' then + if sPos == '101' and EMT.HEAD == 'H3' then if abs( EMT.R3 - 0) < 0.1 then sPos = '101' elseif abs( EMT.R3 - 270) < 0.1 then @@ -1550,7 +1556,7 @@ function AdjustTcPos( bLen3) else EmtSetLastError( 1210, 'Chain saw orientation not allowed') end - elseif sPos == '111' then + elseif sPos == '111' and EMT.HEAD == 'H3' then if abs( EMT.R3 - 0) < 0.1 then sPos = '111' elseif abs( EMT.R3 - 270) < 0.1 then diff --git a/Essetre-FASTrl.ini b/Essetre-FASTrl.ini index 70e4d56..6796466 100644 --- a/Essetre-FASTrl.ini +++ b/Essetre-FASTrl.ini @@ -18,6 +18,7 @@ Active=1 [ToolHolder] H1.1=Standard.nge H1.1:MILL_NOTIP=MillNoTip.nge +H1.1:SAW_FLAT=TcSaw.nge H2.1=Saw.nge H3.1=ChainSaw.nge diff --git a/Essetre-FASTrl.mlde b/Essetre-FASTrl.mlde index 504ea2c..14bc3b5 100644 --- a/Essetre-FASTrl.mlde +++ b/Essetre-FASTrl.mlde @@ -1,4 +1,4 @@ --- Descrizione macchina Essetre-FAST by EgalTech s.r.l. 2023/07/26 +-- Descrizione macchina Essetre-FAST by EgalTech s.r.l. 2024/01/17 -- 2022/07/19 Ver.2.4g1 DS Riallineamento con FAST standard. -- 2022/07/22 Ver.2.4g2 DS Modifiche per ribaltamento pezzo con molto scarto iniziale. -- 2023/01/16 Ver.2.5a1 DS/LM Modificata posizione home della testa H3. @@ -6,11 +6,13 @@ -- 2023/07/26 Ver.2.5g1 DS Per NUM aggiunta gestione rotazione in alto su pezzi alti (G101 EH1) come per TPA in versione 2.3f2. -- 2023/07/26 Ver.2.5g2 DS Per NUM tolta segnalazione errore rotazione a Zmax per pezzi alti non gestita (era su EMT.FLAG == 5). -- 2023/09/29 ver 2.5i1 In BeamData e mlde aggiunta la lettura di alcuni parametri da Ts3Data. +-- 2024/01/17 Ver.2.6a1 DS Aggiunta gestione BlockHouse come in FAST. require( 'EmtGenerator') EgtEnableDebug( false) -PP_VER = '2.5g2' +PP_VER = '2.6a1' +MIN_MACH_VER = '2.5k1' -- Parametri macchina NumericalControl = 'TPA' -- NUM o TPA @@ -47,6 +49,7 @@ AutomaticRotation = true AutoRotMinLen = 2600 DefTcPos = 'T2' SecondSupport = false +SpecialBH = false MaxUnloadLen = 0 BeamHeightForFixRot = 9999 -- per abilitare assegnare 500 CoeffVM = 0.5 @@ -98,12 +101,13 @@ if EgtExistsFile( sData) then if Machine.Offsets.OFFSETX then DeltaTabY = -Machine.Offsets.OFFSETX end if Machine.Offsets.OFFSETZ then DeltaTabZ = Machine.Offsets.OFFSETZ + EgtIf( NumericalControl == 'TPA', MillOffs, 0) end if Machine.Offsets.SECSUP then SecondSupport = ( Machine.Offsets.SECSUP == 1) end + if Machine.Offsets.BLOCKHAUS then SpecialBH = ( Machine.Offsets.BLOCKHAUS == 1) end if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end if Machine.Offsets.DEFTCPOS then DefTcPos = ( 'T' .. Machine.Offsets.DEFTCPOS) end end end end - +if SpecialBH then SecondSupport = false end EmtGeneral { File='Essetre-FASTrl.nge', @@ -137,7 +141,7 @@ EmtAxis { Dir = Z_AX(), Pos = Point3d( -19.25, -113.54, 790.0), Stroke = {MinZ, MaxZ}, - Home = 0, + Home = MaxZ, Geo = 'Z_AXIS/GEO', Aux = {'Z_AXIS/SOLID', 'Z_AXIS/COLLISION'}} EmtAxis { @@ -182,8 +186,8 @@ local H2Id = EmtHead { Parent = 'B', HSet = 'H2', Type = MCH_HT.STD, - Pos = Point3d( 0, 0, (MillOffs-SawOffs)), - TDir = Vector3d( 0, -sin( SawBOffs), -cos( SawBOffs)), + Pos = Point3d( 0, 0, ( MillOffs - SawOffs)), + TDir = VectorFromRotated( -Z_AX(), X_AX(), -SawBOffs), ADir = X_AX(), Rot1W = 0.2, OthColl = {'H1', 'H3', 'B/SOLID', 'C/SOLID'}, @@ -219,17 +223,6 @@ EgtSetInfo( H3Id, 'ZMAXONROT', '1,5') if BeamHeightForFixRot < 1000 then EgtSetInfo( H3Id, 'ROTATZMAX', '1') end --- Dummy -EmtHead { - Name = 'H4', - Parent = 'B', - HSet = 'H4', - Type = MCH_HT.STD, - Pos = Point3d( 0, 0, 0), - TDir = Z_AX(), - ADir = X_AX(), - Rot1W = 0.2, - Geo = 'H4_HEAD/GEO'} -- Morse local YId = EmtAxis { Name = 'Y', @@ -366,13 +359,23 @@ EmtTcPos { TDir = X_AX(), ADir = Y_AX(), Geo = 'BASE/T11'} -EmtTcPos { - Name = 'T101', - Parent = 'Base', - Pos = Point3d( 510.4, -113.2, -160.8), - TDir = -X_AX(), - ADir = Z_AX(), - Geo = 'BASE/T101'} +if not SpecialBH then + EmtTcPos { + Name = 'T101', + Parent = 'Base', + Pos = Point3d( 510.4, -113.2, -160.8), + TDir = -X_AX(), + ADir = Z_AX(), + Geo = 'BASE/T101'} +else + EmtTcPos { + Name = 'T101', + Parent = 'Base', + Pos = Point3d( 510.4, -113.2, -1160.8), + TDir = -X_AX(), + ADir = Z_AX(), + Geo = 'BASE/T101S'} +end if SecondSupport then EmtTcPos { Name = 'T111', @@ -382,6 +385,15 @@ if SecondSupport then ADir = -X_AX(), Geo = 'BASE/T111'} end +if SpecialBH then + EmtTcPos { + Name = 'T111', + Parent = 'Base', + Pos = Point3d( 810.4, -113.2, -329.8), + TDir = -Y_AX(), + ADir = -X_AX(), + Geo = 'BASE/T111S'} +end -- Aggiusto posizioni geometriche local vtMove = Vector3d( 0, ( DeltaTabY + 913.16), ( DeltaTabZ + 830.037)) @@ -413,15 +425,16 @@ PVLightId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PVId, 'SOLID') or GD function OnSetHead() -- se testa lama if EMC.HEAD == 'H2' then - EmtModifyAxisDirection( 'B', Vector3d( cos( SawCOffs), -sin( SawCOffs), 0)) + EmtModifyAxisDirection( 'B', VectorFromRotated( X_AX(), Z_AX(), -SawCOffs)) EmtModifyAxisHome( 'C', 0) -- se sega a catena elseif EMC.HEAD == 'H3' then EmtModifyAxisDirection( 'B', X_AX()) EmtModifyAxisHome( 'C', 180) - if EMC.DIST and abs( EMC.DIST) > 1 then - EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -EMC.DIST)) - local vtMove = Point3d( 0, 0, -EMC.DIST) - Point3d( EMC.EXITPOS) + local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen) + EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -dDist)) + if not EMC.VER or EMC.VER < '2.5h2' then + local vtMove = Point3d( 0, 0, -dDist) - Point3d( EMC.EXITPOS) local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT)) EgtMove( ExitId, vtMove) end diff --git a/Essetre-FASTrl.mlpe b/Essetre-FASTrl.mlpe index ea46947..3901013 100644 --- a/Essetre-FASTrl.mlpe +++ b/Essetre-FASTrl.mlpe @@ -35,15 +35,21 @@ local COLL_SAFE_DIST = 3 --------------------------------------------------------------------- function OnSimulStart() + -- controllo versione programma + if not EMT.VER or EMT.VER < MIN_MACH_VER then + EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel '..MIN_MACH_VER..')') + end -- Carico gli utensili sulle barre portautensili local vTcPos = EgtGetAllTcPosNames() if vTcPos then for i = 1, #vTcPos do local vTools = EgtGetToolsInCurrSetupPos( vTcPos[i]) - if vTools and vTools[1] then - EgtLoadTool( vTcPos[i], 1, vTools[1]) - ShowToolInTcPos( vTcPos[i], true) + for j = 1, #( vTools or {}) do + if vTools[j] ~= '' then + EgtLoadTool( vTcPos[i], j, vTools[j]) + end end + ShowToolInTcPos( vTcPos[i], true) end end -- Se reset o home, esco @@ -68,21 +74,34 @@ function OnSimulStart() DumpCollisionCheck( EMT.COLLOBJ, 'Collision Objects :', 4) -- Preparo lista solidi macchina con cui possono collidere gli oggetti sopra riportati (in aggiunta a VMill) EMT.MCODET = {} - EMT.MCODET[1] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetAxisId( 'Y'), 'COLLISION'), 'VOL1') - EMT.MCODET[2] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetAxisId( 'Y'), 'COLLISION'), 'VOL2') - EMT.MCODET[3] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetAxisId( 'PY'), 'COLLISION'), 'VOL') - EMT.MCODET[4] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetAxisId( 'V'), 'COLLISION'), 'VOL1') - EMT.MCODET[5] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetAxisId( 'V'), 'COLLISION'), 'VOL2') - EMT.MCODET[6] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetAxisId( 'PV'), 'COLLISION'), 'VOL') - EMT.MCODET[7] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'COLLISION'), 'SIDE1') - EMT.MCODET[8] = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'COLLISION'), 'SIDE2') - for i = #EMT.MCODET, 1, -1 do - if not EMT.MCODET[i] then - table.remove( EMT.MCODET, i) - EgtOutLog( ' Warning : MCODET element (' .. tostring( i) .. ') is null') - elseif EgtGetDebugLevel() >= 4 then - EgtOutLog( ' MCODET element (' .. tostring( i) .. ') is ok') + local McdData = { { Grp = 'Y', Sub = 'COLLISION', Name = 'VOL1'}, + { Grp = 'Y', Sub = 'COLLISION', Name = 'VOL2'}, + { Grp = 'PY', Sub = 'COLLISION', Name = 'VOL'}, + { Grp = 'V', Sub = 'COLLISION', Name = 'VOL1'}, + { Grp = 'V', Sub = 'COLLISION', Name = 'VOL2'}, + { Grp = 'PV', Sub = 'COLLISION', Name = 'VOL'}, + { Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE1'}, + { Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE2'}} + EgtOutLog( 'MCODET Objects :', 4) + local nMcdNullCnt = 0 + for i = 1, #McdData do + local nGrpId + if McdData[i].Grp == 'Base' then + nGrpId = EgtGetBaseId( 'Base') + else + nGrpId = EgtGetAxisId( McdData[i].Grp) end + local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId or GDB_ID.NULL, McdData[i].Sub) or GDB_ID.NULL, McdData[i].Name) + if nId then + table.insert( EMT.MCODET, nId) + EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is ok', 4) + else + nMcdNullCnt = nMcdNullCnt + 1 + EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4) + end + end + if nMcdNullCnt > 0 then + EgtOutLog( 'Warning : MCODET with one or more null Element(s) ') end -- Preparo lista collisioni vuota EMT.COLLIDE = {} @@ -1000,11 +1019,20 @@ end --------------------------------------------------------------------- function ShowToolInTcPos( sTcPos, bShow) - -- recupero il gruppo dell'utensile - local TcExitId = EgtGetFirstNameInGroup( EgtGetTcPosId( sTcPos or '') or GDB_ID.NULL, 'T1') - if not TcExitId then return end - -- imposto lo stato di visualizzazione - EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) + -- recupero identificativo della posizione sul TC + local TcPosId = EgtGetTcPosId( sTcPos or '') + if not TcPosId then return end + -- ciclo sulle possibili uscite + for i = 1, 100 do + -- recupero il gruppo dell'utensile + local TcExitId = EgtGetFirstNameInGroup( TcPosId, 'T'..tostring( i)) + if not TcExitId then break end + -- imposto lo stato di visualizzazione + EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) + end + -- recupero eventuale gruppo ausiliario da visualizzare/nascondere + local TcHSId = EgtGetFirstNameInGroup( TcPosId, sTcPos..'_HS') + if TcHSId then EgtSetStatus( TcHSId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) end end --------------------------------------------------------------------- @@ -1193,6 +1221,7 @@ end function OnEstimPathStart() EMT.AUXTYPE = nil EMT.MCHMOVEFIRST = true + EMT.CHARMOVE = nil end --------------------------------------------------------------------- @@ -1220,7 +1249,11 @@ function OnEstimPathStartAux() end -- altrimenti, spostamento carrelli else - if EMT.AUXTOT > 2 and EMT.AUXIND == EMT.AUXTOT then + local Cmd = EgtSplitString( EMT.AUX) + if ( Cmd[1] == '1' and Cmd[2] ~= 'Z') or Cmd[1] == '2' or Cmd[1] == '3' then + EMT.CHARMOVE = true + end + if EMT.AUXIND == EMT.AUXTOT and EMT.CHARMOVE then local dTime = ( EMT.AUXTOT - 2) * CHAR_ONE_MOVE_T EMT.TOTEXTTIME = EMT.TOTEXTTIME + dTime EmtTleAddMachining( 'Charriots move', EmtSecToHMS( dTime), ' - ', ' - ') diff --git a/Essetre-FASTrl.mlse b/Essetre-FASTrl.mlse index 084fb45..7833231 100644 --- a/Essetre-FASTrl.mlse +++ b/Essetre-FASTrl.mlse @@ -39,7 +39,6 @@ local DELTA_TOL_FIXED = 50 local DeltaTol = DELTA_TOL_S local DELTA_SIC = 1 local AGG_LOAD = 50 -local AGG_B_SPLIT = 0 local MIN_JOIN_VV = 75 local MIN_JOIN_SS = 100 local MIN_JOIN_LS = 290 @@ -243,7 +242,7 @@ function OnSpecialApplyDisposition() EMC.ERR = 0 -- Campi obbligatori ma non usati - EMC.HEAD = "H4" + EMC.HEAD = "" EMC.EXIT = 1 EMC.TCPOS = "" EMC.SHIFTS = 0 @@ -347,13 +346,11 @@ function OnSpecialApplyDisposition() return end - -- Verifico ci sia un solo grezzo nella fase corrente - local nRawCount = 0 + -- Recupero il grezzo in lavoro local nCurrRawId = GDB_ID.NULL local nRawId = EgtGetFirstRawPart() while nRawId do - if EgtVerifyRawPartPhase( nRawId, EMC.PHASE) then - nRawCount = nRawCount + 1 + if EgtVerifyRawPartPhase( nRawId, EMC.PHASE) and not EgtVerifyRawPartPhase( nRawId, EMC.PHASE + 1) then nCurrRawId = nRawId end nRawId = EgtGetNextRawPart( nRawId) @@ -374,11 +371,11 @@ function OnSpecialApplyDisposition() UpdateMinJoinDeltaTol() -- Assegno sovramateriale di testa e ingombro tagli di testa e di coda - EMC.HOVM = 0 - EMC.HCING = 0 - EMC.TCING = 0 + EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0 + EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0 + EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0 - -- Devo scaricare il grezzo rimasto (deve essere unico) + -- Devo scaricare il pezzo o il grezzo rimasto -- Posizione trave local dPosT @@ -386,8 +383,8 @@ function OnSpecialApplyDisposition() local vCmd = {} if EMC.PHASE == 1 or IsEnd2Phase( EMC.PHASE) then dPosT = LoadT - if IsEnd2Phase( EMC.PHASE) then dPosT = dPosT + TurnerOffs end - vCmd = SpecCalcLoad( dPosT, 0, min( EMC.LB - MinOther - AGG_LOAD, MaxY - dPosT)) + if IsEnd2Phase( EMC.PHASE) then dPosT = dPosT + TurnerOffs - EMC.HOVM end + vCmd = SpecCalcLoad( dPosT, 0, min( EMC.LB - MinOther - AGG_LOAD - EMC.HOVM, MaxY - dPosT)) -- se altrimenti fase successiva alla prima di tipo inizio o rimanenza elseif IsStartOrRestPhase( EMC.PHASE) then -- recupero posizione trave e quota di aggancio carrello @@ -418,7 +415,7 @@ function OnSpecialApplyDisposition() if IsStartOrRestPhase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE) then EMC.TPOS = dPosT SpecSetCarrPosFromCmds( vCmd) - local dDistFront = EgtIf( EMC.LB < abs( MinV - UnloadT), MinJoin, EMC.LB - abs( MinV - UnloadT) + MinJoin + DeltaTol) + local dDistFront = EgtIf( EMC.LB < abs( MinV - UnloadT), MinJoin, EMC.LB - abs( MinV - UnloadT) + MinJoin + DeltaTol) + EMC.HOVM vCmd2 = SpecCalcCarriages( dDistFront, 0) if vCmd and #vCmd > 1 and vCmd2 and #vCmd2 > 1 then table.insert( vCmd, { 0, 'CARR_MOVE'}) @@ -649,8 +646,10 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR if bPreSplit or bSplitting then local dDistF = SpecialCalcPhaseEncumbrance( EMC.PHASE + 1) dDistFront = min( dDistFront, dDistF) - local dNextHOVM = EgtGetInfo( EgtGetNextRawPart( nCurrRawId) or GDB_ID.NULL, 'HOVM', 'd') or 0 - dDistBack = dDistBack - AGG_B_SPLIT - max( dNextHOVM - 300, 0) + local dNextHOVM = EgtGetInfo( EgtGetNextRawPart( nCurrRawId) or GDB_ID.NULL, 'HOVM', 'd') or 0 + local dBackOther = b3Tot:getDimX() - b3Raw:getDimX() - MinOther - dNextHOVM + EgtOutLog( 'DistBack='..EgtNumToString( dDistBack)..' OtherBack='..EgtNumToString( dBackOther), 3) + dDistBack = min( dDistBack, dBackOther) elseif bPreCut or bCutting then local dDistF = SpecialCalcPhaseEncumbrance( EMC.PHASE + 1) dDistFront = min( dDistFront, dDistF) @@ -875,6 +874,9 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, -- Quota in Z dal punto di inclinazione dei carrelli local dCompZ = sqrt( 1 - vtTool:getZ() * vtTool:getZ()) local dZup = ptMin:getZ() - 0.5 * dCompZ * dTDiam - ( EMC.ZMIN + 130) + -- Posizione min e max del naso mandrino (rispetto a riferimento pezzo in Y e Z) + local ptHeadMin = ptMin + vtTool * dTLen - Vector3d( 0, EMC.YMIN + EMC.SB, EMC.ZMIN) + local ptHeadMax = ptMax + vtTool * dTLen - Vector3d( 0, EMC.YMIN + EMC.SB, EMC.ZMIN) -- Ingombro a sinistra local dDistBack = EMC.LB + ptMin:getX() + LoadT local dHeadBack = 350 @@ -947,7 +949,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, dHeadBack = EgtIf( vtTool:getZ() > 0.966, 160, 280) end end - -- pre fresature longitudinali con utensile di fianco + -- per fresature longitudinali con utensile di fianco if abs( vtTool:getX()) < 0.1 and vtTool:getZ() < 0.707 and vtArm:getX() < -0.5 then dHeadBack = 500 end @@ -955,6 +957,11 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, if bChain and vtTool:getX() < 0.5 and vtTool:getZ() < 0.5 and vtArm:getX() < -0.5 then dHeadBack = max( dHeadBack, 510) end + -- per fresa diretta quasi esattamente come Y+/- e con la testa non troppo nel pezzo + if not bChain and abs( vtTool:getX()) < 0.017 and abs( vtTool:getZ()) < 0.017 and + (( vtTool:getY() > 0 and ptHeadMin:getY() > 80) or ( vtTool:getY() < 0 and ptHeadMax:getY() < -EMC.SB - 80)) then + dHeadBack = EgtIf( EMC.CNT == 1, 180, 130) + end -- per interferenza con triangolo di rinforzo sulla pinza Y if vtTool:getZ() < 0.25 and vtTool:getX() < 0.10 and vtTool:getY() > 0 and vtArm:getX() < -0.707 then dHeadBack = dHeadBack + 90 @@ -1034,7 +1041,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, dHeadFront = EgtIf( vtTool:getZ() > 0.966, 160, 280) end end - -- pre fresature longitudinali con utensile di fianco + -- per fresature longitudinali con utensile di fianco if abs( vtTool:getX()) < 0.1 and vtTool:getZ() < 0.707 and vtArm:getX() > 0.5 then dHeadFront = 500 end @@ -1042,6 +1049,11 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, if bChain and vtTool:getX() > -0.5 and vtTool:getZ() < 0.5 and vtArm:getX() > 0.5 then dHeadFront = max( dHeadFront, 510) end + -- per fresa diretta quasi esattamente come Y+/- e con la testa non troppo nel pezzo + if not bChain and abs( vtTool:getX()) < 0.017 and abs( vtTool:getZ()) < 0.017 and + (( vtTool:getY() > 0 and ptHeadMin:getY() > 80) or ( vtTool:getY() < 0 and ptHeadMax:getY() < -EMC.SB - 80)) then + dHeadFront = 130 + end -- per interferenza con triangolo di rinforzo sulla pinza V if vtTool:getZ() < 0.25 and vtTool:getX() > -0.10 and vtTool:getY() > 0 and vtArm:getX() > 0.707 then dHeadFront = dHeadFront + 90 @@ -2048,8 +2060,8 @@ function SpecAdjustCarrA3( dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDelta table.insert( vCmd, { 11, 0}) -- **1: accentro** Y e (V+T) dYPosA = MyMinY -- (pos. finale) - dVPosA = dVPosA + dExtraY - dTPosA = dTPosA + dExtraY + dVPosA = dVPosA - dExtraY + dTPosA = dTPosA - dExtraY dYDeltaA = dYPosA - dTPosA table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA}) @@ -2971,7 +2983,7 @@ function SpecAdjustCarrB3( dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDelta dYPosA = dYPosA + dCorsaYTd dTPosA = dTPosA + dCorsaYTd dVPosA = dVPosA - dCorsaVd - table.insert( vCmd, { 3, 'Y', dTPosA, 'T', dTPosA, 'V', dVPosA}) + table.insert( vCmd, { 3, 'Y', dYPosA, 'T', dTPosA, 'V', dVPosA}) -- chiudo il carrello V e apro Y table.insert( vCmd, { 12, 1}) @@ -2980,7 +2992,7 @@ function SpecAdjustCarrB3( dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDelta dVPosA = dVPosA + dCorsaVTr dTPosA = dTPosA + dCorsaVTr dYPosA = MyMinY - table.insert( vCmd, { 3, 'Y', dTPosA, 'T', dTPosA, 'V', dVPosA}) + table.insert( vCmd, { 3, 'Y', dYPosA, 'T', dTPosA, 'V', dVPosA}) -- valuto i Delta ottenuti dYDeltaA = dYPosA - dTPosA diff --git a/Essetre-FASTrl.nge b/Essetre-FASTrl.nge index 6409512..fd3bab5 100644 Binary files a/Essetre-FASTrl.nge and b/Essetre-FASTrl.nge differ diff --git a/THolders/BH.nge b/THolders/BH.nge new file mode 100644 index 0000000..80eac65 Binary files /dev/null and b/THolders/BH.nge differ diff --git a/THolders/Mortise.nge b/THolders/Mortise.nge new file mode 100644 index 0000000..184e003 Binary files /dev/null and b/THolders/Mortise.nge differ diff --git a/THolders/Standard97.nge b/THolders/Standard97.nge new file mode 100644 index 0000000..2ab70eb Binary files /dev/null and b/THolders/Standard97.nge differ diff --git a/THolders/TcSaw.nge b/THolders/TcSaw.nge new file mode 100644 index 0000000..e8de2ef Binary files /dev/null and b/THolders/TcSaw.nge differ