BDArmory icon indicating copy to clipboard operation
BDArmory copied to clipboard

dragAccel set in BDAirspeedControl.MaxEngineAccel() can be positive

Open RichardDastardly opened this issue 8 years ago • 1 comments

Tested under FAR and a late 10.4/KSP 1.0.5 version ( as I've been chasing this for a while ):

Issue showed mainly during zoom climb during extend mode when DefaultAltitude is set fairly high - the actual issue is that the craft rolls off the throttle completely while pitched up steeply, which can even result in a stall. Spraying debugging labels showed the issue was caused by +ve figures for dragAccel - I am assuming this is never meant to be positive? - set in BDAirspeedControl.MaxEngineAccel() - clamping that number to <=0 fixed the overall issue with no apparent side-effects so far, but I lack the understanding of intent ( and Unity ) to find the root cause currently.

Example of problem from https://youtu.be/RpM0SxN9aNQ?t=113 onwards.

RichardDastardly avatar Apr 27 '16 08:04 RichardDastardly

From what I can make out you're comparing the estimated absolute acceleration of the craft with it's current acceleration along it's velocity vector - but you're not allowing for the current acceleration having a gravity component at the point you produce accelError. Tacking +GravAccel() onto actualCurrentAccel also fixes the issue but it looks a bit messy :p

RichardDastardly avatar Apr 27 '16 13:04 RichardDastardly