Having issues with energy decay
I have created a closed loop kinematic chain in gazebo with the ODE physics engine (in sdf). I have noticed that if the kinetic energy of one of the joints in this mechanism is plotted, it appears to decay.
All friction and damping parameters having been set to zero/min. value and velocity limits and constraints have been removed for all links and joints.However, after the initial application of force to the mechanism, it continues to slow down. The ERP parameter seems to have the largest effect on this rate of decay, but even with it set to 1.0, the mechanism still loses energy, albeit very slowly ,
approx. 0.1% energy loss per 100 sec, real-time factor 1000, step size: 0.01 sec with erp 1.0, and
approx. 6% energy loss per 100 sec, real-time factor 1000, step size: 0.01 sec with erp 0.2
I have reduced the mechanism down to a single revolute joint with two links, but the decay issue still remains. The opposite seems to happen with DART physics engine, where the single joint mechanism continues to gain energy until the mechanism breaks apart.
This issue does NOT appear when simulating a mass spring system based on prismatic joint, regardless of erp settings. Is there an explanation for this energy conservation instability with freely rotating revolute joints ?
I have attached the single joint mechanism sdf. C:\fakepath\model.sdf
I think 0.01 sec for a step size might be to large. Can you try 0.001 sec?