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.

InstaSpin Motion with arbitrary trajectory

I've got our motor to track positions in lab13b and it works great. If I understand correctly lab13a holds 0 position and lab13b accepts set point which then go though SpinTAC Move. What I would like to do is to track arbitrary positions as they are being generated. Imagine position x(t) = sin(2*PI*f*t) where t is the time. Without the knowledge of the form of the trajectory (only knowing its current and previous values), what is the best way of achieving this task? Is there a way to quickly achieve this in either lab13a or lab13b to continuously change the setpoint?

Thanks,
Sina

  • Sina,

    I've attached a file that describes how our solution deals with large positions.  You should be able to modify the code in either lab 13a or 13b in order to accept your new changing reference.  You need to make sure that your new changing reference respects how we are handling the position references.  I've attached a file that gives a visual representation of how this is handled .  We make the position to vary between -10 mechanical revolutions and 10 mechanical revolutions in order to maintain precision.

    The function ST_runPosCtl is the function where we setup the references and feedback for the SpinTAC Position Controller.  Form there you can modify where we reference is coming from.

    6320.SpinTAC_Position_Move_Rollover.pdf

  • Thanks for the reply Adam. Perhaps my application is a little different from typical position control. I would like to implement a continuous stream of position commands (where the command only changes a small amount from he previous command). I can see there are two ways of providing the position input. Let me know which one you suggest.

    1) ST_runPosCtl: It looks like I would have to specify reference position, velocity and acceleration for this to work. Can you please confirm that? I have access to a reference position, although it is possible,  I would like to bypass differentiating and filtering the position reference twice to get to vel and accel. 

    2) ST_runPosMove: According to the lab description this is a position profile generator taking into account the max accel, decel and jerk. This could also work since the position command are much slower than what the motor can achieve. I was thinking of setting the vel, accel, decel and jerk values to max and set the position commands. I tried this but it looks like PosStepInt_MRev and PosStepFrac_MRev are relative positions not absolute ones. for example if you keep setting MRev to 1 the motor will keep spinning. Is there an absolute position command? (where I can set it to 1 and the motor holds the position at 1?)

    STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, gMotorVars.PosStepInt_MRev,  gMotorVars.PosStepFrac_MRev);

    The other questions is with respect to method 2. What happens if you command position A (e.g. 1 turn) and before the motor reaches that position you command position B (-1 turn). Does the motor go to position A and then position B or as soon as a new command arrives it changes direction?

    Thanks,

    Sina

  • Sina,

    Sounds like a pretty interesting application.  

    1. You don't have to specify the velocity or acceleration references.  But those greatly improve the tracking performance of the algorithm.  You could only specify the position reference if you wanted and set the velocity and acceleration references to 0.

    2. We do everything relative because the variations in terms of absolute positioning are too large.  We find it easier for you to create your absolute positioning scheme and treat Move as profile generator that will simply take you from one point to a second point that is a specific step away.

    In the current version of Move it will finish executing one position command before it executes the next position command.  So it will go to position A and then position B.  If you were to bypass Move and only use Control, than it would not have this issue.