EgtMachKernel :

- miglioria nel calcolo assi per robot (verifica continuità).
This commit is contained in:
Dario Sassi
2025-10-26 19:25:10 +01:00
parent ec5590bd29
commit 7bad9a5cc6
2 changed files with 33 additions and 0 deletions
+2
View File
@@ -72,6 +72,8 @@ class CamData : public IUserObj
{ m_bToolShow = bShow ; return true ; }
int GetMoveType( void) const
{ return m_nMove ; }
bool IsRapid( void) const
{ return ( m_nMove == 0) ; }
bool IsLine( void) const
{ return ( m_nMove == 0 || m_nMove == 1) ; }
bool IsArc( void) const
+31
View File
@@ -2722,6 +2722,37 @@ Operation::CalculateClPathRobotAxesValues( int nClPathId, double dAngDeltaMinFor
nFlag2Prec = pCamData->GetFlag2() ;
bToolShowPrec = pCamData->GetToolShow() ;
}
// controllo la continuità del movimento
const double MAX_DELTA_ANG = 45 ;
bool bRotContOnNext = ( GetType() != OPER_DISP) ;
int nInd = 0 ;
int nCount = m_pGeomDB->GetGroupObjs( nClPathId) ;
const DBLVECTOR* pvPrevAxVal = nullptr ;
for ( int nEntId = m_pGeomDB->GetFirstInGroup( nClPathId) ;
nEntId != GDB_ID_NULL ;
nEntId = m_pGeomDB->GetNext( nEntId)) {
// indice del movimento
++ nInd ;
// recupero i dati Cam dell'entità
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
continue ;
const DBLVECTOR& vCurrAxVal = pCamData->GetAxesVal() ;
// se movimento di lavoro ed esiste precedente, li confronto
if ( ! pCamData->IsRapid() && pvPrevAxVal != nullptr) {
// Se richiesta continuità, verifico non ci siano salti
double dDeltaR4 = vCurrAxVal[3] - (*pvPrevAxVal)[3] ;
double dDeltaR6 = vCurrAxVal[5] - (*pvPrevAxVal)[5] ;
if ( bRotContOnNext && ( abs( dDeltaR4) > MAX_DELTA_ANG || abs( dDeltaR6) > MAX_DELTA_ANG)) {
string sOut = "Lost continuity on R4 (Diff=" + ToString( dDeltaR4, 1) +
") or R6 (Diff=" + ToString( dDeltaR6, 1) +
") at move " + ToString( nInd) + " of " + ToString( nCount) ;
m_pMchMgr->SetWarning( 1101, sOut) ;
}
}
// salvo nuovi precedenti
pvPrevAxVal = &vCurrAxVal ;
}
return bOk ;
}