From 1980cd36583fc3451b2f7ca3aa3b581a3202bfea Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 14 Jan 2020 08:12:49 +0000 Subject: [PATCH] =?UTF-8?q?EgtMachKernel=202.2a3=20:=20-=20aggiunta=20gest?= =?UTF-8?q?ione=20controllo=20velocit=C3=A0=20su=20tagli=20con=20lama=20di?= =?UTF-8?q?=20archi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Sawing.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++++ Sawing.h | 1 + 3 files changed, 53 insertions(+) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 80c5472f54f52021a4a5ac33053fc3aeacf8857e..f5eb0fd1af22765a87ab228814d52da041efc2e2 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 diff --git a/Sawing.cpp b/Sawing.cpp index 46e8006..2d367e8 100644 --- a/Sawing.cpp +++ b/Sawing.cpp @@ -733,6 +733,9 @@ Sawing::Update( bool bPostApply) return false ; } + // aggiustamento feed per movimenti 4 assi + AdjustFeeds() ; + // gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione if ( ! AdjustStartEndMovements()) { string sInfo = m_pMchMgr->GetOutstrokeInfo() ; @@ -752,6 +755,55 @@ Sawing::Update( bool bPostApply) return true ; } +//---------------------------------------------------------------------------- +bool +Sawing::AdjustFeeds( void) +{ + // controlli su GeomDB e simili non ripetuti perchè già fatti + + // recupero gruppo della geometria di lavorazione (Cutter Location) + int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ; + if ( nClId == GDB_ID_NULL) + return false ; + + // ciclo sui gruppi CL + int nClPathId = m_pGeomDB->GetFirstGroupInGroup( nClId) ; + while ( nClPathId != GDB_ID_NULL) { + // ciclo su tutte le entità del percorso CL + for ( int nEntId = m_pGeomDB->GetFirstInGroup( nClPathId) ; + nEntId != GDB_ID_NULL ; + nEntId = m_pGeomDB->GetNext( nEntId)) { + // recupero i dati Cam dell'entità + CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ; + if ( pCamData == nullptr) + continue ; + // se arco + if ( pCamData->IsArc()) { + // determino lunghezza di movimento del tip utensile + Vector3d vtCenEnd = pCamData->GetEndPoint() - pCamData->GetCenter() ; + Vector3d vtTipRad = vtCenEnd - vtCenEnd * pCamData->GetNormDir() * pCamData->GetNormDir() ; + double dTipRad = vtTipRad.Len() ; + double dTipAngCen = pCamData->GetAngCen() ; + double dTipLen = dTipRad * abs( dTipAngCen) * DEGTORAD ; + // determino lunghezza di movimento degli assi utensile + double dAxRad = pCamData->GetAxesRad() ; + double dAxAngCen = pCamData->GetAxesAngCen() ; + double dAxLenXYZ = dAxRad * dAxAngCen * DEGTORAD ; + double dAxLen = sqrt( max( dAxLenXYZ * dAxLenXYZ + dAxAngCen * dAxAngCen, 0.)) ; + // correggo la feed di movimento + if ( dTipLen > EPS_SMALL && dAxLen > EPS_SMALL) { + double dCoeff = dAxLen / dTipLen ; + double dFeed = pCamData->GetFeed() ; + pCamData->SetFeed( dFeed * dCoeff) ; + } + } + } + nClPathId = m_pGeomDB->GetNextGroup( nClPathId) ; + } + + return true ; +} + //---------------------------------------------------------------------------- bool Sawing::GetParam( int nType, bool& bVal) const diff --git a/Sawing.h b/Sawing.h index d4fb8b6..4cdc188 100644 --- a/Sawing.h +++ b/Sawing.h @@ -128,6 +128,7 @@ class Sawing : public Machining bool AddApproach( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ; bool AddRetract( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ; bool AreHeadWorkOnSameSide( void) const ; + bool AdjustFeeds( void) ; private : double GetSpeed( void) const