Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

TMS320F28034: QEP

Part Number: TMS320F28034

Here is a question regarding the F28034 QEP module: When the QEP is enabled (i.e., EQep1Regs.QEPCTL.bit.QPEN = 1), would there be any issues if I initialize QPOSCNT by setting EQep1Regs.QEPCTL.bit.SWI = 1? Or is it necessary to disable QPEN first before initializing QPOSCNT via QPOSINIT?

  • Hi Allen,

    Yes, you can use SWI=1 while QPEN=1. But this bit is not automatically cleared. While the bit is still set, if a 1 is written to it again, the position counter will be re-initialized.

    Thanks,

    Divesh

  • Hi Divesh,

           Thanks for your reply. I encountered a problem when using SWI = 1 to initialize QPOSCNT while QPEN is enabled. My application involves motor control, where the rotor angle and speed are measured by an encoder. The rotor's absolute position is read via a PWM signal. This absolute position is used to initialize QPOSCNT once after power-on, so the PWM signal position and the QPOSCNT position are nearly the same. The problem is that occasionally the QPOSCNT position differs significantly from the PWM signal position, and since subsequent angle measurements rely on QPOSCNT, this results in abnormal torque output. I'm wondering whether this issue is caused by setting SWI = 1 while QPEN = 1.

         Regards.

         Allen

  • Hi Allen,

    The suggestion to use QPEN=0 before initializing QPOSCNT seems correct. But, there would be some latency due to PWM measurement. At higher speeds, the error between the PWM absolute position and QPOSCNT could be significantly larger due to PWM capture latency and time elapsed before SWI=1 is written. Additionally, since this is a motor control application, it is recommended to verify QPOSCNT against the PWM position after initialization before enabling torque output, as an incorrect initial position can cause abnormal and potentially dangerous torque behavior.

    Thanks,

    Divesh