Spacecraft: Configuring Events
The Timeline
The timeline, located under the viewport, contains a summary of all events that will or have happened throughout the simulation. Some events are automatic, such as eclipse and attitude warnings. Others can be specified through the Events System, including timers that will always appear in the timeline, and flags that have markers that appear when they are triggered. The timeline can be panned and zoomed and provides an easy place to specify the epoch and simulation speed.
Configuring Events
Currently, the spacecraft can orbit the Earth but does not have any functionality. To add some function to the spacecraft, select the original Spacecraft that was configured earlier and switch into build mode. Add an optical camera to the spacecraft and add it to the opposite side of the solar panel.
Select the new camera in the outliner and find the events tab in the properties panel. By using either the timeline or the panel, a new event can be created. If the camera was selected, it will be automatically chosen as the target of this event.
Note
Each component has its own series of events that are available. Custom components can have additional events that are defined in the blueprints when exported. By selecting Execute Event, the event action will be immediately applied for testing.
Set the type to User Input
, the action to Capture
, and select a key for the action. When simulating, by pressing this key on the keyboard, the event will be triggered and an image from the camera will be shot. Next select the guidance computer and add another event, with the following parameters:
Event Component: Guidance Computer
Type: Flag
Action: Start Ground Pointing
Watch Object: Battery
Parameter: ChargeFraction
Evaluation: Larger
Value: 0.75
Additionally, add another event to the computer with the parameters:
Event Component: Guidance Computer
Type: Flag
Action: Start Sun Pointing
Watch Object: Battery
Parameter: ChargeFraction
Evaluation: Less
Value: 0.25
With this, the spacecraft can now keep itself charged by switching into sun pointing mode when the battery is low (<25%) and back to ground pointing when the battery is charged (>75%).
Flag events will have markers appear in the timeline when they are triggered, and having an action specified on these is completely optional.
Configuring the Computer
The guidance computer is a ‘smart’ component that is able to detect the components on the spacecraft and enable flight software pointing based on the components that exists. Select the guidance computer and head to component properties. Here, the pointing vectors for the solar panels can be specified. This is important so that the spacecraft knows which side to orient toward the sun. By default, it will pick up on the solar panel vector and apply it here. Set the controller mode to MRP
, instead of IDLE
so that the computer is not idle during the simulation. The pointing mode will define which direction the primary payload should be pointed towards. Specify the pointing vector along the axis the camera is pointing when selected Ground Pointing
. Next set the pointing mode back to Sun Pointing
for the beginning of the simulation and then add the correct pointing vector. In this example we can see the solar panel is pointing along the x-axis.
When the simulation is run, select the battery and watch the Charge level
. When the solar panel is no longer aligned with the Sun the charge should drop. As the simulation continues, a photo can be taken when the camera is aligned with the ground with the key selected earlier (F1 in this example).
Note
The guidance computer is a useful component as it hides away the flight software logic. Custom logic can be built in Nominal Editor and exported to Studio if required. Additionally, pointing modes can be changed during simulation time by selecting the component and adjusting the parameters.