|
|
|
@ -189,6 +189,8 @@ void MotorTask(void *argument) |
|
|
|
else if (g_isMotorInit > 0) |
|
|
|
{ |
|
|
|
static int LS_Motor_Config_Count = 0; |
|
|
|
static int iStatusQueryCycle = 0; |
|
|
|
|
|
|
|
if (LS_Motor_Config_Count <= 200) |
|
|
|
{ |
|
|
|
LS_Motor_Config_Count++; |
|
|
|
@ -197,6 +199,15 @@ void MotorTask(void *argument) |
|
|
|
MotorMgr_SetWatchdog(g_apstMotors[1], 1000); |
|
|
|
Rd_Delay(4); |
|
|
|
} |
|
|
|
|
|
|
|
MotorMgr_SetTargetSpeed(g_apstMotors[0], g_aiMotorSpeed[0]); |
|
|
|
Rd_Delay(4); |
|
|
|
MotorMgr_SetTargetSpeed(g_apstMotors[1], g_aiMotorSpeed[1]); |
|
|
|
Rd_Delay(4); |
|
|
|
|
|
|
|
if (++iStatusQueryCycle >= 10) |
|
|
|
{ |
|
|
|
iStatusQueryCycle = 0; |
|
|
|
MotorMgr_RequestPosition(g_apstMotors[0]); |
|
|
|
Rd_Delay(4); |
|
|
|
MotorMgr_RequestPosition(g_apstMotors[1]); |
|
|
|
@ -209,10 +220,7 @@ void MotorTask(void *argument) |
|
|
|
Rd_Delay(4); |
|
|
|
MotorMgr_RequestVelocity(g_apstMotors[1]); |
|
|
|
Rd_Delay(4); |
|
|
|
MotorMgr_SetTargetSpeed(g_apstMotors[0], g_aiMotorSpeed[0]); |
|
|
|
Rd_Delay(4); |
|
|
|
MotorMgr_SetTargetSpeed(g_apstMotors[1], g_aiMotorSpeed[1]); |
|
|
|
Rd_Delay(4); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|