#0005:扫描速度的下发; Jog运动,运动到指定点,扫描运动三种速度关系;定位合成速度问题,待Metus反馈

This commit is contained in:
zhengxuan.zhang
2024-06-27 15:52:57 +08:00
parent d48096b57d
commit 0c6dc6148a
2 changed files with 22 additions and 21 deletions
+20 -19
View File
@@ -301,7 +301,7 @@ HSI_Motion::HSI_Motion()
{
m_SetPotion_DriveSpeed[j] = 20; //设置定位驱动速度
//写日志
g_pLogger->SendAndFlushWithTime(L"m_SetPotion_DriveSpeed[%d] = %d\n", j, m_SetPotion_DriveSpeed[j]);
//g_pLogger->SendAndFlushWithTime(L"m_SetPotion_DriveSpeed[%d] = %d\n", j, m_SetPotion_DriveSpeed[j]);
}
m_Set_XYZA_Reserve = 0; //XYZA轴方向
@@ -3707,8 +3707,8 @@ HSI_STATUS HSI_Motion::GetSingleAxisParam(int AXIS, double motionParam[5])
ErrorsHandler();
}
//打印数组 motionParam[5]
g_pLogger->SendAndFlushWithTime(L"[GetSingleAxisParam] Vel = %.4f, ACC = %.4f, DCC = %.4f, KillDec = %.4f, Jerk = %.4f\n",
motionParam[0], motionParam[1], motionParam[2], motionParam[3], motionParam[4]);
/* g_pLogger->SendAndFlushWithTime(L"[GetSingleAxisParam] AXIS = %d, Vel = %.4f, ACC = %.4f, DCC = %.4f, KillDec = %.4f, Jerk = %.4f\n",
AXIS,motionParam[0], motionParam[1], motionParam[2], motionParam[3], motionParam[4]);*/
//g_pLogger->SendAndFlushWithTime(L"[GetSingleAxisParam] Out\n");
}
@@ -3760,8 +3760,8 @@ HSI_STATUS HSI_Motion::SetSingleAxisParam(int AXIS, double motionParam[5]) //设
//}
//打印 motionParam[5]
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] Vel = %.4f, ACC = %.4f, DCC = %.4f, KillDec = %.4f, Jerk = %.4f\n",
motionParam[0], motionParam[1], motionParam[2], motionParam[3], motionParam[4]);
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] AXIS = %d, Vel = %.4f, ACC = %.4f, DCC = %.4f, KillDec = %.4f, Jerk = %.4f\n",
AXIS,motionParam[0], motionParam[1], motionParam[2], motionParam[3], motionParam[4]);
//g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] Out\n");
}
@@ -7791,14 +7791,14 @@ HSI_STATUS HSI_Motion::GetSpeedXyzOld(int AxisNum, double& Speed)
HSI_STATUS HSI_Motion::GetSpeedXyz(int AxisNum, double& Speed)
{
g_pLogger->SendAndFlushWithTime(L"[GetSpeedXyz] In\n");
//g_pLogger->SendAndFlushWithTime(L"[GetSpeedXyz] In\n");
auto rStatus = HSI_STATUS_NORMAL;
short AxisNumber = AxisConvertIndex(AxisNum); //将轴号转换为 平台轴号
Speed = m_SetPotion_DriveSpeed[AxisNumber]; //从m_SetPotion_DriveSpeed[AxisNumber]中获取速度
g_pLogger->SendAndFlushWithTime(L"[GetSpeedXyz] AxisNum = %d, Speed=%d\n", AxisNumber, m_SetPotion_DriveSpeed[AxisNumber]);
g_pLogger->SendAndFlushWithTime(L"[GetSpeedXyz] Out\n");
//g_pLogger->SendAndFlushWithTime(L"[GetSpeedXyz] Out\n");
return rStatus;
}
@@ -8002,24 +8002,25 @@ short HSI_Motion::AxisConvertIndex(UINT AxisTypes)
//===========================================================================
void HSI_Motion::SetSingleAxisMotionParams(UINT AxisTypes, double SetMotionParam[5]) //设置单轴运动参数
{
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisMotionParams] In >>>>>>>>>>>>>>>>>>>>>>\n");
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisMotionParams] In >>>>>>>>>>>>>>>>>>>>>> \n");
double getMotionParam[5] = { 0 };
short AxisNumber = AxisConvertIndex(AxisTypes);
//打印轴当前运动参数
GetSingleAxisParam(AxisNumber, getMotionParam); //获取单轴运动参数
//打印 AxisTypes
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisMotionParams] AxisTypes = %d\n", AxisTypes);
GetSingleAxisParam(AxisTypes, getMotionParam); //获取单轴运动参数
g_pLogger->SendAndFlushWithTime(
L"[before] Axis= %.2f, Velocity = %.2f, Acceleration= %.2f, Deceleration= %.2f, KillDeceleration= %.2f, Jerk= %.2f\n",
AxisNumber, getMotionParam[0], getMotionParam[1], getMotionParam[2], getMotionParam[3], getMotionParam[4]);
L"[before] Axis= %d, Velocity = %.2f, Acceleration= %.2f, Deceleration= %.2f, KillDeceleration= %.2f, Jerk= %.2f\n",
AxisTypes, getMotionParam[0], getMotionParam[1], getMotionParam[2], getMotionParam[3], getMotionParam[4]);
//设置单轴参数
SetSingleAxisParam(AxisNumber, SetMotionParam);
SetSingleAxisParam(AxisTypes, SetMotionParam);
//打印轴当前运动参数
GetSingleAxisParam(AxisNumber, getMotionParam); //获取单轴运动参数
GetSingleAxisParam(AxisTypes, getMotionParam); //获取单轴运动参数
g_pLogger->SendAndFlushWithTime(
L"[after] Axis= %.2f, Velocity = %.2f, Acceleration= %.2f, Deceleration= %.2f, KillDeceleration= %.2f, Jerk= %.2f\n",
AxisNumber, getMotionParam[0], getMotionParam[1], getMotionParam[2], getMotionParam[3], getMotionParam[4]);
L"[after] Axis= %d, Velocity = %.2f, Acceleration= %.2f, Deceleration= %.2f, KillDeceleration= %.2f, Jerk= %.2f\n",
AxisTypes, getMotionParam[0], getMotionParam[1], getMotionParam[2], getMotionParam[3], getMotionParam[4]);
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisMotionParams] Out >>>>>>>>>>>>>>>>>>>>>>\n");
@@ -8279,7 +8280,7 @@ HSI_STATUS HSI_Motion::SetSpeedExOld(UINT AxisTypes, double Speed)
HSI_STATUS HSI_Motion::SetSpeedEx(UINT AxisTypes, double Speed)
{
auto rStatus = HSI_STATUS_NORMAL;
g_pLogger->SendAndFlushWithTime(L"[SetSpeedEx] In\n");
//g_pLogger->SendAndFlushWithTime(L"[SetSpeedEx] In\n");
short AxisNumber = AxisConvertIndex(AxisTypes);
if (Speed <= 0)
{
@@ -8297,7 +8298,7 @@ HSI_STATUS HSI_Motion::SetSpeedEx(UINT AxisTypes, double Speed)
//打印日志 轴号不在1-4之间
g_pLogger->SendAndFlushWithTime(L"[SetSpeedEx] 轴号不在0-8之间\n");
}
g_pLogger->SendAndFlushWithTime(L"[SetSpeedEx] Out\n");
//g_pLogger->SendAndFlushWithTime(L"[SetSpeedEx] Out\n");
return rStatus;
}
+2 -2
View File
@@ -12,5 +12,5 @@
#define HSI_VERSION_REVNUM
#define HSI_VERSION_BUILD_DATE _T(__DATE__ )
#define HSI_VERSION_BUILD_TIME _T(__TIME__ )
#define HSI_FILE_DESCRIPTION "周 2.24.06 / 18:03 "
#define HSI_FILE_CSDESCRIPTION _T("周 2.24.06 / 18:03 ")
#define HSI_FILE_DESCRIPTION "周 2.24.06 / 14:56 "
#define HSI_FILE_CSDESCRIPTION _T("周 2.24.06 / 14:56 ")