EgtMachKernel 2.4i5 :

- aggiunta gestione flag MaxDeltaR2OnFirst su testa per disabilitare controllo massimo delta su secondo asse rotante all'inizio di una lavorazione.
This commit is contained in:
DarioS
2022-10-03 08:56:46 +02:00
parent f8f23ed713
commit 677a8466dd
12 changed files with 63 additions and 34 deletions
+13 -7
View File
@@ -1470,6 +1470,9 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
// recupero peso primo asse rotante di testa
double dRot1W = m_pMchMgr->GetCalcRot1W() ;
// recupero flag controllo delta massimo secondo asse rotante anche su primo movimento di lavorazione
bool bMaxDeltaR2OnFirst = m_pMchMgr->GetCalcMaxDeltaR2OnFirst() ;
// recupero la minima differenza angolare da posizione precedente per stare vicino a posizione home
double dAngDeltaMinForHome = m_pMchMgr->GetAngDeltaMinForHome() ;
@@ -1490,18 +1493,21 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
while ( nClPathId != GDB_ID_NULL) {
DBLVECTOR vAxRotPrecOri = vAxRotPrec ;
int nOutStrC = 0 ;
if ( ! CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, dAngDeltaMinForHome, vAxRotHome, vAxRotPrec, nOutStrC)) {
if ( ! CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, bMaxDeltaR2OnFirst,
dAngDeltaMinForHome, vAxRotHome, vAxRotPrec, nOutStrC)) {
// se attivata scelta angolo iniziale vicino ad home ed extra corsa C, provo a rifarlo disattivando
if ( dAngDeltaMinForHome < ANG_FULL && nOutStrC != 0) {
m_pMchMgr->GetCurrMachine()->ResetOutstrokeInfo() ;
CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, INFINITO, vAxRotHome, vAxRotPrec, nOutStrC) ;
CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, bMaxDeltaR2OnFirst,
INFINITO, vAxRotHome, vAxRotPrec, nOutStrC) ;
}
// se extracorsa dell'asse C, provo a precaricarlo al contrario
if ( nOutStrC != 0) {
vAxRotPrec[0] = vAxRotPrecOri[0] + ( nOutStrC > 0 ? - ANG_FULL : ANG_FULL) ;
vAxRotPrec[1] = vAxRotPrecOri[1] ;
m_pMchMgr->GetCurrMachine()->ResetOutstrokeInfo() ;
if ( ! CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, INFINITO, vAxRotHome, vAxRotPrec, nOutStrC))
if ( ! CalculateClPathAxesValues( nClPathId, nLinAxes, nRotAxes, dRot1W, bMaxDeltaR2OnFirst,
INFINITO, vAxRotHome, vAxRotPrec, nOutStrC))
bOk = false ;
}
else
@@ -1515,13 +1521,13 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
//----------------------------------------------------------------------------
bool
Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W, bool bMaxDeltaR2OnFirst,
double dAngDeltaMinForHome, const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec, int& nOutStrC)
{
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// massima variazione secondo asse rotante per continuità
double dDeltaR2Max = 30 ;
double dMaxDeltaR2 = 30 ;
// predispongo variabile per valori assi
DBLVECTOR vAxVal ;
vAxVal.reserve( 8) ;
@@ -1669,10 +1675,10 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
if ( bAng2 && ( dDelta2 < dDelta1 - EPS_ANG_SMALL || ! bAng1))
swap( vAng1, vAng2) ;
// se imposto limite su variazione di secondo asse rotante
if ( dDeltaR2Max > EPS_ANG_SMALL && vAng1.size() >= 2) {
if ( ( bMaxDeltaR2OnFirst || ! bFirst) && dMaxDeltaR2 > EPS_ANG_SMALL && vAng1.size() >= 2) {
double dR2Diff1 = vAng1[1] - vAxRotPrec[1] ;
double dR2Diff2 = vAng2[1] - vAxRotPrec[1] ;
if ( abs( dR2Diff1) > abs( dR2Diff2) && abs( dR2Diff1) > dDeltaR2Max)
if ( abs( dR2Diff1) > abs( dR2Diff2) && abs( dR2Diff1) > dMaxDeltaR2)
swap( vAng1, vAng2) ;
}
}