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 counter did not reset as expected

Part Number: TMS320F28034

Hi Expert,

My customer are using F28034 for motor control with QEP, they find an issue that work unexpected.

when the motor run at a certain speed because of inertia at the beginning, power on F28034, QEP QPOSCNT counter did not reset when match with QPOSMAX.

as below waveform of data log by GUI, QPOSCNT increase and reset only when reach 0xFFFF, not reset at QPOSMAX which is 2500.

in customer code, they will initialize QPOSMAX to 0xFFFF first, then after run about 0.125s later, will initialize QPOSMAX again to real value which is 2500, then do the motor control.

Below is the code:  initialize QPOSMAX to 0xFFFF first

 initialize QPOSMAX to 2500 after run about 0.125s later.

customer have method to fix this issue, for example, they initialize QPOSMAX to a small value like 2, then there will not have the issue.

but can not explain why set QPOSMAX to 0xFFFF at the beginning will have the issue,  could you help explain for this? 

  • Hi Strong,

    Can you clarify a few questions for me?

    1. What is the timing in the waveform you sent? Does it take longer than 0.125s for the QEP counter to reset?

    2. In the intended implementation with QPOSMAX set to 0xFFFF and then set to 2500 later, does QEP counter ever start to reset at 2500? Or does it still continue to reset at 0xFFFF.

    3. Can the customer check the QPOSMAX bit during the program execution and verify what the QPOSMAX value becomes. It may be that the function which changes the QPOSMAX value does not get called.

    Regards,

    Peter

  • Hi Peter,

    Thanks for your reply,

    1. The timing is after set QPOSMAX to 2500, and start motor control.

    2.  it still continue to reset at 0xFFFF when QPOSMAX  is 2500;

    3. Yes they have check QPOSMAX is change to 2500 by the data waveform. actually if motor stop, and power on device, there is no this issue, only when motor is running without control at the beginning due to inertia, power on the device, then will come this issue.

  • Hi Strong,

    That is certainly strange behavior. Allow me time to consult with others on the team to see if they have seen something like this before.

    What exactly is the purpose of setting the QPOSMAX to 0xFFFF and then switching to 2500? Is it not possible to set QPOSMAX to 2500 from the beginning?

    Regards,

    Peter

  • Peter,

    QPOSMAX need to be changed by HMI according to motor encoder type, that is the reason will switch to 2500 or other value.

     

  • Hi Strong,

    Thanks for that information. You mentioned previously that setting the QPOSMAX to a small value and then switching to 2500 resolves the issue. Would this be a suitable long time term solution or is 0xFFFF at the beginning a requirement? As of now, I don't see see why the eQEP counter is not resetting when it reaches the new QPOSMAX value. 

    Is the customer using any sort of GPIO synchronization and can they verify that there is no noise on the input signals going into the eQEP peripheral?

    Regards,

    Peter

  • Would this be a suitable long time term solution or is 0xFFFF at the beginning a requirement? As of now, I don't see see why the eQEP counter is not resetting when it reaches the new QPOSMAX value. 

    --> It can be a long term solution, but customer find this issue on their product already sale in the market, so they need us give them an explanation. 

  • Hi Strong,

    Ok, looks like this does not negatively affect the performance. Can the customer sample the exact value of the position counter before and after QPOSMAX is updated? A colleague and I believe that if the current value of the counter is above 2500 when the QPOSMAX value is updated, the eQEP module will need to be reset before the eQEP takes into account the new maximum value.

    Regards,

    Peter

  • Hi Peter,

    It is hard to save the counter value as there is not able to use emulator to reproduce this issue, the current value of the counter should be above 2500 when the QPOSMAX value is updated because the issue only occur when the motor run at the beginning. 

  • Hi Peter,

    A colleague and I believe that if the current value of the counter is above 2500 when the QPOSMAX value is updated, the eQEP module will need to be reset before the eQEP takes into account the new maximum value.

    --> will we update this note in next gen TRM or Errata?

  • Hi Strong,

    I'll have to look at our current documentation to see if there are gaps, and if this note is not present in the eQEP documentation, I'll send in a TRM update request. 

    Regards,

    Peter