10 lines
623 B
Plaintext
10 lines
623 B
Plaintext
// This alternative approach to hovering is ultimately not worth the complexity to use, but it's really neat! It maintains *whatever your current vertical velocity is* using the fact that F = μ*m/(r^2).
|
|
// In practice, by the time the PID controller settles enough to make this worth
|
|
// using, the efficiency gains have mostly dried up anyway.
|
|
|
|
// lock STEERING to SHIP:UP.
|
|
// wait until done or abs(SHIP:VERTICALSPEED - vertSpeed) < 0.05.
|
|
// print "Maintaining velocity.".
|
|
// lock targetForce to (SHIP:BODY:MU * SHIP:MASS) / ((SHIP:ALTITUDE + SHIP:BODY:RADIUS)^2).
|
|
// lock THROTTLE to targetForce / SHIP:AVAILABLETHRUST.
|