The Guidance Computer is a subclass of computers that allows the user or software to change the pointing and flight software modes during runtime in the simulation. This can allow the spacecraft’s task to be changed during the flight. The guidance computer is designed to be a ‘plug and play’ device, working straight out of the box without configuration. This guide shows how to add the computer to the spacecraft and how the flight chains work.


Adding the Computer

The computer can be added to the spacecraft in two ways; adding to the spacecraft blueprint or spawning it in a blueprint. In this example, we will be spawning via a blueprint, just to show off the public variables on-spawn, but there is no preferable method for adding the component to the spacecraft. The component can be added using the Create Object method and selecting the BP_NS_GuidanceComputer.

image 4.png


Software Modes

Four sets of software modes are used to create a flight software chain onboard the guidance computer. Each chain type has a specific purpose and the chains can be added together to perform a full software stack. These are:

  • Navigation Chain
  • Pointing Chain
  • Controller Chain
  • Mapping Chain

Each chain can consist of one or many software (or interface) modules and there can be many different chains per chain category. However, each chain within the category must have the same input and output messages to connect with the interface between chains.

Untitled

Changing the chain selection for each chain type can be done with the enumerations, and each category has a different number of chain options to select from. By setting the Initial values when spawning the guidance computer, the starting software chain can be selected and executed on the spacecraft. More documentation on how each of the software chains works and their use cases can be found in the Guidance Computer Technical Manual document.


Updating Software Modes

Software modes can be set during runtime when a simulation is running already. The current software modes can be fetched from the guidance computer using a blueprint function and the modes can be set at any point during the simulation. To do so, call Get or Set on the desired chain from the computer.

image.png


Idling

The guidance computer can idle the spacecraft, which will disable the reaction wheel or other actuators from applying torque on the spacecraft. The Idle Controller Mode can be found by adjusting the controller software chain type from MRP to IDLE. This will disable the commands coming from the controller into the actuator and ensure that no torques are applied. This will not stop the spacecraft from spinning if it is already spinning, but it will prevent the attitude rate from changing due to internal torques.

NOTE

By default, guidance computers will have the MRP controller mode selected in the create function.


Configuring Chain Parameters

Each software chain has several configurable parameters that can be adjusted on the guidance computer. By default, a standard selection of parameters is chosen for initializing the software chains. However, if the user prefers to use alternative parameters, they can be adjusted using the Get Config methods in Unreal and then adjusting the values on the configs.

image.png

Each software chain that is available across the modes has a dedicated configure method and the parameters exposed in each method may be different. For example, each of the six pointing chains has a parameter called Alignment, which specifies a non-default alignment vector or matrix (depending on the flight software) to align the pointing direction in. By default, leaving these values as a zero vector or a zero matrix will result in the default alignment vector not being overridden. These default values are dependent on the chain but are often using a camera or solar panel payload that exists on the spacecraft already.

image.png

A relative pointing chain requires an input target ID for the software to work. This is the object’s GUID in the simulation and can be pulled from the object using the Get ID function. For example:

image.png


Changing Modes with Key Presses

Using a Blueprint, button key presses, or events, can be mapped to changing the software modes on the guidance computer. For example, to change a particular pointing software chain type the set pointing mode function can be used. In the case below, when the X button is pressed during the simulation, the mode will change to sun pointing, but all navigation, controller and mapping modes remain the same.

image.png


Output Messages

Each of the software chain interface messages is exposed to the guidance computer on the blueprint level. They are:

  • Attitude Error Message
  • Attitude Reference Message
  • Command Torque Body Message
  • Navigation Attitude Message
  • Navigation Translation Message

Each of these messages is required for one of the chain types to use or output. To access these messages, use the individual Get Out [MESSAGE] variables on the computer.

image.png

For example, to get the message that contains the error between the reference frame and the alignment frame that gets fed into the feedback controller, use the Get Out_AttitudeErrorMsg method.

image.png