Gazebo | Ignition | Community
Ask Your Question

A simple method to tune PID gains

asked 2015-03-30 17:51:06 -0500

Formigola gravatar image

updated 2015-03-30 18:36:31 -0500


I'm trying to control the UR10 model via sockets with python. I'm just sending trough the topic "/gazebo/default/UR10/joint_cmd" some messages to the PID controller that is included in Gazebo. It works but it would work much better with a well-tuned PID controller. Someone knows a simple method to tune a PID controller in gazebo?

Thanks in advance!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-20 13:31:49 -0500

Tytteboevsen gravatar image

Tuning a PID controller in gazebo is not different from tuning any other PID controller... and that is not easy. there are some rule of thumbs Ziegler Nichols method and look under How do the PID parameters affect system dynamics? but the last time I did it i used trial and error. If you where to go all in you could make a neural network to uptimise the gains... I plan on using this approach on a robot i am building.

Short answer: There is no simple way of tuning a PID controller.

edit flag offensive delete link more

answered 2016-07-08 15:06:32 -0500

klaatu gravatar image

Perhaps begin by trial-and-error tuning with only P-control (set I and D to zero). Note that this alone will probably be inadequate, due to steady-state error: because, if the error is zeroed out, then the P-control effect (proportional to error) will be zero and the system will deviate again to settle at some equilibrium offset away from the command reference. Of course, if your system oscillates, you probably want to reduce the P-gain.

A little I-control can then be judiciously added to gradually move the system away from this equilibrium, toward zero error. (I-control has traditionally been known as "automatic reset" in some circles, since it effectively "resets" the original set point to counteract the steady-state error.)

Add some D-control (effectively, viscous braking) to stabilize the system.

Of course, these three effects interact. So, rinse and repeat as needed. You'll probably have to back off your original P-control once you've added I and D.

It's up to you if a little damped oscillation is an acceptable trade-off for fast response.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-30 17:51:06 -0500

Seen: 7,305 times

Last updated: Jul 08 '16