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.

CCS/CCSTUDIO: lab 6b

Part Number: CCSTUDIO

Tool/software: Code Composer Studio

Hello,

I am working on lab 6b trying to get it to produce a simple motion profile for my motor. I don't understand the relationship between the acceleration and jerk entered and the acceleration displayed in CCS in the expression window. As you can see, in the code I have acceleration set to .1, but the acceleration displayed in the expression window is 2.4. Why aren't these values the same? Similarly, the jerk is set to 50 but the jerk displayed is 1200.

  • Hi Andrew,

    The parameter you entered in function STVELPLAN_setCfgHaltState has different unit than the parameter you saw on the watch window during debug. The parameters in the STVELPLAN_setCfgHaltState  function are

    //! \param[in] AccLim Acceleration limit for Halt state { unit: [pu/s^2], value range: [0.001, 120.0] }
    //! \param[in] JrkLim Jerk limit for Halt state { unit: [pu/s^3], value range: [0.0005, 2000.0] }

    and the watch window parameters has unit krpm/s and krps/s^2 respectively.

    Here the scale factor is calculated as

    //! \brief Defines the speed scale factor for the system
    //! \brief Compile time calculation for scale factor (ratio) used throughout the system
    #define ST_SPEED_KRPM_PER_PU ((0.001 * 60.0 * USER_IQ_FULL_SCALE_FREQ_Hz) / USER_MOTOR_NUM_POLE_PAIRS)

    Thanks.

    Han