Get full automation to orbit functioning.
This commit is contained in:
@ -28,15 +28,16 @@ function AddCircularizationNode {
|
||||
}
|
||||
local n is Node(t, 0, 0, 0).
|
||||
add(n).
|
||||
|
||||
local delta is 1.
|
||||
local diff is n:ORBIT:APOAPSIS - n:ORBIT:PERIAPSIS.
|
||||
until (diff < 1000) {
|
||||
set n:PROGRADE to n:PROGRADE + delta.
|
||||
local newDiff is n:ORBIT:APOAPSIS - n:ORBIT:PERIAPSIS.
|
||||
if newDiff > diff {
|
||||
set delta to (delta * -1) / 10.
|
||||
}
|
||||
set diff to newDiff.
|
||||
|
||||
local epsilon is 100.
|
||||
lock diff to n:ORBIT:APOAPSIS - n:ORBIT:PERIAPSIS.
|
||||
local pid is PIDLoop(0.05, 0.006, 0.006).
|
||||
set pid:EPSILON to epsilon.
|
||||
set pid:SETPOINT to n:ORBIT:APOAPSIS.
|
||||
|
||||
until abs(diff) < epsilon {
|
||||
print diff.
|
||||
set n:PROGRADE to pid:Update(TIME:SECONDS, n:ORBIT:PERIAPSIS).
|
||||
wait 0.001.
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ function TWR {
|
||||
function BurnTime {
|
||||
parameter dV.
|
||||
|
||||
local en is list().
|
||||
list ENGINES in en.
|
||||
|
||||
local f is en[0]:MAXTHRUST * 1000. // Engine Thrust (kg * m/s²)
|
||||
|
Reference in New Issue
Block a user