All docsStellar ControlMission control · by Stellar Systems v1.1.0

Catalogues

Alarms

Limits and named alarms declared in the catalogue.

Alarms are declared in the catalogue, next to the measures they watch. The alarm service evaluates them on real-time samples, manages their lifecycle (raised, acknowledged, cleared, shelved) and can run a procedure when one is raised. This page covers the declarations; the lifecycle, acknowledgement and shelving are in Alarm Handling.

YAML
components:
  channel:
    instances: eps_channel
    measures:
      current:
        raw: u16
        type: f32
        unit: A
        calibration: {polynomial: [0.0, 0.001]}
        limits: {hard: [0 A, 2.0 A]}
      tripped: {type: bool}
    alarms:
      channel_tripped: {severity: critical, when: tripped}
      overcurrent:
        severity: critical
        when: stable(current > 1.8 A, 5 s)
        on_raise: run "Channel off"

Two sources of alarms#

SourceNameSeverity
Limits of a measure or derived measureThe name of the measure: channel[PAYLOAD].currentcritical outside the hard limits, else warning outside the soft limits
Named alarm (alarms:)Its name: channel[ADCS].overcurrentIts severity

On a multi-instance component, every alarm exists per instance: channel[PAYLOAD].overcurrent and channel[ADCS].overcurrent have their own state. On a single-instance component, it is written without index: camera.no_reply.

Because the alarm of the limits bears the name of the measure, measures, derived measures, telecommands and alarms of a component share one namespace (catalogue::name-collision).

Limits#

Limits are declared on the measure (or the derived measure) itself: see Measures, Limits and Calibration.

YAML
temperature:
  raw: i16
  type: f32
  unit: degC
  calibration: {polynomial: [0.0, 0.1]}
  limits: {soft: [-20 degC, 60 degC], hard: [-40 degC, 85 degC]}

Named alarms#

KeyRequiredMeaning
severityyeswarning or critical.
whenyesCondition raising the alarm: a boolean expression over the measures and derived measures of the component.
on_raisenoReaction: run "<procedure>".
descriptionnoFree text for operators.

when uses the syntax of derived measures, temporal functions included. Use stable to debounce a condition, or a window function to watch a trend:

YAML
alarms:
  overcurrent:
    severity: critical
    when: stable(current > 1.8 A, 5 s)
  stream_gap:                       # on the standard stream component
    severity: warning
    when: delta(gaps, 30 s) > 0
  silent:
    severity: warning
    when: age(responding) > 2 min

A condition that is not boolean is refused (expr::type-mismatch).

How conditions are evaluated#

  • Real time only. Deferred samples never raise an alarm: they are archived and analysed afterwards.
  • Same evaluation as the compute stage. The alarm service reads the real-time samples of PARAMS, measures and derived measures, keeps the same history and schedules the same deadlines: overcurrent is raised 5 s after the threshold is crossed, without a new sample.
  • Unknown changes nothing. A condition whose value is unknown (no value, empty window) leaves the alarm in its state.

Reactions: on_raise#

YAML
on_raise: run "Channel off"

A reaction runs a procedure on the target of the alarm, once per activation: when the alarm goes to ACTIVE_UNACK from NORMAL or CLEARED_UNACK because of its condition. An increase of severity, a shelved alarm or the end of a shelving triggers nothing.

The compiler checks the procedure against the libraries that depend on the platform:

  • it exists in such a library (procedure::unknown-reaction);
  • it sends no hazardous telecommand, directly or through its calls (procedure::hazardous-reaction): a reaction runs without confirmation;
  • it declares exactly one role, of the platform of the alarm, and, for a multi-instance component, exactly one input of the enum of its instances; for a single-instance component, no input (procedure::invalid-reaction). The executor binds them to the target and the instance of the alarm.

In a library of the EPS package (depends: {cubesat-eps: 1.x}):

Procedure
procedure "Channel off"
  uses eps: cubesat-eps
  input channel: eps_channel

  step "Cut the channel"
    send switch_off to eps.channel[channel]
    expect eps.channel[channel].enabled is false within 3 s

At run time, a run holding the target is suspended first, and the reaction must be allowed in the environment; in in_orbit, it is launched only when a link is available. See Alarm Handling for the full sequence.

↑↓ to moveEnter to open