Gazebo | Ignition | Community
Ask Your Question
0

wheel velocity oscillate

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

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
0

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

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.

See:

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


edit flag offensive delete link more

Comments

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 -0500 )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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

josephcoombe: thank you for your reply. Recently I found that the oscillation is caused by fixed joint, as I asked here(http://answers.gazebosim.org/question/19359/does-fixed-joint-have-a-bug-in-sdf/). The <collision> we talked before doesn't influence the oscillation.

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

Yeah that's really strange. You might also open a issue in the Gazebo repo: https://bitbucket.org/osrf/gazebo/src

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

Question Tools

Stats

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

Seen: 885 times

Last updated: May 03 '18