Guest User

Untitled

a guest
May 26th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1.  
  2.  
  3. //Rendezvous with space station from initial orbit of 210x400 km
  4. clearscreen.
  5. set pi to 3.1415926535897932384626433832795028841971693993751058209749445923.
  6. set mu to 3.986*(10^14).
  7. ag1 off.
  8. rcs on.
  9. sas off.
  10. gear off.
  11. set ship:control:neutralize to true.
  12. lock steering to prograde + r(0,0,180).
  13. set target to "LIESS".
  14. print "Awaiting AG1".
  15. wait until ag1.
  16. ag1 off.
  17. unlock steering.
  18. sas on.
  19.  
  20. //I found that the initial orbit gains on the space station at 10 degrees
  21. //per orbit.
  22. set ang to 239485239.
  23. Until ang < 15 {
  24. print "Please wait. Circularization will occur when".
  25. print "initial phasing is complete".
  26. set ang to vang(ship:body:position,(target:position+ship:body:position)).
  27. print "Loop ends at zero: "+round(100*(ang-15)).
  28. wait 0.1.
  29. clearscreen.
  30. }
  31. set warp to 0.
  32. print "Circularizing at Apogee".
  33. if ship:verticalspeed > 0 {
  34. wait until ship:verticalspeed<0.
  35. } else {
  36. wait until ship:verticalspeed>0.
  37. wait until ship:verticalspeed<0.
  38. }
  39.  
  40. //Circularizing
  41. set kpv to 1. //to control the vertical speed to keep it at zero
  42. sas off.
  43. lock steering to prograde + r(0,0,180).
  44. set ship:control:fore to 1. //burn
  45. set shipA to 0.
  46. set targetA to 29483924832.
  47. set A0 to ship:altitude.
  48. until ship:apoapsis>(A0+500) {
  49. print "Burning".
  50. wait 0.1.
  51. clearscreen.
  52. set ship:control:top to (kpv*ship:verticalspeed). //Controlling vertical speed
  53. }
  54. set ship:control:neutralize to true.
  55. print "Circularized at "+round(.5*(ship:apoapsis+ship:periapsis))+" meters".
  56.  
  57. print "Awaiting AG1".
  58. wait until ag1.
  59. ag1 off.
  60. unlock steering.
  61. sas on.
  62.  
  63. //second phasing orbit. This one gains on the space station at about 2.5 degrees
  64. //per orbit (400x400)
  65. set ang to 100000.
  66. Until ang < 2.5 {
  67. print "Please wait. Transfer will occur when".
  68. print "secondary phasing is complete".
  69. set ang to vang(ship:body:position,(target:position+ship:body:position)).
  70. print "Loop ends at zero: "+round(100*(ang-2.5)).
  71. wait 0.1.
  72. clearscreen.
  73. }
  74.  
  75. print "Awaiting Station Apsis".
  76. set warp to 0.
  77. //the two spacecraft have a very low angular difference, so when the station is
  78. //at an apsis, the spacecraft is approximately at that apsis. Burning at this
  79. //point gives the chaser a similar argument of perigee
  80. wait until abs(target:verticalspeed<0.1).
  81. sas off.
  82. lock steering to prograde + r(0,0,180).
  83. print "Initiating Hohmann Transfer to 5km below Station Orbit".
  84. set ship:control:fore to 1.
  85.  
  86. //stops burn when chaser apogee is at either target apogee or perigee
  87. if abs(target:altitude-target:periapsis)<1000 {
  88. wait until ship:apoapsis>(target:apoapsis-4750).
  89. } else {
  90. wait until ship:apoapsis>(target:periapsis-4750).
  91. }
  92. set ship:control:neutralize to true.
  93. print "Transfer Burn Complete".
  94. print "Awaiting AG1".
  95. wait until ag1.
  96. ag1 off.
  97. unlock steering.
  98. sas on.
  99. clearscreen.
  100. //stops at just below 5km
  101. until (target:altitude-ship:altitude)<5075 {
  102. print "Awaiting Apogee".
  103. print "Loop ends at zero: "+round((target:altitude-ship:altitude)-5075).
  104. wait 0.1.
  105. clearscreen.
  106. }
  107. set warp to 0.
  108. clearscreen.
  109. print "Awaiting AG1".
  110. wait until ag1.
  111. ag1 off.
  112. run fivekm.
Add Comment
Please, Sign In to add comment