Jump to content

[1.4.x] Orbital Decay - Resumed v1.6.1.1, 04 Jun 2018


Recommended Posts

My main concern with using this plugin is that I can't model it using KSPTOT for mission planning. I don't want to be able to model it accurately, I just want to be able to account for it happening. I've read the UI gives you an idea of how long the object will remain in orbit. Is this based upon some rough formula that could also be integrated into KSPTOT so the mission planner, if you coast an orbit for several revolutions, can make a similar estimate as to how much the SMA will have changed in that period of time?

Link to post
Share on other sites

btw could KSPTOT plugin running be the reason for the stock decay bug being back?

No matter if I set ORBIT_DRIFT_COMPENSATION = True or False, in low orbit I loose 0.1m about every 1-2s ... that's a lot.

Link to post
Share on other sites

I wonder if I can use other fuels for StationKeeping as well - not as replacement, as addition.

For example when sending a Xenon powered ion probe to another planet ...

Like this:

RESOURCES
{
	StatKeepResource = Xenon
	ResourceRateDifficulty = x.x
}

Also EC should be a resource then, because ion engines use a lot of it.

Link to post
Share on other sites

A probe leaving Kerbin SOI is destroyed as soon as

  • it's on rails, so when switching to another vessel or just leaving the flight mode
  • station keeping is enabled

The StationKeeping UI says decay is imminent before I enable station keeping ...

[F: 318663]: Vessel Torekka Sarnus 1 was on-rails at 16.0 kPa pressure and was destroyed.
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

[SpaceAge] OnVesselDestroy('Torekka Sarnus 1')
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

[SpaceAge] Torekka Sarnus 1 (unloaded) is Probe. NO adding to Chronicle.
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Vessel destroyed:Torekka Sarnus 1

Full log and craft:
https://www.dropbox.com/s/cr6ydjbmbgjxvw0/2018-06-24_1 KSP.log.7z?dl=1

Link to post
Share on other sites

Hey @Papa_Joe

For my own research in orbital decay simulation for solarsail, I looked at how the Orbital Decays "RealisticAtmosphericDragDecay" method worked and noticed that is mainly functions by modifying and persisting a vessel orbit semi-major axis . This might be sufficient for a circular orbit but for an elliptic orbits, this is highly unrealistic as the decay would decrease the periapsis much to fast, causing a vessel to get lost prematurely. I fiddled around a bit I figured a better method by simply applying a drag factor to the every vessel orbit.

Here is the simplified code:

            foreach (var currentvessel in FlightGlobals.Vessels)
            {
                var vesselHeading = currentvessel.GetOrbitDriver().orbit.GetWorldSpaceVel();

                var vesselDeceleration = vesselHeading.normalized * -dragOnVessel;

                ChangeVesselVelocity(currentvessel, universalTime, vesselDeceleration * TimeWarp.fixedDeltaTime);
            }

        private static void ChangeVesselVelocity(Vessel vessel, double universalTime, Vector3d acceleration)
        {
            if (vessel.packed)
                vessel.orbit.Perturb(acceleration, universalTime);
            else
                vessel.ChangeWorldVelocity(acceleration);
        }

        public static void Perturb(this Orbit orbit, Vector3d deltaVV, double universalTime)
        {
            // Transpose deltaVV Y and Z to match orbit frame
            Vector3d deltaVV_orbit = deltaVV.xzy;

            // Position vector
            Vector3d position = orbit.getRelativePositionAtUT(universalTime);

            // Update with current position and new velocity
            orbit.UpdateFromStateVectors(position, orbit.getOrbitalVelocityAtUT(universalTime) + deltaVV_orbit, orbit.referenceBody, universalTime);
            orbit.Init();
            orbit.UpdateFromUT(universalTime);
        }

As you can see this code simply applied a drag factor to all vessel and persistence is automatically taken care by KSP.

Edited by FreeThinker
Link to post
Share on other sites
On 6/24/2018 at 9:35 AM, FreeThinker said:

Hey @Papa_Joe

For my own research in orbital decay simulation for solarsail, I looked at how the Orbital Decays "RealisticAtmosphericDragDecay" method worked and noticed that is mainly functions by modifying and persisting a vessel orbit semi-major axis . This might be sufficient for a circular orbit but for an epileptic orbit this is highly unrealistic as the decay would decrease the periapsis much to fast, causing vessel to get lost prematurely. I fiddled around a bit I figured a better method  by simply applying a drag factor to the every vessel orbit.

Here is the simplified code:

            foreach (var currentvessel in FlightGlobals.Vessels)
            {
                var vesselHeading = currentvessel.GetOrbitDriver().orbit.GetWorldSpaceVel();

                var vesselDeceleration = vesselHeading.normalized * -dragOnVessel;

                ChangeVesselVelocity(currentvessel, universalTime, vesselDeceleration * TimeWarp.fixedDeltaTime);
            }

        private static void ChangeVesselVelocity(Vessel vessel, double universalTime, Vector3d acceleration)
        {
            if (vessel.packed)
                vessel.orbit.Perturb(acceleration, universalTime);
            else
                vessel.ChangeWorldVelocity(acceleration);
        }

        public static void Perturb(this Orbit orbit, Vector3d deltaVV, double universalTime)
        {
            // Transpose deltaVV Y and Z to match orbit frame
            Vector3d deltaVV_orbit = deltaVV.xzy;

            // Position vector
            Vector3d position = orbit.getRelativePositionAtUT(universalTime);

            // Update with current position and new velocity
            orbit.UpdateFromStateVectors(position, orbit.getOrbitalVelocityAtUT(universalTime) + deltaVV_orbit, orbit.referenceBody, universalTime);
            orbit.Init();
            orbit.UpdateFromUT(universalTime);
        }

As you can see this code simply applied a drag factor to all vessel and persistence is automatically taken care by KSP.

Looks good.  Let me take a look at that...

Link to post
Share on other sites
On 6/25/2018 at 8:02 PM, Gordon Dry said:

@Papa_Joe @FreeThinker Would this help with the issue I had about a vessel after leaving Kerbin SOI having more than 16 kPa on rails and being destroyed?

Possibly, because instead of fighting/hacking the orbit of vessels, it would work with the KSP vessel Orbit system, without weird side effects

Edited by FreeThinker
Link to post
Share on other sites
  • 3 weeks later...
On 6/18/2018 at 10:16 PM, Drew Kerman said:

My main concern with using this plugin is that I can't model it using KSPTOT for mission planning. I don't necessarily need to be able to model it accurately, I just want to be able to account for it happening. I've read the UI gives you an idea of how long the object will remain in orbit. Is this based upon some rough formula that could also be integrated into KSPTOT so the mission planner, if you coast an orbit for several revolutions, can make a similar estimate as to how much the SMA will have changed in that period of time?

@Papa_Joe or anyone? I want to bring this to the attention of the KSPTOT dev but not until I have a bit more info.

Link to post
Share on other sites
21 hours ago, Drew Kerman said:

@Papa_Joe or anyone? I want to bring this to the attention of the KSPTOT dev but not until I have a bit more info.

I've not wrapped my head around the mod well yet beyond getting it to work in 1.4.x and setting it up for my build/deploy environment.  I would imagine that we could work out some arrangement of exposing what data is needed by KSPTOT if the mod author is interested.

Link to post
Share on other sites
1 hour ago, Papa_Joe said:

I've not wrapped my head around the mod well yet beyond getting it to work in 1.4.x and setting it up for my build/deploy environment.  I would imagine that we could work out some arrangement of exposing what data is needed by KSPTOT if the mod author is interested.

okay, I'll pursue this when I return from vacation next week, thanks. Like I said, what we need may already be there - I'll have a look at the source as well to see if I can dig up what is calculating the estimated time to impact

Link to post
Share on other sites
2 hours ago, Arrowstar said:

@Papa_Joe, do you have your new source code on github or something yet? 

Yes.   in the OP is a link to the source.  PapaJoesSoup is the git account.

For your convenience:  https://github.com/PapaJoesSoup/OrbitalDecay

Note that it also uses Solar cycle simulator found here:  https://github.com/PapaJoesSoup/SolarCycleSimulator

Let me know what you might need and I can expose it if it is not already available, or create a specific method for what data you might need.

 

Edited by Papa_Joe
Link to post
Share on other sites
6 hours ago, Papa_Joe said:

Yes.   in the OP is a link to the source.  PapaJoesSoup is the git account.

For your convenience:  https://github.com/PapaJoesSoup/OrbitalDecay

Note that it also uses Solar cycle simulator found here:  https://github.com/PapaJoesSoup/SolarCycleSimulator

Let me know what you might need and I can expose it if it is not already available, or create a specific method for what data you might need.

 

Thanks! I will let you know.

Link to post
Share on other sites
  • 4 weeks later...
1 hour ago, Vanya-Kerbalnovich said:

I'll ask the perennial question: does this awesome mod (and its depen work for v. 1.3.1? I looked into the Git releases, seems the recompiled version for 1.4 is all there is there right now.

This is a rerelease intended to make it compatible with the updated game. If you want an older version, you'll probably need to look at the previous thread with Whitecat's original version; there's a link in the OP.

Link to post
Share on other sites

Heya. 

Running into a bit of a problem and tried to troubleshoot my way out of it but to no avail. 

First and foremost here is relevant logs etc

KSP Log

Output Log

Fresh install via steam of 1.4.5, no other mods other than Orbital Decay and dependencies (MM, Solar Cycle). 

https://imgur.com/a/OzHSoHZ

Let me know if anything else could be of use. 

Basically the problem is no orbital decay. I checked the settings file and made sure the orbital drift is "False". I am not sure if this is a big prior to 1.4.5, as I haven't played KSP in over a year and just came back this week. 
I've let warp run at full speed for about 10 mins in one of my tests but got no changes. As you can see in the Screenshot, it hows 1000 years till decay, no matter what I do, how I adjust orbits or distances from the body, it never changes. 

If anyone has suggestions or a fix it would be most welcome as I loved this mod back when I played before and feel like my game is missing something without it. 

 

Edited by rakol
forgot screenshot
Link to post
Share on other sites
  • 2 weeks later...

I was messing around with Hyperedit on a craft that was about to decay according to Orbital Decay manager. Being in the flight screen for that craft past it's "supposed to decay" time seemed to have plagued my Orbital Decay plugin with NaN.

I see "Time Until Decay: NaN" for that craft and every other craft I launch after. I want to go in my save files to edit out the NaNs so Orbital Decay could regenerate proper values for them again, but I don't know where to look. Can I get some advice on this matter?

Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...