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.

InstaSPIN-Motion acceleration more than 500krpm/s2

Hello, I posted "InstaSPIN acceleration more than 500krpm/s2" as follows.

http://e2e.ti.com/support/microcontrollers/c2000/f/902/p/316054/1138610.aspx#1138610

It was solved by the helpful supports. We checked enough acceleration on our equipment by using the modified codes on InstaSPIN-FOC.

As the next step, we need the same acceleration as above on InstaSPIN-Motion.

How do we modify InstaSPIN-Motion source codes?

Best regards,

ay0689 

  • ay0689,

    The limit on acceleration in InstaSPIN-MOTION is due to the conversion between scaled units and real-world units.  If we remove the scaling, you can set accelerations up to the fixed point limit.

    The first place to modify is in the spintac_velocity.h file.  This can be accessed by opening the main.h file.  Look in the function ST_setupVelMove.  There is a line where we set the profile maximums.  You can replace it with the following:

    STVELMOVE_setProfileMaximums(obj->velMoveHandle, _IQ24(1.0), _IQ24(120.0), _IQ20(2000.0));

    This represents the absolute maximum limits of SpinTAC Velocity Move.  These are scaled unit values, so their true value is dependent on the base frequency value you have specified in the user.h file.  This is defined by USER_IQ_FULL_SCALE_FREQ_Hz.

    Next, in the main source file you need to make modifications in the ST_runVelMove function to remove the scaling on the acceleration and jerk variables.  See the code example below and compare it to the code in your main source file.

    STVELMOVE_setAccelerationLimit(stObj->velMoveHandle, gMotorVars.MaxAccel_krpmps);
    STVELMOVE_setJerkLimit(stObj->velMoveHandle, gMotorVars.MaxJrk_krpmps2);

    This now changes the units of the variables in the gMotorVars struct.  They are no long krpm/s & krpm/s^2.  They are scaled unit / sec and scaled unit / sec^2 respectively.  

    When setting fast accelerations it is also important to make sure you set a high enough jerk as well.  In SpinTAC Velocity Move, we use the jerk to limit the rate of change of acceleration, so if you set a very large acceleration but a small jerk, then the profile will end up with a sloe acceleration since it is not allowed to change very quickly.  

    Also if you are using SpinTAC Velocity Plan you will need to modify the code there that writes to the gMotorVars so that it will not place user unit values into these variables.