MechJeb2

MechJeb2

4M Downloads

Mechjeb not timing burns correctly with RCS thrusters

Delliardo opened this issue ยท 4 comments

commented

MechJeb Version

2.9.2.0-949

KSP Version

1.8.1

Description

When a craft has only RCS thrusters, Mechjeb does not start a burn at negative something node time. Instead it waits till the node time gets to 0, thus throwing off the maneuver.

Replication Case

Should be able to use any RCS Craft in KSP to recreate this issue, but here's a link to my craft file:

https://www.dropbox.com/s/3vg69h2rm547p5x/X-20.craft?dl=0

Requires Well's X-20 mod and Cobalt's BDB (I'm using the 1.7 dev branch)

KSP.log

https://www.dropbox.com/s/016ivn3dsbgofxy/KSP.log?dl=0

commented

The NodeExecutor doesn't know anything about RCS. The stage analysis also doesn't know about RCS and won't compute the delta v for those stages. This isn't really a bug and is a dup of the feature request in #1084

commented

@lamont-granquist @sarbian is that even when Fore By Throttle is activated? The next question would be... is that possible? It's relatively common IRL for many spacecraft, in fact the majority, to use RCS class thrusters for manuevering.

My users asked (see the issue @Delliardo mentioned above) if I could add engine modules to RCS with large prograde thrusters but that seems like a bodge. I'm not a programmer so I don't know how much of an ask it is but it seems like a more elegant and future proof solution would be to be able to make it use RCS as engines.

commented

AFAIK, Fore By Throttle only wires up the controls. Fundamentally the FuelFlowSimulation doesn't know anything about ModuleRCS. Ticking the ForeByThrottle doesn't convert the ModuleRCS to ModuleEngine (although I guess I haven't technically checked that, but if it did, it would all just magically work).

I would certainly NOT add ModuleEngines to ModuleRCS, that's pretty deeply crazy. This is not a downstream bug in mods, this is a legit issue with MJ.

Unfortunately though the code in FuelFlowSimulation is fairly horribly complicated and extending it to do RCS in a non-hacky way is not a simple patch. If you just treat RCS like engines that is probably what nobody wants (along with exposing other horrible bugs in FFS by adding those RCS thrusters which FFS will assume would burn at the same time and now you have different burnout conditions and FFS would try to add those RCS thrusters to the overall starthrust, which then gets applied over the entire burntime of the stage, FFS is very much NOT architected to deal with that well at all). It might be possible to make a smaller patch to detect RCS which is wired up as forebythrottle and add those to the thrust and fuel calculations, assuming that is the only kind of "engine" in the stage. The way that RCS magically draws monoprop also means that the normal fuel flow analysis may be buggy if you just apply it to RCS fuels (although I can't recall now if RF solves this).

commented

Oh to be clear "this isn't really a bug" i meant to say that it isn't a bugfix it is a large-scope enhancement/feature request.