0
$\begingroup$

Rosanswers logo

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?


Originally posted by pomelilola on ROS Answers with karma: 5 on 2020-05-01

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by billy with karma: 1850 on 2020-05-01

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.