From e5442d976a7c407d97458064dc1419e4740e7757 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 21 Jul 2025 11:57:37 +0200 Subject: [PATCH 1/3] Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare --- Common_FAST.NUM.mlpe | 21 +++++++++++++++++---- Common_FAST.NUM_PLUS.mlpe | 18 +++++++++++++++--- Common_FAST.TPA.mlpe | 21 +++++++++++++++++++-- Common_FAST.mlpe | 16 +++++++++++++--- UpdateLog.txt | 3 +++ Version.lua | 2 +- 6 files changed, 68 insertions(+), 13 deletions(-) diff --git a/Common_FAST.NUM.mlpe b/Common_FAST.NUM.mlpe index 4ab98cb..f24d531 100644 --- a/Common_FAST.NUM.mlpe +++ b/Common_FAST.NUM.mlpe @@ -626,11 +626,17 @@ function OnRapid() end end + local bGoToHome = false + -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then + bGoToHome = true + end + -- primo posizionamento local MyZHome = EgtGetAxisHomePos( 'Z') local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti - if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then + if not EMT.LOAD and EMT.PREVHEAD == 'H3' and (EMT.ST > BeamHeightForFixRot or bGoToHome) and EMT.FLAG2 == 1 then local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) .. ' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES @@ -652,11 +658,18 @@ function OnRapid() local sES = ' ES'..EgtNumToString( EMT.S, 0) -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione - if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and - ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350)) and EMT.FLAG2 == 1 then + if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and + ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then + local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. - EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES + ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES + EmtOutput( sOutPreMove) + local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES + EmtOutput( sOutPreMove) + local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + ' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES EmtOutput( sOutPreMove) EmtOutput( 'G101 ET1001') EmtOutput( 'G101 ET2001') diff --git a/Common_FAST.NUM_PLUS.mlpe b/Common_FAST.NUM_PLUS.mlpe index 7963d74..8f9d62d 100644 --- a/Common_FAST.NUM_PLUS.mlpe +++ b/Common_FAST.NUM_PLUS.mlpe @@ -675,11 +675,17 @@ function OnRapid() end end + local bGoToHome = false + -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then + bGoToHome = true + end + -- primo posizionamento local MyZHome = EgtGetAxisHomePos( 'Z') local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti - if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then + if not EMT.LOAD and EMT.PREVHEAD == 'H3' and ( EMT.ST > BeamHeightForFixRot or bGoToHome) and EMT.FLAG2 == 1 then local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) .. ' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES @@ -725,10 +731,16 @@ function OnRapid() -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and - ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350)) and EMT.FLAG2 == 1 then + ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. - EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES + ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES + EmtOutput( sOutPreMove) + local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES + EmtOutput( sOutPreMove) + local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + ' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES EmtOutput( sOutPreMove) EmtOutput( 'G101 ET1001') EmtOutput( 'G101 ET2001') diff --git a/Common_FAST.TPA.mlpe b/Common_FAST.TPA.mlpe index 17f8f8d..45ec899 100644 --- a/Common_FAST.TPA.mlpe +++ b/Common_FAST.TPA.mlpe @@ -658,11 +658,18 @@ function OnRapid() bHeadFirst = false end end + + local bGoToHome = false + -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then + bGoToHome = true + end + -- primo posizionamento local MyZHome = EgtGetAxisHomePos( 'Z') local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti - if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then + if not EMT.LOAD and EMT.PREVHEAD == 'H3' and ( EMT.ST > BeamHeightForFixRot or bGoToHome) and EMT.FLAG2 == 1 then local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. ' P4=' .. EgtNumToString( EMT.R2pp, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) .. ' P6=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) .. @@ -679,8 +686,18 @@ function OnRapid() -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and - ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350)) and EMT.FLAG2 == 1 then + ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. + ' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) .. + ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. + ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') + EmtOutput( sOutPreMove) + sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. + ' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) .. + ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. + ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') + EmtOutput( sOutPreMove) + sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. ' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') diff --git a/Common_FAST.mlpe b/Common_FAST.mlpe index e327619..957048e 100644 --- a/Common_FAST.mlpe +++ b/Common_FAST.mlpe @@ -785,14 +785,24 @@ function OnSimulMoveStart() VerifyVStroke( EMT.A2) -- se inizio lavorazione if EMT.MCHFIRST then + + local bGoToHome = false + -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2p - EMT.R2) > 25 or abs( EMT.R1p - EMT.R1) > 25) then + bGoToHome = true + end + EgtOutText( '') EMT.MCHFIRST = false local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) -- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo - if not EMT.LOAD and EMT.MOVE == 0 and ( EMT.HB > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TOTLEN > 350)) and EMT.FLAG2 == 1 then - -- se motosega mi muovo a X di sicurezza per ruotare + if not EMT.LOAD and EMT.MOVE == 0 and ( EMT.HB > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then + -- se motosega mi muovo a X di sicurezza per ruotare, prima si raddrizza B e poi C in posizione if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) then - SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT) + SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID) + SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT) + SimulMoveAxis( 'C', EMT.R1, MCH_SIM_STEP.COLLROT) + SimulMoveAxis( 'B', EMT.R2, MCH_SIM_STEP.COLLROT) end end EMT.POSTROT = nil diff --git a/UpdateLog.txt b/UpdateLog.txt index 148139e..48e5d7e 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,8 @@ ==== Common_FAST Update Log ==== +Versione 2.7-- (--/--/2025) +- (SIM-GEN) Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare. Ticket#1844 + Versione 2.7g1 (01/07/2025) - (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052 diff --git a/Version.lua b/Version.lua index 453ada9..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.7g1', -- versione script + VERSION = '2.7--', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel } From 1f358ce1e1dc96812825bf32eba3ff9284387610 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 21 Jul 2025 13:09:49 +0200 Subject: [PATCH 2/3] Migliorata gestione movimenti speciali in caso di motosega --- Common_FAST.NUM.mlpe | 20 ++++++++++++-------- Common_FAST.NUM_PLUS.mlpe | 19 ++++++++++++------- Common_FAST.TPA.mlpe | 13 ++++++++----- Common_FAST.mlpe | 6 ++++-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/Common_FAST.NUM.mlpe b/Common_FAST.NUM.mlpe index f24d531..126d684 100644 --- a/Common_FAST.NUM.mlpe +++ b/Common_FAST.NUM.mlpe @@ -496,6 +496,7 @@ function OnMachiningEnd() EMT.U_STD = nil EMT.PREVTOOL = EMT.TOOL EMT.PREVHEAD = EMT.HEAD + EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3) end --------------------------------------------------------------------- @@ -626,9 +627,11 @@ function OnRapid() end end + local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3) + local bGoToHome = false -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio - if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and sET == EMT.PREVET and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then bGoToHome = true end @@ -654,21 +657,22 @@ function OnRapid() local sEE = ' EE' .. EgtIf( bZmax, '3', '4') local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3) local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3) - local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3) local sES = ' ES'..EgtNumToString( EMT.S, 0) -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') - local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') - local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + local sOutPreMove + if EMT.HEAD == 'H3' and bGoToHome then + sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES - EmtOutput( sOutPreMove) - local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + EmtOutput( sOutPreMove) + sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES - EmtOutput( sOutPreMove) - local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + EmtOutput( sOutPreMove) + end + sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES EmtOutput( sOutPreMove) EmtOutput( 'G101 ET1001') diff --git a/Common_FAST.NUM_PLUS.mlpe b/Common_FAST.NUM_PLUS.mlpe index 8f9d62d..a245c20 100644 --- a/Common_FAST.NUM_PLUS.mlpe +++ b/Common_FAST.NUM_PLUS.mlpe @@ -544,6 +544,7 @@ function OnMachiningEnd() EMT.PREVTOOL = EMT.TOOL EMT.PREVHEAD = EMT.HEAD EMT.PREVR3 = EMT.R3 + EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3) end --------------------------------------------------------------------- @@ -675,9 +676,11 @@ function OnRapid() end end + local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3) + local bGoToHome = false -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio - if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and sET == EMT.PREVET and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then bGoToHome = true end @@ -726,20 +729,22 @@ function OnRapid() sER = sER..EmtLenToString( EMT.TDIAM / 2, 3) end - local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3) local sES = ' ES'..EgtNumToString( EMT.S, 0) -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') - local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + local sOutPreMove + if EMT.HEAD == 'H3' and bGoToHome then + sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES - EmtOutput( sOutPreMove) - local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + EmtOutput( sOutPreMove) + sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES - EmtOutput( sOutPreMove) - local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. + EmtOutput( sOutPreMove) + end + sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. ' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES EmtOutput( sOutPreMove) EmtOutput( 'G101 ET1001') diff --git a/Common_FAST.TPA.mlpe b/Common_FAST.TPA.mlpe index 45ec899..c6aafe7 100644 --- a/Common_FAST.TPA.mlpe +++ b/Common_FAST.TPA.mlpe @@ -661,7 +661,7 @@ function OnRapid() local bGoToHome = false -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio - if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TCPOS == EMT.PREVTCPOS and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then bGoToHome = true end @@ -687,16 +687,19 @@ function OnRapid() -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and ( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then - local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. + local sOutPreMove + if EMT.HEAD == 'H3' and bGoToHome then + sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. ' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') - EmtOutput( sOutPreMove) - sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. + EmtOutput( sOutPreMove) + sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. ' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') - EmtOutput( sOutPreMove) + EmtOutput( sOutPreMove) + end sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) .. ' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. diff --git a/Common_FAST.mlpe b/Common_FAST.mlpe index 957048e..bb9357c 100644 --- a/Common_FAST.mlpe +++ b/Common_FAST.mlpe @@ -788,7 +788,7 @@ function OnSimulMoveStart() local bGoToHome = false -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio - if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( abs( EMT.R2p - EMT.R2) > 25 or abs( EMT.R1p - EMT.R1) > 25) then + if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TOOL == EMT.PREVTOOL and abs( EMT.R3p - EMT.R3) < 100 * GEO.EPS_SMALL and ( abs( EMT.R2p - EMT.R2) > 25 or abs( EMT.R1p - EMT.R1) > 25) then bGoToHome = true end @@ -798,11 +798,13 @@ function OnSimulMoveStart() -- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo if not EMT.LOAD and EMT.MOVE == 0 and ( EMT.HB > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then -- se motosega mi muovo a X di sicurezza per ruotare, prima si raddrizza B e poi C in posizione - if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) then + if EMT.HEAD == 'H3' and bGoToHome then SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C', EMT.R1, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'B', EMT.R2, MCH_SIM_STEP.COLLROT) + elseif ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) then + SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT) end end EMT.POSTROT = nil From 6a530927c91ee4ad37659499a4a29fc25f2e19f6 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 8 Sep 2025 08:41:00 +0200 Subject: [PATCH 3/3] Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico --- Common_FAST.mlse | 8 ++++++-- UpdateLog.txt | 3 ++- Version.lua | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Common_FAST.mlse b/Common_FAST.mlse index 34a8e5e..1abfef3 100644 --- a/Common_FAST.mlse +++ b/Common_FAST.mlse @@ -1642,7 +1642,9 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF -- * deve effettivamente spostarsi -- * non si arriva da gestione passo del pellegrino -- * se riesce a raggiungere la posizione con le corse a disposizione per come sono posizionate le morse attualmente - if ( dYDeltaI - dVDeltaF) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and abs( dVDeltaF - dVDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and + if ( dYDeltaI - dVDeltaF) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and + ( abs( dVDeltaF - dVDeltaI) > 10 * GEO.EPS_SMALL or not EMC.VDELTA) and + not EMC.PILGRIMSTEP and ( dVDeltaF - dVDeltaI > MinV - dVPosI + MyMinY - dYPosI) then table.insert( vCmd, { 0, 'Direct-V-Y'}) -- se l'altra morsa non era in presa, vado a pinzare il pezzo @@ -1747,7 +1749,9 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF -- * deve effettivamente spostarsi -- * non si arriva da gestione passo del pellegrino -- * se riesce a raggiungere la posizione con le corse a disposizione per come sono posizionate le morse attualmente - elseif ( dYDeltaF - dVDeltaI) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL and not EMC.PILGRIMSTEP and + elseif ( dYDeltaF - dVDeltaI) + 10 * GEO.EPS_SMALL >= MyMinY - MaxV and + ( abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL or not EMC.YDELTA) and + not EMC.PILGRIMSTEP and ( dYDeltaF - dYDeltaI < MaxY - dYPosI + MaxV - dVPosI) then table.insert( vCmd, { 0, 'Direct-Y-V'}) -- se l'altra morsa non era in presa, vado a pinzare il pezzo diff --git a/UpdateLog.txt b/UpdateLog.txt index 48e5d7e..ad9dabe 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,7 +1,8 @@ ==== Common_FAST Update Log ==== -Versione 2.7-- (--/--/2025) +Versione 2.7i1 (08/09/2025) - (SIM-GEN) Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare. Ticket#1844 +- (SIM-GEN) Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico dove la pinza V poteva andare in posizione direttamente, ma cercava di fare passo pellegrino. Ticket#2572 Versione 2.7g1 (01/07/2025) - (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052 diff --git a/Version.lua b/Version.lua index e0a36b2..3841ba9 100644 --- a/Version.lua +++ b/Version.lua @@ -3,7 +3,7 @@ local InfoCommon_STD_PP = { NAME = 'Common_FAST', -- nome script PP standard - VERSION = '2.7--', -- versione script + VERSION = '2.7i1', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel }