MuMech / MechJeb2

MechJeb2 - KSP mod
Other
982 stars 250 forks source link

RCS keeps getting enabled when toggling autopilot and when staging #1860

Closed Gouvernathor closed 2 months ago

Gouvernathor commented 4 months ago

I didn't find any option to disable that in the ascent autopilot settings. This is using my RCS reserves without asking for permission, kinda rude.

When I'm on the landing pad, the mod doesn't even allow me to deactivate RCS !

Gouvernathor commented 4 months ago

It also triggers during landing guidance, whenever the thrust is very low, it seems. I have to spend a lot of time just shutting off the RCS, it's very annoying and borders unplayable.

Sinomen commented 3 months ago

RCS is always active when enabling MJ, be it Ascent Guidance, be it Node Execution. No Kopernicus/RO/RSS installed. This bug is persistent since build #1344.

Starwaster commented 3 months ago

Sounds like RCS auto mode is on. There is a setting for that in the attitude adjustment window.

(and the landing guidance window has a similar RCS control for killing lateral motion)

Gouvernathor commented 3 months ago

The "RCS auto mode" is disabled in the attitude adjustment window, which I never opened before. The one in landing guidance is still enabled, but I suppose (as it did before) that that setting only changes anything for specific moments during the landing autopilot, and not to unrelated modules (ascent guidance or auto maneuver for example).

Sinomen commented 3 months ago

Sounds like RCS auto mode is on. There is a setting for that in the attitude adjustment window.

(and the landing guidance window has a similar RCS control for killing lateral motion)

RCS auto mode is off, never was on. As I said, the issue came up with #1344, never before, and is persistent since.

Workaround: in GameData\MechJeb2\Plugins\PluginData\MechJeb2 delete all vessel specific config files if required.. Edit mechjeb_settings_global.cfg, change AutoRCSUllaging from True to False, provided you don't need that RCS Ullage.

Said RCS Ullage setting should only be active using RO or RSS, yet it is even active in vanilla.

Starwaster commented 3 months ago

@Sinomen Narrow that down to Real Fuels which you can have installed independently of RO or RSS. That is what is being looked for. That said, it should only ever trigger if commanded throttle is > 0 and there is unstable ullage, so it's clearly missing some checks. There's only 4 files where AutoRCSUllaging is referenced so it shouldn't be too hard to find.

Sinomen commented 3 months ago

No Real Fuels installed here. Which 4 files are referencing AutoRCSUllaging ?

Starwaster commented 3 months ago

If you don't even have RF installed then that is definitely a problem, but it should make it easier to track down. I'm on my phone so I'll have to wait until I'm back on my PC to comment further.

Gouvernathor commented 3 months ago

No Real Fuels either on my side.

Starwaster commented 3 months ago

https://github.com/MuMech/MechJeb2/blob/12368452ea88c8584f80866bf0ffc55276d4a053/MechJeb2/MechJebModuleStagingController.cs#L300 https://github.com/MuMech/MechJeb2/blob/12368452ea88c8584f80866bf0ffc55276d4a053/MechJeb2/MechJebModuleNodeExecutor.cs#L140 https://github.com/MuMech/MechJeb2/blob/12368452ea88c8584f80866bf0ffc55276d4a053/MechJeb2/MechJebModuleThrustController.cs#L101

I am leaning towards this being in the thrust controller but it could be a bit deeper where it actually checks ullage. Without RF installed, all ullage checks are supposed to be assumed stable but I don't like the way that's implemented at that level. There's no sanity check and it depends on an update to actually SET the field as stable, and that leads to race conditions.

(I said 4 but this last one is just ascent guidance settings, it doesn't touch RCS itself) https://github.com/MuMech/MechJeb2/blob/12368452ea88c8584f80866bf0ffc55276d4a053/MechJeb2/MechJebModuleAscentSettings.cs#L343

Starwaster commented 3 months ago

Would one of you two mind posting your logs when you've been in flight mode long enough for this to happen?

Gouvernathor commented 3 months ago

I don't know how to generate logs, but in any case the bug happens on the launchpad so you don't need to wait "in flight mode" to see it.

Starwaster commented 3 months ago

I should have said flight scene which includes the pad, prelaunch, landed, etc.

Logs are in the KSP folder and they're always generated.

I can make a pull request that might fix this but I won't be able to build it and test it myself because I'm not set up for it. But it might not be enough which is why I'd like to check someone's log for some things.

Sinomen commented 3 months ago

Would one of you two mind posting your logs when you've been in flight mode long enough for this to happen?

Which log file(s) exactly? KSP.log? And, I assume, with AutoRCSUllaging = True?

Sinomen commented 3 months ago

Reminds me of Autostaging issue #1658: changes were made, things went broke.

Starwaster commented 3 months ago

Would one of you two mind posting your logs when you've been in flight mode long enough for this to happen?

Which log file(s) exactly? KSP.log? And, I assume, with AutoRCSUllaging = True?

Yes and yes.

Starwaster commented 3 months ago

Never mind the log. I made new install with just MJ/MM and I didn't see what I was looking for.

I could only partially replicate it though. It happened anytime I tried to throttle up but not when staging or using other autopilot functions. And enabling the auto RCS in attitude adjustment didn't turn RCS off reliably. I don't think that's related to this bug though.

Sinomen commented 3 months ago

For me, it definitely happens using the Ascent Guidance and the Node Execution, other MJ functions I only use rarely. Enabling the Ascent Guidance, the RCS thrusters are becoming active immediately while the vessel is still on the launch pad.

Gouvernathor commented 3 months ago

For me, it happens not only when you throttle up (manually), but also maybe one second ahead of firing the engine when executing a maneuver node.

Maybe we can send our saved settings to you, it could be related ?

Starwaster commented 3 months ago

It's the ship I tested with. While technically stageable, it didn't have multiple stages. That was why it didn't happen for me at first.

Sinomen commented 3 months ago

For me, it happens ... maybe one second ahead of firing the engine when executing a maneuver node.

Which totally makes sense, the problem is the forced RCS ullaging, imo.

Starwaster commented 3 months ago

The pull request I made was merged in. Try the latest dev build.

Gouvernathor commented 3 months ago

Nope, RCS is still enabled and impossible to deactivate when on the launchpad. RCS still enables itself around 1s before starting a maneuver node.

Sinomen commented 3 months ago

Nope, RCS is still enabled and impossible to deactivate when on the launchpad. RCS still enables itself around 1s before starting a maneuver node.

I concur.

lamont-granquist commented 3 months ago

1876 should fix the node executor RCS issue but i didn't test.

lamont-granquist commented 3 months ago

1877 may fix the rest of it

Gouvernathor commented 3 months ago

It is now possible to deactivate RCS while on the launchpad. However, it is still enabled by default, and still enables itself on its own when executing a maneuver burn.

lamont-granquist commented 3 months ago

still enables itself on its own when executing a maneuver burn.

Do you somehow have "RCS Burn" checked in the maneuver planner?

Gouvernathor commented 3 months ago

Nope.

Gouvernathor commented 2 months ago

@lamont-grandquist @Starwaster any news ?

Gouvernathor commented 2 months ago

That seems to finally work !!