Gazebo | Ignition | Community
Ask Your Question

wheel velocity oscillate

asked 2018-05-01 00:27:10 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I use gazebo7 with ubuntu16.04 to simulate a four wheel robot. The robot was controlled by a model plugin with PID. The problem is that the wheel velocity (radian per second) oscillates, see the attachment pictureC:\fakepath\wheel velocity.jpg. The sdf file C:\fakepath\model.sdfand plugin C:\fakepath\topymodel_push.cppis also in the attachments.

Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-03 09:02:07 -0600

Based on the image you shared of (I assume) wheel velocity vs time, you should first try tuning your PID gains to get rid of the oscillations.


That's the easiest thing to try before exploring other possible fixes.

edit flag offensive delete link more


josephcoombe: thank you for your answer. I have tried to tuning PID gains. The problem still exists. When the angular velocity is set to 0.1 rad/s, it oscillates between 0.8~1.2 rad/s. When set to 5.0 rad/s, it oscillates between 4.97~5.03 rad/s (sometimes there is a peak 4.8, or 5.2...). Body is about 40kg while four wheels are 1kg separately. I wonder, does this matter? Do I need to set damp of joint, Maxforce or some other parameter?

luxiaojun gravatar imageluxiaojun ( 2018-05-08 00:11:48 -0600 )edit

You could try adding a small joint damping value (and enabling ImplicitSpringDamper). The behavior you are observing appears to be a classic controls problem. You can tune P, I, and D gains to eliminate oscillations, but you also have the added disturbance input of the interactions with ground surface.

josephcoombe gravatar imagejosephcoombe ( 2018-05-08 08:24:31 -0600 )edit

After that, your main option is to implement a higher-level controller (e.g. PID) to compensate for drift away from an intended heading/trajectory. In the real world, you are going to observe drift (try driving down a straight road in a car without touching steering wheel). In your car, you are the high-level controller.

josephcoombe gravatar imagejosephcoombe ( 2018-05-08 08:24:52 -0600 )edit

josephcoombe: thank you for your reply. When i change the <collision> of each link from my own **.stl to box or cylinder, the oscillation is removed. My **.stl is exported from simple solidworks parts. I don't know why this happen. Another phenomenon is that when I decrease <max_step_size> (0.001 --> 0.0001), the simulation performance will improve a lot. Why?

luxiaojun gravatar imageluxiaojun ( 2018-05-09 07:40:04 -0600 )edit

That's interesting. In that case, the oscillation may be caused b/c the .stl (e.g. for wheels) is not as smooth as cylinder geometric primitive - so it's like riding a car with octagon wheels. Decreasing the max_step_size lets the engine better handles constraint violations in a more numerically stable manner, resulting in (theoretically) closer to ideal behavior.

josephcoombe gravatar imagejosephcoombe ( 2018-05-09 10:34:39 -0600 )edit

josephcoombe: thank you for your reply. Recently I found that the oscillation is caused by fixed joint, as I asked here( The <collision> we talked before doesn't influence the oscillation.

luxiaojun gravatar imageluxiaojun ( 2018-05-15 06:26:07 -0600 )edit

Yeah that's really strange. You might also open a issue in the Gazebo repo:

josephcoombe gravatar imagejosephcoombe ( 2018-05-15 08:57:16 -0600 )edit

Question Tools


Asked: 2018-05-01 00:27:10 -0600

Seen: 871 times

Last updated: May 03 '18