Team-OKC-Robotics / FRC-2023

The FRC team #2718 Team OKC Robotics code for the 2023 season
Other
2 stars 0 forks source link

Make a better PID tuning flow #40

Open danielbrownmsm opened 1 year ago

danielbrownmsm commented 1 year ago

Summary Low priority

Right now, the way we tune PID control loops is kinda bad. We're changing numbers and viewing the real-world results, but we're not actually looking for a numerical change. It's a lot of guessing until it seems like we've hit a limit. If we had fancy graphs, we could be a lot more objective and precise about this. We have logs, but the process for pulling those is kinda bad. We have to connect to the RIO using the DataLog tool, pull the logs (and we have to pull all of them, so they all get deleted to free up storage space), then look for the correct log out of all the logs we pulled. Which isn't easy, because the filenames are bad. We then have to select those, then use the DataLog tool to export from wpilib's binary format to a CSV file we can read. Then, to view the log, we must edit the process_wpilib_logs.py file to handle the log appropriately, then paste the full path of the file (copied and pasted from file explorer based on which is most recent) into the python script which will then spit out a very nice matplotlib plot. This is annoying and not conducive to very efficient or particularly good PID tuning. Also it's annoying. Did I mention it's annoying? The goal is to write a python (technically there is no language requirement, but like, it's gonna be Python) script that does all of this automatically, so the programmer just has to push a button and get a graph.

Work Required

Verification