mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
771 stars 70 forks source link

Automated stationkeeping #4128

Closed kellpossible closed 3 weeks ago

kellpossible commented 3 weeks ago

It would be nice to have some way to have automated stationkeeping for communication satellite arrays in Principia. Something like an option for a satellite to: "maintain current orbital parameters around Body X", it would then expend RCS or Fuel at the appropriate rate during timewarp in order to maintain the desired orbit.

pleroy commented 3 weeks ago

This has been suggested about a hundred times (recent thread here on the Principia Discord, older thread here on the forum) and it's not going to happen. Fundamentally the data model of KSP makes this impossible: a vessel that's warping is in a state known as "packed" where all its parts are unloaded and the mod has no idea what engines and tanks exist or their state.

Also, "maintain current orbital parameters" does a lot of work here. The orbits in Principia are subject to various perturbations (e.g., the Moon) which introduce precessions. Surely stationkeeping is not going to cancel those (think of stationkeeping a sun-synchronous orbit). So just specifying the desired station (and attitude) is actually a very complex topic.

kellpossible commented 3 weeks ago

Thanks for the reply! It's now logged as a closed issue here, in an easy place for others to find when they come up with the same idea.

Could theoretically the mod save the relevant info before the vessel enters a warping state, and apply differences once it exits?

I guess you're right about the precessions likely being stronger to overcome than any practical station keeping resources at hand. How does this work in real life? Are the parameters set for station keeping a little looser? Perhaps in the instance of a constellation they aim for a constant period?

(Edited to remove email formatting -- pleroy.)

pleroy commented 3 weeks ago

How does this work in real life?

This question puzzles me. In real life, there are teams of engineers working 365×24×7 to handle things like stationkeeping (and lots of other stuff, e.g., collision avoidance). I don't work in this domain, but I am pretty sure that every single burn is the result of a thorough planning and execution process, because every single burn reduces the life expectancy of the vessel (there's only so much fuel). Surely modelling and telemetry and so on go into the decision process, but there is no big red button "do stationkeeping for me".

kellpossible commented 3 weeks ago

I'm asking these questions with the view to potentially making a contribution. I'm an engineer in my day job, so it interests me.

Perhaps somewhere on the spectrum between doing nothing and letting the craft float where it will, and assigning a team to work on it 24/7 there lies some automatable solutions which still provide value by maintaining some parameters which are useful? I'll have a bit more of a think about it over the next few weeks.

kellpossible commented 3 weeks ago

Just to be clear I'm totally fine with something that isn't a "big red button". I wouldn't be using Principia if that was the the only goal.