Java - LibGDX - Ease Rotation with Speed?

I have a rail. On this rail moves a cart.
When the cart moves with default speed on this rail, the movement looks good.
But when I increase the speed of the cart the movement looks not good. First the Code:

private float _dr = 0f;
private float _ar = 0f;
private float _vr = 0f;
private float _targetRotation = 0f;
private float _rotationSpring = 0.1f;
private float _rotationDamping = 0.6f;

...

_targetRotation = linePath.angle;

if (_targetRotation > _plane.rotation + 180) _targetRotation -= 360;
if (_targetRotation < _plane.rotation - 180) _targetRotation += 360;

//ease and spring the rotation a bit so it looks nicer!
_dr = _targetRotation - _plane.rotation;
_ar = _dr * _rotationSpring;
_vr += _ar;
_vr *= _rotationDamping;
_plane.rotation +=  _vr;

...

And here is the Image with the problem:

The red rectangle is the speed that is increased. The dotted car is with the default speed.

If you wanna look, I downloaded the original code from here.

I changed this code a little bit.

There is also another problem. For e.g. After 10 seconds, 20 seconds and so on, the cart
rotates 360 degrees on the rail during movement.

Now, how can I fix the 360 degrees problem and how can I add the variable speed in the ease rotation calculation?

Thanks for any help.

So, if you take out the rotation ease code, it works correctly?

I’m not 100% sure, but it looks like either _rotationSpring or _rotationDamping will affect what you want. The variables are constant at the moment, and one or both of them need to change according to the speed. Try messing around with the variables to see which one affects what, and go from there.

I can’t tell exactly what’s going on with the math because the variable names are so ridiculous…_dr, _ar, _vr…???

dr = delta rotation
ar = ? rotation
vr = velocity rotation (rotational velocity)

I guess…

But I’m sorry as well, I can’t help you that much. I didn’t even understand the problem that well…

I have a solution now. Not good and not bad.

I added the speed in this line:

[quote]_dr = (_targetRotation - _plane.rotation)*speed;
[/quote]
The problem with the 360 degrees is not solved.