When is PID actually used?

I noticed that our robot used kalman filter + LQR for everything. I don’t actually understand how kalman filter and LQR work.

There’s lots of people on here that can explain these topics to you, but only if they understand what you’re asking :). The title of your post asks about pid but you then ask about Kalman Filters and LQRin the body of the post. If you clarify which one (or both) you’re asking for you’re much more likely to get answers to your questions.

Other than that, 2 pieces of advice:

  1. If you don’t already understand PID (like the title suggests), start by focusing on that. a decent understanding of PID is very important in FRC programming, and the other topics mentioned are generally are more advanced.
  2. Don’t be afraid to talk to the people who wrote the code. Strangers on the internet can try to help, but the best way to understand how and why these concepts are used is to talk to the programmers who wrote all of the code in the first place.

Mostly, they’re the same thing. When you use LQR you’re more or less doing PID with gains chosen based on a model.

A Kalman filter is a fancy exponential moving average that helps smooth your sensor data. It should really be called a “covariance filter” - it selects bandwidths for the filtering based on the covariance of the measurements and the model state.


To the title of the post…

Three common examples of applying PID include

Flywheel speed control

Turret position control

Arm position control


Sorry about that! There is just so much to learn that I am overwhelmed with questions haha!