All docsStellar ControlMission control · by Stellar Systems v1.1.0

Operations

Modes and Parameters

Parameters of the components, modes of operation, the value of each parameter per target and mode, the current mode of a target, and configure in procedures.

A component exposes parameters: on-board settings such as the rate of a transmitter or the detector setpoint of a camera. The topology declares the modes of operation (Nominal, Cold…) and gives each target the value of its parameters in each mode. Every target has a current mode; the procedure statement configure applies a mode on board, and the ground chain (driver, transport, gateway) receives the parameters of the current mode, so that a ground modem can follow the rate of the spacecraft.

The pieces live in four places:

WhereWhat
Catalogueparameters of a component: type, unit, range, and how each is set (set) and read back (readback, tolerance)
Topologymodes, and per target parameters (value per mode) and overrides (by environment)
Proceduresconfigure <role> for <mode>, and param <path> [in <Mode>] in expressions
OperationsThe current mode of each target in the state store (stellar_modes); stellar mode, stellar parameters and the API
flowchart LR
    cat["Catalogue<br/>parameters: set, readback"] --> conf
    topo["Topology<br/>modes, values per target"] --> conf
    conf["configure cam for Cold<br/>(send setters, expect readbacks)"] --> store[("stellar_modes<br/>current mode")]
    op["Operator<br/>stellar mode / PUT"] --> store
    store --> rec["Reconciler<br/>bindings: mode + parameters"]
    rec --> chain["Driver, transport, gateway<br/>LinkContext.mode, .parameters"]
    store --> exe["Executor<br/>param in the current mode"]

Parameters in the catalogue#

A component declares its parameters under parameters, like the arguments of a telecommand. From the catalogue of the HSC-100 camera (packages/hsc-100/catalogue.yaml in payload-integration):

YAML
components:
  camera:
    measures:
      detector_setpoint:
        raw: i16
        type: f32
        unit: degC
        calibration: {polynomial: [0.0, 0.01]}
        description: Setpoint of the detector temperature.
      # … other measures
    telecommands:
      # … ping, housekeeping, set_mode, configure_acquisition…
      set_detector_setpoint:
        description: Setpoint of the detector temperature (port 15).
        args:
          temperature: {type: f32, unit: degC, range: [10 degC, 25 degC]}
        verify: [{detector_setpoint: args.temperature, within: 5s}]
    parameters:
      detector_setpoint:
        description: Setpoint of the detector temperature, per mode of the target.
        type: f32
        unit: degC
        range: [10 degC, 25 degC]
        tolerance: 0.1 degC
        set: {telecommand: set_detector_setpoint, arg: temperature}
        readback: detector_setpoint
  • set names the telecommand of the component that sets the parameter and the argument that carries its value. Several parameters may share one setter, each through its own argument (two parameters integration_time and binning would both go through configure_acquisition, each through its argument of that name).
  • readback names the measure (or derived measure) of the component that reads it back; tolerance bounds the gap accepted on a numeric readback.
  • A multi-instance component has one parameter per instance. The examples below give the instanced component thermal of the 6U CubeSat (satellite-integration) a parameter heater_on, set by set_heater (argument on) and read back by the measure heater_on: it exists once per zone, such as thermal[PAYLOAD].heater_on.

The full reference of the keys and their checks is in Telecommands and Verification.

Modes and values in the topology#

topology.yaml declares the modes, in their order, and exactly one default: the mode of a target whose mode was never set.

YAML
modes:
  Nominal: {description: Camera detector at 18 °C, default: true}
  Cold: {description: Camera detector at 12 °C}

Each target gives the value of its parameters: one value for every mode, or a table by mode, possibly partial. A key names the parameter as procedures do (thermal[PAYLOAD].heater_on; the component is left out on a platform of one component). On a multi-instance component, a key without instance (thermal.heater_on) holds for every instance; the key of an instance (thermal[BATTERY].heater_on) wins for that instance.

YAML
targets:
  sat-sim:
    platform: cubesat-6u@1.0.0
    environments: [SIM]
    parameters:
      camera.detector_setpoint: {Nominal: 18 degC, Cold: 12 degC}
      thermal.heater_on: false
      thermal[BATTERY].heater_on: {Nominal: true}
  sat-fm-1:
    platform: cubesat-6u@1.0.0
    environments: [FLATSAT, FM]
    parameters:
      camera.detector_setpoint: {Nominal: 18 degC, Cold: 12 degC}
      thermal.heater_on: false
    # On the flatsat, in ambient air, the detector is kept above the dew point.
    overrides:
      FLATSAT:
        parameters:
          camera.detector_setpoint: {Cold: 15 degC}

On sat-sim, thermal[BATTERY].heater_on is true in Nominal and, since its own table has no Cold, false in Cold from the key without instance. On sat-fm-1, camera.detector_setpoint in Cold is 15 °C in FLATSAT and 12 °C in FM. The topology rules are on Targets.

Which value applies#

The value of a parameter of a target, in a mode and an environment, is looked up in this order:

  1. the key as written (with its instance): the override of the environment, then the value of the target;
  2. for a parameter of an instance without a value of its own: the key without instance, again override first, then the value of the target.

So an override of thermal.heater_on does not change an instance that has its own value in the same mode, such as thermal[BATTERY].heater_on on sat-sim: override the key of the instance for that.

The current mode#

The current mode of each target lives in the state store, in stellar_modes, under the name of the target: the mode, when it was set, who set it, and the run that set it. A target whose mode was never set (or whose stored mode is no longer declared by the topology) is in the default mode.

It changes in two ways:

  • A run, at the end of a successful configure: the event mode_changed is logged, and the record names the run.
  • An operator, who declares the mode after something that happened outside Stellar Control, such as an autonomous switch of the spacecraft to survival. Declaring a mode sends nothing to the target.
Shell
stellar mode cam-sim-1           # cam-sim-1: Nominal (default)
                                 # modes: Nominal, Cold
stellar mode cam-sim-1 Cold      # declare the mode, as the operator of --as

The web console shows it in the tab Parameters of a target, where an operator can declare another mode (see Web Console). The API offers the same (tag modes):

RequestResult
GET /v1/targets/{target}/modeModeView: mode, default, modes, since, by, run
PUT /v1/targets/{target}/mode with {"mode": "Cold"}Sets the mode, answers the new ModeView

PUT needs the identity of the operator (X-Stellar-User or a token, else 400 api::anonymous), refuses a mode the topology does not declare (422 mode::unknown) and a target held by a run (409 mode::target-held: its runs set its mode). An unknown target answers 404 api::unknown-target.

Parameters of a target#

stellar parameters <target> lists the parameters of a target: their value in the current mode, their value in each mode, and their readback with its last sample.

text
$ stellar parameters sat-sim
sat-sim: mode Nominal, environment SIM
thermal[BATTERY].heater_on  true  [Nominal=true, Cold=false]  read true ok
thermal[PAYLOAD].heater_on  false  [Nominal=false, Cold=false]  read false ok
…
camera.detector_setpoint  18.0 degC  [Nominal=18.0, Cold=12.0]  read 18.02 ok

The tab Parameters of a target in the web console shows the same table, read again every 5 s, the readbacks marked ✓ or ✗. --environment picks the environment of the overrides; by default, a target engaged in a single environment is read in it, and a target engaged in several without overrides. The API is GET /v1/targets/{target}/parameters?environment=…, answering a ParametersView: for each parameter its name, unit, value in the current mode, values by mode, set (the setter telecommand) and readback (measure, current sample, and matches: whether the sample has the value of the mode within the tolerance; null without a sample or a value). Codes: 404 api::unknown-target, 422 api::unknown-environment (the target is not engaged in it), 503 api::no-catalogue.

Applying a mode: configure#

In a step, configure <role> for <mode> applies a mode to the target of the role. « First light » (packages/hsc-100-ops/camera.proc) applies Nominal before cooling the detector; two procedures could switch the camera from one mode to the other:

Procedure
procedure "Cold detector"
  uses cam: hsc-100

  step "Configure cold"
    configure cam for Cold

procedure "Nominal detector"
  uses cam: hsc-100

  step "Configure nominal"
    configure cam for Nominal
    check cam.camera.detector_setpoint is param cam.camera.detector_setpoint +/- 0.1 degC

The compiler expands configure from the catalogue of the platform of the role:

  1. for each telecommand setting parameters, in the order of the catalogue, and for each instance of its component in the order of the enum of its instances, one send whose parameter arguments take param … in <mode> (the other arguments keep their default);
  2. right after each send, for each of its parameters that has a readback, an expect that the readback measure is the value of the mode (+/- tolerance when declared), within the longest within of the verifications of the setter, or 10 s when it has none;
  3. once all have succeeded, the mode of the target becomes the mode (event mode_changed).

For hsc-100, configure cam for Cold therefore sends set_detector_setpoint with temperature = 12 degC (on cam-sim-1) and expects detector_setpoint is 12 degC +/- 0.1 degC within 5 s. On the CubeSat with the parameter heater_on above, configure sat for Cold first sends, for thermal[BATTERY], then [PAYLOAD], [PANEL_PX] and [PANEL_MX], set_heater with on = false and expects heater_on is false within 5 s; then it sets the camera, since thermal comes before camera in the catalogue of cubesat-6u. A dry run shows the expansion:

text
step Cold payload / Configure cold
  send thermal[BATTERY].set_heater to dry-sat
  → VERIFIED
  expect sat.thermal[BATTERY].heater_on is param sat.thermal[BATTERY].heater_on in Cold: PASSED
  …
  send camera.set_detector_setpoint to dry-sat
  → VERIFIED
  expect sat.camera.detector_setpoint is param sat.camera.detector_setpoint in Cold +/- 0.1 degC: PASSED
  mode of dry-sat: Cold

These sends follow the rules of every send: a hazardous setter needs its ask operator in the same step, a step with a setter that changes the on-board state is not eligible for retries, and the maximum duration counts every setter and every readback window (see Safety Rules). If a step fails, the mode is not changed.

At the resolution of the run, every parameter a configure sets must have a value on the target in that mode (run::parameter-undefined, 422).

Reading a parameter: param#

In any expression of a procedure, param <role>.<component>[<instance>].<parameter> is the value of the parameter in the current mode of the target, read when the statement is evaluated, in the environment of the run; param … in <Mode> is its value in that mode. It has the type and unit of the parameter, and serves as an argument of a telecommand or in a condition:

Procedure
send set_heater to sat.thermal[zone] with on = param sat.thermal[zone].heater_on in Nominal
check sat.camera.detector_setpoint is param sat.camera.detector_setpoint +/- 0.1 degC

The mode is checked at compile time (procedure::unknown-mode). A param … in <Mode> whose instance is known is checked again at the resolution of the run (run::parameter-undefined); otherwise a parameter without value for the target fails the statement at run time. Details are in Expressions.

The ground chain#

The ground segment follows the mode of the target:

  • Each binding the reconciler delivers (stellar_bindings, verb bindings) carries the current mode of its target and its parameters in that mode, plus parameter_environments: the same, overrides applied, for each environment that overrides some. The reconciler watches stellar_modes and delivers the bindings again at each change of mode.
  • The context of a link (LinkContext) gains mode and parameters, resolved for the environment like params. Drivers and transports receive it with each telecommand and each frame, as before.
  • A gateway receives it with each frame (Gateway::send_with in Rust, a send with three arguments in Python) and each time its bindings change (Gateway::configure, @gateway.configure), for instance to set the rate of its modem.
  • LinkContext::parameter("thermal[PAYLOAD].heater_on") gives the value of an instance, falling back on the key without instance, as in procedures.

See Writing a Gateway and Writing a Driver.

Diagnostics#

CodeWhereMeaning
catalogue::parameter-typeCatalogueA parameter is a number, bool or an enum value, not bytes nor a duration
catalogue::unknown-setter, catalogue::unknown-setter-argumentCatalogueset names no telecommand of the component, or no argument of it
catalogue::setter-type-mismatchCatalogueThe argument has another type or unit than the parameter
catalogue::duplicate-setterCatalogueThe argument already carries another parameter
catalogue::setter-argument-without-defaultCatalogueA setter has an argument that carries no parameter and has no default
catalogue::unknown-readback, catalogue::readback-type-mismatchCataloguereadback names no measure of the component, or one of another type or unit
catalogue::tolerance-on-non-numeric, catalogue::invalid-toleranceCatalogueA tolerance on a non-numeric parameter, or negative or in the wrong unit
topology::default-modeTopologyNo mode, or several, marked default: true
topology::unknown-parameterTopologyThe key names no parameter of the catalogue of the target
topology::unknown-modeTopologyA value is given for an undeclared mode
topology::invalid-parameter-valueTopologyA value does not fit the parameter: type, unit, range, enum value
topology::unknown-override-environmentTopologyoverrides names an environment the target is not engaged in
procedure::unknown-modeProcedureconfigure … for or param … in names an undeclared mode
procedure::unknown-parameterProcedureparam names no parameter
procedure::nothing-to-configureProcedureThe platform of the role has no parameter with a set
expr::parameter-not-hereCatalogueparam in a catalogue expression: parameters are read in procedures only
run::parameter-undefinedRun requestThe target has no value of a parameter in the mode used
mode::unknown, mode::target-heldAPISee The current mode

↑↓ to moveEnter to open