Skip to content

Commit

Permalink
Tweaking defaults for ascent script
Browse files Browse the repository at this point in the history
  • Loading branch information
JWSenteney committed Apr 8, 2019
1 parent 9fca8f3 commit 78e2bee
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions launch.ks → ascent.ks
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
clearscreen.
print "Launch guidance enabled. Hands off the stick!".
print "Pilot must control staging and throttle manually.".
print "Ascent guidance enabled. Hands off the stick!".
print "Staging is not handled by this program.".

// Heading will stay locked to startAngle until apoapsis reaches this point.
parameter turnStartAltitude is 500.
// How fast the autopilot will pitch the craft down. Higher numbers mean you will go horizontal faster.
parameter turnSpeedMultiplier is 2.
parameter turnSpeedMultiplier is 1.2.
// Program will terminate when apoapsis reaches this point.
parameter targetAltitude is 80000.
// Angle of the craft at inial burn. 90 is vertical. Change if you're using clamps to start at an angle.
Expand All @@ -14,7 +14,7 @@ parameter startAngle is 90.
// If set to false, the program will only terminate when apoapsis reaches target altitude.
parameter endOnStage is false.
// Allows you to set the ascent profile to a parabolic curve. 1 is for a linear function.
parameter profileCurve is 1.
parameter profileCurve is 0.75.
// Ascent angle cannot be set higher than this number.
parameter maxAngle is 90.
// Ascent angle cannot be set lower than this number.
Expand All @@ -29,8 +29,11 @@ set SAS to false.
set headingCalc to heading(startRoll,startAngle).
lock steering to headingCalc.

// play around with the parameters here: https://www.desmos.com/calculator/cofygusacw
lock ascentAngle to startAngle - (startAngle * turnSpeedMultiplier) * (ship:apoapsis - turnStartAltitude)^profileCurve / ((targetAltitude - turnStartAltitude)^profileCurve).

lock throttle to 1.0.

print "Ascent angle is: " + round(startAngle,2).
until ship:apoapsis >= targetAltitude {
if endOnStage and (stage:number <= endOnStage) {
Expand Down

0 comments on commit 78e2bee

Please sign in to comment.