I just want to clear some stuff up. The API says that the timer class return a double that represent microseconds, but in reality, it returns a double that represents seconds. Did they mean that the resolution of the timer is accurate up to the microseconds, but returns it in seconds?
Another thing: do you think a Kalman Filter is overkill? Considering the fact that some people just use the proportional portion of the PID, the noise of the sensor would not matter.
A Kalman filter is complete overkill for FRC. You need a complete understanding, mathematically, of your physical system for a Kalman filter to be effective.
We have never used it for any of our robots in FRC.
Sometimes a relatively simple (poor) process model can produce acceptable results if one “injects” enough uncertainty into the process via the selection of Q [process noise covariance].
That being said, I agree that Kalman filters are generally overkill for FRC.
My point was that even with the extended Kalman filter, you have to have significantly more equations to get an acceptable answer compared to an effectively tuned PID. Kalman filters for simple sensing (encoders + gyro) are ineffective compared to PID due to their overly complicated sets of equations.
When using multiple IMUs and sensing devices, Kalman is the ONLY way to go, but for us I still say ineffective.
A Kalman Filter is not a substitute for a PID. It is something you might do in addition to a PID.
A Kalman Filter attempts to accurately estimate the state (position, velocity, etc.) of your system. It is used either when your sensors are inaccurate (always true to some extent) or when you do not have enough sensors to measure your full state directly.
A KF with even a very crude model can provide more accurate state estimates than reading your sensors directly or traditional filtering if the KF is tuned correctly (not necessarily easy to do). A more accurate system model will result in correspondingly more accurate state estimates.
Extended Kalman Filters allow you to use nonlinear models of your system, which is sometimes desirable, but significantly complicates the process.
I would say that a KF is almost always overkill for FRC applications.
A PID is a control strategy, which means it determines actuator commands (usually motor voltage or duty cycle in an FRC context) based on the system state.
I know, I know, I have both of them implemented already. I guess my grammar was a bit off. I was using the KF to get a more accurate estimate than trying to rely on the encoders that can be off my about 50 degrees. What I meant was that teams did fine using noisy sensors with just the proportional portion of the PID controller. So if having the I and D components is overkill, a Kalman Filter is way overkill… Eh, it was fun writing those though, a great learning experience.