mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
771 stars 70 forks source link

Service Module and enclosed fairings will start to rotate faster and faster when free falling in atmosphere #3697

Closed pleroy closed 1 year ago

pleroy commented 1 year ago

This was reported by "Wilds" on the forum:

Certain parts like SM-6A Service Module and enclosed fairings will start to rotate faster and faster when free falling in atmosphere. Eventually their rotating increases so much that the craft krakens; and the camera shakes violently.

This behavior is only happening in atmospheres. Floating down to Venusian surface below 10m/s in a simple SM-6A service bay with 1.25m heat shield shield will see the craft start to rotate/spin without any reaction wheels. Once it starts to rotate, its rotation rate accelerates dramatically. Attaching any kind of wings or certain aerodynamic parts will counteract this spinning issue.

Removing Principia will cause these parts to behave normally again.

It certainly "feels" like a phantom force is being applied to one side of the craft.

edit: The fix for me is to just not use those parts for re-entry capsules. A 1.25m service bay will never have this spinning issue, same for the pods that can contain Kerbals.

I enabled journal, changed scenes, and launched a suborbital rocket with a 4 part capsule known for spinning. I reach around 550km apoapsis. At around 17mins into the flight, the capsule re-enters atmosphere. Spinning gets worse and worse, parachute is ripped off from high G spinning, and it krakens itself

Journal is here.

This is reminiscent of the so-called "scimas problem" with #2519.

pleroy commented 1 year ago

We were finally able to reproduce this problem in a very simple situation: take a single part, a Mk1-3 Command Pod, cheat it to an altitude of 100 km with a pitch of 90°, and let it fall. When it starts entering the atmosphere the drag slowly orients it in the "right" direction (that is, with the bottom, where the heat shield should be, facing down). As the atmosphere becomes denser the oscillations increase in frequency but remain of moderate amplitude. However, around an altitude of 5 km, the oscillations start increasing in amplitude and exceed 90° when it touches the ground.

With FAR this is all different: the pod also orients itself when entering the atmosphere, but then it oscillates very little until it reaches the ground.

It turns out that KSP sets the angularDrag field of the Rigidbody and lets Unity/PhysX compute a torque that dampens the oscillations. However, it never calls Part.AddTorque so Principia doesn't know about it and the oscillation never gets dampened. FAR, on the other hand, sets angularDrag to 0 and gives us the torque with AddTorque so everything is rosy.