TMS320F28P650DK: About EQEP QDECCTL.QIDIRE bit

Part Number: TMS320F28P650DK

Hi, experts.

I hope everyone is having a great day.

Last year, I developed code for the EQEP module with an incremental encoder based on the F28P65. The EQEP was configured as follows: QSRC = 0, PCRM = 0, and IEL = 3. Regarding the QIDIRE bit, I referred to the configuration in the relevant example code and set it as EQEP_disableDirectionChangeDuringIndex(EQEP1_BASE);.

At that time, I assumed that when QIDIRE = 0, the EQEP would no longer process quadrature direction changes while the index signal is high. However, I recently discovered that during the index high period, changes in the quadrature signals can still alter the polarity of the marker edge. Please refer to the attached waveform for details. 

I have the following questions:

Question 1:
From the waveform and test data, the first index marker occurs at edge = 11 (QA: 1→0, QB = 1). I therefore expected that subsequent marker edges would occur when QB = 1. However, why does the marker edge appear at edge = 61 (QA: 0→1, QB = 0)?

Question 2:
When QIDIRE = 0, what is the exact behavior of the EQEP logic?

Question 3:
When QIDIRE = 1, what is the exact behavior of the EQEP logic?

Please do not use AI to automatically generate answers to these questions. Our users have reported that when the servo motor jitters back and forth near the index position, the EQEP may produce erroneous data. We therefore look forward to your professional response.

 

result.txt 

qep_waveform.html

 main.c 

  • Hi,

    Apologies for the delayed response.

    Question 1:
    From the waveform and test data, the first index marker occurs at edge = 11 (QA: 1→0, QB = 1). I therefore expected that subsequent marker edges would occur when QB = 1. However, why does the marker edge appear at edge = 61 (QA: 0→1, QB = 0)?

    Reply: This is because the direction has undergone change. While capturing first index marker , it was CCW and at edge 61, it is CW. 

    Refer 23.5.1.1 Position Counter Reset on Index Event (QEPCTL[PCRM] = 00) in Techincal Reference Manual:

    For example, if the first reset operation occurs on the falling edge of QEPB during the forward direction, then all the subsequent reset must be aligned with the falling edge of QEPB for the forward rotation and on the rising edge of QEPB for the reverse rotation as shown in Figure 23-9.

    Question 2:

    When QIDIRE = 0, what is the exact behavior of the EQEP logic?

    Reply: 

     By setting this bit to 0, the eQEP will function as it normally would in type 0 and type 1 eQEP. By setting this bit to 1, you enable the support for direction change during index. This bit only needs to be enabled if the application requires a direction change occurring at the same time as an incoming QEPI signal, or when they may see erroneous PC resets.

     You can have a look at the e2e for more information: TMS320F28P650DK: About EQEP QDECCTL.QIDIRE bit - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

    Thanks,

    Divesh

  • hi, Divesh

         Thank you very much for your reply. Over the past two days, I have conducted additional tests and found that regardless of whether QIDIRE is 0 or 1, when the index is at a high level, the direction of the input quadrature signals may exhibit behavior that I cannot explain. Therefore, to be on the safe side, I have decided that when PCRM = 0, I will not change the motor direction in the application.

    Thank you very much for your response.

    Best regards.

  • Hi,

    Since the issue is resolved, I am marking the status of this thread as resolved.

    Thanks,

    Divesh