Correct. SysId needs velocity measurements that aren’t provided natively by duty cycle encoders. I’ve been experimenting with a different OLS formulation for SysId that supports position data as well:
}
/**
* Solves linear system ID problem with Eigen to produce initial guess for
* nonlinear problem.
*
* @param[in] json SysId JSON.
* @param[in] motionThreshold Data with velocities closer to zero than this are
* ignored.
* @param[in] positionStddev Position standard deviation.
* @param[in] velocityStddev Velocity standard deviation.
* @return Initial guess for nonlinear problem.
*/
FeedforwardGains SolveEigenLinearSystem(
const wpi::json& json, units::meters_per_second_t motionThreshold,
units::meter_t positionStddev, units::meters_per_second_t velocityStddev) {
// [p] = [1 a][p] + [0] + [0]
// [v]ₖ₊₁ [0 b][v]ₖ [c]uₖ [d]sgn(vₖ)
//
// [p] = [pₖ] + [vₖa] + [ 0 ] + [ 0 ]
This file has been truncated. show original
1 Like