diff --git a/Common_ONE-PF.NUM.mlpe b/Common_ONE-PF.NUM.mlpe index c228279..1c36653 100644 --- a/Common_ONE-PF.NUM.mlpe +++ b/Common_ONE-PF.NUM.mlpe @@ -911,7 +911,16 @@ function OnRapid() if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) - EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed}) + EmitMoveDataHead( 1, { B=EMT.R2, S=Speed}) + else + EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + end + if bMoveZbeforeX then EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) end @@ -995,7 +1004,15 @@ function OnRapid() if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) - EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed}) + EmitMoveDataHead( 1, { B=EMT.R2, S=Speed}) + else + EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + end if bMoveZbeforeX then EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) end @@ -1065,7 +1082,15 @@ function OnRapid() if EMT.HEAD == 'H22' then EmitMoveDataHead( 2, { B=0, S=Speed}) EmitMoveDataHead( 2, { C=EMT.R1, S=Speed}) - EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed}) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + EmitMoveDataHead( 2, { Z=dZref, B=dBref, S=Speed}) + EmitMoveDataHead( 2, { B=EMT.R2, S=Speed}) + else + EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed}) + end if bMoveZbeforeX then EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed}) end @@ -1285,7 +1310,15 @@ function OnRapid() if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) - EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed}) + EmitMoveDataHead( 1, { B=EMT.R2, S=Speed}) + else + EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + end if bMoveZbeforeX then EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) end @@ -1374,7 +1407,15 @@ function OnRapid() if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then EmitMoveDataHead( 1, { B=0, S=Speed}) EmitMoveDataHead( 1, { C=EMT.R1, S=Speed}) - EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + EmitMoveDataHead( 1, { Z=dZref, B=dBref, S=Speed}) + EmitMoveDataHead( 1, { B=EMT.R2, S=Speed}) + else + EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed}) + end if bMoveZbeforeX then EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed}) end @@ -1439,7 +1480,15 @@ function OnRapid() if EMT.HEAD == 'H22' then EmitMoveDataHead( 2, { B=0, S=Speed}) EmitMoveDataHead( 2, { C=EMT.R1, S=Speed}) - EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed}) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + EmitMoveDataHead( 2, { Z=dZref, B=dBref, S=Speed}) + EmitMoveDataHead( 2, { B=EMT.R2, S=Speed}) + else + EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed}) + end if bMoveZbeforeX then EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed}) end diff --git a/Common_ONE-PF.mlpe b/Common_ONE-PF.mlpe index 2c3b4c8..078b1ff 100644 --- a/Common_ONE-PF.mlpe +++ b/Common_ONE-PF.mlpe @@ -1051,7 +1051,15 @@ function OnSimulMoveStart() if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT) - SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT) + SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) + else + SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) + end if bMoveZbeforeX then SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID) end @@ -1120,7 +1128,15 @@ function OnSimulMoveStart() if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT) - SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT) + SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) + else + SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT) + end if bMoveZbeforeX then SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID) end @@ -1192,7 +1208,15 @@ function OnSimulMoveStart() if EMT.HEAD == 'H22' then SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT) SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT) - SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT) + -- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento + -- evita collisione con carro X + if EMT.R2 > 90 or EMT.R2 < -90 then + local dBref = EgtClamp( EMT.R2, -90, 90) + SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', dBref, MCH_SIM_STEP.COLLROT) + SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT) + else + SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT) + end if bMoveZbeforeX then SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID) end diff --git a/UpdateLog.txt b/UpdateLog.txt index 420183b..bf34e53 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -2,6 +2,7 @@ Versione 2.7-- (--/--/2025) -(SIM-GEN) Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset(). Ticket#2727 +-(SIM-GEN) Divisione movimento B in approccio se > 90°. Ticket#2754 Versione 2.7k3 (28/11/2025) - (GEN) Prima di andare allo scarico, si aggiunge movimento intermedio dove si aspetta che rulli scarico siano arrivati in posizione. Ticket#2716