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.

RM57L843: Speed measurement using eQEP

Part Number: RM57L843

Tool/software:

Hi,

I am trying to use eQEP module for speed measurement. I have read through the reference manual for RM57 specifically Fig 33-15 and 33-17. I have following questions.

1. What is the difference equations 67 and 68. In equation 67. In equation 67, we divide number of pulses between unit position events by elapsed time between UNIT POSITION events. Whereas in equation 68, we divide the delta value of the position counter between UNIT TIMER events.

2. It also talks about using capture module for low speed measurement. What is the criteria for low speed, medium and high speed?

3. What is the role of Unit timer and Capture timer?

Any help will be greatly appreciated.

Thanks,

Ravi

  • Hi Ravi,

    1. What is the difference equations 67 and 68. In equation 67. In equation 67, we divide number of pulses between unit position events by elapsed time between UNIT POSITION events. Whereas in equation 68, we divide the delta value of the position counter between UNIT TIMER events.

    Yes, you are understanding is correct.

    Unit position:

    Here the position is fixed, so that means the variation in input velocity waveform is determined by using variation in the time period. Here the time period is nothing but number of CAPCLK periods.

    Unit Timer:

    Here the period is fixed, so that means the variation in input velocity is determined using the variation in the position count. Here the postion count is nothing but change in the QPOSCNT value between one unit timer.

    2. It also talks about using capture module for low speed measurement. What is the criteria for low speed, medium and high speed?

    First i want to explain why unit position should need to be used for low frequency and unit timer for high frequency:

    1. Unit position for low frequency:

    If unit position is fixed now my input velocity is depends on the number of CAPCLK between this position, right? So, to get more capture clocks (CAPCLK), then my position should be large, otherwise if i will get less clocks means there could be more errors.

    For example, imagine i am capturing high frequency near to the CAPCLK, so that means i will get capture clock count as only-1 that means here there could be an error of another CAPCLK could be possible, i mean even if we applied almost two clock pulses it could roundup as 1 clock pulse only.

    2. Unit Time for High Frequency:

    If unit time is fixed, now velocity will be depending on the number of positions (QPOSCNT), If you verify above pic i will get more QPOSCNT between unit time period only if i have high frequency input waveform. If i have low frequency quadrature input waveform means i will get low position value that leads more error like we discussed above for unit position.

    So, there won't be any exact range for these measurements. Maybe for certain frequencies both methods can be good. That is the reason they didn't give any frequency ranges.

    My suggestion would be that if you are measuring your input in the order of Khz (time in ms) then it would be good to use unit position and if your input frequency is in Mhz (time in us) then better to use Unit time method.

    3. What is the role of Unit timer and Capture timer?

    Sorry i don't get this question correctly, i hope the above explanation will clarify this question. Please elaborate this question if above explanation doesn't solve it.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thank you for the explanation. I think I now have a better understanding of the module. I have the following follow-up questions.

    1. The capture timer and capture period can be configured to latch under following conditions.

    a. CPU read of QPOSCNT register
    b. Unit time-out event

    So, as per my understanding, say we configure it in Unit time-out event mode, the position counter (QPOSLAT), capture timer (QCTMRLAT) and capture period (QCPRDLAT) every time Unit timer generates an interrupt. And in the unit time-out event ISR, we would either calculate speed value using low speed formula i.e. (Unit position) / (QCPRDLAT value) or for high speed measurement, we would use (QPOSLAT - (QPOSLAT value during previous unit time interrupt)) / (QUPRD). Is my understanding correct? 

    2. Where do we use QCTMRLAT value in calculations?

  • Hi Ravi,

    So, as per my understanding, say we configure it in Unit time-out event mode, the position counter (QPOSLAT), capture timer (QCTMRLAT) and capture period (QCPRDLAT) every time Unit timer generates an interrupt. And in the unit time-out event ISR, we would either calculate speed value using low speed formula i.e. (Unit position) / (QCPRDLAT value) or for high speed measurement, we would use (QPOSLAT - (QPOSLAT value during previous unit time interrupt)) / (QUPRD). Is my understanding correct? 
    2. Where do we use QCTMRLAT value in calculations?

    Your understanding and your formula were totally correct to me.

    And you no need to use QCTMRLAT for value calculation, QCPRDLAT and QCTMRLAT registers only helpful when you are using unit position method. But here it is not necessary, i think.

    Recently in below thread we did unit position method for velocity calculation, if you want you can have a look on this example as well.

    (+) TMS570LC4357: QUADRATURE PULSE GENERATOR - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    How do I read the direction information? I see that there is a QDIR signal internally but I don't see any register from where I can access this value.

    Ravi

  • Hi Ravi,

    Sorry for the late reply, i am on sick leave yesterday.

    The 5th bit in the QEPSTS register will provide the direction.

    Even if you see my example project i provided in my last comment.

    We used same bit to find out the direction.

    --
    Thanks & regards,
    Jagadish.