Advertisement
Guest User

donode.txt

a guest
Apr 24th, 2014
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. clearscreen.
  2. print "Steering...".
  3. SAS off.
  4. lock steering to nextnode.
  5.  
  6. print "Waiting for node".
  7. wait until NEXTNODE:ETA < 1.
  8.  
  9. print "Beginning burn".
  10. set tvar to 0.
  11. lock throttle to tvar.
  12. print "Fast burn.".
  13. set olddv to nextnode:deltav:mag.
  14. until (nextnode:deltav:mag < 1 and stage:liquidfuel > 0) or (nextnode:deltav:mag > olddv) {
  15. set da to maxthrust * throttle / mass.
  16. set tset to nextnode:deltav:mag * mass / maxthrust.
  17. if nextnode:deltav:mag < 2*da and tset > 0.1 {
  18. set tvar to tset.
  19. }
  20. if nextnode:deltav:mag > 2*da {
  21. set tvar to 1.
  22. }
  23. set olddv to nextnode:deltav:mag.
  24. }
  25. // compensate 1m/s due to "until" stopping short; nd:deltav:mag never gets to 0!
  26. print "Slow burn.".
  27. if stage:liquidfuel > 0 {
  28. wait 1/da.
  29. }
  30. lock throttle to 0.
  31.  
  32. unlock all.
  33.  
  34. print "Done.".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement