- costruzione piano generico in base a direzione utensile e non a vett. estrusione

- Componente W del piano generico è positiva verso l'alto
- Nel piano generico non si deve compensare altezza pezzo
This commit is contained in:
andrea.villa
2025-02-11 11:28:37 +01:00
parent 84fab92d78
commit d85aef5a6e
3 changed files with 29 additions and 10 deletions
+21 -8
View File
@@ -17,6 +17,7 @@ function OnStart()
EMT.USETO1 = true -- abilitazione uso origine tavola
EMT.MODAL = true -- abilitazione emissione modale
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
EMT.DECNUM = EgtIf( EMT.INCHES, 4, 3) -- numero di decimali dopo la virgola
EMT.NUM = false -- abilitazione numerazione linee
end
@@ -192,7 +193,12 @@ function OnRapid()
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- emissione primo punto della lavorazione
local sLinearAxes = EmtGetRapidAxis('L1') .. EmtGetRapidAxis('L2') .. EmtGetAxis('L3')
local sLinearAxes = EmtGetRapidAxis('L1') .. EmtGetRapidAxis('L2')
if not EMT.IPLGL then
sLinearAxes = sLinearAxes .. ' ' .. EMT.L3t .. EmtLenToString( - EgtMdbGetGeneralParam( MCH_GP.SAFEZ), EMT.DECNUM)
else
sLinearAxes = sLinearAxes .. EmtGetAxis('L3')
end
local sSpeed = ' S' .. EmtLenToString( EMT.S / 1000)
local sFeed = ' E50' -- feed rapido
local sToolSelection = GetToolSelectionString( EMT.HEAD, EMT.TCPOS)
@@ -220,6 +226,7 @@ function OnRapid()
EmtAdjustRotaryAxes()
-- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then
-- da gestire ???
-- altrimenti errore
else
error( "Unknown Rapid flag")
@@ -313,7 +320,7 @@ function EmitInterpPlane()
EMT.IPLGLFR = nil
-- Imposto piano di interpolazione
EMT.IPLSX = false
local vtE = Vector3d( EMT.EXTR)
local vtE = Vector3d( EMT.TDIR) -- si costruisce il piano in base alla direzione utensile
local nPlaneNumber = 1
-- piano TOP
@@ -334,7 +341,7 @@ function EmitInterpPlane()
if EMT.USETO1 then
ptS[1] = ptS[1] - EMT.TABORI1[1] - EMT.RAWPOS[1]
ptS[2] = ptS[2] - EMT.TABORI1[2] - EMT.RAWPOS[2] - EMT.HP
ptS[3] = ptS[3] - EMT.TABORI1[3] - EMT.RAWPOS[3] - EMT.TP
ptS[3] = ptS[3] - EMT.TABORI1[3] - EMT.RAWPOS[3]
end
-- calcolo per piano generico da emettere a vero inizio lavorazione
EMT.IPLGLFR = Frame3d( ptS, vtE)
@@ -349,7 +356,7 @@ function EmitInterpPlane()
end
EmtOutput( '( --- Plane GEN') -- EmtLenToString EgtNumToString
local sOriPlane = ' U' .. EmtLenToString( ptS:getX()) .. ' V' .. EmtLenToString( -ptS:getY()) .. ' W' .. EmtLenToString( -ptS:getZ())
local sOriPlane = ' U' .. EmtLenToString( ptS:getX()) .. ' V' .. EmtLenToString( -ptS:getY()) .. ' W' .. EmtLenToString( ptS:getZ())
local sDirPlane = ' A' .. EmtLenToString( dAngV) .. ' B' .. EmtLenToString( dAngO)
EmtOutput( 'G121 K'..EmtLenToString( EMT.INDEXGENPLANE)..sOriPlane..sDirPlane)
EmtOutput( 'G120 K' .. EmtLenToString( EMT.INDEXGENPLANE))
@@ -414,10 +421,16 @@ function MyAdjustLinearAxes()
EMT.L2 = EMT.L2 - vtE:getY()
EMT.L3 = EMT.L3 - vtE:getZ()
-- compensazione punto zero pezzo
EMT.L1 = EMT.L1 - EMT.RAWPOS[1]
EMT.L2 = EMT.L2 - EMT.RAWPOS[2] - EMT.HP
EMT.L3 = EMT.L3 - EMT.RAWPOS[3] - EMT.TP
if not EMT.IPLGL then
-- compensazione punto zero pezzo
EMT.L1 = EMT.L1 - EMT.RAWPOS[1]
EMT.L2 = EMT.L2 - EMT.RAWPOS[2] - EMT.HP
EMT.L3 = EMT.L3 - EMT.RAWPOS[3] - EMT.TP
else
EMT.L1 = EMT.L1 - EMT.RAWPOS[1]
EMT.L2 = EMT.L2 - EMT.RAWPOS[2] - EMT.HP
EMT.L3 = EMT.L3 - EMT.RAWPOS[3]
end
EmtAdjustLinearAxes()
+1 -1
View File
@@ -126,7 +126,7 @@ EmtAxis {
Dir = Y_AX(),
Pos = Point3d( -135, 86.5, 0),
Stroke = AAxisStroke,
Home = 0,
Home = 90,
Geo = 'A_AXIS/GEO',
Aux = 'A_AXIS/SOLID'}
EmtHead {
+7 -1
View File
@@ -55,7 +55,13 @@ end
---------------------------------------------------------------------
function OnSimulEnd()
-- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( 'X')
local HomeY = EgtGetAxisHomePos( 'Y')
local HomeZ1 = EgtGetAxisHomePos( 'Z1')
local HomeC = EgtGetAxisHomePos( 'C')
local HomeA = EgtGetAxisHomePos( 'A')
SimulMoveAxes( 'X', HomeX, MCH_SIM_STEP.RAPID, 'Y', HomeY, MCH_SIM_STEP.RAPID,'Z1', HomeZ1, MCH_SIM_STEP.RAPID, 'A', HomeA, MCH_SIM_STEP.COLLROT, 'C', HomeC, MCH_SIM_STEP.COLLROT)
end
---------------------------------------------------------------------