2
$\begingroup$

Launch vehicles will generally have multiple multiple attitude control modes.

At launch, the engine-gimballing thrust-vectoring system is in charge.

In orbit, the reaction control system is (at least often if not always) in charge.

And in a self-landing rocket stage, steering fins might be in charge---once the stage enters the thick of the atmosphere, anyway.

It's also possible that multiple attitude control systems will be active at the same time. In its final landing burn, a Falcon-9 stage 1 uses everything it has: thrust vectoring, reaction control, steering fins.

And this has me wondering.

To switch between these modes, the GNC software must have logic algorithms to select the appropriate mode and to identify that mode to the subsystems that need it---like the attitude control systems themselves.

So how would those attitude control modes be expressed internally? As strings (e.g., "ACM002" for attitude control mode 2)? As integers (e.g., "2" for mode 2)?

And would those strings/integers be arranged in objects with other properties like data type, size, name, etc?

Open to answers even if they're specific to one vehicle (e.g., space shuttle or Saturn V) :D

$\endgroup$
0

1 Answer 1

4
$\begingroup$

In the flight software, certainly not as a string. Strings are just nasty in this regard. Almost all flight software is written in one of three languages: Ada, C, or C++. All three of those languages support the concept of an enumeration. In the flight software code, it is best to the enumeration value by name (but not a string) rather than integer value in the code, but underneath the hood, it is an integer.

Suppose that, for some reason, your flight software has a mode named TheAnswerToLifeTheUniverseAndEverything. That enumeration value had better have a numerical value of 42. If a code reviewer see you using 42 instead of the enum value TheAnswerToLifeTheUniverseAndEverything in your code, that code reviewer will rip you a new one. On the other hand, if your code uses "TheAnswerToLifeTheUniverseAndEverything" (the string name as opposed to the enum name), the code reviewers will also rip you a new one.

$\endgroup$
1
  • $\begingroup$ Thank you David! This is so helpful. I actually replaced strings with enumerations just yesterday after reading a comment that strings were computationally expensive. It seemed better but i still wasn’t sure if that was the way to go! Your answer is just the thing I needed right now. And thanks for framing it in strong terms. I do want to know where code reviewers would scream at me :D $\endgroup$
    – user39728
    Jun 7, 2021 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.