From 3c82040b21b8bbe5baf8c17119ac8405cbb66f4b Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 30 Jun 2025 12:22:10 +0200 Subject: [PATCH] Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. --- Common_FAST.NUM.mlpe | 10 ++++------ Common_FAST.NUM_PLUS.mlpe | 12 +++++------- Common_FAST.TPA.mlpe | 16 +++++++--------- UpdateLog.txt | 3 +++ Version.lua | 2 +- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Common_FAST.NUM.mlpe b/Common_FAST.NUM.mlpe index b317cc7..4ab98cb 100644 --- a/Common_FAST.NUM.mlpe +++ b/Common_FAST.NUM.mlpe @@ -27,7 +27,9 @@ function OnStart() --EMT.LINEINC = 1 -- incremento numerazione linee --EMT.Ft = 'F' -- token per feed --EMT.St = 'S' -- token per speed - EMT.FMAXPINZE = 154000 -- feed massima pinze + EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze + EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze + EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze end --------------------------------------------------------------------- @@ -183,16 +185,12 @@ function OnDispositionEnd() local STrave = EMT.ST local HOverM = EMT.HOVM -- calcolo dati pinze - local MinAccPinze = 0.3 - local MaxAccPinze = 4 local KgMtCubo= WoodDensity or 550 -- densità legno in Kg / metro cubo local Massa = ( HTrave * STrave * LBarra * KgMtCubo ) / 1000000000 local FMaxPinze = EMT.FMAXPINZE local ForzaAtrito = 700 / 2 -- Serve per regolare P32 (700 valore reale pistone) local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAtrito) / 1000) - if ( TempoAcc < MinAccPinze) then TempoAcc = MinAccPinze end - if ( TempoAcc > MaxAccPinze) then TempoAcc = MaxAccPinze end - local AccPinze = FMaxPinze / ( 60 * TempoAcc) + local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC) local RidFeed = 100 / Massa * 100 if ( RidFeed > 100) then RidFeed = 100 end if IdTrave >= 0 then diff --git a/Common_FAST.NUM_PLUS.mlpe b/Common_FAST.NUM_PLUS.mlpe index b5fe644..7963d74 100644 --- a/Common_FAST.NUM_PLUS.mlpe +++ b/Common_FAST.NUM_PLUS.mlpe @@ -27,7 +27,9 @@ function OnStart() --EMT.LINEINC = 1 -- incremento numerazione linee --EMT.Ft = 'F' -- token per feed --EMT.St = 'S' -- token per speed - EMT.FMAXPINZE = 154000 -- feed massima pinze + EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze + EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze + EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze end --------------------------------------------------------------------- @@ -1096,17 +1098,13 @@ end --------------------------------------------------------------------- function CalcDinamicaPinze( dH, dS, dL) - local MinTempoAcc = 0.3 -- [s] - local MaxTempoAcc = 4.0 -- [s] 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 = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000) - if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end - if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end - local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc) - local AccPinze = FMaxPinze / ( 60 * TempoAcc) + local AccMaxPinze = EMT.MAXACC + local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC) local RidFeed = 100 / Massa * 100 if RidFeed > 100 then RidFeed = 100 diff --git a/Common_FAST.TPA.mlpe b/Common_FAST.TPA.mlpe index 41b1a42..a3832b5 100644 --- a/Common_FAST.TPA.mlpe +++ b/Common_FAST.TPA.mlpe @@ -31,7 +31,9 @@ function OnStart() --EMT.LINEINC = 1 -- incremento numerazione linee --EMT.Ft = 'F' -- token per feed --EMT.St = 'S' -- token per speed - EMT.FMAXPINZE = 154000 -- feed massima pinze + EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- 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 --------------------------------------------------------------------- @@ -1056,24 +1058,20 @@ end --------------------------------------------------------------------- function CalcDinamicaPinze( dH, dS, dL) - local MinTempoAcc = 0.3 -- [s] - local MaxTempoAcc = 4.0 -- [s] + local MinTempoAcc = EMT.MINACC -- [ms] ~300 + local MaxTempoAcc = EMT.MAXACC -- [ms] ~4000 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 = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000) - if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end - if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end - local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc) - local AccPinze = FMaxPinze / ( 60 * TempoAcc) + 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 * 1000, MinTempoAcc * 1000, RidFeed + return TempoAcc, MinTempoAcc, RidFeed end --------------------------------------------------------------------- diff --git a/UpdateLog.txt b/UpdateLog.txt index ab439c5..bd8fd56 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,8 @@ ==== Common_FAST Update Log ==== +Versione 2.7-- (--/--/2025) +- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052 + Versione 2.7f3 (26/06/2025) - (SIM-GEN) Aggiunti 10mm di sicurezza in caso di primo pinzaggio per stare oltre tolleranza riqualifica laser di 50mm. Ticket#2504 diff --git a/Version.lua b/Version.lua index be6e87e..e0a36b2 100644 --- a/Version.lua +++ b/Version.lua @@ -3,7 +3,7 @@ local InfoCommon_STD_PP = { NAME = 'Common_FAST', -- nome script PP standard - VERSION = '2.7f3', -- versione script + VERSION = '2.7--', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel }