Hi,
I have a problem with SpinTAC Position Move. I get error 1104. The documentation writes about this error:
"Calculation overflow, JrkLim out of the range"
I setup the Position Move with the following code:
// // set curve type // if (pMotion->nRampMode == nsCentrifugeMotor::RampSinusoid) { STPOSMOVE_setCurveType(stObj->posMoveHandle, ST_MOVE_CUR_STCRV); } else { STPOSMOVE_setCurveType(stObj->posMoveHandle, ST_MOVE_CUR_TRAP); } // // set distance to travel in spinTAC lib // int32_t posStepInt = nMoveCoords / MOTOR_ENCODER_STEPS_PER_REVOLUTION; float posStepFrac = ((float)(nMoveCoords % MOTOR_ENCODER_STEPS_PER_REVOLUTION)) / MOTOR_ENCODER_STEPS_PER_REVOLUTION; STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, posStepInt, _IQ(posStepFrac)); // // set velocity, acceleration, deceleration, jerk // // convert from U/min to kU/min maxVel_krpm = _IQ(((float)pMotion->nVelocity)/1000.0); STPOSMOVE_setVelocityLimit(stObj->posMoveHandle, _IQmpy(maxVel_krpm, _IQ(ST_SPEED_PU_PER_KRPM))); // convert from U/min^2 to kU/min/s maxAccel_krpmps = _IQ(((float)pMotion->nAcceleration)/60000.0); STPOSMOVE_setAccelerationLimit(stObj->posMoveHandle, _IQmpy(maxAccel_krpmps, _IQ(ST_SPEED_PU_PER_KRPM))); // convert from U/min^2 to kU/min/s maxDecel_krpmps = _IQ(((float)pMotion->nDeceleration)/60000.0); STPOSMOVE_setDecelerationLimit(stObj->posMoveHandle, _IQmpy(maxDecel_krpmps, _IQ(ST_SPEED_PU_PER_KRPM))); // use a fixed value for jerk STPOSMOVE_setJerkLimit(stObj->posMoveHandle, _IQ20mpy(_IQ20(jerk), _IQ20(ST_SPEED_PU_PER_KRPM))); // // configure SpinTAC Controller // STVELCTL_setEnable(stObj->velCtlHandle, false); STPOSMOVE_setEnable(stObj->posMoveHandle, true); STPOSCTL_setEnable(stObj->posCtlHandle, true);
I used the following parameters:
nMoveCoords = 4000 (MOTOR_ENCODER_STEPS_PER_REVOLUTION = 8000)
pMotion->nVelocity = 200
pMotion->nAcceleration = 60000
pMotion->nDeceleration = 60000
jerk = 4.0
I have a device where no error occurs. And I have another device where the hardware is slightly different, where the error occurs. Then I always get the error 1104.
When the distance to travel is greater (not 4000, but maybe 20000) there is no problem. I also tried to change the jerk parameter from 0.1 up to 8.0 but that did not help. I tried to change the acceleration/deceleration limit but this also did not help. I tried to increase the jerk limit during initialization from 1.0 to 5.0 with
STPOSMOVE_setJerkLimit(obj->posMoveHandle, _IQ20(5.0));
But this is also not a solution.
So where is the problem. What can I do?
Sebastian