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.

TMS320F28055: SPINTAC-MOTION Problem How can I detect the status of position plan without lost its control

Part Number: TMS320F28055

Hi TI,

  Every time when I tried to detect the status of position plan or move status using code below. The whole motion profile crashed, motor just disconnected and lost control.

gSelectedPlan = HOME;
ST_setupPosPlan_Home(stHandle);

gMotorVars.SpinTAC.PosPlanRun = ST_PLAN_START;//Run Home Plan
			   
while(gMotorVars.SpinTAC.PosPlanStatus !=ST_PLAN_IDLE){};//wait until it's finished

SCI_putDataBlocking(obj->sciHandle, 0);//Return 0 after position plan HOME is finished

My purpose to detect the status, it's to make sure my position plan is completely finished before it send back a feedback.

If I delete the while loop to wait, I am not able know whether the position plan is finished or not.

If I continuously sending commands without using while() loop to wait the movement to be completed, none of the movements will be finished.

if you have any suggestions or ideas, please let me know! Thank you!

  • Where is this code being executed? Putting a while loop into an ISR is probably going to cause the issues you reported.

    You should be able to simply do an if test on the status instead of a while loop.

    There is some logic in the example labs where we use the status of Plan to know if it is completed or not.
  • I got the position plan working, using if test under ST_runPosPlan, wait until the status to complete and send out a feedback.
    Can I use this same method to ST_runPosMove?
  • You should be able to.  Plan also gets this information from Move so that Plan knows it is time to advance states.