Jump to content

[WIP][1.3] PersistentThrust v1.0.9


mrsolarsail

Recommended Posts

16 hours ago, mrsolarsail said:

 If I turn the throttle up too far the power generation of the solar panels can't keep up with the consumption, the control module ElectricCharge depletes (before the extra batteries do), and I can't engage timewarp. If I turn the throttle down enough that the generation keeps up with consumption, and the control module has charge, then timewarp engages. Can you verify?

Well there is a solution for this you know, you could add a charged power buffer to the engine which is dynamicly scaled with timewarp. I do something similar in KSPI-E with the Megajoule resource. The trick is to correcly scale stored electricchage while accelerating and de-accelerating

Edited by FreeThinker
Link to comment
Share on other sites

11 hours ago, FreeThinker said:

Well there is a solution for this you know, you could add a charged power buffer to the engine which is dynamicly scaled with timewarp. I do something similar in KSPI-E with the Megajoule resource. The trick is to correcly scale stored electricchage while accelerating and de-accelerating

Currently, PersistentEngine doesn't actually deplete any ElectricCharge (due to the problem with it doing so inconsistently at different warp levels), but your suggestion may help with that problem: do it manually based on on the timewarp, instead of trusting "RequestResource" to work correctly.

With this current problem, I've only seen it happen when the vehicle isn't power positive in realtime mode, the control module batteries deplete (even if other batteries still have power), and I try to switch to timewarp. If I'm generating more ElectricCharge than the engines are consuming, I have no trouble switching to timewarp. The control modules typically have very small internal batteries, and for some reason KSP depletes them at the same rate as any other larger batteries, and can quickly deplete the control module.

I was wondering if anyone else can confirm this, or has seen the problem under any other circumstances?

Link to comment
Share on other sites

1 hour ago, mrsolarsail said:

Currently, PersistentEngine doesn't actually deplete any ElectricCharge (due to the problem with it doing so inconsistently at different warp levels), but your suggestion may help with that problem: do it manually based on on the timewarp, instead of trusting "RequestResource" to work correctly.

Well if you could account for all  power effects, you would, but you can't know because a vessel might start produce less power for instance because it get into the shadow of a moon/planet  or the angle of the sun changes causing you to lose power due to blocking solar planers, etc. The only way to know would be to measure Electric Charge which becomes insufficient during high time warp, therefore you need to compensate somehow, and a dynamic buffer would solve it.

Edited by FreeThinker
Link to comment
Share on other sites

I'm getting a lot of NRE's with the mod still. It happens when I switch to craft with Ion engines - pops 43 NRE's exactly. And again when I time accelerate to a node. Burning a node (without time acceleration) is fine. Haven't tried with time acceleration yet. Seems to all be the following NRE:

160708T065327.041 [EXCEPTION] [PersistentThrust.PersistentEngine.CalculateDemands] NullReferenceException: Object reference not set to an instance of an object
   at PersistentThrust.PersistentEngine.CalculateDemands (Double demandMass)
   at PersistentThrust.PersistentEngine.OnFixedUpdate ()
   at Part.ModulesOnFixedUpdate ()
   at Part.FixedUpdate ()

 

Link to comment
Share on other sites

12 hours ago, mrsolarsail said:

With this current problem, I've only seen it happen when the vehicle isn't power positive in realtime mode, the control module batteries deplete (even if other batteries still have power), and I try to switch to timewarp. If I'm generating more ElectricCharge than the engines are consuming, I have no trouble switching to timewarp. The control modules typically have very small internal batteries, and for some reason KSP depletes them at the same rate as any other larger batteries, and can quickly deplete the control module.

I was wondering if anyone else can confirm this, or has seen the problem under any other circumstances?

I got a chance yesterday to test this out a bit.  The ability to go into time warp doesn't seem to be effected by the amount of excess power for me.  I am testing using a reactor and NFP engine which should always provide enough power to fire the engine.  Even when decreasing the throttle or using the thrust tweakable it still has issues entering into time warp.  If it would be easier to visualize I can try to throw a GIF/video together when I get home so you can see what I am experiencing.  Timewarp will quickly engage then immediately disengage and I have to repeatedly press the > key to eventually get it to fully engage and allow thrust while warped.  It does work, just takes some patience. 

Link to comment
Share on other sites

Just now, RedParadize said:

I can't use persistantThrust with more than 1kN thrust per tons limitation. Is it a limitation that I can change?

I didn't program a limitation in there. You may have discovered a conflict between the plugin and KSP at high thrust levels. I've only tested it with low thrust engines.

Link to comment
Share on other sites

I get the "cannot warp faster than 1X while under acceleration." Message.  I am using relatively powerfull NFT engine. Looks like 1 KN per tons is the default KSP threshold to get in warp speed. I will check if I can change it in physics config.

Edited by RedParadize
Link to comment
Share on other sites

4 minutes ago, RedParadize said:

I get the "cannot warp faster than 1X while under acceleration." Message.  I am using relatively powerfull NFT engine.

Sounds like the same problem Trollception is seeing. Thanks. I'll look into it.

Link to comment
Share on other sites

Note that once you get into warp, it doesn't matter anymore, you can accelerate quicker than the limit (1ms). There might be a workaround there.

Edited by RedParadize
was not clear
Link to comment
Share on other sites

It definitely looks like KSP is doing some inconvenient "safety" check that prevents switching to timewarp when the thrust is above ~4kN (I tested with the stock LV-N "Nerv" Atomic Rocket Motor). Any ideas on how I can trick it? Like, temporarily zero out the throttle when the command to switch to timewarp is performed?

Link to comment
Share on other sites

12 minutes ago, mrsolarsail said:

It definitely looks like KSP is doing some inconvenient "safety" check that prevents switching to timewarp when the thrust is above ~4kN (I tested with the stock LV-N "Nerv" Atomic Rocket Motor). Any ideas on how I can trick it? Like, temporarily zero out the throttle when the command to switch to timewarp is performed?

In KSPI-E for the Daedalus Engine, I get arround this limitation by allowing the engine to generate durring timewarp even without throtle set. As long as the engine is enable, it will accelerate.This will technically allow any engine  with any thrust to speed durring tome warp. Of cource at low Isp it will mean you will lose all your fuel in a matter of seconds. I suggest you simply add a switch which allows you to do the same for the PersistantEngineFX.

Edited by FreeThinker
Link to comment
Share on other sites

7 hours ago, RedParadize said:

@FreeThinker thats sounds good. Can the trust be ajusted during warp?

Although you cannot adjust thrust during warp (the controls don't allow for it) thrust will be adjusted based on available thrust

Edited by FreeThinker
Link to comment
Share on other sites

On 7/14/2016 at 8:48 AM, FreeThinker said:

In KSPI-E for the Daedalus Engine, I get arround this limitation by allowing the engine to generate durring timewarp even without throtle set. As long as the engine is enable, it will accelerate.This will technically allow any engine  with any thrust to speed. Of cource at low Isp it will mean you will lose all your fuel in a matter of seconds

Thanks. How exactly are you doing this? I'm looking at the source. I can see some differences with my code.

https://github.com/sswelm/KSP-Interstellar-Extended/blob/master/FNPlugin/Propulsion/DeadalusEngineController.cs

The problem shows up even when I'm not using PersistentEngine. If the thrust is over ~5 kN, it won't enter timewarp. When under 5 kN, it will enter timewarp and shut off the engine. Thus, preventing PersistentEngine from being able to do anything.

Edited by mrsolarsail
Link to comment
Share on other sites

  • 2 weeks later...

About the Ion engines... They have the same thrust as NASA's engines with this mod... But they still have KSP's ISP!

that just makes them really terrible and not useful.

an ISP of 42000 or 42 million makes more sense if you are going to turn down the thrust to that low.

Edited by Rory Yammomoto
Link to comment
Share on other sites

31 minutes ago, Rory Yammomoto said:

About the Ion engines... They have the same thrust as NASA's engines with this mod... But they still have KSP's ISP!

that just makes them really terrible and not useful.

an ISP of 42000 or 42 million makes more sense if you are going to turn down the thrust to that low.

The KSP ISP is actually about right for real ion engines. The KSP devs made the thrust so high because the game can't thrust during timewarp. By thrusting at high timewarp for months or years along most of the entire trajectory, they work pretty well. The SolarSailNavigator mod helps with this by scheduling how to steer and throttle the spacecraft, and showing what the future trajectory looks like.

Link to comment
Share on other sites

3 hours ago, Rory Yammomoto said:

an ISP of 42000 or 42 million makes more sense if you are going to turn down the thrust to that low.

This actually is about an order of magnitude higher than the (currently) best non - experimental ion thruster, the NEXT used on the Dawn spacecraft. The KSP ion engine is modeled after that engine (even the name gives it out), it's just that the thrust has been increased by a factor of ~8000.

Link to comment
Share on other sites

  • 4 weeks later...

Just tested this out and it works like a charm! Loving it.

However, I noticed that persistent thrust does not seem to work when the vessel isn't active. So I can't set up a maneuver node with solar sail navigator, go do something else for a year and then come back to a probe in the desired orbit. Are there any plans to add this functionality in the future?

Link to comment
Share on other sites

On 8/21/2016 at 8:34 AM, Ralathon said:

Just tested this out and it works like a charm! Loving it.

However, I noticed that persistent thrust does not seem to work when the vessel isn't active. So I can't set up a maneuver node with solar sail navigator, go do something else for a year and then come back to a probe in the desired orbit. Are there any plans to add this functionality in the future?

Glad to hear it! I do plan on adding that functionality, using the orbit states from the preview trajectory. It's one of the most requested features.

Link to comment
Share on other sites

  • 1 month later...

Hello, I'm using Realism Overhaul. Just wanted to know if there's a way to add this functionality to all of the engines in the game but without the modified thrust since Realism Overhaul already has realistic values.

Link to comment
Share on other sites

@romanasul yep, there is a MM patch to enable it for at least the stock ion engine:

You could expand it to cover any engine module that uses EC and Xenon though:

@PART[*]:HAS[@MODULE[ModuleEngines*]]:HAS[@PROPELLANT[XenonGas],@PROPELLANT[ElectricCharge]]:NEEDS[PersistentThrust]:AFTER[RealismOverhaul]
{
    !MODULE[PersistentEngine],*{}

    MODULE
    {
        name = PersistentEngine
    }
}

 

Link to comment
Share on other sites

19 hours ago, Phineas Freak said:

@romanasul yep, there is a MM patch to enable it for at least the stock ion engine:

You could expand it to cover any engine module that uses EC and Xenon though:


@PART[*]:HAS[@MODULE[ModuleEngines*]]:HAS[@PROPELLANT[XenonGas],@PROPELLANT[ElectricCharge]]:NEEDS[PersistentThrust]:AFTER[RealismOverhaul]
{
    !MODULE[PersistentEngine],*{}

    MODULE
    {
        name = PersistentEngine
    }
}

 

Thank you, the Nstar engine finally works now. If I need to add it to engines that use different propellants do I just need to copy the entire line but switch Xenon with Argon for example?

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...