I have attached a speed sensor with 32 ticks/rev and 2 channels to channel A and B of the eQEP module. I am using the DRV8301-69M kit.
How can I calculate the speed from the eQEP tick count?
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.
I have attached a speed sensor with 32 ticks/rev and 2 channels to channel A and B of the eQEP module. I am using the DRV8301-69M kit.
How can I calculate the speed from the eQEP tick count?
Hi Thomas,
In the eQEP section of the TRM, you should find a section which describes the eQEP Edge Capture Unit. I believe it will help you accomplish what you are trying to do (measure the amount of time between encoder ticks to estimate speed).
The other potential approach is to look at the eQEP value during the current ISR and the last ISR to estimate speed.
The former is better for situations where the pulses happen slowly relative to the ISR frequency (which I believe describes your application better).
Thank you,
Brett
Brett,
Thanks for the answer. The Edge Capture Unit is indeed what I am looking for. Are there perhaps any examples of code available where this feature is implemented?
Hi Thomas,
That seems correct. Depending on your exact encoder and what your definition of ticks is, QPOSMAX to 0x40 or 0x80 may actually be correct.
Take a look/experiment and I think you'll get it to do what you want.
Thank you,
Brett