MechJeb2

MechJeb2

4M Downloads

Final landing burn triggers too late when TWR is greater than 2

jrodrigv opened this issue ยท 4 comments

commented

Hi,

I have been experiencing this problem for a very long time. I have never reported it before because I always manage to reduce the TWR at landing to something like 1.7-1.8 which seems more Mechjeb friendly.

The problem seems to be that Mechjeb is not taking into account the time it takes for an engine to produce thrust after the landing guidance begin to increase the vessel throttle (from idle).

I can attach demo video if it helps (I'm using RSS/RO)

From a development point of view I think this time can be measure empirically (in case it is not defined as part of the ModuleEngines), during launch or doing a quick burn test during landing.

commented

Yes, exactly :)

commented

I can confirm this will only happen with RealFuels/RealismOverhaul due to specific patches that change the way the throttling response works.

commented

Is it because of such thing like useEngineResponseTime, engineAccelerationSpeed?

commented

relevant bit of existing code that could get reused:

// Call this function to set the throttle for a burn with dV delta-V remaining.
// timeConstant controls how quickly we throttle down toward the end of the burn.
// This function is nice because it will correctly handle engine spool-up/down times.
public void ThrustForDV(double dV, double timeConstant)
{
timeConstant += vesselState.maxEngineResponseTime;
double spooldownDV = vesselState.currentThrustAccel * vesselState.maxEngineResponseTime;
double desiredAcceleration = (dV - spooldownDV) / timeConstant;
targetThrottle = Mathf.Clamp01((float)(desiredAcceleration / vesselState.maxThrustAccel));
}