General approach for tuning PID
I have a two-wheeled robot, with each wheel hooked up to a PID controller (using the pid
package) and rotary encoders providing the plants' states. I would like to tune the two controllers but wanted to know whether it's better to tune the robot in real life or to have the robot defined in URDF, then tune it in a simulator.
I have never done this type of thing before and wanted to have a general idea of which approach works better. The way I see it, tuning physically would give more accurate results (after all, you'd be working with the actual robot) at the cost of limited space and potential damage to the robot, whereas tuning in a simulator wouldn't have these limitations but could give you a bad tuning if the simulation parameters are off.
Those of you who have had to tune a PID controller on your robots, what approach did you take? How did it work out in the end?