HvrdlS

Starship Integrated Test Flight 1(Engines lose, booms, FTS)

Jun 17th, 2023 (edited)
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. clearscreen.
  2. on ag10 {
  3. abortflight().
  4. }
  5.  
  6. prep().
  7. fuel().
  8. flight().
  9. detanking().
  10.  
  11.  
  12. function prep {
  13. print "Welcome to Starship Flight Software V1!".
  14. print "Running hardware, preparings for software...".
  15. wait 1.
  16. set teststatus to "Preparations".
  17. wait until teststatus = "Preparations".
  18. wait 1.
  19. set goal to "Launch".
  20. rcs on.
  21. set targetPe to 125000.
  22. set targetAp to 40000.
  23. set Azimuth to 110.
  24. set topv to ship:facing:topvector.
  25. lock steering to lookdirup(up:vector,topv).
  26. set h to alt:radar.
  27. lock altit to alt:radar-h.
  28. set engList to list().
  29. set i to -1.
  30. until i >= 32 {
  31. set i to i + 1.
  32. engList:add(ship:partstagged("Vector" + i)[0]).
  33. }
  34.  
  35. for eng in engList { eng:shutdown. }
  36. print "Goal: " + goal.
  37. print "Press 9".
  38. wait 1.
  39. wait until ag9.
  40. set now to time:seconds.
  41. lock testtime to time:seconds - now.
  42. wait 1.
  43. toggle ag9.
  44. set teststatus to "Fueling".
  45. print "Go for test".
  46. }
  47.  
  48. function fuel {
  49. print "Beginning fueling".
  50. wait 1.
  51. print "Awaiting for fueling end, press 9 to end".
  52. wait 1.
  53. until ag9 {
  54. printing().
  55. }
  56.  
  57. set teststatus to goal + " preparing".
  58. wait 1.
  59. toggle ag1.
  60. toggle ag2.
  61. toggle ag9.
  62. print "Fueling finished, press 9".
  63. wait 1.
  64. until ag9 {
  65. printing().
  66. }
  67.  
  68. toggle ag9.
  69. toggle ag1.
  70. toggle ag2.
  71. wait 6.
  72. set teststatus to goal + " go".
  73. }
  74.  
  75. function flight {
  76. print "Hold for final GO/NO GO, press 9".
  77. set teststatus to goal + "GO/NO GO POLL".
  78. until ag9 {
  79. printing().
  80. }
  81.  
  82. toggle ag9.
  83. set teststatus to goal.
  84. print "Countdown initiated, T-10".
  85. set now to time:seconds.
  86. lock t to time:seconds-now.
  87. until t >= 7 {
  88. clearscreen.
  89. print "T-" + (10-t).
  90. wait 1.
  91. }
  92.  
  93. lock throttle to 0.05.
  94. wait 0.5.
  95. set now to time:seconds.
  96. lock t to time:seconds-now.
  97. ship:partstagged("Vector0")[0]:activate.
  98. ship:partstagged("Vector1")[0]:activate.
  99. ship:partstagged("Vector2")[0]:activate.
  100. ship:partstagged("Vector20")[0]:activate.
  101. ship:partstagged("Vector18")[0]:activate.
  102. ship:partstagged("Vector28")[0]:activate.
  103. ship:partstagged("Vector30")[0]:activate.
  104. lock throttle to min(0.4, t/0.3).
  105. wait 0.5.
  106. print "T-2".
  107. lock throttle to 0.45.
  108. ship:partstagged("Vector29")[0]:activate.
  109. ship:partstagged("Vector19")[0]:activate.
  110. ship:partstagged("Vector10")[0]:activate.
  111. ship:partstagged("Vector12")[0]:activate.
  112. ship:partstagged("Vector5")[0]:activate.
  113. ship:partstagged("Vector7")[0]:activate.
  114. wait 0.2.
  115. ship:partstagged("Vector16")[0]:activate.
  116. ship:partstagged("Vector11")[0]:activate.
  117. ship:partstagged("Vector6")[0]:activate.
  118. ship:partstagged("Vector21")[0]:activate.
  119. ship:partstagged("Vector17")[0]:activate.
  120. ship:partstagged("Vector27")[0]:shutdown.
  121. ship:partstagged("Vector31")[0]:activate.
  122. wait 0.2.
  123. ship:partstagged("Vector15")[0]:activate.
  124. ship:partstagged("Vector14")[0]:activate.
  125. ship:partstagged("Vector25")[0]:activate.
  126. ship:partstagged("Vector24")[0]:activate.
  127. ship:partstagged("Vector23")[0]:activate.
  128. ship:partstagged("Vector13")[0]:activate.
  129. wait 0.2.
  130. ship:partstagged("Vector26")[0]:shutdown.
  131. ship:partstagged("Vector22")[0]:activate.
  132. ship:partstagged("Vector32")[0]:activate.
  133. ship:partstagged("Vector9")[0]:activate.
  134. ship:partstagged("Vector3")[0]:activate.
  135. ship:partstagged("Vector8")[0]:activate.
  136. ship:partstagged("Vector4")[0]:activate.
  137. wait 0.4.
  138. print "T-1".
  139. set now to time:seconds.
  140. lock testtime to time:seconds - now.
  141. print "Full Ignition".
  142. until testtime > 7 {
  143. printing().
  144. }
  145.  
  146. lock throttle to min(0.85, 0.4+t/0.3).
  147. until ship:verticalspeed > 1 {
  148. printing().
  149. }
  150.  
  151. ship:partstagged("Vector0")[0]:shutdown.
  152. print "Liftoff".
  153. wait 0.1.
  154. until altit > 150 {
  155. printing().
  156. }
  157.  
  158. lock gravityturn to 90-(((ship:apoapsis/TargetPe)^0.6)*90).
  159. lock steering to heading(Azimuth, gravityturn, 40).
  160. until altit > 520 {
  161. printing().
  162. }
  163.  
  164. ag8 on.
  165. ship:partstagged("Vector0")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  166. ship:partstagged("Vector1")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  167. ship:partstagged("Vector2")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  168. ship:partstagged("Vector3")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  169. ship:partstagged("Vector4")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  170. ship:partstagged("Vector5")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  171. ship:partstagged("Vector6")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  172. ship:partstagged("Vector7")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  173. ship:partstagged("Vector8")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  174. ship:partstagged("Vector9")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  175. ship:partstagged("Vector10")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  176. ship:partstagged("Vector11")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  177. ship:partstagged("Vector12")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
  178. until altit > 2380 {
  179. printing().
  180. set ship:partstagged("Vector19")[0]:thrustlimit to random()*100.
  181. }
  182.  
  183. ship:partstagged("Vector19")[0]:shutdown.
  184. until altit > 1700 {
  185. printing().
  186. set ship:partstagged("Vector32")[0]:thrustlimit to random()*100.
  187. }
  188.  
  189. lock throttle to 0.75.
  190. until altit > 2800 {
  191. printing().
  192. set ship:partstagged("Vector32")[0]:thrustlimit to random()*100.
  193. }
  194.  
  195. ship:partstagged("Vector22")[0]:shutdown.
  196. set oldq to ship:q.
  197. wait 0.1.
  198. set newq to ship:q.
  199. until newq < oldq {
  200. printing().
  201. set ship:partstagged("Vector32")[0]:thrustlimit to random()*100.
  202. set oldq to ship:q.
  203. wait 0.1.
  204. set newq to ship:q.
  205. }
  206.  
  207. print "Max-Q".
  208. lock throttle to 0.85.
  209. set ship:partstagged("Vector32")[0]:thrustlimit to 100.
  210. until altit > 8230 {
  211. printing().
  212. }
  213.  
  214. set ship:partstagged("Vector2")[0]:thrustlimit to random()*100.
  215. wait 2.
  216. until altit > 10173 {
  217. printing().
  218. set ship:partstagged("Vector2")[0]:thrustlimit to random()*100.
  219. set ship:partstagged("Vector23")[0]:thrustlimit to random()*100.
  220. }
  221.  
  222. toggle ag5.
  223. until altit > 12000 {
  224. printing().
  225. set ship:partstagged("Vector2")[0]:thrustlimit to random()*100.
  226. }
  227.  
  228. ship:partstagged("Vector2")[0]:shutdown.
  229. until altit > 14000 {
  230. printing().
  231. }
  232.  
  233. unlock steering.
  234. set ship:control:pitch to -1.
  235. set ship:control:yaw to 1.
  236. set ship:control:roll to 0.5.
  237. wait 5.
  238. set ship:control:pitch to 0.
  239. set ship:control:yaw to 0.
  240. set ship:control:roll to 0.
  241. until ship:verticalspeed < 40 {
  242. printing().
  243. }
  244.  
  245. for eng in engList { set eng:thrustlimit to 41. }
  246. lock throttle to 1.
  247. until ship:verticalspeed < 1 {
  248. printing().
  249. }
  250.  
  251. ship:partsdubbed("FTSE1")[0]:activate.
  252. ship:partsdubbed("FTSE2")[0]:activate.
  253. for eng in engList { set eng:thrustlimit to 33. }
  254. until altit < 15000 and ship:verticalspeed < -20 {
  255. printing().
  256. }
  257.  
  258. set teststatus to "FTS activated".
  259. set testtime to testtime.
  260. ag4 on.
  261. wait 3.
  262. ag7 on.
  263. stage.
  264. until altit < 50 or ship:verticalspeed > -5 and ship:verticalspeed < 5 {
  265. printing().
  266. }
  267. }
  268.  
  269. function detanking {
  270. print "Test status: " + teststatus.
  271. ag1 off.
  272. ag2 off.
  273. for eng in engList { eng:shutdown. }
  274. }
  275.  
  276. function printing {
  277. clearscreen.
  278. print "Time from test beginning: " + testtime + " Seconds".
  279. print "Test status: " + teststatus.
  280. print "Goal: " + goal.
  281. print "Time(KSC): " + time:clock.
  282. wait 0.1.
  283. }
  284.  
  285. function abortflight {
  286. print "Abort".
  287. for eng in engList { eng:shutdown. }
  288. lock throttle to 0.
  289. unlock steering.
  290. wait 1.
  291. unlock throttle.
  292. set teststatus to "Detanking".
  293. detanking().
  294. }
Add Comment
Please, Sign In to add comment