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.

eQEP F28335 (SPEED CALCULATION UPE)

Other Parts Discussed in Thread: CONTROLSUITE

Dear all,

I am using F28335 BOARD and struggling with eQEP for speed measurement (by unit position event).

Doubt : Suppose I want to calculate the speed using capture unit. I am setting QCAPCTL[UPPS]=1/32, implies one unit position for every 32 edges (QCLK). Now, in order to measure the speed, the capture timer/capture period register reading is required. (Since I know unit position, therefore speed in rps =                                       {(32/encoder resolution)* time (in seconds) from capture timer for UPE}                                                            // Capture clock converted to time

 

But the capture timer reading can be taken only in 2 modes

1.  CPU read of QPOSCNT register  : (Which I guess will not be used since I want to get time for 32 QCLK and not 1 QCLK).

2. Unit time out event : (UNIT TIME OUT EVENT by name itself is OPPOSITE to UNIT POSITION EVENT)

My major doubt is 2 mode. How can this mode be used for measurement of speed.  If in case I use  UNIT POSITION EVENT mode,

CASE 1 :  If motor speed is such that 32 QCLK occurs before unit time out event (QCPRD value), then the capture timer reading will be latched to QCPRD, while QCTMR will get reset.  Then the value shown to us after unit time event out by QCTMRLAT register (which is the latched value of QCTMR) is going to be somewhat less as QCTMR has been reset before.  Also how does measuring time on UNIT TIME OUT event makes sense when we want time for UNIT POSITION EVENT?

CASE 2 :  In case when unit time out event occurs before the unit position event, then the time so obtained is not corresponding to 32 QCLK.

The speed that would be obtained by calculations from QPOSLAT and QCTMRLAT will give a fair calculation of speed but that is now related to UNIT POSITION calculation (For low speed.) the speed I will achieve is good for high speed calculation (UNIT TIME EVENT).

 

PLEASE guide me the missing link in my understanding about case 1 and 2  and the confusion prevailing in UPE and UTE by the reference of two cases, so that I could fix the calculation of speed. Also point out if at some point you feel what I am understanding is wrong.   

Regards

Mayank Jain    

  • Hi Mayank,

    The eQEP peripheral includes an integrated edge capture unit to measure the elapsed time between the unit position events. This feature is typically used for low speed measurement. This is described in the eQEP Edge Capture Unit of the eqep use guide.
    Also, there are various timing diagrams and details given in subsequent sections describing how the speed measurement can be accomplished using eQEP. You can also refer to the various motor based example projects in controlSuite.
    But your understanding seems to be correct w,r,t the module behavior.
    If you want to just capture the edge to edge timing one option is to use a capture unit (eCAP).
    There is also an app note on Using the Enhanced Quadrature Encoder Pulse (eQEP) Module in TMS320x280x, 28xxx as a Dedicated Capture below.
    www.ti.com/.../spraah1.pdf

    -Bharathi.
  • Hi Bharathi

    I already have gone through the reference guide but the above query still prevails....
    I could not correctly measure speed and position yet...

    Regards
    Mayank