From 68a92f942c4ffdbd39cdc380b7356f59d5bd11f7 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 29 Jul 2024 10:15:38 +0200 Subject: [PATCH 1/3] EgtMachKerenel : - ulteriore modifica per controllo punto medio in calcolo assi macchina di tipo centro di lavoro. --- Operation.cpp | 18 +++++++++++------- Operation.h | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Operation.cpp b/Operation.cpp index a726b74..8224b64 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -1984,6 +1984,8 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, Vector3d vtBackAux ; pMachine->GetBackAuxDirFromAngles( vAxRot, vtBackAux) ; pCamData->SetBackAuxDir( vtBackAux) ; + // tipo di movimento + int nMoveType = pCamData->GetMoveType() ; // se punto finale di linea if ( ! bFirst && pCamData->IsLine()) { // Verifica ricorsiva del punto medio @@ -1991,7 +1993,7 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, bool bAxesError ; if ( ! VerifyLineMidPoint( ptPrec, vtDirPrec, vtAuxPrec, vtCorrPrec, vAxPrec, ptP, vtDir, vtAux, vtCorr, vAxVal, - 0, nEntId, dRot1W, bMidAdded, bAxesError)) { + 0, nEntId, dRot1W, nMoveType, bMidAdded, bAxesError)) { LOG_ERROR( GetEMkLogger(), "Error : VerifyLineMidPoint of CalculateClPathAxesValues failed") return false ; } @@ -2301,7 +2303,7 @@ Operation::CalculateRotAxesValues( bool bFirst, const Vector3d& vtTool, const Ve bool Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, const Vector3d& vtAuxPrec, const Vector3d& vtCorrPrec, const DBLVECTOR& vAxPrec, const Point3d& ptP, const Vector3d& vtDir, const Vector3d& vtAux, const Vector3d& vtCorr, const DBLVECTOR& vAxVal, - int nCnt, int nEntId, double dRot1W, bool& bAdded, bool& bAxError) + int nCnt, int nEntId, double dRot1W, int nMoveType, bool& bAdded, bool& bAxError) { // impostazioni bAdded = false ; @@ -2340,6 +2342,8 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, return false ; // LOG_INFO( GetEMkLogger(), ( "Midpoint dist =" + ToString( dDist, 3)).c_str()) double dLinTol = GetApproxLinTol() ; + if ( nMoveType == 0) + dLinTol = max( 10 * dLinTol, LIN_TOL_RAW) ; // Se posizione in tolleranza, non devo fare alcunché if ( dDist <= dLinTol) @@ -2349,13 +2353,13 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, Point3d ptMid = Media( ptPrec, ptP) ; Vector3d vtDirMid = Media( vtDirPrec, vtDir) ; if ( ! vtDirMid.Normalize()) - return true ; + return ( nMoveType == 0) ; Vector3d vtAuxMid = Media( vtAuxPrec, vtAux) ; if ( ! vtAuxPrec.IsSmall() && ! vtAux.IsSmall() && ! vtAuxMid.Normalize()) - return true ; + return ( nMoveType == 0) ; Vector3d vtCorrMid = Media( vtCorrPrec, vtCorr) ; if ( ! vtCorrPrec.IsSmall() && ! vtCorr.IsSmall() && ! vtCorrMid.Normalize()) - return true ; + return ( nMoveType == 0) ; // inserisco nuova entità e modifico vecchia int nMidEntId = m_pGeomDB->Copy( nEntId, GDB_ID_NULL, nEntId, GDB_BEFORE) ; if ( nMidEntId == GDB_ID_NULL) @@ -2415,7 +2419,7 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, bool bAdded1, bAxError1, bAdded2, bAxError2 ; if ( ! VerifyLineMidPoint( ptPrec, vtDirPrec, vtAuxPrec, vtCorrPrec, vAxPrec, ptMid, vtDirMid, vtAuxMid, vtCorrMid, vAxMid, - nCnt, nMidEntId, dRot1W, bAdded1, bAxError1)) + nCnt, nMidEntId, dRot1W, nMoveType, bAdded1, bAxError1)) return false ; if ( bAxError1) { bAxError = true ; @@ -2423,7 +2427,7 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, } if ( ! VerifyLineMidPoint( ptMid, vtDirMid, vtAuxMid, vtCorrMid, vAxMid, ptP, vtDir, vtAux, vtCorr, vAxVal, - nCnt, nEntId, dRot1W, bAdded2, bAxError2)) + nCnt, nEntId, dRot1W, nMoveType, bAdded2, bAxError2)) return false ; if ( bAxError2) { bAxError = true ; diff --git a/Operation.h b/Operation.h index f477f21..fed8795 100644 --- a/Operation.h +++ b/Operation.h @@ -192,7 +192,7 @@ class Operation : public IUserObj const DBLVECTOR& vAxRotHome, const DBLVECTOR& vAxRotPrec, DBLVECTOR& vAxRot) ; bool VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, const Vector3d& vtAuxPrec, const Vector3d& vtCorrPrec, const DBLVECTOR& vAxPrec, const Point3d& ptP, const Vector3d& vtDir, const Vector3d& vtAux, const Vector3d& vtCorr, const DBLVECTOR& vAxVal, - int nCnt, int nEntId, double dRot1W, bool& bAdded, bool& bAxError) ; + int nCnt, int nEntId, double dRot1W, int nMoveType, bool& bAdded, bool& bAxError) ; bool CalculateClPathRobotAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W, bool bMaxDeltaR2OnFirst, bool bRotContOnNext, double dAngDeltaMinForHome, const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec) ; From 6348a40e18a44a9a7625f1f99a5338afe7529b25 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 30 Jul 2024 09:28:05 +0200 Subject: [PATCH 2/3] =?UTF-8?q?EgtMachKernel=202.6g7=20:=20-=20prime=20mod?= =?UTF-8?q?ifiche=20per=20gestire=20link=20tra=20lavorazioni=20con=20diver?= =?UTF-8?q?se=20modalit=C3=A0=20(per=20ora=20rimane=20la=20standard).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Machine.h | 1 + MachineCalc.cpp | 17 +++++++++++++++++ Operation.cpp | 48 +++++++++++++++++++++++++++++++++++++++-------- Operation.h | 2 ++ 5 files changed, 60 insertions(+), 8 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index a85db43b4fc8874bcc1be8abbc049af6982e0192..7a59acf1e79de420a726791a4896de0cda9be7bd 100644 GIT binary patch delta 236 zcmewt{V#gMI%aKGhCGIJh8%`WhGK>c1_cHUhESkLCPN8BDnkm89}HwAf_cT0IklxX ze_&=~W;EaYUhX2(<& nF)y2}rOv|(a;PWRX*mp)Acsxz>% diff --git a/Machine.h b/Machine.h index 64dd408..b2ef67d 100644 --- a/Machine.h +++ b/Machine.h @@ -126,6 +126,7 @@ class Machine bool GetAllCurrAxesNames( STRVECTOR& vAxName) const ; bool GetCurrAxisToken( int nInd, std::string& sAxToken) const ; bool GetAllCurrAxesTokens( STRVECTOR& vAxToken) const ; + bool GetCurrAxisType( int nInd, bool& bHead) const ; bool GetCurrAxisMin( int nInd, double& dMin) const ; bool GetCurrAxisMax( int nInd, double& dMax) const ; bool GetCurrAxisOffset( int nInd, double& dOffset) const ; diff --git a/MachineCalc.cpp b/MachineCalc.cpp index b62b7e8..e47fd5e 100644 --- a/MachineCalc.cpp +++ b/MachineCalc.cpp @@ -1947,6 +1947,23 @@ Machine::GetAllCurrAxesTokens( STRVECTOR& vAxToken) const return bOk ; } +//---------------------------------------------------------------------------- +bool +Machine::GetCurrAxisType( int nInd, bool& bHead) const +{ + int nLinAxes = int( m_vCalcLinAx.size()) ; + int nRotAxes = int( m_vCalcRotAx.size()) ; + if ( nInd >= 0 && nInd < nLinAxes) { + bHead = m_vCalcLinAx[nInd].bHead ; + return true ; + } + else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) { + bHead = m_vCalcRotAx[nInd-nLinAxes].bHead ; + return true ; + } + return false ; +} + //---------------------------------------------------------------------------- bool Machine::GetCurrAxisMin( int nInd, double& dMin) const diff --git a/Operation.cpp b/Operation.cpp index 8224b64..8961055 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -4008,6 +4008,7 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn pMch->GetAllCurrAxesNames( vAxName) ; if ( vAxName.size() != vAxStart.size() || vAxName.size() != vAxEnd.size()) return false ; + // Porto la macchina in home pMch->ResetAllAxesPos() ; // Elenco grezzi attivi @@ -4031,12 +4032,6 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn // Aggancio bloccaggi alla tavola corrente for ( const auto nFxtId : vFxtId) pMch->LinkFixtureToGroup( nFxtId, sTable) ; - // Parti di tavola da considerare per la collisione - INTVECTOR vTabCollId ; - pMch->GetCurrTableCollGroups( vTabCollId) ; - // Parti di testa e collegati da considerare per la collisione - INTVECTOR vHeadCollId ; - pMch->GetCurrHeadCollGroups( vHeadCollId) ; // Lancio la verifica custom int nRes = SpecialTestCollisionAvoid( vAxStart, vAxEnd) ; @@ -4045,6 +4040,45 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn return ( nRes == SCAV_AVOID) ; } + // Verifica standard + bool bCollAvoid ; + int nHeadOrder = 0 ; + if ( nHeadOrder == 0) { + bCollAvoid = OneMoveTestCollisionAvoid( vAxName, vAxStart, vAxEnd, pMch, vRawId, vFxtId) ; + } + else { + DBLVECTOR vAxMid( int( vAxName.size())) ; + // ciclo sugli assi correnti, assegno opportunamente valori a seconda del tipo (testa o tavola) + for ( int i = 0 ; i < int( vAxName.size()) ; ++ i) { + bool bHead ; pMch->GetCurrAxisType( i, bHead) ; + if ( nHeadOrder == -1) + vAxMid[i] = ( bHead ? vAxEnd[i] : vAxStart[i]) ; + else if ( nHeadOrder == +1) { + vAxMid[i] = ( bHead ? vAxStart[i] : vAxEnd[i]) ; + } + } + bCollAvoid = OneMoveTestCollisionAvoid( vAxName, vAxStart, vAxMid, pMch, vRawId, vFxtId) && + OneMoveTestCollisionAvoid( vAxName, vAxMid, vAxEnd, pMch, vRawId, vFxtId) ; + } + + // Ripristino lo stato macchina + ResetMachine( pMch) ; + + return bCollAvoid ; +} + +//---------------------------------------------------------------------------- +bool +Operation::OneMoveTestCollisionAvoid( const STRVECTOR& vAxName, const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, + Machine* pMch, const INTVECTOR& vRawId, const INTVECTOR& vFxtId) const +{ + // Parti di tavola da considerare per la collisione + INTVECTOR vTabCollId ; + pMch->GetCurrTableCollGroups( vTabCollId) ; + // Parti di testa e collegati da considerare per la collisione + INTVECTOR vHeadCollId ; + pMch->GetCurrHeadCollGroups( vHeadCollId) ; + // distanza di sicurezza const double TOL_SAFEDIST = 5.0 ; const double MIN_SAFEDIST = 5.0 ; @@ -4234,8 +4268,6 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn } } } - // Ripristino lo stato macchina - ResetMachine( pMch) ; return ( ! bCollide) ; } diff --git a/Operation.h b/Operation.h index fed8795..4dbd58b 100644 --- a/Operation.h +++ b/Operation.h @@ -220,6 +220,8 @@ class Operation : public IUserObj int GetUserNotesZmax( void) const ; bool GetZHomeDown( void) const ; bool TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ; + bool OneMoveTestCollisionAvoid( const STRVECTOR& vAxName, const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, + Machine* pMch, const INTVECTOR& vRawId, const INTVECTOR& vFxtId) const ; int SpecialTestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ; bool SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, int& nFlag2, bool& bModif) ; bool SpecialMoveRapid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, DBLVECTOR& vAxNew, bool& bModif) ; From 46e52e09950db882602fdf54b0f4f676f900cbbf Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 30 Jul 2024 11:45:24 +0200 Subject: [PATCH 3/3] EgtMachKernel 2.6g8 : - minimo step per fori abbassato a 1mm. --- Drilling.cpp | 2 +- EgtMachKernel.rc | Bin 11774 -> 11774 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Drilling.cpp b/Drilling.cpp index b10a86b..928d111 100644 --- a/Drilling.cpp +++ b/Drilling.cpp @@ -2300,7 +2300,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId) return false ; } // ciclo di affondamento a step - const double MIN_STEP = 5 ; + const double MIN_STEP = 1 ; const double APPR_STEP = 1 ; const double MIN_MOVE = 1 ; double dStep = max( m_Params.m_dStep, MIN_STEP) ; diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 7a59acf1e79de420a726791a4896de0cda9be7bd..a5125bd6f8afafd33811e6bb7007a9df4b84b409 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Pt&A-`fnHeo6Ka|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUdVBe(zn delta 97 zcmewt{V#gMFE&Q=&A-`fnHkL|Ka|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUYMBd`Df