diff --git a/Beam/BeamData.lua b/Beam/BeamData.lua index 6cd5611..0b30ba3 100644 --- a/Beam/BeamData.lua +++ b/Beam/BeamData.lua @@ -68,6 +68,9 @@ local BeamData = { KIOTP = 5, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare MAXDIAM_POCK_CORNER = 201, -- diametro massimo utensile ammesso per tasche con angoli interni USE_LONGCUT = true, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut + HEAD_DIM_FOR_BH = 125, -- dimensione di ingombro della testa per block haus + MAX_LEN_BH_FROM_BOTTOM = 210, -- massima lunghezza lavorabile da un lato di block haus da sotto + MAX_DIST_BH_FROM_BOTTOM = 600, -- massima distanza tra naso mandrino e sopra della trave senza collisione ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta ADVANCE_TAIL_OFFS = 10, -- accorciamento taglio di coda avanzato (minimo 1) DOUBLE_HEAD_DOVETAIL = false, -- flag abilitazione lavorazione mortase a coda di rondine in doppio diff --git a/Common_ONE-PF.NUM.mlpe b/Common_ONE-PF.NUM.mlpe index 782da97..de52ab1 100644 --- a/Common_ONE-PF.NUM.mlpe +++ b/Common_ONE-PF.NUM.mlpe @@ -129,6 +129,11 @@ function OnToolData() local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( EMT.TDIST or ChSawLen, 1) sOut = sOut .. EgtIf( EMT.TCPOS == 'T111', ' G76H9998.2N411N414', ' G76H9998.2N511N514') EmtOutput( '('..sOut..')') + -- emissione dati aggregato BlockHaus + elseif EMT.HEAD == 'H17' then + sPos = EgtIf( #EMT.TCPOS == 2, EMT.TCPOS:gsub( 'T', 'N30'), EMT.TCPOS:gsub( 'T', 'N3')) + local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( ( AngTrBHOffs), 1)..' G76H9998.2'..sPos..sPos + EmtOutput( '('..sOut..')') -- emissione dati utensile (esclusa sega a catena) else -- output info @@ -142,7 +147,6 @@ function OnToolData() if EMT.TCPOS == 'T201' then sPos = 'N411' else - sPos = EgtIf( #EMT.TCPOS == 2, EMT.TCPOS:gsub( 'T', 'N30'), EMT.TCPOS:gsub( 'T', 'N3')) end local sOut = 'L1='..EgtNumToString( EMT.SMAX, 0)..' L2='..EmtLenToString( dAddLen + EMT.TTOTLEN, 1)..' G76H9998.2'..sPos..sPos @@ -2507,10 +2511,15 @@ function MyAdjustLinearAxes() local Len = ( EMT.TDIST or ChSawLen) + Mill2Offs local LenRef = Mill2Offs vtE = Vector3d( EMT.ADIR) * Len - Z_AX() * LenRef + elseif EMT.HEAD == 'H17' then + local LenAux = AngTrBHOffs + MillOffs + local LenRef = MillOffs + local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3) + vtE = vtAux * LenAux - Z_AX() * LenRef else EmtSetLastError( 1211, 'Head not defined ' .. ( EMT.HEAD or '')) end - if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H13' or EMT.HEAD == 'H15' then + if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H13' or EMT.HEAD == 'H15' or sHead == 'H17' then EMT.L1 = EMT.L1 - vtE:getX() EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY() EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ() @@ -2623,6 +2632,9 @@ function GetToolRadLen() -- se sega a catena elseif HeadIsChainSaw( EMT.HEAD) then return EMT.TLEN, ( EMT.TDIST or ChSawLen) + -- se aggregato BlockHaus + elseif EMT.HEAD == 'H17' then + return EMT.TDIAM / 2, AngTrBHOffs end end @@ -3107,7 +3119,7 @@ function PreselectNextDiffHead( nMchId, sHead) EmitMoveStartHead( 1) EmitMoveWaitHead( 1) end - -- Emetto preselezione (non ammessa per sega a catena H13 e H23) + -- Emetto preselezione (non ammessa per sega a catena H13 e H23 e aggregato BlockHaus H17) if sNextHead == 'H11' then EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, sNextTcPos)}) EmitMoveStartHead( 1) diff --git a/Common_ONE-PF.mlpe b/Common_ONE-PF.mlpe index 2a5224e..fefbbee 100644 --- a/Common_ONE-PF.mlpe +++ b/Common_ONE-PF.mlpe @@ -648,7 +648,7 @@ function OnSimulToolDeselect( dPrevA) SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT) SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID) -- deposito utensile lama - elseif EMT.PREVHEAD_H1 == 'H12' then + elseif EMT.PREVHEAD_H1 == 'H12' or EMT.PREVHEAD_H1 == 'H17' then -- simulo movimento SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT) SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID) @@ -716,7 +716,7 @@ function OnSimulToolDeselect( dPrevA) -- nascondo l'utensile sulla testa EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN) -- prendo utensile fresa o lama - if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' then + if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' or EMT.NEXTHEAD == 'H17' then local MyParkX1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1) local MyParkB1 = ParkB1 local MyParkC1 = ParkC1 @@ -1084,7 +1084,7 @@ function OnSimulMoveStart() else if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then -- se movimento iniziale da Zmax con lama o fresa - if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then + if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H17' then if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then --EgtOutBox( 'Flag 2,1', 'Info Rapid') local bMoveZbeforeX = false @@ -2848,7 +2848,7 @@ end --------------------------------------------------------------------- function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2) - if sHead == 'H11' or sHead == 'H12' or HeadIsChainSaw( sHead) then + if sHead == 'H11' or sHead == 'H12' or sHead == 'H17' or HeadIsChainSaw( sHead) then return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1)) elseif sHead == 'H21' or sHead == 'H22' or HeadIsChainSaw( sHead) then return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1)) diff --git a/Common_ONE-PF.mlse b/Common_ONE-PF.mlse index 5a16ac7..68f9e34 100644 --- a/Common_ONE-PF.mlse +++ b/Common_ONE-PF.mlse @@ -72,7 +72,7 @@ function OnSpecialGetMaxZ() local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}} EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ) end - elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then + elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then if vtTp:getX() > 0.4 and vtT:getX() > 0.4 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) @@ -173,7 +173,7 @@ function OnSpecialMoveZup() if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' then ; -- se lama posizionata su CU prossimo a testa 1 - elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then + elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then -- se inclinata oltre 90 gradi e interferisce con la trave if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ())) diff --git a/Essetre-PF.mlde b/Essetre-PF.mlde index a88670d..56966e6 100644 --- a/Essetre-PF.mlde +++ b/Essetre-PF.mlde @@ -378,7 +378,7 @@ if AggreBlockHaus then Parent = 'B1', HSet = 'H11', Type = MCH_HT.STD, - Pos = Point3d( AngTrBHLen, 0, -AngTrBHOffs), + Pos = Point3d( -AngTrBHLen, 0, -AngTrBHOffs), TDir = X_AX(), ADir = Z_AX(), Rot1W = 0.2, @@ -881,12 +881,16 @@ function OnSetHead() EmtModifyAxisHome( 'B1', ParkB1) EmtModifyAxisDirection( 'B1', X_AX()) -- se testa H12 (lama) - elseif EMC.HEAD == 'H12' then + elseif EMC.HEAD == 'H12' or EMC.HEAD == 'H17' then EmtModifyAxisHome( 'X1', ParkX1) EmtModifyAxisHome( 'Z1', ParkZ1) EmtModifyAxisHome( 'C1', ParkC1) EmtModifyAxisHome( 'B1', ParkB1) - EmtModifyAxisDirection( 'B1', Vector3d( cos( SawC1Offs), -sin( SawC1Offs), 0)) + if EMC.HEAD == 'H12' then + EmtModifyAxisDirection( 'B1', Vector3d( cos( SawC1Offs), -sin( SawC1Offs), 0)) + else + EmtModifyAxisDirection( 'B1', X_AX()) + end -- se testa H21 (fresa2) elseif EMC.HEAD == 'H21' then local dRawH = GetRawHeight() @@ -923,7 +927,7 @@ end --------------------------------------------------------------------- function GetHeadSet( sHead) - if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then + if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then return 1 elseif sHead == 'H21' or sHead == 'H22' or sHead == 'H23' then return 2 @@ -937,7 +941,7 @@ end function GetHeadTCSet( sHead, sTcPos) local nPos = tonumber( string.sub( sTcPos, 2)) or 0 -- testa 1 - if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' then + if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then -- testa 1 su CU prossimo a testa 2 if nPos > 10 then return 'Head1_TC2' @@ -1001,7 +1005,7 @@ end --------------------------------------------------------------------- -- Funzione che ritorna ZExtra partendo dalla testa e dall'angolo verticale function GetZExtra( sHead, dAngV) - if sHead == 'H11' or sHead == 'H21' then + if sHead == 'H11' or sHead == 'H21' or sHead == 'H17' then if abs( dAngV) < 30.1 then return 400 elseif abs( dAngV) < 45.1 then diff --git a/Scripts/SetUp.lua b/Scripts/SetUp.lua index 78847d5..f00db67 100644 --- a/Scripts/SetUp.lua +++ b/Scripts/SetUp.lua @@ -25,11 +25,12 @@ local INVALIDPOS = "" local POS = "Pos" -- Geom Set -local GS = {{"H11", "H17"}} +local GS = {} -- Configurazione posizioni (con o senza TC2) local PositionTable = {} local SecondSaw = ( EgtGetHeadId( 'H22') ~= nil) +local AggreBH = ( EgtGetHeadId( 'H17') ~= nil) if SecondSaw then PositionTable = {{Pos = "Pos1", TcPos = "T1", Head = "H12", Group = "G1"}, {Pos = "Pos2", TcPos = "T3", Head = "H11", Group = "G1"}, @@ -38,7 +39,7 @@ if SecondSaw then {Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"}, {Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"}, {Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"}, - {Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"}, + {Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"}, {Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"}, {Pos = "Pos10", TcPos = "T11", Head = "H22", Group = "G3"}, {Pos = "Pos11", TcPos = "T13", Head = "H21", Group = "G3"}, @@ -61,7 +62,7 @@ else {Pos = "Pos5", TcPos = "T6", Head = "H11", Group = "G1"}, {Pos = "Pos6", TcPos = "T7", Head = "H11", Group = "G1"}, {Pos = "Pos7", TcPos = "T8", Head = "H11", Group = "G1"}, - {Pos = "Pos8", TcPos = "T9", Head = "H11", Group = "G1"}, + {Pos = "Pos8", TcPos = "T9", Head = EgtIf( AggreBH, "H17", "H11"), Group = "G1"}, {Pos = "Pos9", TcPos = "T10", Head = "H11", Group = "G1"}, {Pos = "Pos10", TcPos = "T11", Head = "H21", Group = "G3"}, {Pos = "Pos11", TcPos = "T12", Head = "H21", Group = "G3"}, @@ -78,7 +79,7 @@ else table.insert( PositionTable, {Pos = "Pos21", TcPos = "T211", Head = "H23", Group = "G2"}) end end -local UsePositionHead = true +local UsePositionHead = false local function IsInGeomSet( ToolHead, PosHead) for GsIndex = 1, #GS do diff --git a/THolders/AngTransmBH.nge b/THolders/AngTransmBH.nge index 276505f..ef9fe96 100644 Binary files a/THolders/AngTransmBH.nge and b/THolders/AngTransmBH.nge differ