From 2b1d0b68212d2e8e80ad18a69cdd3999c4d12afa Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 2 Sep 2025 09:14:02 +0200 Subject: [PATCH] Allineamento con versione 2.7i1 dei common non ancora rilasciata. --- Common_PF1250.TPA.mlpe | 18 ----------- Common_PF1250.mlpe | 64 ++++++++++++++++++++++++++++++++++--- Common_PF1250.mlse | 25 +++++++++++++++ Essetre-PF1500MAXrl-3T.mlde | 4 +-- UpdateLog.txt | 5 +++ Version.lua | 2 +- 6 files changed, 92 insertions(+), 26 deletions(-) diff --git a/Common_PF1250.TPA.mlpe b/Common_PF1250.TPA.mlpe index 1dd5921..4e2a6d1 100644 --- a/Common_PF1250.TPA.mlpe +++ b/Common_PF1250.TPA.mlpe @@ -1628,24 +1628,6 @@ function OnArc() EmtUpdatePrev() end ---------------------------------------------------------------------- -function CalcDinamicaPinze( dH, dS, dL) - local MinTempoAcc = EMT.MINACC -- [ms] ~600 - local MaxTempoAcc = EMT.MAXACC -- [ms] ~6000 - local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo] - local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg] - local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min] - local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N] - local TempoAcc = EgtClamp( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito), MinTempoAcc, MaxTempoAcc) - local RidFeed = 100 / Massa * 100 - if RidFeed > 100 then - RidFeed = 100 - elseif RidFeed < 10 then - RidFeed = 10 - end - return TempoAcc, MinTempoAcc, RidFeed -end - --------------------------------------------------------------------- function CalcForzaPinze( dH, dS, dL, dT) local MassaRef = 1500 -- [Kg] diff --git a/Common_PF1250.mlpe b/Common_PF1250.mlpe index 639d1a9..4e9d448 100644 --- a/Common_PF1250.mlpe +++ b/Common_PF1250.mlpe @@ -646,7 +646,7 @@ function OnSimulToolDeselect( dPrevA) -- se passo da testa 1 a 3 scarico aggregato if nNextSetHead == 3 then -- deposito utensile prelevato da posizioni speciali - if EMT.TCPOS == 'T101' or EMT.TCPOS == 'T111' or EMT.TCPOS == 'T121' then + if EMT.PREVTCPOS_H1 == 'T101' or EMT.PREVTCPOS_H1 == 'T111' or EMT.PREVTCPOS_H1 == 'T121' then -- visualizzo utensile su TcPos ShowToolInTcPos( EMT.PREVTCPOS_H1, true) -- nascondo l'utensile sulla testa @@ -2187,6 +2187,9 @@ local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s --------------------------------------------------------------------- function OnEstimStart() EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches + EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 116000, 20000, 130000) -- feed massima pinze + EMT.MAXACC = MaxAcc or 6000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata + EMT.MINACC = MinAcc or 600 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata end --------------------------------------------------------------------- @@ -2272,6 +2275,15 @@ function OnEstimDispositionEnd() EMT.OPEISDISP = false end +--------------------------------------------------------------------- +function OnEstimRawMoveData() + -- se start del pezzo + if IsStartOrRestPhase( EMT.PHASE) then + EMT.SPLIT = false + end + OnRawMoveData() +end + --------------------------------------------------------------------- function OnEstimToolSelect() -- reset indice utensile in tabella lunghezze @@ -2328,6 +2340,12 @@ function OnEstimMachiningEnd() EMT.TLE_NAME = nil EMT.TLE_TIME = nil end + + EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or '' + EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil) + if EMT.MCHSPLIT then + EMT.SPLIT = true + end end --------------------------------------------------------------------- @@ -2453,17 +2471,20 @@ function OnEstimRapid() EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen -- calcolo tempo local dTime = RAPID_MIN_T - local dT1 = abs( dL1) / RAPID_X_FEED * 60 + + local dT1 = CalcMoveTime( abs( dL1), RAPID_X_FEED, EMT.SPLIT) if dT1 > dTime then dTime = dT1 end - local dT2 = abs( dL2) / RAPID_Y_FEED * 60 + local dT2 = CalcMoveTime( abs( dL2), EMT.FMAXPINZE, EMT.SPLIT) if dT2 > dTime then dTime = dT2 end - local dT3 = abs( dL3) / RAPID_Z_FEED * 60 + local dT3 = CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT) if dT3 > dTime then dTime = dT3 end local dT4 = abs( dR1) / RAPID_C_FEED * 60 if dT4 > dTime then dTime = dT4 end local dT5 = abs( dR2) / RAPID_B_FEED * 60 if dT5 > dTime then dTime = dT5 end + EMT.MCHEXTTIME = EMT.MCHEXTTIME + dTime + EgtOutLog( string.format( ' G0 Len=%.0f Rot=%.0f° Time=%.2f', dLen, abs( dR1) + abs( dR2), dTime), 5) -- aggiorno valori come precedenti EmtUpdatePrev() @@ -2479,7 +2500,7 @@ function OnEstimLinear() local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3) EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen -- calcolo tempo - local dTime = dLen / EMT.F * 60 + local dTime = CalcMoveTime( dLen, EMT.F, EMT.SPLIT) EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5) -- aggiorno valori come precedenti @@ -2753,5 +2774,38 @@ function GetCmdAxMove( Cmd, sAx) end end +--------------------------------------------------------------------- +function CalcDinamicaPinze( dH, dS, dL) + local MinTempoAcc = EMT.MINACC -- [ms] ~600 + local MaxTempoAcc = EMT.MAXACC -- [ms] ~6000 + local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo] + local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg] + local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min] + local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N] + local TempoAcc = EgtClamp( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito), MinTempoAcc, MaxTempoAcc) + local RidFeed = 100 / Massa * 100 + if RidFeed > 100 then + RidFeed = 100 + elseif RidFeed < 10 then + RidFeed = 10 + end + return TempoAcc, MinTempoAcc, RidFeed +end + +--------------------------------------------------------------------- +function CalcMoveTime( dPathLen, dFeed, bIsSplitted) + local dTime + local dFeedInSec = dFeed / 60 + local dTempoAcc, _, _ = CalcDinamicaPinze( EMT.HB, EMT.SB, EgtIf( bIsSplitted, EMT.LT, EMT.LB)) + dTempoAcc = dTempoAcc / 1000 + -- se si raggiunge la velocità massima + if dPathLen >= dFeedInSec * dTempoAcc then + dTime = dTempoAcc * 2 + ( ( dPathLen - dFeedInSec * dTempoAcc) / dFeedInSec) + else + dTime = 2 * sqrt( (dPathLen * dTempoAcc) / dFeedInSec) + end + return dTime +end + --------------------------------------------------------------------- -- *** END GENERAL *** diff --git a/Common_PF1250.mlse b/Common_PF1250.mlse index c1e9ef9..fd28e04 100644 --- a/Common_PF1250.mlse +++ b/Common_PF1250.mlse @@ -7,6 +7,31 @@ EgtEnableDebug( false) -- Carico libreria local BD = require( 'BeamData') +--------------------------------------------------------------------- +-- *** Generic Machinings *** +--------------------------------------------------------------------- +require( 'EmtGenMachining') + +--------------------------------------------------------------------- +-- *** Special GetPrevMachiningOffset *** +--------------------------------------------------------------------- +----------------------------------------------------------------------------------------- +function OnSpecialGetPrevMachiningOffset() + -- default + EMC.ERR = 0 + EMC.PREVOFFSX = 0 + -- se c'è cambio di fase tra le lavorazioni (quindi la precedente è l'ultima della sua fase e la corrente la prima) + if EMC.PREVPHASE ~= EMC.CURRPHASE then + -- se la fase corrente è di inizio lavorazione di nuova trave + if IsStartOrRestPhase( EMC.CURRPHASE) then + -- recupero la posizione finale della lavorazione precedente + local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID) + -- la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset + EMC.PREVOFFSX = ParkV1 - vPrevAx[1] + end + end +end + --------------------------------------------------------------------- -- *** Special Z moves *** --------------------------------------------------------------------- diff --git a/Essetre-PF1500MAXrl-3T.mlde b/Essetre-PF1500MAXrl-3T.mlde index 81fdbab..6220f92 100644 --- a/Essetre-PF1500MAXrl-3T.mlde +++ b/Essetre-PF1500MAXrl-3T.mlde @@ -5,8 +5,8 @@ require( 'EmtGenerator') EgtEnableDebug( false) -PP_VER = '2.7h2' -PP_NVER = '2.7.8.2' +PP_VER = '2.7i1_DEV1' +PP_NVER = '2.7.9.1' MIN_MACH_VER = '2.7d2' MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio diff --git a/UpdateLog.txt b/UpdateLog.txt index 8014786..f937899 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,10 @@ ==== Common_PF1250 Update Log ==== +Versione 2.7-- (--/--/2025) +- (GEN) Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto. Serve CAM5 2.7h1 (facoltativo) +- (EST) La stima tempi considera ora le accelerazoni degli assi +- (SIM) Corretto controllo ultimo utensile utilizzato su testa 1, prima si controllava il precedente, ma poteva essere la testa 2 + Versione 2.7h2 (21/08/2025) - (GEN) Se la testa rimane bassa, corretto caso di reset del piano generico a fine lavorazione - (GEN) Corretto movimento in Z massima dopo scarico pezzo diff --git a/Version.lua b/Version.lua index 2294ec7..b4a74f1 100644 --- a/Version.lua +++ b/Version.lua @@ -3,7 +3,7 @@ local InfoCommon_STD_PP = { NAME = 'Common_PF1250', -- nome script PP standard - VERSION = '2.7h2', -- versione script + VERSION = '2.7--', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel }