wheel velocity oscillate
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.
Asked by luxiaojun on 2018-05-01 00:27:10 UTC
Answers
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:
- https://robotics.stackexchange.com/questions/167/what-are-good-strategies-for-tuning-pid-loops
- https://www.crossco.com/blog/basics-tuning-pid-loops
That's the easiest thing to try before exploring other possible fixes.
Asked by josephcoombe on 2018-05-03 09:02:07 UTC
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?
Asked by luxiaojun on 2018-05-08 00:11:48 UTC
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.
Asked by josephcoombe on 2018-05-08 08:24:31 UTC
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.
Asked by josephcoombe on 2018-05-08 08:24:52 UTC
josephcoombe: thank you for your reply.
When i change the
Asked by luxiaojun on 2018-05-09 07:40:04 UTC
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.
Asked by josephcoombe on 2018-05-09 10:34:39 UTC
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
Asked by luxiaojun on 2018-05-15 06:26:07 UTC
Yeah that's really strange. You might also open a issue in the Gazebo repo: https://bitbucket.org/osrf/gazebo/src
Asked by josephcoombe on 2018-05-15 08:57:16 UTC
Comments