OHM Precession MFD

OrbitHangar

Addon Comments
Joined
Apr 9, 2008
Messages
3,832
Reaction score
18
Points
0

Author: wishbone

Precession MFD (Sep.8, 2011, build 27) by wishbone

CHANGES: fixed the vector axis swapping bug, added instant burn optimization.
 

  • Would you like to arrive to the rendezvous with another vessel more accurately than with TransX and at a given range along the R-bar?
  • Have you ever wanted to set up a perfect Sun-synchronous orbit, or a Molniya-type HEO that would not suffer from perigee rotation?
  • Do you plan to sail away on solar pressure?
  • Have you wondered how to handle a craft with center-of-gravity shift or a stack of vessels?
  • Do you want to program attitude changes days and weeks in advance?
  • Are you going to dock "by the numbers"?
  • Do you want to know what surface features are within reach from your chosen landing site?
  • Are you interested in Earth's magnetic field or the heat loads of your craft?
  • Do you want to see aerodynamic coefficients of a vessel?
  • Are you planning to take a nap and would like to be woken up by the MCC in time for the next burn?
If yes, this is the MFD for you.

Acknowledgements:
Martin Schweiger for something (Orbiter) to plug this MFD in. http://www.orbiter-forum.com dwellers for suggestions.
BrianJ for SolarSailEx add-on, frame conversion routine, and bits and pieces of code I have not yet mastered.
NASA World Wind team for quaternion handling code.
Ajaja for the code of Lagrangian Points MFD (yet to be integrated properly), and introducing to the world of SPICESPICE team at CalTech and JPL.
Orb for helping out with the stars.
Chris Knestrick for code from Attitude MFD 3.2 (maintained and updated by Tim Blaxland).
Kepler Orbital Simulation Toolkit 0.75 authors (C J Plooy and Tim Blaxland).
Sergey Bochkanov for the AlgLib maths library.
jedidia for EPP from Orbiter Galaxy far far away.
Michel Berkelaar, Jeroen Dirks, Kjell Eikland and Peter Notebaert for the lpSolve 5.5 library.
Roy Vegard Ovesen, Dr.Michael E.Lisano, II, G.Vulpetti, Peter H. Zipfel, Ken Shoemake,Susan McMillan, Ronald J. Boain, James R. Wertz, Andreas Hörstemeier and Jan Meeus, igel, Kenneth Sutton, R.A. Graves, M.E.Tauber, JAT team, SSU developers.
All errors are mine. The code (insofar as it is written by me and not anybody else) is public, see notes attached to code snippets for extra limitations. This is work in progress, so some things may not always go as planned. Formulas are common knowledge…

DOWNLOAD
 
A small comment, coming as an afterthought: currently, rotation of the periapsis is calculated between two successive updates of the MFD. I understand that this is neither correct nor realistic, and some kind of filtering would be necessary in the future. Still, am a bit puzzled by the difference between the by-the-book and Orbiter ArgP rotation rate.

EDIT: SSO management added as of Build 3.

EDIT #2: spotted a typo in energy calculations. Will be fixed in the next build. Wonder if anybody has got a copy of McInnes solar sailing book, am trying to calculate optimum cone/clock angles to maximize dSMa/dT.
 
Last edited:
Cool. Very handy utility :thumbup:
One request - would it be possible to set the reference body manually or use the major gravitational influence body? When solar-sailing in heliocentric orbit (approaching Sun for close flyby) the reference body flips to the nearest planet (Mercury or Venus) occasionally - but it's not a major problem though.

Thanks.
 
Noted. Will do. Currently am struggling with quaternions and optimal clock/cone angle combo.

EDIT: Reference body problem now solved (sort of). Selection of gravitationally dominant body is left for future implementation (no, I never write "left as an exercise for the reader", do I? :) ).
 
Last edited:
Just grabbed the new version (haven't had time to try it yet). Thanks!

Good luck with those quaternions and optimal attitude calculations.
 
Update: did equilibrium temperature calculations, a _crude_ autopilot and a CoG shift utility. Will upload as soon as practical (for instance tomorrow night). wish I had learnt more geometry way back then... The autopilot wobbles the sail around looking for the best attitude...
 
Update: update uploaded. The UI has been revised, there are three on-screen pages now. No nifty graphics planned until I get the optimizing autopilot to work.
 
Will upload the newest build after OHM goes back on-line. This build includes proximity ops "by the numbers" - dock-to-dock Cartesian offsets, rates, attitudes etc. and not a single picture/graph. The Autopilot is getting more and more twisted, will have to re-think the endeavour (there are from 2 to 22 bugs in the autopilot-related code).
 
Last edited:
Closest approach/Intercept

Those of you who have tried the new Intercept page may have noticed that there are a few problems with accuracy at high relative velocities. Mea culpa, I need to make search steps smaller and KOST iteration count larger to avoid this.

The requisite accuracy for intercept should be +-0.50 m (placing quite stringent constraints on the maximum time steps).

In the working version, I also added derivatives in Rmin from a small dV burn along the principal axes in the orbital frame. Thus, a future intercept autopilot won't have to shake, rattle and roll around and will instead use translation RCS for corrections, at least for some time (until I figure out the maximum gradient direction).
 
Last edited:
Update (b.14): fixed a CTD that crawled into build 12. Hopefully... If anybody spots it anew please give me a kick via this very thread.
 
Noted. Will do. Currently am struggling with quaternions and optimal clock/cone angle combo.

EDIT: Reference body problem now solved (sort of). Selection of gravitationally dominant body is left for future implementation (no, I never write "left as an exercise for the reader", do I? :) ).

What is your struggled with quaternoins? any help?
 
I'm fighting on several fronts. Top priority now is completing the study guide for one of the subjects I teach, in Precession MFD I'm integrating jedidia's EPP library, also reading Gurfil's Modern Astrodynamics, and the next thing is integrating Euler's equations in a separate thread (for optimised attitude maneuvers).

Re: help - yes, would be great if you could help me answer the following question - what is the most fuel efficient way of maneuvering a heavy spacecraft (with arbitrary PMI) into a given attitude in the presence of gravity gradient torque in a given period of time?
 
BUG WARNING: the airfoil coefficient function cannot tell if a 2010 or earlier API callback is being used and hence would CTD on earlier versions of Airfoil callbacks. A workaround (two buttons, each for its own API version) is done but will be uploaded with the next release.

EDIT: workaround uploaded.
 
Last edited:
A new post is warranted: the package includes a small utility to peruse the telemetry files (TelemetryBrowser). Kinda useful when profiling tough launches like the TX or SpaceX Falcons.
 
The CG shift function has a bug where it does not shift the mesh properly. (observe that in external view the mesh, thruster effects and nav lights are adjusted to the new local vessel coordinate system.

It does work properly somewhat - I can confirm that the effect can be noticed when you apply thrust (main/hover/RCS translation) after the gravity shift. (+X shift will cause yaw right after applying main aengine thrust, -Z will pitch up if you hover etc.)

It will affect unpowered flight through atmosphere only of those vessels that have a realistic enough flight model (tested on XR2 vs stock DG) - e.g. stock DG will not yaw/pitch by itself if you shift the CG off Z-axis (in the XY plane), while the XR2 will. It is quite likely that the stock Atlantis will behave like the DG in this manner. That's not an MFD issue, though.

The "airfoil-grabbing" feature causes a significant FPS reduction until it finishes. That's the biggest problem at the moment, because it happens every time you switch to the Precession MFD.
 
Last edited:
Thanks for the observations. The CG shift was primarily a hack (not touching the visuals at all), and I found it to be of little help if atmo flight was involved.

Re: airfoil grabbing. Yes, it is me to blame, and I have moved the grabbing into a separate thread in the current version, which will be uploaded next week. There were a few strands that I have started but not finished; fixed the CTD at exit (at least confirmed it was no longer appearing when set to "Deallocate memory" option).

Have you tried stack RCS management?

---------- Post added at 03:54 PM ---------- Previous post was at 08:00 AM ----------

updated. am vying for the laurels of the worst add-on ever.
 
Last version immediately shuts down orbiter.
Last lines in log:
Module PrecessionMFD.dll ..... [Build 110228, API 100830]
190 stars read into catalogue
 
Oh. What is the scenario? Investigating... (it's still the worst one, remember)
 
No scenario, it's
if precessionmfd.dll is activated => while drawing main dialog window
or when i activate it in "Modules" tab.

Looks like trouble in DLLCLBK void InitModule (HINSTANCE hDLL)
I tried to check it by myself, but i can't find some include files...
 
Thanks, now looking at this piece of code, am disabling SPICE loading, will upload the revision to OHM soon.

---------- Post added at 08:41 PM ---------- Previous post was at 08:34 PM ----------

Found the bug. It was not processing EDIT: non-existing file names correctly... :facepalm: (EDIT: contrary to what I wrote in the dox :facepalm: )

---------- Post added at 08:51 PM ---------- Previous post was at 08:41 PM ----------

Uploading the corrected version now. It is "precessionmfd.zip" (the quick fix was "precessionmfd2.zip").
 
Last edited:
Back
Top