-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3000km.ks
57 lines (55 loc) · 1.56 KB
/
3000km.ks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
parameter
comp, // compass to initially aim at
pit, // pitch to imitially aim at
sec. // seconds to hold that before following srfprograde
set launchsite to LATLNG(ship:latitude, ship:longitude).
set first_eng to ship:partstagged("engine 1")[0].
clearscreen.
print "|".
print "|".
print "|".
// Display printing runs in interrupts in BG:
when true then {
print "Dist from Launch: " + round(launchsite:distance/1000,1) + "km " at (2,0).
print "Apo: " + round(apoapsis/1000,1) + "km " at (2,1).
return 1.
}
print "Set launchsite to " + launchsite.
set ship:control:pilotmainthrottle to 1.
lock throttle to 1.
print "Starting engine.".
stage.
print "Waiting for TWR > 1.1".
local twr is 0.
until twr > 1.1 {
set twr to first_eng:thrust / (mass*(body:mu/(body:radius+altitude)^2)).
print "TWR = " + round(twr,2).
wait 0.1.
}
print "Declamping.".
stage.
wait 1.
set cPit to 90.
lock steering to heading(comp,cPit).
print "Gently pitching down over time.".
set start to time:seconds.
until time:seconds > start + sec {
set elapsed to time:seconds - start.
set cPit to 90 - ((90 - pit)*(elapsed/sec)).
clearscreen.
print "Pitching to " + round(cPit,1) + " (goal="+pit+")".
wait 0.
}
print "just following prograde.".
lock steering to srfprograde.
print "Waiting for liquid stage to end.".
wait until maxthrust = 0.
print "Waiting for top of trajectory.".
wait until verticalspeed < 0.
unlock steering.
print "Decoupling from booster.".
stage.
print "Waiting until safe for opening chutes.".
wait until alt:radar < 3_000 and verticalspeed < 300 .
stage.
print "Script over.".