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.

Encoder index offset. How can I read and use it?



Hello;

I´m playing lab 13.

 When Rs-recalibration is done, electric angle and rotor are aligned and the lab runs without problems.

The alignment is done "to the nearest pole".

After that alignment, I want to read index position and read rotor position at that moment. Is there any function/flag that reads when Index is TRUE?

In my aplication I want to reference the "0" position with encoder index signal. This offset  will be constant: index-rotor are locked and relative position is every time the same.

After  I get the offset between index and my "0" position,  I can change the "0" int parameter of STPOSCTL_setPositionReference_mrev function, but this is not so correct... what can I do?


Thanks

Robert

  • Robert,

    You can read the value of the QEP counter when the index line is high, via the QPOSILAT register.

    From there you could update the offset value in the encoder module now that you have the difference between the pole aligned value and the index aligned value, but you would also need to inform the encoder that it should reset on index pulse and not max count.  The alignment for quadrature encoders is dependent on where the motor starts, and how you are resetting the counter.  

    If you can switch over the encoder module seamlessly there should be no need to modify the value provided to SpinTAC Position Control, as it should see no change in the electrical and mechanical angle of the motor.

  • Hi Robert,

    In order to get the precise position of the motor I need to figure out the Index offset.

    Do you have a particular I can follow to figure this encoder Index Offset ?

    Please advise.

    Thank You,
    Kamal Joshi
  • Kamal,

    If you run your motor using Labs 12-13 from InstaSPIN-MOTION, this will align the motor to the nearest pole and will then spin up the motor. After the motor is spinning you should be able to read the value in the QPOSILAT register.

    Based on the index offset and the recorded calibration in the ENC module it should be possible to figure out the index offset from a motor pole in your motor.