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.

Position transitions with SpainTAC Move

Good day!

Thanks to TI, I Have a great time controlling my servo motor :).

I worked with this function:

STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, gMotorVars.PosStepInt_MRev, gMotorVars.PosStepFrac_MRev);
I have to set PosStepInt_MRev , PosStepFrac_MRev to go to my target position,

Now, I like to work by Pulse and Direction Like all of Servo drives.

would you please tell me how I can run servo motor in position mode by Pulse and Direction instead of " PosStepInt_MRev , PosStepFrac_MRev "

  • You have to add some code to convert the Pulse and Direction signal to PosStepInt_MRev and PosStepFrac_MRev by yourself, the convert coefficient is based on motor and position sensor specification. And then call STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, gMotorVars.PosStepInt_MRev, gMotorVars.PosStepFrac_MRev) to set the target position.

    PosStepInt_MRev is the integer part of mechanical rotation, and PosStepFrac_MRev is the fraction part of mechanical rotation.
  • thanks dear Yanming for replying soon.

    As you may know the updating time for position loop is 1 kHz (1 ms interval ), so that is the time when I can collect my pulses and convert ti to  (PosStepInt_MRev and PosStepFrac_MRev) that part is so easy.

    but the problems is,there is long delay after executing one  STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, gMotorVars.PosStepInt_MRev, gMotorVars.PosStepFrac_MRev).

    will actually act like this  STPOSMOVE_setPositionStep_mrev(...)      long dealy          STPOSMOVE_setPositionStep_mrev(...) .

    how to sove it !

    are you sure we can control pulse and direction by using  STPOSMOVE_setPositionStep_mrev. if so, I would be happy if you explain it more thanks.

    best regards .

    Dave.

     

  • Yes, you may implement position control via pulse and direction by using STPOSMOVE_setPositionStep_mrev(). You could change ISR_TICKS_PER_SPINTAC_TICK to decrease the delay per your requirement. And you may also change gMotorVars.MaxVel_krpm, gMotorVars.MaxAccel_krpmps and gMotorVars.MaxDecel_krpmps to improve the response.
  • Dear yanming

    Hi

    eventually I could solve my problem :)

    the problems came from STPOSMOVE_Setsampletime_Sec() which need to be decreased !

    Thanks any way
    Best wishes .
    Dave.