This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SpinTAC Position Move Error 1104

Other Parts Discussed in Thread: MOTORWARE, UNIFLASH

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

  • Hi,

    I'm using motorware v13.

    Sebastian
  • Sebastian,

    Can you post the exact values found in the following variables when you get the 1104 error?
    st_obj.pos.move.PosStepInt_mrev
    st_obj.pos.move.PosStepFrac_mrev
    st_obj.pos.move.VelLim
    st_obj.pos.move.AccLim
    st_obj.pos.move.DecLim
    st_obj.pos.move.JrkLim

    The macro ST_SPEED_PU_PER_KRPM is based on your motor and system parameters, and without knowing those it is difficult for me to know exactly why this error is occurring. If you give me those values I'll be able to suggest some things you can change in order to get rid of this error.

    Thanks
  • Hi Adam,

    I'm not really sure what is the cause for my problem. The situation is, that the problem occurs at our customer. The customer has build two new prototype devices and flashed our software by using TI/Uniflash. Then he gets the error 1104 when positioning the motor with both devices. And this is the only issue that is known at the moment.

    Then one device was shipped to me and I flashed the exactly same software and I do not have the error 1104.

    So I'm pretty irritated where the problem is. And I'm not sure if there is a problem with the SpinTAC lib or anywhere else.

    Sebastian

  • Sebastian,

    The 1104 error in Position Move is letting you know that the SpinTAC library protected you from underflow. Basically this error only happens when the profile limits are out of balance with each other. Maybe the position step is getting set way too small for a given jerk limit, or something is causing the jerk limit calculation to produce a number that is too small.

    If you can get the values I posted previously and provide me with a user.h file I can tell you exactly why this is occurring and what limits you can change to prevent this.

    Just as a guess I would try increasing the jerk, accel/decel, and velocity limits one at a time to get this error to go away.
  • Hi Adam,

    here are the variables you have requested:

    PosStepInt_mrev: 0.000000

    PosStepFrac_mrev: 0.500000

    VelLim: 0.029333

    AccLim: 0.133333

    DecLim: 0.133333

    JrkLim: 0.533333

    And here ist the user.h file:

    7534.user.h

    And here is the spinTAC header file:

    spintac_velocity.h

    Hope this helps.

    What I do not understand ist, that it's working here when I flash the softwar and it's not working when the customer flashes the software. The requested parameters are always the same.

    Thanks

    Sebastian

  • Sebastian,

    I plugged your values into our simulator and was successfully generating profiles.  So I'm getting the same results that you are.

    However I am running SpinTAC v2.3.0 which is included in MotorWare 14.  Which version of MotorWare are you using?

    My guess is that the customer must be putting in different values than you are.  

    If I play with the settings I'm not able to get a 1104 error until I reduce PosStepFrac_mrev to 0.00005.  Is it possible that the PosStepFrac_mrev is being set to too small of a value?

  • Hi Adam,

    as I already wrote I'm still using motorware v13. Might this be a problem?

    The software set's the values in the SpinTAC library and after that I read them out. So I think it's unlikely that the customer has different values.

    Is there something else I can do?

    Sebastian
  • Hi Adam,

    it's getting very strange now: The customer told me that he now uses another computer to flash the software. And the problem is gone. But when he uses his computer the problem comes back.

    We are using TI/UniFlash to flash the software to the device. We also made a flash dump (start 0x3E8000, length 131072), but the dump's of a working and not working flashing process are absolutely identical.

    And if the software produces this error 1104, it is the only known issue of the software.

    So I do not understand:

    - why does it work when flashing the software with computer A but not when flashing with computer B

    - if it is somehow related to the flashing process, why is the flash checksum and the flash dump identical

    - if something fails during flashing why is the software working except this error 1104

    I hope we can bring some light into this. It's very hard for me to explain this to the customer without loosing confidence.

    Sebastian

  • Sebastian,

    This is very strange behavior. I don't think this error is related to the SpinTAC library. Maybe there is something about the customer's computer or installation/version of Uniflash/CCS.