mrsolarsail
Members-
Posts
95 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by mrsolarsail
-
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
I released a minor update - v1.0.1-alpha. The preview samples fewer intermediate orbits, so there's less work to redraw the preview trajectory. See the 1st post for details. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
The "PropagateOrbit" function (currently in SolarSailNavigator.cs) is what generates a preview segment. It calls "PerturbOrbit" repeatedly from the initial time (UT0) to the final time (UTf) to generate a sequence of intermediate orbits. "PerturbOrbit" is used by "OnFixedUpdate" each time step to increment the orbit velocity by the sail acceleration multiplied by the time step size (when in timewarp. In realtime, OnFixedUpdate calls "vessel.ChangeWorldVelocity" with the sail acceleration times the time step size. The only trig is in the attitude calculation (RTNFrame, SailFrameLocal, and SailFrame) that turn the Cone and Clock angles into a sail attitude. Thanks. I do on occasion work professionally on solar sails (when there's funding - which isn't often), and it's been a hobby for a long time. The tutorial has a long way to go. My goal is for a student to build up - incrementally - a physical intuition for how a sail reflects light and generates thrust, then go into steering and orbits. Yeah, attitude control can take hours to maneuver a realistic sail. I was just thinking of a demo mode. It's a small perturbation to longer trajectories. Makes sailing close to planets very difficult, though, where things happen a lot faster. I have some more diagrams like the one I posted, I just need to clean them up. I do use a slightly different interpretation of "Clock" angle that I think makes a little more sense, where 0 degrees means in-orbit-plane rotations, and 90 degrees means out-of-plane. Yes, or coasting. When time passes beyond the end of the attitude maneuver sequence, the sail automatically goes to 90 deg, so it stops changing the orbit. Yeah, there are definitely things I could use some help with. One is the lines I use to draw the preview. I got LineRenderer to work, though I'd prefer lines that are a constant width on the screen no matter what the zoom level, like the orbit lines in map view. I heard about VectorLine, but couldn't figure out how to get it to work. Are you familiar with that? I would also like to figure out how to create more sail models. I made some in Blender with curved sails, and parts like steering vanes. I just need to follow a guide, I think, but if somebody wants to help me model, I'd appreciate it. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Good point. I think it's like allocating mass to payload, which slows the sail down, but lets you do useful things with it. If you devote a fraction of the sail's substantial area to photovoltaics, you can generate a lot of power to do something useful with. Japan's IKAROS solar sail tested thin film PV cells embedded in the sail. They plan on building a 2nd generation craft, and the PV cells will power ion engines that will serve as a 2nd stage to rendezvous with Jupiter and the Trojan asteroids. Sails have good thrust by themselves close to the sun, and use no propellant. Out at Jupiter, their thrust is very low (~1/27th), but the solar power over a large array is still high enough for ion engines. I think it would be very interesting to add options features like hybrid solar sails / solar power arrays. Any large, lightweight spacecraft turns into a solar sail - whether you want it to or not. - - - Updated - - - - This includes a solar sail part, with integrated navigation tool. I'm probably going to separate it, though, so you can apply the navigation tool to any low thrust part, like sails and ion engines. - Not yet. - Could you post a link to Atomic rocket's engine list? I'm not familiar with it. - - - Updated - - - Thank you! - - - Updated - - - Not yet, but I'd like to make it work for any low thrust propulsion system. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
I've had a busy couple of days, so I'll work through the feedback one at a time. I'm glad you got it to work, and thank you for the feedback. The preview calculates a lot of intermediate orbits, which may be why you had problems. I need to sample & save fewer of them, which should reduce the calculations and memory used when redrawing the preview. I have a companion project called the Solar Sail Flight School to explain the physical principals of solar sailing. I agree that this plugin assumes a lot of knowledge in its current form. It's similar to how professionals plot trajectories. What do you think about adding some tutorial features, like I have in the flight school? A realistic attitude control mode, with solar torque, is another possibility. http://flightschool.solarsails.info I'm working on some illustrations to explain the reference frames and angles. The "Cone" and "Clock" angle are common terms used by pros. They are relative to the frame described here (though, mine are a little different). "Clock" rotates about the position vector of the sail from the sun. "Cone" then rotates about the orbit normal vector (after it's been rotated by the "Clock". I'll add more illustrations soon. https://github.com/bld/SolarSailNavigator/wiki/Reference-Frames I like to allow up to 90 degrees Cone angle, because it lets you "turn off" the sail without retracting it. When building trajectories, you want to flexibility to dramatically reduce thrust, so that you end up in the right place. The example trajectory I have in the tutorial goes up to 75 degrees cone angle. https://github.com/bld/SolarSailNavigator/wiki/Tutorial%3A-Trajectory-planning -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Based on the feedback so far, I'm going to start separating the navigation code from the sail, so I can make it into a more general low thrust navigation tool. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Interesting point. To produce the preview, I'm already calculating in advance where the sail should be. By saving the preview data to persistent variables, it could be used to update the orbit when you focus back on it. I have experience using numerical optimization to calculate the sail angles & times to target a desired orbit, like gradient methods and genetic algorithms. So, I plan on adding that feature. Manually plotting a course that gets you close can serve as a starting point. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Not yet. That would be nice, so you could set it in motion along with other spacecraft. I think that would be in the "Rails" feature. I'd have to see if there's a way to perturb the orbit there. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Cool! Let me know how it works for you. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Yep. It's standalone. I can take a look at the Magnetic Nozzle. Fractal_UK came up with a solution to thrust during timewarp for the sail that should work for low thrust reaction engines as well. -
[WIP][1.3] SolarSailNavigator v1.0.9
mrsolarsail replied to mrsolarsail's topic in KSP1 Mod Development
Thanks. Yes, I think it could be made to work with other low thrust, continuous propulsion. In addition to the force & orbit perturbation models, it would need a model of mass flow rate to correctly predict and apply the acceleration. Do you mean the sail? It does work very differently, and didn't take much work to pull out as a standalone plugin. I am considering making the steering & navigation system standalone, so that the sail plugin only includes the force & orbit propagation model, and the control & navigation can be generalized to work with propellant-using low thrust systems. -
KSP Interstellar Extended Continued Development Thread
mrsolarsail replied to FreeThinker's topic in KSP1 Mod Development
For anyone interested, I've started a new thread on my solar sail navigation plugin: http://forum.kerbalspaceprogram.com/threads/119579-WIP-1-0-2-SolarSailNavigator-v1-0-0-alpha -
SolarSailNavigator is a new plugin (ALPHA: you have been warned) to navigate continuous thrust spacecraft with solar sails, ion engines, and similar propulsion systems. The goal of this plugin is to make solar sailing and continuous thrust engines a practical means of travel throughout the KSP solar system. The modules PersistentThrust and ModuleManager are required. The Module Manager plugin is now required. Download the zip file from the latest release, and unzip into KSP's GameData folder: https://github.com/bld/SolarSailNavigator/releases Also available on CKAN The source code and README file are available at: https://github.com/bld/SolarSailNavigator Tutorials to walk you through the current features are at: https://github.com/bld/SolarSailNavigator/wiki/Tutorials The current features are: Command the attitude and throttle of a vessel during realtime and timewarp for long duration, continuous thrust missions Lock the vessel attitude relative to a reference frame that rotates around the sun Schedule multiple attitude and throttle maneuvers of specified duration in days and hours Preview the future trajectory and the final orbit those attitude maneuvers produce Select a target object, and see how far off you are at the end of the maneuver sequence Use multiple persistent thrust engines and solar sails Control all sails and persistent thrust engines from any command pod Type in angles/throttle/days/hours Change default control values on a per vessel basis for new command segments Two reference frames available Radial/Tangential/Normal with Cone/Clock/Flatspin angles In-track/Cross-track/Normal with Flight-path-angle/Azimuth/Flatspin angles Known issues and limitations Really only supports trajectories orbiting the sun. Sailing around a planet or moon hasn't been tested, and tools to help navigate around a planet haven't been written. Plotting trajectories is entirely manual, and is time consuming, especially if you are trying to accurately rendezvous with a target. It is suggested to have a backup high thrust propulsion system to close the gap. Future versions of SolarSailNavigator may have a "fine tuning" tool that takes your initial trajectory and hones in on the target orbit. At high time warp, the ElectricCharge usage of an ion engine spacecraft has an error where stored energy drops (even to 0), even though energy production is high enough. The vessel keeps operating, and the propellant mass use works correctly. Preview doesn't detect when the trajectory enters the sphere of influence of another body Final orbit not drawn when parabolic or hyperbolic Recalculate target line and error when new target is selected - toggle "Show Preview" to workaround Some important convenience features are not implemented yet: Automatically tune the trajectory to rendezvous with a target Show start date/end date/duration in years/days/hours/secs Check mass and resource use of persistent engines during command sequence against remaining Check resource rate (e.g. Electric Charge) against vessel generating capacity Update the vessel orbit state when you leave it to work on something else and come back ("Sails on Rails") Changelog: see https://github.com/bld/PersistentThrust/releases
- 115 replies
-
- 14
-
KSP Interstellar Extended Continued Development Thread
mrsolarsail replied to FreeThinker's topic in KSP1 Mod Development
It could be adapted to ion engines and other low thrust propulsion, if it also included a prediction of the propellant mass usage. The sail doesn't need that. -
KSP Interstellar Extended Continued Development Thread
mrsolarsail replied to FreeThinker's topic in KSP1 Mod Development
I have an alpha quality standalone plugin running already. I should be able to post it soon. I changed the partmodule name so it shouldn't conflict with "ModuleSolarSail" in KSPI-E if that's loaded too. I'm working on getting KSPI-E compiling on my system so that I can test that my plugin doesn't conflict and help look for bugs. -
KSP Interstellar Extended Continued Development Thread
mrsolarsail replied to FreeThinker's topic in KSP1 Mod Development
KSP has very nice tools to plan high thrust maneuvers by showing you what the new orbit looks like after the planned burns. I'm working on doing the same for sails by predicting what the trajectory and final orbit will be after executing a series of attitude maneuvers (which determines thrust with a sail). Without knowing where you're going, yes, low thrust isn't practical. -
KSP Interstellar Extended Continued Development Thread
mrsolarsail replied to FreeThinker's topic in KSP1 Mod Development
I discovered it while pulling out the sail as a standalone solar sail navigation plugin. I know what you mean about wanting to play. I want to get the sail working as a practical transportation system (in the game too ). I can take a look at other parts, too. -
KSP Interstellar Extended Continued Development Thread
mrsolarsail replied to FreeThinker's topic in KSP1 Mod Development
Thanks for continuing to maintain this project. I wanted to let you know that the solar sail module has a couple errors in the force model. If the back side points towards the sun, so does the normal vector and force vector. Also, the force should be proportional to the cosine-squared of the angle to the sun, instead of just the cosine. One cosine term comes from the sail intercepting less light as it tilts. The second is because the light glances off the sail at steeper angles, contributing less to thrust. To fix it, replace the "CalculateSolarForce" function with the following code. I'd submit a Github pull request, but my connection's running painfully slow. private Vector3d CalculateSolarForce() { if (this.part != null) { Vector3d sunPosition = FlightGlobals.fetch.bodies[0].position; Vector3d ownPosition = this.part.transform.position; Vector3d ownsunPosition = ownPosition - sunPosition; Vector3d normal = this.part.transform.up; if (surfaceTransform != null) { normal = surfaceTransform.forward; } // If normal points away from sun, negate so our force is always away from the sun // so that turning the backside towards the sun thrusts correctly if (Vector3d.Dot (normal, ownsunPosition) < 0) { normal = -normal; } // Magnitude of force proportional to cosine-squared of angle between sun-line and normal double cosConeAngle = Vector3.Dot (ownsunPosition.normalized, normal); Vector3d force = normal * cosConeAngle * cosConeAngle * surfaceArea * reflectedPhotonRatio * solarForceAtDistance(); return force; } else { return Vector3d.zero; } } -
[0.90] KSP Interstellar port maintance thread
mrsolarsail replied to Boris-Barboris's topic in KSP1 Mod Development
I submitted a pull request on Github to fix two problems in the solar sail module force calculation. One ensures the force is always away from the sun, so that the back side of the sail thrusts correctly. The other scales the force magnitude by the cosine-squared of the angle between the sail normal and sun vectors. One cosine term arises from there being less light intercepted as the sail turns away from the sun. The second is because the reflected light glances off the sail at higher angles, producing less thrust directly into it. https://github.com/Boris-Barboris/KSPInterstellar/pull/1