Two different issues that I fixed today had to do with adjusting the PID values for the controller.
These values adjust how the machine responds to a command to change position. If they are too small the machine won’t respond quickly, if they are too large the machine will oscillate and move jerkily.
Finding the ‘right’ values is as much an art as a science, and the values I have in place now are just my best somewhat informed guesses. I think it would benefit the community as a whole to make it possible to change the PID values from within Ground Control and try different options.
I have a couple concerns with doing this and want everyone’s feedback on how to do it right.
Here are some thoughts:
PID tuning is an advanced topic and most people will probably never want to mess with it so the settings should be hidden under ‘Advanced Settings’
There should be a “Restore PID Defaults” button to restore the default values if someone makes changes that don’t work well
Values stored in the settings file are tough to update from my side. With the values hard coded in the firmware it’s easy for me to make a change and push it out to everyone’s machines in the weekly firmware update. Values stored in the settings file aren’t overridden when Ground Control is updated (normally a great thing). This means that it will be tough to update the PID values with a weekly release. We could force those values to be overwritten by the weekly release, but then anyone who had chosen new values would loose them each week.
Would we want the custom settings to be saved? I dunno maybe someone wants to go back and forth between the two when experimenting? I don’t think this is super critical, I suspect most people will never touch this.
Yeah, maybe I’m missing something, but wouldn’t the “reset default” button perform the “pull from @bar’s new values” if you have pushed a new update? If somebody is hard core enough to be messing with PID values, then they will be updating frequently from your pushes, and can reset to “your value” if desired.
Will we be able to save multiple values or just one custom set? That would allow for multiple sets to be tested as quickly as possible. Would also be great for using different bit sizes that require different sets to run optimally.
On that note would it be possible to have Ground Control automatically select sets based on your bit selection? I get that the majority of users will likely only use one bit, but some may want to use multiple bit sizes. Am I correct in assuming that the error corrections would need to change for different bit sizes?
If the switches are off, a set of default values are used. If they are turned on, the values shown in the settings are used. It is possible to switch between the two mid way through a cut, but keep in mind that the PID controllers “learn” so a truly fair comparison between two sets requires a power cycle by pulling out the USB cable. I
I haven’t had time to test these thoroughly, so use with some caution for now. I’ll give them a through inspection on Monday, but feel free to give them a go!
And most importantly if you find a set that you think works better than the defaults, share them and we’ll all benefit!