All docsStellar ControlMission control · by Stellar Systems v1.1.0

Procedure Language

Safety Rules and Maximum Duration

The rules the compiler enforces on steps and procedures: confirmation of hazardous telecommands, bounded waits and durations, no recursion, safe alarm reactions.

Errors are caught at compile time, in CI and in the editor, not during a pass. Beyond types and references, the compiler enforces safety rules on every step and procedure, and computes how long each can last at most. A library with an error cannot be compiled into a snapshot, so it never reaches the executor.

Hazardous telecommands#

A telecommand declared hazardous: true in the catalogue needs a human confirmation before it leaves. The rule: each send of a hazardous telecommand follows, in the same step, an ask operator "…" confirmation that no other hazardous send has used.

Procedure
procedure "Release cover"
  uses cam: hsc-100

  step "Release"
    ask operator "Release the launch cover of the camera? It cannot be closed again."
    send release_cover to cam.camera
  • The confirmation is an ask operator without as … into: a typed answer does not confirm anything.
  • It is in the same step, before the send.
  • One confirmation per hazardous send: two hazardous sends need two ask.

Otherwise the compiler reports procedure::unconfirmed-hazardous:

text
procedure::unconfirmed-hazardous

  × `release_cover` is hazardous and needs a confirmation
   ╭─[test.proc:5:5]
 4 │   step "Release"
 5 │     send release_cover to cam.camera
   ·     ────────────────────────────────
   ╰────
  help: add `ask operator "…"` before it in the step: one confirmation per hazardous telecommand

The text marks where the confirmation happens; the environment decides who confirms: nobody without human orchestration (acknowledged automatically and logged), the operator on the flatsat (FLATSAT), the operator then a supervisor on the flight model (FM), in the satellite integration use case. See Hazardous Confirmations. The procedure text stays the same in every environment.

Every wait is bounded#

  • expect and wait until require within (procedure::missing-timeout).
  • retry requires a count or a total duration (procedure::unbounded-retry).
  • There is no loop in the language.
  • The durations of within, wait, every and for are literals (procedure::non-constant-duration), with a time unit (procedure::not-a-duration). A wait or a within may also be a duration input of the step with a range: its upper bound counts in the maximum duration (procedure::unbounded-duration without range).

The only unbounded wait is a human one: the answer to an ask, or an operator decision. For a run bound to a pass, the executor bounds the wait of a confirmation by the LOS of the pass minus scheduler.margin: past it, the step fails and nothing is sent.

No recursion#

A procedure cannot call itself, directly or through other procedures: a cycle of run is a compile error (procedure::recursion), which shows the cycle:

text
× `Check camera` calls itself: `Check camera` → `Recover` → `Check camera`

Steps call nothing, so they cannot recurse.

Retries only where safe#

A retry on a step or a call that sends a telecommand changing the on-board state is an error (procedure::retry-not-allowed). See Retries.

Maximum duration#

The compiler computes the maximum duration of every step and procedure. The scheduler compares it with the window of a pass before accepting a schedule, and the API with the pass in progress before launching a run.

One attempt of a step adds up its statements:

StatementCounts
sendThe longest within of the verifications of the telecommand; an echo or a verification without within counts zero. Plus the delay of after, or an hour for at
expect, wait untilTheir within
waitIts duration
check, log, download, uploadZero
askZero: the response time of the operator is not counted
configureFor each send it expands to: the longest within of the verifications of the setter, plus one readback window per parameter it sets that is read back (each is an expect within that same longest within, 10 s without one)

For hsc-100, configure cam for Cold sends set_detector_setpoint (verified within 5 s), then reads back the setpoint within the same 5 s: 5 s + 5 s = 10 s. This setter reads back one parameter; a setter reading back two would count its window twice, and a component with instances counts each instance.

A configure is also subject to the other rules of this page, for each telecommand it sends: a hazardous setter needs its own ask operator before the configure in the step (procedure::unconfirmed-hazardous), and a setter that changes the on-board state (the default) makes the step ineligible for retries.

A step with its retry policy is bounded by the formula of Retries: d + N × max(d, e) for N times, max(d, T) for for T, the smaller of the two with both. An eligible step without retry is bounded with executor.default_retry.

A procedure adds up its actions: each step call with its policy, each sub-procedure (with its own retry if the call has one), each inline step, and every if failed block, since a block may run.

Example, "Power-up test" of Steps and Procedures, with the default policy {times: 1, every: 2s}:

ActionMaximum
Inline step Power the camera: set_voltage (verified within 3 s), output_on (3 s), expect … within 3 s9 s, not eligible
run "Check camera": "Camera answers" (10 s, retry 3 times every 2 s: 40 s), "Camera in mode" (a check: 0 s, eligible, so the default policy adds one attempt 2 s later: 2 s)42 s
if failed: run "Safe camera": set_mode (verified within 130 s), expect … within 10 s140 s
Total191 s

Alarm reactions#

An alarm of a catalogue may run a procedure when it is raised: the alarm vacuum_leak of the tvac-chamber catalogue, in the test bench automation use case, declares on_raise: run "Safe chamber". The reaction runs without anyone to confirm anything, so the compiler checks, against the libraries compiled for the platform of the alarm:

RuleCode
The procedure exists in the libraryprocedure::unknown-reaction
It sends no hazardous telecommand, directly or through its callsprocedure::hazardous-reaction
It declares exactly one role, of the platform of the alarm, and, for a component with instances, exactly one input of the instance enum (none otherwise)procedure::invalid-reaction

The executor binds the role to the target of the alarm and the input to its instance. See Alarms and Alarm Handling.

Procedure
# Reaction of the alarm `vacuum_leak`: no hazardous telecommand, no confirmation.
procedure "Safe chamber"
  description "Isolates the turbo pump and brings the plate back towards ambient."
  uses chamber: tvac-chamber
  allowed in SIM, LAB

  step "Isolate and warm"
    send close_gate_valve to chamber.vacuum
    send set_setpoint to chamber.thermal with temperature = 20 degC
    log "Chamber made safe: gate valve closed at {chamber.vacuum.pressure}, plate back to 20 degC"

Summary of the diagnostics#

CodeRule
procedure::unconfirmed-hazardousA hazardous send without its own confirmation in the step
procedure::missing-timeoutexpect or wait until without within
procedure::unbounded-retryretry without count nor total duration
procedure::non-constant-durationA duration that is neither a literal nor a bounded input
procedure::unbounded-durationA duration input without range
procedure::invalid-rangeA range on an input that is not a duration of a step, or not written as times
procedure::not-a-durationA duration without time unit
procedure::retry-not-allowedA retry on something that changes the on-board state
procedure::recursionA cycle of run
procedure::unknown-reaction, procedure::hazardous-reaction, procedure::invalid-reactionAlarm reactions

↑↓ to moveEnter to open