Year after year we continue to struggle to use PID loops to effectively control our mechanisms. This is true whether it’s velocity control of a shooter wheel or position control of an arm joint. Are there good software tools available for logging and live display of the relevant PID parameters like commanded position, actual position, and error, so we can properly tune PID loops without always “shooting in the dark”? Has anyone ever posted YouTube videos demonstrating a really good method for tuning the position of an arm? This would be invaluable to teams that struggle with robust motion control.
First, I highly recommend AdvantageScope for viewing NetworkTables and Logged data. You can graph and visualize data in many ways.
For logging this information to NetworkTables, there are many ways (AdvantageKit, Oblog, we have our own custom solution too for simplicity). For simple situations, you can get away with logging and sending data to NT using the built in methods (e.g. DoublePublisher, DoubleSubscriber, DoubleLogEntry…).
SmartDashboard and Shuffleboard also allow you to tune some values, like PIDController for example.
WPILib docs also has a great advanced controls section with online demos for tuning PIDs.
Tuning an arm can be a more difficult task, however (there is an online demo to help explain why). While feedback control alone may be sufficient depending on the mechanism, many will require a feedforward controller as well to counteract the impact of gravity, to make it easier for the feedback controller.
I found WPILib’s tuning simulator and this guide to be very helpful practice before tuning PID on a real bot
I also recommend this intro to PID video - it walks through each of the terms and shows visuals of an arm moving based on different PID values