misc changes + new circ mode

This commit is contained in:
2026-04-20 02:44:11 -04:00
parent 7431ab7946
commit 25212af055
6 changed files with 21 additions and 25 deletions
+1 -3
View File
@@ -1,5 +1,3 @@
import("library/lib_ascent"). import("library/lib_ascent").
WaitForEngineStart(). WaitForEngineStart().
@@ -25,7 +23,7 @@ wait until kuniverse:timewarp:rate = 0.
lock steering to srfRetrograde. lock steering to srfRetrograde.
wait until surfaceSpeed < 1000. wait until altitude <= 20000.
unlock steering. unlock steering.
set kuniverse:timewarp:rate to 5. set kuniverse:timewarp:rate to 5.
+1 -1
View File
@@ -12,7 +12,7 @@ set profile to 1.2.
set turn_start to 1000. set turn_start to 1000.
set target_orbit to 120000. set target_orbit to 120000.
Ascent(target_orbit, turn_start, profile, 0, 73). Ascent(target_orbit, turn_start, profile, 3, 90 + 12).
print "Orbit Achieved, Releasing Controls". print "Orbit Achieved, Releasing Controls".
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal"). CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
+1 -1
View File
@@ -10,7 +10,7 @@ set profile to 1.2.
set turn_start to 1000. set turn_start to 1000.
set target_orbit to 130000. set target_orbit to 130000.
Ascent(target_orbit, turn_start, profile, 0). Ascent(target_orbit, turn_start, profile, 3).
print "Orbit Achieved, Releasing Controls". print "Orbit Achieved, Releasing Controls".
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal"). CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
+18 -9
View File
@@ -3,7 +3,6 @@ import("library/lib_math").
import("library/lib_vessel_utils"). import("library/lib_vessel_utils").
import("library/lib_orbits"). import("library/lib_orbits").
declare function Ascent{ declare function Ascent{
parameter targetOrbit is 100000. parameter targetOrbit is 100000.
parameter vericalAscent is 1000. parameter vericalAscent is 1000.
@@ -11,7 +10,6 @@ declare function Ascent{
parameter circ is 1. parameter circ is 1.
parameter inc is 0. parameter inc is 0.
print "Params (" + targetOrbit + ", " + vericalAscent + ", " + ascentProfile + ", " + circ + ", " + inc + ")". print "Params (" + targetOrbit + ", " + vericalAscent + ", " + ascentProfile + ", " + circ + ", " + inc + ")".
print "Vertical Climb to " + vericalAscent. print "Vertical Climb to " + vericalAscent.
@@ -59,6 +57,9 @@ declare function Ascent{
CircularizeBrute(targetOrbit, head). CircularizeBrute(targetOrbit, head).
}else if circ = 2{ }else if circ = 2{
Circularize(targetOrbit, head). Circularize(targetOrbit, head).
}else if circ = 3 {
lock steering to heading(head, 0, 270).
CreateCircularizationNode(apoapsis).
} }
set isDone to true. set isDone to true.
@@ -68,9 +69,8 @@ declare function Ascent{
wait until throttle = 0. wait until throttle = 0.
} }
local function Circularize{ local function Circularize{
parameter targetOrbit. parameter tgt.
parameter head. parameter head.
lock throttle to 0. lock throttle to 0.
@@ -78,7 +78,7 @@ local function Circularize{
local warpTime is eta:apoapsis. local warpTime is eta:apoapsis.
local burnDv is CalculateCircularizationDV(targetOrbit, orbit:semimajoraxis). local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis).
local burnDuration is CalculateMultiStageBurnDuration(burnDv). local burnDuration is CalculateMultiStageBurnDuration(burnDv).
local remDv is ship:deltav:current - burnDv. local remDv is ship:deltav:current - burnDv.
print "Warping to Circularization. " + round(burnDv) + "m/s. T: " + round(burnDuration, 2) + "s" at(0, 5). print "Warping to Circularization. " + round(burnDv) + "m/s. T: " + round(burnDuration, 2) + "s" at(0, 5).
@@ -94,18 +94,27 @@ local function Circularize{
lock throttle to 1. lock throttle to 1.
// wait burnDuration. // wait burnDuration.
wait until periapsis >= targetOrbit. wait until periapsis >= tgt.
lock throttle to 0. lock throttle to 0.
wait 0.01. wait 0.01.
} }
local function CircularizeBrute{ local function CircularizeBrute{
parameter targetOrbit. parameter tgt.
parameter head. parameter head.
lock throttle to 1. lock throttle to 1.
lock steering to heading(head, 0, 270). lock steering to heading(head, 0, 270).
wait until periapsis >= targetOrbit. wait until periapsis >= tgt.
lock throttle to 0. lock throttle to 0.
} }
local function CreateCircularizationNode{
parameter tgt.
lock throttle to 0.
wait until altitude > 80000.
local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis).
set circNode to Node(eta:apoapsis, 0, 0, burnDv).
add circNode.
}
-10
View File
@@ -1,13 +1,3 @@
declare function CreateDeorbit{
parameter target.
parameter dv is 300.
parameter offsetX is 0.0.
parameter offsetZ is 0.0.
}
declare function CalculateCircularizationDV{ declare function CalculateCircularizationDV{
parameter ap is 0. parameter ap is 0.
parameter sma is 0. parameter sma is 0.
-1
View File
@@ -1,4 +1,3 @@
import("library/lib_math").
declare function WaitForEngineStart{ declare function WaitForEngineStart{
wait until AnyEngineActive(). wait until AnyEngineActive().