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.

TMS320F28069F: Encoder count incorrect

Part Number: TMS320F28069F
Other Parts Discussed in Thread: MOTORWARE, C2000WARE

TI Experts: I have a strange problem. When I use the incremental encoder in the motorware routine, the number of lines is 2500. When the speed exceeds about 650rpm, the count value of QEP is incorrect. In order to verify the hardware circuit, I give a 50k pulse signal to determine that the waveform on the MCU pin is correct. I change QEP_Qsrc_Quad_Count_Mode to QEP_Qsrc_Dir_Count_Mode. When the pulse frequency is greater than about 30k, the counting value starts to be incorrect (changing in the direction of reduction, using fixed time sampling counting value). What is the reason?

Regards,

Quan

  • Add: the maximum setting is 2500 * 4 - 1, and the counting sampling time is 10ms. without overflow

  • Hi,

    The expert is out of the office because of Holiday. Please expect a reply by Tuesday.

    Thanks.

  • OK,wait expert,thanks!

  • Hi Quan,

    Which variable or register did you watch for the count value of QEP? For verifying the hardware circuit, do you mean that you connected a 50 kHz pulse train to the dedicated eQEP pin and verified if the quadrature signal has been sent to the DSP?

    By the way, did you refer to chapter 18 of "InstaSPIN-FOC and InstaSPIN-MOTION user's guide" in the MOTORWARE's technical documentation for development?

    Thanks,

    Jiaxin

  • Hi ,Jiaxin Teng :Thank you for your reply!

    1. When the encoder works in orthogonal mode and is used for motor control, the QPOSILAT value changes when it is more than 650rpm in the register observation window, which is not appropriate because the speed is stable and the QPOSILAT value should remain unchanged.

    2. Yes, I tested the hardware with a 50 kHz square wave signal, and the waveform was normal.

    3. Yes, I set it according to refer to chapter 18, otherwise I can't use the 1000 line encoder to control 1500rpm ACIM by routine, it is normal.

    4. I used F28335 to take the same method, using square wave signal test, it can reach 1.5MHz, and the test result is normal.

    Regards,

    Quan

  • Add:By observing the register window, it is found that the counting direction signal (QDF) changes when the counting error occurs. Whether in the Quadrature count mode or the direction count mode, the QDF changes when the frequency of the signal exceeds 30k. But when using the direction counting mode, the direction signal is applied to the QEPB, which is fixed at the high level. I really don't know what causes the QDF to change?

  • Add:To further verify the F28069F hardware circuit, set QDECCTL. QSRC=10 (UP count mode), QEPA input square wave signal, QEPB/I does not input signal, and QDF will not change, but when the input signal exceeds 30k, the count value is still incorrect, and the count difference measured within 10ms begins to decrease.

  • Hi Quan,

    What does your hardware setup look like when encountering this issue? You mentioned that you do not have the same issue on F28335 which leads me to believe that this is primarily a hardware issue, if you did not make configuration changes between switching devices. The F28335 and F28069 feature the same eQEP peripheral inside. Do you have multiple F28069 devices you can test to make sure the device is good?

    Regards,

    Peter

  • Hi,Peter:Thank you for your reply. Software settings follow Chapter 18 of InstaSPIN-FOC Tm and InstaSPIN-MOTION Tm

    User's Guide, it is no problem. In order to verify the software and hardware, I did the experiment again::

    1. Do not use the motorware routine, use the c2000ware routine to test, and input the 200kHz square wave, which is normal.
    2. The execution time of the interrupt program of the test motorware routine is less than 80us, and my interrupt cycle is 200us. Therefore, there is no interrupt overflow.
    3. When comparing c2000ware with motorware, the status of EQEP related registers is the same, QDECCTL=0x4000, QEPCTL=0x9018, QEPSTS=0x00A0, QFLG=0x0040, and the other are set to 0.

      Regards,

      Quan

  • Add:set QPOSMAX=0x270F

  • Does the encoder has the Index signal? And the signal is connected to EQEPI? 

    What pole pairs is the motor you used?

  • Hi,Luo:Thank you very much for your reply! I think I may have found a solution. I directly use the motorware routine without any modification. I just add QEP module and input 400kHz square wave for testing. It is normal. It indicates that it is caused by adding SCI/CAN/I2C or CCS settings. I am trying to solve it. Thanks again for the prompt! I wish China a happy Spring Festival!

    Regards,

    Quan