QEP dependency on time step

I am using QEP module to sense the speed using JENCODER speed sensor. I am finding it strange that QEP output is changing with respect to time step when i am trying to compile the file and see the output in HIL simulation file. When the time step is small (3000Hz) the QEP is getting saturated at 0.5 value. When time step is 20000Hz the QEP is shooting through value of 1 for very low speed. QEP is giving linear response from 0 to 1 only when I am keeping time step to be 10000Hz. I am also attaching the complete file for reference. I would be glad if someone point me out why the QEP module behaviour is changing with respect to timestep and how to make QEP behaviour independent of time step.

Hi Sachin,Overall, you had a

Hi Sachin, Overall, you had a good approach, but there were a couple issues with your diagram:

  1. The encoder scaling you were using was set up for a 4000 tick count encoder, but your diagram comments indicate that you are using 256 counts.
  2. You have only 256 counts in your encoder, and you used a 4 pole division to get electrical angle which you used for speed measurement which reduced your counts to 64 and multiplied your speed by 4. This will have very rough results at low speeds. As you arent' doing FOC, there is no need for rotor electrical angle, so need to divide by pole count. You should use mechanical angle.
  3. The TI "QEP Speed" block has poor results for low encoder tick counts. We recommend use of the Embedded > Examples > Digital Motor Control > Tools > fxCalcSpeed

The attached diagram below has the mods mentioned above.