ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

General approach for tuning PID

asked 2020-05-01 20:42:24 -0600

pomelilola gravatar image

updated 2020-05-01 20:43:01 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-01 20:57:41 -0600

billy gravatar image

Disclaimer: I've never tuned a PID in a simulator but have tuned PID on motion control systems at work and at home on robots.

Even if you gave me parameters tuned in the worlds best simulator, I would not be willing to just blindly dump them into an untested piece of completed hardware. I would do it the old fashion way and start with P and at a low setting to verify the system is wired correctly and encoders working and circuit breakers aren't popping. Raise them slowly and get a decent response.

Once I was confident the system could be stable and at least mostly responsive, then I'd drop in the parameters from the worlds best simulator.

In a manufacturing setting you can expect that for motion systems there are different sets of parameters that are used depending on the state of assembly and the system function is checked as the system gets built up. You're gonna make sure your lens positioning system is functioning properly before you glue on a $8,000 piece of glass, but it won't be using the same config file when tested without the optic. So even in the real world on well understood systems, it would be considered normal to not just stick in the final PID parameters at the end of assembly if there was risk to it.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-05-01 20:42:24 -0600

Seen: 596 times

Last updated: May 01 '20