Introduction
You can get the joint velocity from the position data of an encoder. A first order approximation of the derivative gives .
How it works
The position is updated every seconds. The computer does these steps:
- Read and store the current encoder count
- Get the previous encoder count
- Calculate the approximate velocity
- Increase by one and repeat steps 1 to 3

You can also use a higher order approximation of the derivative.
Choosing the update time T
- if is too large, it can violate the sampling theorem
- if is too small, the count changes very little at low speed, so low speed performance is poor