MechJeb2

MechJeb2

4M Downloads

Delta-V incorrect for jets (standing bug from MJ1)

tavert opened this issue ยท 4 comments

commented

You're probably aware of this already, hope you don't mind me posting it here for tracking. Delta-V expended and Current acceleration give incorrect values for jet engines.

All thrust calculations in MJ for jet engines are currently ignoring the velocityCurve's effect on max thrust. VesselState.ThrustAccel should really be a function of surface speed if there are any active airbreathing engines on the craft.

There's also a transient error due to the throttle spool lag. This would probably require querying the engines for their current thrust to fix.

commented

yes i have that tow

commented

For a full fix we need to loop over all engines and add up the thrust they actually achieved last timestep.

For a partial fix we can just tweak this line:
https://github.com/MuMech/MechJeb2/blob/master/MechJeb2/VesselState.cs#L436

"usableFraction" should be a lookup in the velocity curve, if the engine uses the velocity curve. This is imperfect because jets also take time to spin up / spin down, and we'll be ignoring that, but it's at least much closer to the right answer.

commented

Maybe as simple as:

if (e.useVelocityCurve) usableFraction = e.velocityCurve.Evaluate(velocityVesselSurface.magnitude);

Would that work properly? There seem to be 2 columns of zeros in the velocityCurve, not sure what those are for...

commented

I forgot about this bug, but developed pull request #209 anyway, which does the full fix I mentioned above.