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.

TMS320F28069M-Q1: Motion Position Plan: Modify PLAN with different speed do not seem to comply

Part Number: TMS320F28069M-Q1

void RVP_setupPosPlan6Step_ModifyPlanVelocity(float Krpm)
    _iq   VelLim, AccLim, DecLim;
    _iq20   JrkLim;
    uint16_t FromState,ToState,AndOr,CondIdx1,CondIdx2;
    ST_Obj *stObj = (ST_Obj *) RVP_stHandle[5];
    STPOSPLAN_getCfgTran(stObj->posPlanHandle, 1, &FromState, &ToState, &AndOr, &CondIdx1, &CondIdx2, &VelLim, &AccLim, &DecLim, &JrkLim); // From StateB to StateC
    VelLim = _IQ24(Krpm * ST_SPEED_PU_PER_KRPM);   // ST_SPEED_PU_PER_KRPM =0.1333
    STPOSPLAN_setCfgTran(stObj->posPlanHandle, 1, FromState, ToState, (ST_PlanCond_e) AndOr, CondIdx1, CondIdx2, VelLim, AccLim, DecLim, JrkLim);           // From StateB to StateC
    STPOSPLAN_getCfgTran(stObj->posPlanHandle, 1, &FromState, &ToState, &AndOr, &CondIdx1, &CondIdx2, &VelLim, &AccLim, &DecLim, &JrkLim);

void RVP_DisplayPosPlan(_iq VelLim, _iq AccLim, _iq DecLim, _iq20 JrkLim)
    zprintf("Velim : %Q24\n",VelLim);
    zprintf("AccLim: %Q24\n",AccLim);
    zprintf("DecLim: %Q24\n",DecLim);
    zprintf("JrkLim: %Q20\n",JrkLim);

Attached code which modifies the VeLim for different speed parameter before starts. I tried a different speed and it does not comply. Below is the terminal snapshot, the activity period is the time taken to complete the plan should differ (as well as observing the motor spins).... but it does not between 100rpm and 1000rpm 

The code below work when I change the VelLim in there for each debug flash and run. 

I have read the Instant Spin User Guide but could not find the reason. 

void RVP_setupPosPlan_Plan6_ValveZero(ST_Handle sthandle)
    _iq   velMax, accMax, jrkMax;                             // DWORD = 32 bit.
    _iq   velLim, accLim, decLim;
    _iq20 jrkLim;
    ST_Obj *stObj = (ST_Obj *)sthandle;
    // Pass the configuration array pointer into SpinTAC Position Plan
    STPOSPLAN_setCfgArray(stObj->posPlanHandle, &stPosPlanCfgArray_Plan6[0], sizeof(stPosPlanCfgArray_Plan6), 0, 0, 0, 4, 4);
    // Establish the Velocity, Acceleration, Deceleration, and Jerk Maximums
    velMax = _IQ24(2.5 * ST_SPEED_PU_PER_KRPM);  // 1000 RPM to PU number. = 0.333               // Limit:0.0 to +1.0
    accMax = _IQ24(17.0);                        // Max Accel, should this be 120, not 127?
    jrkMax = _IQ20(266.0);                       // Max Jerk
    velLim = _IQ24(0.05 * ST_SPEED_PU_PER_KRPM);   // ST_SPEED_PU_PER_KRPM =0.1333                                         // Limit:0.0 to 1.0
    accLim = _IQ24(17.0);                         //_IQ24(1.0 * ST_SPEED_PU_PER_KRPM);     17 is very max Accel for Q24   // Limit:0.001 to 120.0
    decLim = _IQ24(17.0);                         //_IQ24(1.0 * ST_SPEED_PU_PER_KRPM);                                    // Limit:0.001 to 120.0
    //----------------------------------------------------------------------------Jerk via ST_MOVE_CUR_STCRV
    jrkLim = _IQ20(266.0);                        // Max is 266 under ST_MOVE_CUR_STCRV only.                             // Limit:0.0005, 2000.0

    //gMotorVars.SpinTAC.PosMoveCurveType: See pobj->PosMoveCurveType[5] in RVP_MotorPlan.c
    STPOSPLAN_setCfg(stObj->posPlanHandle, _IQ(ST_SAMPLE_TIME), false);                       // Do not repeat Loop.
    STPOSPLAN_setCfgHaltState(stObj->posPlanHandle, 0, 0, velMax, accMax, jrkMax, 1000L);     // Configure halt state: PosStep[MRev], PosStepFrac[MRev], VelEnd, AccMax, JrkMax, Timer

    //Example: STPOSPLAN_addCfgState(handle,    PosStep[MRev], PosStepFrac[MRev], StateTimer[ticks]);
    STPOSPLAN_addCfgState(stObj->posPlanHandle, 0,              0,                  1L);   // StateIdx0: A
    STPOSPLAN_addCfgState(stObj->posPlanHandle, +6,             0,                  1L);   // StateIdx1: B      // This does nothing since it now controlled by STEP/FRAC code.
    STPOSPLAN_addCfgState(stObj->posPlanHandle, 0,              0,                  1L);   // StateIdx2: C

    //Example: STPOSPLAN_addCfgTran(handle,    FromState, ToState, CondOption, CondIdx1, CondiIdx2, VelLim[pups],            AccLim[pups2], DecLim[pups2], JrkLim[pups3]);
    // NOTE: The deceleration limit must be set between the following bounds [acceleration limit, 10*acceleration limit]

    STPOSPLAN_addCfgTran(stObj->posPlanHandle, 0,   1, ST_COND_NC, 0,        0,         velLim,      accLim,      decLim,      jrkLim);   // From StateA to StateB
    STPOSPLAN_addCfgTran(stObj->posPlanHandle, 1,   2, ST_COND_NC, 0,        0,         velLim,      accLim,      decLim,      jrkLim);   // From StateB to StateC
    STPOSPLAN_addCfgTran(stObj->posPlanHandle, 2,   0, ST_COND_NC, 0,        0,         velLim,      accLim,      decLim,      jrkLim);   // From StateD to StateA