|
@@ -35,7 +35,7 @@ void PositionControlTaskInit (void) {
|
|
|
// positionSettingMutex = osMutexNew (NULL);
|
|
|
osThreadAttr_t osThreadAttrPositionControlTask = { 0 };
|
|
|
osThreadAttrPositionControlTask.stack_size = configMINIMAL_STACK_SIZE * 2;
|
|
|
- osThreadAttrPositionControlTask.priority = (osPriority_t)osPriorityNormal;
|
|
|
+ osThreadAttrPositionControlTask.priority = (osPriority_t)osPriorityHigh;
|
|
|
|
|
|
positionXControlTaskInitArg.channel1 = TIM_CHANNEL_1;
|
|
|
positionXControlTaskInitArg.channel2 = TIM_CHANNEL_2;
|
|
@@ -74,7 +74,7 @@ void PositionControlTaskInit (void) {
|
|
|
}
|
|
|
|
|
|
void PositionControlTask (void* argument) {
|
|
|
- const int32_t PositionControlTaskTimeOut = 100;
|
|
|
+ const int32_t PositionControlTaskTimeOut = 10;
|
|
|
PositionControlTaskInitArg* posCtrlTaskArg = (PositionControlTaskInitArg*)argument;
|
|
|
PositionControlTaskData posCtrlData __attribute__ ((aligned (32))) = { 0 };
|
|
|
uint32_t motorStatus = 0;
|
|
@@ -148,7 +148,11 @@ void PositionControlTask (void* argument) {
|
|
|
#ifdef DBG_POSITION
|
|
|
printf ("Axe %c speed up phase\n", posCtrlTaskArg->axe);
|
|
|
#endif
|
|
|
- movementPhase = speedUpPhase;
|
|
|
+ if (abs (posCtrlData.positionSettingValue - startPosition) > ANGLE_RANGE_FOR_MOTOR_SPEED_LIMIT) {
|
|
|
+ movementPhase = speedUpPhase;
|
|
|
+ } else {
|
|
|
+ movementPhase = slowDownPhase;
|
|
|
+ }
|
|
|
timeLeftMS = 0;
|
|
|
moveCmdTimeoutCounter = 0;
|
|
|
} else {
|