Spark max PIDF tuning/coding

Since the spark max software has a built in pidf tuning section, do I even need to reference it in my code? Or does it just use the preset I made? Sorry if this seems like a stupid question.

You definitely want to apply the constants programmatically and then do spark.burnFlash()
This will preserve settings in case it trips a breaker and resets (annoying feature I know).

1 Like

I would use the tool to do your tuning, then “Save Configuration” to burn the values into the Spark’s flash.

Then copy the numbers and put them in your code as well.

Better safe than sorry.

From a versioning perspective, it is risky to maintain code in multiple disparate places. With that in mind, consider that setting the PIDF gains via the API will also have the added benefit of knowing exactly which values are used every single time, even if you forget to change constants back while experimenting with the clients.

What build in PIDf tuning section? We’re trying to do PID tuning too, and I don’t know where to start to get the PID constants. One thread recommended the Characterization tool, which I tried, but got stopped by a deployment error.

After generating the project, open it in VScode and try to build & deploy it from there. Make sure you are connected to the internet when running “WPILib: Build Robot Code” and connected to the RoboRio when running “WPILib: Deploy Robot Code”. After deploying from VScode you can go back to the characterization tool for launching the Data Logger. That process has always worked for me.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.