Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Gouvernathor opened this issue Feb 10, 2024 · 31 comments · Fixed by #1880
Closed

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

Gouvernathor opened this issue Feb 10, 2024 · 31 comments · Fixed by #1880

Comments

@Gouvernathor
Copy link

Gouvernathor commented Feb 10, 2024

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
Copy link
Author

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
Copy link

Sinomen commented Mar 14, 2024

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
Copy link
Contributor

Starwaster commented Mar 17, 2024

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
Copy link
Author

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
Copy link

Sinomen commented Mar 20, 2024

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
Copy link
Contributor

@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
Copy link

Sinomen commented Mar 21, 2024

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

@Starwaster
Copy link
Contributor

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
Copy link
Author

No Real Fuels either on my side.

@Starwaster
Copy link
Contributor

if (InverseStageHasUnstableEngines(Vessel.currentStage - 1) && Core.Thrust.AutoRCSUllaging && Vessel.hasEnabledRCSModules() &&

if (!Core.Thrust.AutoRCSUllaging)

public bool AutoRCSUllaging = true;

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)

Core.Thrust.AutoRCSUllaging = true;

@Starwaster
Copy link
Contributor

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

@Gouvernathor
Copy link
Author

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
Copy link
Contributor

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
Copy link

Sinomen commented Mar 21, 2024

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?

Starwaster added a commit to Starwaster/MechJeb2 that referenced this issue Mar 21, 2024
There's a bug reported MuMech#1860  where RCS keeps turning on when unwanted for non-Real Fuels users and requires turning off AutoRCSUllaging. This may be enough to fix it but this could use other sanity checks elsewhere. Also, RCS ullaging should either

* Check for Core.Attitude.RCS_auto = true or else don't enable RCS!
* Put in code to turn RCS back off when ullaging is completed.
@Sinomen
Copy link

Sinomen commented Mar 21, 2024

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

@Starwaster
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

Sinomen commented Mar 22, 2024

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
Copy link
Author

Gouvernathor commented Mar 22, 2024

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
Copy link
Contributor

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
Copy link

Sinomen commented Mar 23, 2024

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
Copy link
Contributor

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

@Gouvernathor
Copy link
Author

Gouvernathor commented Mar 26, 2024

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
Copy link

Sinomen commented Mar 28, 2024

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
Copy link
Collaborator

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

@lamont-granquist
Copy link
Collaborator

#1877 may fix the rest of it

@Gouvernathor
Copy link
Author

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
Copy link
Collaborator

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

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

@Gouvernathor
Copy link
Author

Nope.

@Gouvernathor
Copy link
Author

@lamont-grandquist @Starwaster any news ?

@Gouvernathor
Copy link
Author

That seems to finally work !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants