For the Kalman filter design, it's a valid strategy to break the encoder reading out into two values. We don't need a one-to-one mapping between instruments and measurements input to the Kalman filter.
- - Use the position value directly for the position measurement, with a low measurement noise. This indicates that we believe the position measurement to within its resolution.
- Differentiate the position measurement to provide a synthetic "measurement" of velocity. Use a higher measurement error in the R matrix to indicate that this measurement is less accurate, due to timing and resolution issues.
filtfilt) off-line to get an estimate of the "actual"
velocity.
Friction and gravity compensation is hard. This page shows a nice video of the gravity and friction compensation in action.