Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a better PID tuning flow #40

Open
danielbrownmsm opened this issue Feb 6, 2023 · 0 comments
Open

Make a better PID tuning flow #40

danielbrownmsm opened this issue Feb 6, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request long-term stuff that we don't necessarily have to do right now

Comments

@danielbrownmsm
Copy link
Collaborator

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

  • write a python script to pull the logs off the RIO, then delete them from the RIO
  • write a python script to convert the logs from .wpilog binaries to CSV files (I think there's a library that WPILib makes for this)
  • write a python script to automatically process a CSV file, creating a separate graph for each level in the path (ie /swerve/input is in a separate graph from /swerve/left/output, which is separate from /arm/input) with no operator intervention
  • write a python script to tie it all together, and that does it for only the latest log (although others can be specified, maybe using some kind of regex?)

Verification

  • script works
  • doesn't screw unduly with the repo (ie keeps everything contained to a single folder)
  • script is usable by rookies for future knowledge/tool base
@danielbrownmsm danielbrownmsm added the enhancement New feature or request label Feb 6, 2023
@danielbrownmsm danielbrownmsm self-assigned this Feb 6, 2023
@jkleiber jkleiber added this to the Long Term Improvements milestone Feb 12, 2023
@danielbrownmsm danielbrownmsm added the long-term stuff that we don't necessarily have to do right now label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request long-term stuff that we don't necessarily have to do right now
Projects
None yet
Development

No branches or pull requests

2 participants