#0006: 扫描时速度的交互?底层向metus传输急停错误? jerk 和减减速度的设置?
This commit is contained in:
@@ -234,9 +234,9 @@ HSI_Motion::HSI_Motion()
|
||||
|
||||
//是否启用日志
|
||||
CTime tm = CTime::GetCurrentTime();
|
||||
//CString csTime = tm.Format("%Y-%m-%d_%H-%M-%S"); //构造时间字符串
|
||||
CString csTime = tm.Format("%Y-%m-%d"); //构造时间字符串
|
||||
CString dir = L"\\Log\\" + csTime += L"_EF3.Log";
|
||||
CString csTime = tm.Format("%Y-%m-%d_%H-%M-%S"); //构造时间字符串
|
||||
//CString csTime = tm.Format("%Y-%m-%d"); //构造时间字符串
|
||||
CString dir = L"\\Log\\" + csTime += L"_Motion.Log";
|
||||
g_pLogger = new CLogger(dir);
|
||||
g_pLogger2 = new CLogger(L"\\Log\\EF3_SumTime.Log");
|
||||
|
||||
@@ -3541,8 +3541,8 @@ HSI_STATUS HSI_Motion::SetPositionXyz(UINT AxisTypes, double PositionX, double P
|
||||
m_SetPotion_DriveSpeed[1],
|
||||
m_SetPotion_DriveSpeed[1] * 10,
|
||||
m_SetPotion_DriveSpeed[1] * 10,
|
||||
0,
|
||||
0
|
||||
m_SetPotion_DriveSpeed[1] * 100,
|
||||
m_SetPotion_DriveSpeed[1] * 100
|
||||
};
|
||||
|
||||
SetSingleAxisMotionParams(ACSC_AXIS_1, X_SetmotionParam);//设置X轴定位速度
|
||||
@@ -3552,8 +3552,8 @@ HSI_STATUS HSI_Motion::SetPositionXyz(UINT AxisTypes, double PositionX, double P
|
||||
m_SetPotion_DriveSpeed[2],
|
||||
m_SetPotion_DriveSpeed[2] * 10 ,
|
||||
m_SetPotion_DriveSpeed[2] * 10,
|
||||
0,
|
||||
0
|
||||
m_SetPotion_DriveSpeed[2] * 100,
|
||||
m_SetPotion_DriveSpeed[2] * 100
|
||||
};
|
||||
|
||||
|
||||
@@ -3561,11 +3561,11 @@ HSI_STATUS HSI_Motion::SetPositionXyz(UINT AxisTypes, double PositionX, double P
|
||||
|
||||
g_pLogger->SendAndFlushWithTime(L"[SetPositionXyz] 设置Z轴定位速度 %d\n", m_SetPotion_DriveSpeed[3]);
|
||||
double Z_SetmotionParam[5] = {
|
||||
m_SetPotion_DriveSpeed[3],
|
||||
m_SetPotion_DriveSpeed[3] * 10 ,
|
||||
m_SetPotion_DriveSpeed[3] * 10,
|
||||
0,
|
||||
0
|
||||
m_SetPotion_DriveSpeed[3], //速度
|
||||
m_SetPotion_DriveSpeed[3] * 10 ,//加速度
|
||||
m_SetPotion_DriveSpeed[3] * 10, //减速度
|
||||
m_SetPotion_DriveSpeed[3] * 100,//加加速度
|
||||
m_SetPotion_DriveSpeed[3] * 100 //减减速度
|
||||
};
|
||||
|
||||
SetSingleAxisMotionParams(ACSC_AXIS_8, Z_SetmotionParam);//设置Z轴定位速度
|
||||
@@ -3744,20 +3744,21 @@ HSI_STATUS HSI_Motion::SetSingleAxisParam(int AXIS, double motionParam[5]) //设
|
||||
rStatus = HSI_ACS_ERROR;
|
||||
ErrorsHandler();
|
||||
}
|
||||
//// 杀死速度
|
||||
//if (!acsc_SetKillDeceleration(handleACS, AXIS, motionParam[3], nullptr))
|
||||
//{
|
||||
// g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] acsc_SetKillDeceleration error\n");
|
||||
// rStatus = HSI_ACS_ERROR;
|
||||
// ErrorsHandler();
|
||||
//}
|
||||
////抖动
|
||||
//if (!acsc_SetJerk(handleACS, AXIS, motionParam[4], nullptr))
|
||||
//{
|
||||
// g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] acsc_SetJerk error\n");
|
||||
// rStatus = HSI_ACS_ERROR;
|
||||
// ErrorsHandler();
|
||||
//}
|
||||
ACSC_WAITBLOCK* Wait = NULL;
|
||||
// 杀死速度
|
||||
if (!acsc_SetKillDeceleration(handleACS, AXIS, motionParam[3], Wait))
|
||||
{
|
||||
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] acsc_SetKillDeceleration error\n");
|
||||
rStatus = HSI_ACS_ERROR;
|
||||
ErrorsHandler();
|
||||
}
|
||||
//抖动
|
||||
if (!acsc_SetJerk(handleACS, AXIS, motionParam[4], Wait))
|
||||
{
|
||||
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] acsc_SetJerk error\n");
|
||||
rStatus = HSI_ACS_ERROR;
|
||||
ErrorsHandler();
|
||||
}
|
||||
|
||||
//打印 motionParam[5]
|
||||
g_pLogger->SendAndFlushWithTime(L"[SetSingleAxisParam] AXIS = %d, Vel = %.4f, ACC = %.4f, DCC = %.4f, KillDec = %.4f, Jerk = %.4f\n",
|
||||
@@ -4132,7 +4133,7 @@ HSI_STATUS HSI_Motion::Load_EF3_Motion_Inifile(CString GoogolIniFile)
|
||||
/*m_JogDriveSpeed[j][i] = GetPrivateProfileInt(L"JOG_SPEED", L"JOG_DRIVESPEED_" , 10, csAppPath);*/
|
||||
//m_JogDriveSpeed[j][i] = speed / (m_Resolution[j] * 50);//速度转换为脉冲
|
||||
m_JogDriveSpeed[j][i] = speed; //直接读取速度
|
||||
g_pLogger->SendAndFlushWithTime(L"[Load_EF3_Motion_Inifile] m_JogDriveSpeed[%d][%d]: %ld %ld\n", i, j,
|
||||
g_pLogger->SendAndFlushWithTime(L"[Load_EF3_Motion_Inifile] m_JogDriveSpeed[%d][%d]: %ld %ld\n", j, i,
|
||||
speed, m_JogDriveSpeed[j][i]); //打印配置文件 档位速度
|
||||
|
||||
GetPrivateProfileString(L"JOG_SPEED", L"JOG_STARTSPEED_" + strGear[i] + axisNum[j], L"10",
|
||||
@@ -7796,7 +7797,7 @@ HSI_STATUS HSI_Motion::GetSpeedXyz(int AxisNum, double& Speed)
|
||||
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] AxisNum = %d, Speed=%d\n", AxisNumber, Speed);
|
||||
|
||||
//g_pLogger->SendAndFlushWithTime(L"[GetSpeedXyz] Out\n");
|
||||
return rStatus;
|
||||
|
||||
@@ -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 / 14:56 "
|
||||
#define HSI_FILE_CSDESCRIPTION _T("周四 2.24.06 / 14:56 ")
|
||||
#define HSI_FILE_DESCRIPTION "周五 2.24.07 / 17:38 "
|
||||
#define HSI_FILE_CSDESCRIPTION _T("周五 2.24.07 / 17:38 ")
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user