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.

TMS320F2837xS Eqep - encoder counter errors

Other Parts Discussed in Thread: CONTROLSUITE

hi 

i am using the Eqep configuration as in the IDDK_PM_Servo_F2837x example.

when i use the encoder in very slow speeds every things seems to work fine , but as soon i little bit higher the rpm i see big errors in the QPOSCNT counter .

maybe i didnt configured the model properly?

what is effecting the QPOSCNT updating? , i have looked in the datasheet many times and i cant fully understand the eqep functionality , the QDU unit reads the A, B signals and generates QCLK signal to the position counter, does the position counter unit also responsible for updating QPOSCNT?

if i set the QDECCTL register properly , which else configuration can effect the QPOSCNT?

any suggestion please?

best regards

Mark

  • Hi Mark,

    Your understanding is correct. QDU reads A and B inputs and generates QCLK - corresponding to the edges on A and B inputs.
    QPOSCNT should reflect the number of edges on A and B inputs. Yes - position counter unit is responsible for the QPOSCNT updates.
    If you are saying that the edges are being counted properly at low speed, then I would not suspect the configuration.
    When you say errors in QPOSCNT - is it higher than expected or lower?
    Have you enabled any filtering (inside GPIO) of inputs A and B? Can you probe the signals to check if there is noise on A and B?

    -Bharathi
  • Hi Bharathi

    thank you very much for your reply! .

    the errors in QPOSCNT are lower then expected.

    i took a 500 lines encoder and i am just moving it slowly by hand , when i move it extremely slow it counts right but if spin little bit faster the count shows error right away - it seems like the encoder pulses are to high to follow - but it cant be as its a low resolution encoder spin by hand...

    i have monitored the signals and no noise is seen ( i am using the LAUNCHXL-F28377S with its built in capacitor filters )

    i am using Sync Qualification but i have also tried the 6/3 sample window . 

    maybe you can please give me more ideas how to solve this problem ?

    thank you

    Mark

  • Mark,

    As an experiment - try to disable the qualification - enable synchronization only.
    Is the input pulses are too short, they could be swallowed by qualification.
    QEP should be able to count the pulses exactly, as monitored by you at the inputs.
    If the encoder is malfunctioning, still whatever are the pulses generated out of the encoder should be measured correctly.

    -Bharathi.

  • hi Bharathi

    i tried to work without the qualification - no improvement .
    it is very strange because i am using the encoder at very low speed.

    can you please tell me if there any other configuration (except of QDECCTL register and the gpio settings )
    that can effect the QPOSCNT count?

    Mark
  • Mark,

    Since you are using IDDK_PM_Servo_F2837x project and also the low speed operation is fine, i don't think it's a config issue.
    There is also a stand alone controlSuite example you can try.
    In this case the inputs are generated from EPWM, instead of an encoder.
    You can try to run this and check.
    C:\ti\controlSUITE\device_support\F2837xD\v200\F2837xD_examples_Cpu1\eqep_pos_speed\cpu01

    //! The example requires the following hardware connections from EPWM1 and
    //! GPIO pins (simulating QEP sensor) to QEP peripheral.
    //! - GPIO20/eQEP1A <- GPIO0/ePWM1A (simulates eQEP Phase A signal)
    //! - GPIO21/eQEP1B <- GPIO1/ePWM1B (simulates eQEP Phase B signal)
    //! - GPIO23/eQEP1I <- GPIO4 (simulates eQEP Index Signal)


    -Bharathi.