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