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: InstaSPIN Motion (Position control) stopping the motor

Part Number: TMS320F28069M-Q1


we have implemented the position control using InstaSPIN - SpinTac position control using eQEP angle sensor.

Things worked fine and i can rotate the motor at integer number of revolution and fraction of a revolution as well.

now, i am trying to stop the motor while rotating (e.g i wanted to rotate the motor 50 revolutions, but say i want to stop after 10 revolutions).

the InstaSPIN user guide section 3.5.6 (SpinTac Position Control) table 3-16 has two control ENB and RESET, snapshot below.

i tried to disable ENB while it is running.  Instead of stopping the motor, it spins the motor really fast (as of no control of speed during rotation) to reach the revolution and then it stops.

after that, it does not work well anymore.  i have to disable the motor and come back in.

The reasons we ask these questions were that:

1- we will measure the input current, if the motor Iq torque becomes too large (e.g. > 1.5A) we want to disable the motor quickly.  The hardware cut off through PWM trip is set to higher limit.

2- after disable the position control, we will rocking the motor shaft back and forth to release the debris.  When disabling the motor, we do not want to force motor angle to 0 again by Rs process because the motor can be jammed.  what is the clean way to stop the motor without redoing the Rs to force rotor to 0 position again?

Thanks and Best Regards,


  • i tried to disable ENB while it is running.  Instead of stopping the motor

    No, you can't use this method to stop the motor for InstaSPIN-Motion.

    If you brake the motor, the position will be lost for InstaSPIN-Motion, you have to re-start the InstaSPIN-Motion.

  • Thanks Yanming and i noticed that.  my question is still:

    1- how do you properly stop the motor before the InstaSPIN-MOTION completes the number of revolution user set?

    2- i like to stop the motor during rotation such that it does not lose the rotor position.  how can you accomplish this?

    this is now a pressing issue for us.  please give us correct method for InstaSPIN-MOTION.



  • 1. The InstaSPIN-Motion will decrease the running speed according to the motion profile and plan, and then turn-off the PWM output.

    2. InstaSPIN-motion doesn't support this function in the example labs. You have to accomplish by adding your own codes.

  • Hi Yanming,

    thank you so much for the answer, but this does not answer my questions from user. 

    the problem i have is that i do not know how SpinTac is done and they only exposed the API listed in the user guide, so there is not so much control i can do.

    For #1, my question is how to stop in a "sudden" like emergency stop before the profile execution completes?  There has to be something implemented by SpinTac or TI Inta-SPIN for this purpose.  i know you can disable PWM output, but this is not the proper way of doing it because SpinTac loop can be stuck in some weird state.

    For #2,  this is related to question #1.  what is the option to add on?  can you please just tell me the logic, no need for codes, but the logic to make it work with Insta-SPIN MOTION framework?



  • Hi Yanming,

    i think i found the answer myself.  the Insta-SPIN user is kind of confusing.  

    SpinTac Posotoin has multiple subcomponents like Control, Move, and Plan.

    Each of them has the ENB control bit.  To make sudden stop while rotating, i used the wrong ENB (Control component) in the past.

    the correct one is setting this: st_obj.pos.move.ENB = 0; where st_obj is an instance of ST_Obj.

    typedef struct _ST_Obj
    POS_Params_t pos; //!< the position components of the SpinTAC (ST) object
    ST_Ver_t version; //!< the version (ST_Ver) object
    ST_POSCTL_Handle posCtlHandle; //!< Handle for Position Controller (ST_PosCtl)
    ST_POSMOVE_Handle posMoveHandle; //!< Handle for Position Move (ST_PosMove)
    ST_POSPLAN_Handle posPlanHandle; //!< Handle for Position Plan (ST_PosPlan)
    ST_POSCONV_Handle posConvHandle; //!< Handle for Position Converter (ST_PosConv)
    ST_VER_Handle versionHandle; //!< Handle for Version (ST_Ver)
    } ST_Obj;

    Setting this st_obj.pos.move.ENB = 0 accomplishing both of my questions above.

    I can restart from where it left off and it does not need to set rotor to zero position again using RsCalcuation.

    when stopping by this method, it still hold the stop position in place against any counter torque which is exactly what we need because we are doing position control.

    Well, i am posting the self answer here for others who may have the same question.