Created
September 28, 2013 21:05
-
-
Save hughes/6746545 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup | |
SET offset TO ALT:RADAR. | |
SET alt_target TO 25. | |
SET max_throttle TO 0.5. | |
SAS ON. | |
LOG "MISSION START" TO output. | |
UNTIL 0 { | |
// setup | |
SET alt_radar TO ALT:RADAR - offset. | |
SET time TO MISSIONTIME. | |
SET throttle_target TO 0. | |
// control | |
SET error TO alt_target - alt_radar. | |
IF error > 0 AND time < 60 { | |
LOCK THROTTLE TO max_throttle. | |
}. | |
IF error < 0 OR time > 60 { | |
LOCK THROTTLE TO 0. | |
}. | |
// logging | |
SET line TO time + "," + alt_radar + "," + throttle_target. | |
LOG line TO output. | |
WAIT 0.1. | |
}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment