Hello, quick question
I have encoder with 1024 lines and trying to calculate rpm off that.
Equation 1: w = delta_cnt / (4 * 1024 lines)] * fsampling.
Equation 2: rpm= w*60
Is this correct equation so far?
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.
Sung,
Looks correct. You're just calculating speed = delta_x/T. In your equations, fsampling is in samples/s and w is in revolutions/s.
Note that at low speed, the delta_X/T method of computing speed will fail because you will get delta_x = 0 for many sample instances (i.e., the rotation is slow so the encoder does not 'tick' between samples). In this case, you can use the eQEP in time capture mode and compute speed = X/delta_T. This is discussed in the various technical reference manuals, for example F2806x TRM, SPRUH18D, p.465. It depends on your application as to whether you are concerned with low speed estimation or not.
Regards,
David
Sung,
fsampling is whatever you configure to read the eQEP reading. You would know what you are using in your code. For example, you could use a timer interrupt to take eQEP readings. Then, fsampling would be whatever your timer period was.
- David
Sung,
No. QCAPCTL[CCPS] controls the prescalar to a clock used as the timebase for capture mode results. This would be used in the low-speed velocity estimation I mentioned earlier, but has nothing to do with the regular v = delta_x/T speed estimation. You need to setup a timer (e.g., ePWM timer, or CPU Timer) that triggers an interrupt. In the interrupt ISR, you read the eQEP results and perform your speed calculations.
- David
Hi song,
I have encoder with 1024 lines and trying to calculate rpm off that. but I can not do it.
Can you send all of your program? please.
I do not understand where I went wrong
regards...
Hi david,
You said "You need to setup a timer (e.g., ePWM timer, or CPU Timer) that triggers an interrupt. In the interrupt ISR, you read the eQEP results and perform your speed calculations."
How can I do this?
regards...