Jump to content

KGS - Kerbal Guidance System (a kOS guidance script)


tlion

Recommended Posts

I just finished the first version of "Kerbal Guidance System", a kOS script capable of  launching a rocket to a precise orbit while maximizing payload. The algorithm is based on optimal control theory using a Newton-Raphson algorithm to solve a set of guidance equations and determine the optimal trajectory. I am aware that other scripts exist, including PEGAS from which I gained a lot of inspiration, my original goal was to get a better understanding of the math behind guidance algorithms. I set out to learn more about PEG, but ultimately decided to use a different type algorithm. Both are based on similar fundamentals, but hopefully this adds something new and can maybe help others learn a little bit more as well. This technique is relatively computationally expensive when compared to the slow processor speeds of kOS. In the future I may translate the code to python to use with krpc.

KGS can launch a rocket to a specified orbit while minimizing fuel consumption. KGS offers the specification of three types of orbits:

  • Unconstrainted orbital plane
  • Constrained inclination
  • Constrained inclination and longitude of the ascending node

Some of the capabilities of KGS include:

  • calculation of launch time
  • calculate of launch azimuth
  • predefined atmospheric ascent phase
  • coast phases
  • precise orbit targeting

I put together a few examples, two for the stock KSP system and one for RSS. The scripts, a guide, and theoretical background documents can all be found on my GitHub page https://github.com/TomTheLion/Kerbal-Guidance-System. It can be somewhat challenging to set up and successfully fly a rocket using this script, but hopefully the guide provides enough detail. I would be more than happy to offer help or clarify anything if anyone decides to try this script.

For the stock rockets the only required mod is kOS, for the RSS rocket I used a custom module manager patch to rebalance the engines for a larger solar system (included on my Github page) and the following mods installed from CKAN:

  • Real Solar System
  • Kerbal Joint Reinforcement Continued
  • Restock
  • Restock+
  • Waterfall Core
  • Simple Adjustable Fairings - KW Rocketry Pack
  • Simple Adjustable Fairings - Plugin

 

 

Link to comment
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...