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.

How to track positions with SpinTAC-Position ?

Hello:

In a typical Position Loop Controller in this picture:

The above position error dynamically changes by subtracting position-feedback from pulse-generator-command.

 

Can SpinTAC-Position accept this dynamically changed pulse-generator command ?

Can I use the code in lab13a to track(or follow) the incoming generated pulses ?

What value should I pass into STPOSCTL_setVelocityReference() and STPOSCTL_setAccelerationReference() ?

void ST_runPosCtl(ST_Handle handle, CTRL_Handle ctrlHandle)
{
	...
	// provide the updated references to the SpinTAC Position Control
	STPOSCTL_setPositionReference_mrev(stObj->posCtlHandle, 0);
	STPOSCTL_setVelocityReference(stObj->posCtlHandle, 0);
	STPOSCTL_setAccelerationReference(stObj->posCtlHandle, 0);
	
	// provide the feedback to the SpinTAC Position Control
	...
	// Run SpinTAC Position Control
	STPOSCTL_run(stObj->posCtlHandle);
	// Provide SpinTAC Position Control Torque Output to the FOC
	...
}

Thank you in advance!

  • Mao,

    SpinTAC can work with this type of input.  You will need to write some code that will convert the incoming pulses into the position reference for SpinTAC Position Control.  

    You should be able to modify the code in lab 13a to support your system.  At a minimum you only need to provide the position reference via STPOSCTL_setPositionReference function.  Initially for testing you can leave the inputs STPOSCTL_setVelocityReference() and STPOSCTL_setAccelerationReference() as 0.  Once you have the basic code running you should be able to create a velocity reference based on how fast the pulses are coming into your system.

    In the SpinTAC code the position signal has rollovers.  This is done so that there isn't overflow as the position values get to larger and larger positions.  It will be important that your code can create the position signal in the manner that SpinTAC expects.  I've attached a document that shows what this position signal needs to look like.

    6406.SpinTAC_Position_Move_Rollover.pdf

     

  •  Adam,

    I modified the code in lab 13a , and finally the system can track position. But there comes an question , when I changed the position signal  too fast ,  the motor moved in wrong way, when I change the position signal slowly , the motor moved in right way. I wonder it is the rate of change the position has  a limit . How can I fix the problem