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.

some small questions

Genius 5910 points

Other Parts Discussed in Thread: CONTROLSUITE, MOTORWARE

Hi,

 I have a couple of questions hope you can answer.

 -  I want to know the position of the motor. So I want to know the encoder information. Or a internal position reference, greater then 1 rotation, I didn't find  how to do this, any hints?  I tried QEP_read_posn_count but it only return 0. (Yes I have a encoder connected)

- If I want to do a (soft) reset of the controller. What I have to reinitialize?

- How do I make a quick/emergency  stop?

-  Is it possible to use dlog4ch.c for my own debug purposes? documentation?

 Thanks for the reply.

  • are you using InstaSPIN-MOTION and MotorWare, or basing this on a controlSUITE example?

  • I'm using InstaSPIN-MOTION.

     STPOSCONV_getPosition_mrev gives me the position info. Only STPOSCONV_getPositionRollOver stays zero all the time. So why isn't STPOSCONV_getPositionRollOver counting roll over? Do I have to enable it?

     Why is ST_MREV_ROLLOVER defined in spintac_pos_conv.h and not in user.h?

  • STPOSCONV_getPositionRollOver will only increment when the motor position has transitioned from 10 to -10.  It indicates that we have switched position "windows".  Similarly, if you transition from -10 to 10 the STPOSCONV_getPositionRollOver will decrement.

    I've attached a document that might help: 3487.SpinTAC_Position_Move_Rollover.pdf

    ST_MREV_ROLLOVER is defined in spintac_position.h instead of user.h because we don't expect many customers to need to modify this value.  We thought that our default value was good enough for most applications.  But feel free to change that definition if you need to.

  • I expected that. But the odd part is, that STPOSCONV_getPositionRollOver stays zero even when STPOSCONV_getPosition_mrev rolls over.  So what may be the problem or what do I have to check? Can't debug it any further because it is in the closed part of the library, any hints?

     

  • The value from STPOSCONV_getPositionRollOver is an int32_t.  I want to make sure you aren't treating it as an IQ number.  

    It it also a representation of the current position of the motor, so if you previously rolled over and then came back it would read 0.

  • Adam,

    I did an unintentional typecast from long to int. That was the result of my 0.  It works now. 

     Can you please answer the following questions:

    - Is it possible to Zero(reset) the position counter?

    - If I want to do a (soft) reset of the controller. What I have to reinitialize?

    - How do I make a quick/emergency  stop?

     Thanks,

     Ernst

     

  • Ernst,

    evs said:
    Is it possible to Zero(reset) the position counter?

    Yes, you can zero out the position counter.  To do this, you need to write a zero to both the feedback path and the reference path.  

    Since the position control that we offer is not absolute based there isn't much need to zero out the position counter.  It is easier to move the machine to a known zero position, then to align the reference to the feedback and do relative position movements from that point.  To align the reference with the feedback, once the motor is at the "zero position" write the output value from the Position Converter to the position start value for Position Move, assuming you are not in the middle of a position movement.  You would call the following code:

    STPOSMOVE_setPositionStart_mrev(stObj->posMoveHandle, STPOSCONV_getPosition_mrev(stObj->posConvHandle));

    You can zero out the feedback path, you need to set the value of Pos_mrev.  There is not a function to do this, so you can either make the inline function or directly write to the structure member.  This will cause a small spike in the speed feedback since you cannot write to the previous values for the position signal.  If you do this you will also need to write a zero to the

    evs said:
    If I want to do a (soft) reset of the controller. What I have to reinitialize?

    To do a soft reset of the controller, the best way is to overwrite the output signal of the controller to zero.  There is a function called STPOSCTL_setTorqueReference.  If you pass in a zero with this function it will do a soft reset of the controller.

    evs said:
    How do I make a quick/emergency  stop?

    This depends on how quick of an emergency stop you need.  If you set the enable of Position Move, while it is generating a profile to false it will go into the halt mode where it will quickly stop the motion on the axis.  When this happens it will use the programmed acceleration, deceleration, and jerk limits to reduce the velocity to 0.  So if you need a faster stop you should increase these limits to their maximums and set the curve type to be trapezoidal.  

    If it is truly an emergency stop, it is probably better to do this in hardware than in software.

  • Adam,

     Thanks for the detailed reply.

     The soft reset:

     For example: Lab13E I let the motor spinning.

      I stop the motor by Flag_enableSys=false;

      I set Torque to 0
        STPOSCTL_setTorqueReference ((stObj->posCtlHandle),_IQ (0));

     and start the Controller again: Flag_enableSys=true; Flag_Run_Identify=true;

    // To be sure.

      STPOSCTL_setTorqueReference ((stObj->posCtlHandle),_IQ (0));

    The motor start spinning again. So do I need to reset something in STPOSMOVE_?

  • Ernst,

    You will also need to set the velocity end of Position Move to be 0, so that it isn't providing an updated reference.