Tool/software:
I have a low PPR (64) quadrature encoder used for rotor position in a motor control application.
I need to determine the rotor position and velocity in an ePWM interrupt. Rotor position will need to be extrapolated from last edge to the time of the start of the current ePWM ISR.
The ePWM interrupt also generates a ADCSOCA event for the ADC A/B/C.
I have figured out how to use the ADCSOCA to trigger the strobe event latch to capture the counter position in the QPOSSLAT.
Q. Does this event also latch the QCTMR and QCPRD or do I need to manually read the QPOSCNT ?
The TRM states "If the QEPCTL[QCLM] bit is cleared, then the capture timer and capture period values are latched into the
QCTMRLAT and QCPRDLAT registers, respectively, when the CPU reads the position counter (QPOSCNT)."
At high speeds I plan to use the Edge Capture Unit QCPRDLAT to calculate the time over one quadrature cycle (four edges) for velocity measurement. I would use the QCTMRLAT to calculate how "old" the edge is relative to the ADCSOCA for extrapolation. I would use minimal clock dividing to get decent resolution.
If the Edge Capture Unit timers were proper 32bit timers I could also use this approach for low speeds. Since they are only 16bit I will need to use another method.
I am considering using the eCAP for time measurements at low speeds since they are 32bits.
Q. Is it possible to connect the eQEP QCLK to one or more of the eCAP timers to get a delta-time between edges and a timestamp of the current edge. Alternatively I can map the EQEPA and B signals (in the input XBAR) each into an eCAP but this is not ideal.
Jason
