From 74a0bc4a438fca40cc7672dd194d514e1256ef13 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 24 Sep 2024 10:13:10 +0200 Subject: [PATCH] Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco --- Common_FAST.mlse | 86 +++++++++++++++++++++++++++++++++++++++++++++++- UpdateLog.txt | 4 +++ Version.lua | 2 +- 3 files changed, 90 insertions(+), 2 deletions(-) diff --git a/Common_FAST.mlse b/Common_FAST.mlse index f4be8e6..fba0a4c 100644 --- a/Common_FAST.mlse +++ b/Common_FAST.mlse @@ -1111,7 +1111,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack) EgtOutLog( ' *[L2]', 1) end else - -- si pinza sempre a 1000mm massimo + -- altrimenti si pinza sempre a massimo 1000mm dNewYDelta = min( dNewYDelta, 1000) end @@ -1492,6 +1492,7 @@ end --------------------------------------------------------------------- function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF, dVDeltaF, bFixedDelta, bFixedPos) local dYPosA, dVPosA, dTPosA + local dGainOnReclamping = BD.GAIN_RECLAMPING or 1000 -- se primo scambio local MyMinY = EgtIf( EMC.CNT == 1, MinY + AGG_LOAD, MinY) @@ -1568,6 +1569,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF dVPosI = dVPosA table.insert( vCmd, { 11, 1}) end + -- se spostando morsa diretto esco dalle corse, calcolo di quanto devo muovere la trave (cioè l'altra morsa) come minimo -- se non era ingaggiata, vado al suo minimo if not EMC.VDELTA then @@ -1580,6 +1582,27 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF dBeamMove = dVPosI + ( dVDeltaF - dVDeltaI) - MaxV end + -- se serve un grande spostamento e si sta pinzando poco. Y trascinatore pinza poco e V si sposta per prima per recuperare + if not BD.FASTCLAMPING and abs( dBeamMove) > 2000 and dDeltaBeam < 0 and EMC.LB - dYDeltaI < max( 550, (MinJoin * 2)) then + table.insert( vCmd, { 12, 0}) + dVPosA = dVPosI - dGainOnReclamping + -- sposto il carrello V di 1000mm + table.insert( vCmd, { 1, 'V', dVPosA}) + table.insert( vCmd, { 12, 1}) + -- apro morsa Y e recupero i 1000mm + table.insert( vCmd, { 11, 0}) + dVPosA = dVPosI + dYPosA = dYPosI + dTPosA = dTPosI + dGainOnReclamping + table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA}) + dTPosI = dTPosA + dVPosI = dVPosA + dVDeltaI = dVDeltaI - dGainOnReclamping + dYDeltaI = dYDeltaI - dGainOnReclamping + table.insert( vCmd, { 11, 1}) + dBeamMove = dBeamMove + dGainOnReclamping + end + table.insert( vCmd, { 12, 0}) dTPosA = dTPosI - dBeamMove @@ -1667,6 +1690,27 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF dBeamMove = dYPosI + ( dYDeltaF - dYDeltaI) - MaxY end + -- se serve un grande spostamento e si sta pinzando poco. V trascinatore pinza poco e Y si sposta per prima per recuperare + if not BD.FASTCLAMPING and abs( dBeamMove) > 2000 and dDeltaBeam > 0 and dVDeltaI < max( 550, (MinJoin * 2)) then + table.insert( vCmd, { 11, 0}) + dYPosA = dYPosI + dGainOnReclamping + -- sposto il carrello V di 1000mm + table.insert( vCmd, { 1, 'Y', dYPosA}) + table.insert( vCmd, { 11, 1}) + -- apro morsa Y e recupero i 1000mm + table.insert( vCmd, { 12, 0}) + dVPosA = dVPosI + dYPosA = dYPosI + dTPosA = dTPosI - dGainOnReclamping + table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA}) + dTPosI = dTPosA + dVPosI = dVPosA + dVDeltaI = dVDeltaI + dGainOnReclamping + dYDeltaI = dYDeltaI + dGainOnReclamping + table.insert( vCmd, { 12, 1}) + dBeamMove = dBeamMove - dGainOnReclamping + end + table.insert( vCmd, { 11, 0}) dTPosA = dTPosI + dBeamMove @@ -1768,6 +1812,26 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF -- Il trascinatore si decide in base alla direzione di movimento trave -- trascino con morsa allo scarico. Obiettivo mandare Y in posizione per prima if dDeltaBeam > 0 then + -- se serve un grande spostamento e si sta pinzando poco. Y trascinatore pinza poco e V si sposta per prima per recuperare + if not BD.FASTCLAMPING and abs( dDeltaBeam) > 2000 and dVDeltaI < max( 550, (MinJoin * 2)) then + table.insert( vCmd, { 11, 0}) + dYPosA = dYPosI + dGainOnReclamping + -- sposto il carrello V di 1000mm + table.insert( vCmd, { 1, 'Y', dYPosA}) + table.insert( vCmd, { 11, 1}) + -- apro morsa Y e recupero i 1000mm + table.insert( vCmd, { 12, 0}) + dVPosA = dVPosI + dYPosA = dYPosI + dTPosA = dTPosI - dGainOnReclamping + table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA}) + dTPosI = dTPosA + dVPosI = dVPosA + dVDeltaI = dVDeltaI + dGainOnReclamping + dYDeltaI = dYDeltaI + dGainOnReclamping + table.insert( vCmd, { 12, 1}) + end + -- apro morsa al carico table.insert( vCmd, { 11, 0}) -- devo recuperare più delle corse disponibili di entrambi i carrelli @@ -1853,6 +1917,26 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF end -- trave si muove dallo scarico verso il carico. Obiettivo mandare V in posizione per prima else + -- se serve un grande spostamento e si sta pinzando poco. Y trascinatore pinza poco e V si sposta per prima per recuperare + if not BD.FASTCLAMPING and abs( dDeltaBeam) > 2000 and EMC.LB - dYDeltaI < max( 550, (MinJoin * 2)) then + table.insert( vCmd, { 12, 0}) + dVPosA = dVPosI - dGainOnReclamping + -- sposto il carrello V di 1000mm + table.insert( vCmd, { 1, 'V', dVPosA}) + table.insert( vCmd, { 12, 1}) + -- apro morsa Y e recupero i 1000mm + table.insert( vCmd, { 11, 0}) + dVPosA = dVPosI + dYPosA = dYPosI + dTPosA = dTPosI + dGainOnReclamping + table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA}) + dTPosI = dTPosA + dVPosI = dVPosA + dVDeltaI = dVDeltaI - dGainOnReclamping + dYDeltaI = dYDeltaI - dGainOnReclamping + table.insert( vCmd, { 11, 1}) + end + -- apro morsa allo scarico table.insert( vCmd, { 12, 0}) -- devo recuperare più del doppio delle corse diff --git a/UpdateLog.txt b/UpdateLog.txt index d1dd83c..b44ed72 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,9 @@ ==== Common_FAST Update Log ==== +Versione 2.6i4 (24/09/2024) +- (SIM-GEN) Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco. + L'aggiunta del ripinzaggio dipende da FASTCLAMPING (che deve essere disattiva). Viene aggiunta GAIN_RECLAMPING per decidere il guadagno in mm del ripinzaggio. + Versione 2.6i3 (23/09/2024) - (SIM-GEN) Aggiunta nuova strategia riposizionamento morse - (SIM-GEN) Aggiunta lettura flag NEWCLAMPING in BeamData, per abilitare nuova strategia riposizionamento. Se false o nil, funziona con metodo vecchio. diff --git a/Version.lua b/Version.lua index bbe883c..a600b8d 100644 --- a/Version.lua +++ b/Version.lua @@ -3,7 +3,7 @@ local InfoCommon_STD_PP = { NAME = 'Common_FAST', -- nome script PP standard - VERSION = '2.6i3', -- versione script + VERSION = '2.6i4', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel }