Jump to content

Ascent Autopilot kOS


arthur106

Recommended Posts

I've been working for the past several days on an ascent autopilot.  It's not quite done yet, but I'm excited to have some tangible results at this point, as 90% of the work didn't really yield anything tangible, other than some function libraries.  It still needs tweaking, I'm confident I can eliminate the position error to less than 1 meter at least 90% of the time; I chose the values for my PID control by shooting from the hip, so unless I got really lucky, there's room for improvement.  Anyway, this is my first kOS program so I just wanted to show off.  More details are in the video link.

If the position initialization isn't exciting enough for you, just skip to 0:50   :)

 

Link to comment
Share on other sites

Nice Job for starting from scartch :cool:

Just being curious, what is your guidance like ? I seems mostly a Gravity Turn starting at 100 m/s with 5-10 degree initial turn. However I did notice small throttle changes and heading is sometimes slightly off from prograde, which does not make sense to happen if GT is scripted. And the position / velocity error indicate that your script tries to follow some trajectory, but how did you gather this ? Or is it computed with MatLab ?

Link to comment
Share on other sites

8 hours ago, CBase said:

Nice Job for starting from scartch :cool:

Just being curious, what is your guidance like ? I seems mostly a Gravity Turn starting at 100 m/s with 5-10 degree initial turn. However I did notice small throttle changes and heading is sometimes slightly off from prograde, which does not make sense to happen if GT is scripted. And the position / velocity error indicate that your script tries to follow some trajectory, but how did you gather this ? Or is it computed with MatLab ?

Although ive started work on actually creating an ascent profile in matlab, i havent created any tangible results yet (mostly because of my limited understand long of drag ins stock ksp).  That will be my next phase of this project.

This is simply a proof of concept.  The profile was recorded from a previous launch of the same rocket so that I could guaruntee the profile would be viable.

Edit:  the guidance is just a list of 1.) coordinates at discrete time increments of where the rocket should be and suggested facing vector and throttle position to stay on track.  Position error is decomposed into components along "track error" and perpendicular "lateral error" to the facing vector.  I correct the error by prescribing a desired acceleration in the proper direction (by increase in throttle for track error and by adding correction angle theta=Accel*mass/thrust to the unit facing vector for lateral error).  Assuming all errors are small, the dynamics are linear(ish) and stability SHOULD be achieved for track and lateral error using the same PID controller.  I'm still working on this bit here--digging through my old college textbooks trying to understand a subject area I never was too good at... :(

One area of concern is that im currently using kOS built-in "cooked" steering to actually point my rocket in the prescribed direction.  This uses two nested PID loops..blah blah blah...to point the rocket where you tell it.  It's a jack of all trades but master of none.  I'm thinking I could expand my guidance to use raw control inputs as control variables (rather than desired attitude) but this would open up a whole can of worms I'm not sure I'm ready to deal with right now.  I'd be interested if anyone has created their own (or knows someone who has) steering controls already and see how they've done it.

Edited by arthur106
Typo and added content
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...