When dealing with a system near zero velocity, it is common to run in to problems estimating velocities.
This is most often due to sensors, such as the encoders or touch panel having too low a resolution to smoothly resolve very slow displacements, which results in granular position data. Granular position data can cause the velocity to spike when, for instance, an encoder registers a new tick. To avoid these velocity spikes we implemented an alpha beta velocity estimation filter which acts similar to a low pass filter and eliminates sudden spikes in velocity. The goal of an alpha beta filter is to have the filtered velocity track closely with the "naive" velocity estimation method, but eliminate sharp peaks in estimated velocity. Shown below are graphs of the "naive" and filtered velocities measured by the encoders, as well as the "naive" and filtered velocities measured by the touch panel.