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.

Smoothly transitioning between position and velocity control

Hi,

I am trying to control a motor using my custom hardware based on F28069M. We would like to operate the motor in the following states:

START -> Velocity control between 1000 and 2000 RPM based on velocity command -> Transition to position control and move to position A -> Move to position B -> Move to position A -> Transition to Velocity control and run between 1000 and 2000 RPM based on velocity command -> STOP

I have been doing velocity control and position control satisfactorily with separate projects, and now would like to combine them to obtain the above state transitions. My velocity control project is based on proj_lab 12. For position control, I tried InstaSPIN's position control, but we liked to have more aggressive gains than what InstaSPIN would give us. So, I have a custom PID module that directly sets the Iq_ref value of the CTRL object. 

I was wondering if it will be possible to use SpinTAC Position Move or any other module to accomplish my goal. If so, I would really appreciate any pointers for using it in this particular application.

Thanks,
Tamil

  • Tamil,

    I've forwarded to Adam at LineStream to comment, but I think the Position move feature will do just this.  Since there is a single controller for Postion and Velocity, the velocity commands are just a bunch of Position commands, so it should be very simple to move between the two (in actuality you will always be in Position control mode).

     

  • Tamil,

    SpinTAC Position Move contains two modes of operation.  It can work in a velocity mode where it acts like a velocity profile generator or in a position mode where it acts like a position profile generator.  

    The position mode is documented and shown in Lab 13b while the velocity mode is shown in Lab 13e.  

    You can switch between these two modes of operation at any time provided that the motor is not moving.  

    It should be straight forward to use SpinTAC Position Move for this operation.  One thing that needs to be accounted for is how SpinTAC Position Move handles the position reference.  We limit the maximum and minimum range of this signal.  This bounding of the signal allows us to not sacrifice accuracy as the real position increases.  Each time that the position reference goes from the negative bound to the positive bound the rollover count is decreased, and when the position reference goes from the positive bound to the negative bound the rollover count is increased.  I've attached a PDF that illustrates this point.

    If this is accounted for in your regulator you should have no problems interfacing SpinTAC Position Move to your own regulator.  Look at the API interfaces that are called out in Lab 13b for how to interface to a controller.

    5078.SpinTAC_Position_Move_Rollover.pdf

  • Chris & Adam,

    Thanks for your tips. I could successfully interface my controller with STPOSMOVE  in both position and velocity modes.

    As you pointed out, switching between the modes seems to be possible only when the motor is not moving. This is fine when switching from position mode to velocity mode, but when switching from velocity mode to position mode, this bothers us. When coming out of the velocity mode, we would want the rotor to stop at a particular position every time. With the current setup, the rotor comes to halt at different positions based on when I command zero speed and at what speed it is spinning. Is there a way to make it always halt at the same pre-defined position regardless of speed or when I command zero?

    Thanks,
    Tamil

  • Tamil,

    Right now our profile generator does not work in that fashion.  Our profile doesn't consider non-zero starting velocities for position point to point moves.

    Since our profile generator is deterministic, you could determine how much additional distance a given velocity move will take, and determine when to do that velocity move in order to end up at the particular position.  

  • Thanks Adam, I managed to get it working.

    -Tamil

  • Dear Tamil Kadir Rajavel,

    I also have an application in that I need to switch between Velocity Mode and Position Mode using the same SpinTAC-Move Position Generator.

    What did you do to get it working?

    Thank you for sharing your knowledge!