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:

  1. Read and store the current encoder count
  2. Get the previous encoder count
  3. Calculate the approximate velocity
  4. 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