Remove RT and tweaked ascent profile
This commit is contained in:
+5
-5
@@ -1,6 +1,6 @@
|
||||
wait until ship:unpacked.
|
||||
if addons:RT:hasKSCConnection(ship) {
|
||||
runPath("0:/scripts/basic.ks").
|
||||
} else {
|
||||
print "No connection to the KSC".
|
||||
}
|
||||
runPath("0:/scripts/basic.ks").
|
||||
//if addons:RT:hasKSCConnection(ship) {
|
||||
//} else {
|
||||
// print "No connection to the KSC".
|
||||
//}
|
||||
|
||||
+61
-20
@@ -13,6 +13,47 @@ function signedHeading {
|
||||
return mod(hdg + 360, 360).
|
||||
}
|
||||
|
||||
function gravityTurn {
|
||||
parameter targetHeading.
|
||||
|
||||
set tarSteer to heading(targetHeading, 90).
|
||||
lock steering to tarSteer.
|
||||
until ship:velocity:surface:mag >= 100 {
|
||||
set tarSteer to heading(targetHeading, 90 - (ship:velocity:surface:mag / 20)).
|
||||
wait 0.
|
||||
}
|
||||
|
||||
// lock steering to the target heading, but account for drift, and the pitch
|
||||
// of the surface normal vector
|
||||
lock calculatedHeading to mod(targetHeading + 2 * (targetHeading - signedHeading()) + 360, 360).
|
||||
lock steering to heading(
|
||||
calculatedHeading,
|
||||
max(5, 90 - vAng(up:vector, ship:srfprograde:vector))
|
||||
).
|
||||
print "Locked steering to surface prograde pitch and target heading".
|
||||
|
||||
}
|
||||
|
||||
// function structuredAscent {
|
||||
// parameter targetHeading.
|
||||
|
||||
// set tarSteer to heading(targetHeading, 90).
|
||||
// lock steering to tarSteer.
|
||||
// until ship:velocity:surface:mag >= 100 {
|
||||
// set tarSteer to heading(targetHeading, 90 - (ship:velocity:surface:mag / 10)).
|
||||
// wait 0.
|
||||
// }
|
||||
|
||||
// // lock steering to the target heading, but account for drift, and the pitch
|
||||
// // of the surface normal vector
|
||||
// lock calculatedHeading to mod(targetHeading + 2 * (targetHeading - signedHeading()) + 360, 360).
|
||||
// lock steering to heading(
|
||||
// calculatedHeading,
|
||||
// max(5, 90 - vAng(up:vector, ship:srfprograde:vector))
|
||||
// ).
|
||||
// print "Locked steering to surface prograde pitch and target heading".
|
||||
// }
|
||||
|
||||
function basicAscent {
|
||||
parameter targetHeading is 90, targetAltitude is 80000.
|
||||
|
||||
@@ -40,22 +81,7 @@ function basicAscent {
|
||||
return true.
|
||||
}.
|
||||
|
||||
// initial pitch-over
|
||||
set tarSteer to heading(targetHeading, 90).
|
||||
lock steering to tarSteer.
|
||||
until ship:velocity:surface:mag >= 100 {
|
||||
set tarSteer to heading(targetHeading, 90 - (ship:velocity:surface:mag / 10)).
|
||||
wait 0.
|
||||
}
|
||||
|
||||
// lock steering to the target heading, but account for drift, and the pitch
|
||||
// of the surface normal vector
|
||||
lock calculatedHeading to mod(targetHeading + 2 * (targetHeading - signedHeading()) + 360, 360).
|
||||
lock steering to heading(
|
||||
calculatedHeading,
|
||||
max(5, 90 - vAng(up:vector, ship:srfprograde:vector))
|
||||
).
|
||||
print "Locked steering to surface prograde pitch and target heading".
|
||||
gravityTurn(targetHeading).
|
||||
|
||||
when ship:q < 0.01 then {
|
||||
for f in fairings {
|
||||
@@ -69,16 +95,31 @@ function basicAscent {
|
||||
panels on.
|
||||
radiators on.
|
||||
for a in antennas {
|
||||
set m to a:getmodule("ModuleRTAntenna").
|
||||
if m:hasevent("activate") m:doevent("activate").
|
||||
if m:getfield("target") = "no-target" m:setfield("target", "Mission Control").
|
||||
set m to a:getmodule("ModuleDeployableAntenna").
|
||||
if m:hasevent("extend antenna") m:doevent("extend antenna").
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// try to limit the throttle to get a good ascent
|
||||
set ascentPID to pidLoop(1/30, 0, 0, 0.1, 1).
|
||||
set ascentPID:setpoint to 60.
|
||||
set ascentThrottle to 1.
|
||||
lock throttle to ascentThrottle.
|
||||
lock pitchAngle to 90 - vAng(up:vector, ship:prograde:vector).
|
||||
until ship:apoapsis >= targetAltitude or pitchAngle < 10 {
|
||||
set ascentThrottle to ascentPID:update(time:seconds, eta:apoapsis).
|
||||
}
|
||||
|
||||
// we're pitched down so much we might as well just burn
|
||||
if ship:apoapsis < targetAltitude {
|
||||
lock throttle to 1.
|
||||
wait until ship:apoapsis >= targetAltitude.
|
||||
}
|
||||
|
||||
// coast to apoapsis
|
||||
wait until ship:apoapsis >= targetAltitude.
|
||||
unlock calculatedHeading.
|
||||
unlock pitchAngle.
|
||||
lock steering to ship:prograde.
|
||||
lock throttle to 0.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user