pre-release v0.3.0-alpha.1 Tell us what breaks
downrange

The system definition

One TOML file says what your machine is. The diagram, the model checks and the requirements all read it. Working example: systems/demo-loop.system.toml, used by downrange demo --scenario loop.

It holds no positions (those are in the layout, per diagram) and no packet layouts (those are in the mission file).

downranged system check my.system.toml --mission my-mission.toml

checks it, alone and against a mission.

Components #

downrange_system = 1

[system]
id = "pump-loop"
name = "Circulation loop"
revision = "A"                  # your label. Recorded with every run

[[component]]
id = "P1"                       # stable. Everything refers to this, never to the name
type = "pump"
name = "Circulation pump"
parent = "LOOP"                 # containment: a component of type "subsystem"
provenance = "Datasheet rev C, table 2"
  [component.params]
  k_q = 0.01                    # numbers a model may use, as param.k_q
  [[component.port]]
  id = "out"
  medium = "liquid"             # liquid gas electrical signal mechanical
  [[component.measurement]]
  role = "speed"                # what the value is to this component
  channel = "loop.pump_speed"   # a channel of the mission
  unit = "rpm"                  # checked against the channel's unit
  kind = "measured"             # measured, estimated or commanded

Types: sensor valve pump tank pipe source motor subsystem controller processor.

Connections #

[[connection]]
id = "L2"
kind = "material"               # material electrical signal mechanical logical
from = "P1.out"
to = "FT1.in"
Kind Joins Means
material two liquid ports, or two gas ports fluid moves between them
electrical electrical ports a conductor
signal signal ports information
mechanical mechanical ports a shaft, a linkage
logical ports or whole components a dependency that is none of the above

None of these means "causes". Loops are fine: a circulation loop is one.

Checks #

A check compares a channel with what a model says it should read. See 15-model-based-monitoring.md for how they behave.

[[check]]
id = "flow-model"
description = "Flow follows pump speed: Q = k_q * n"
method = "residual"             # residual (default), cusum, frozen, missing
component = "P1"                # the component the model describes
observed = "flow.q"
expected = "param.k_q * loop.pump_speed"
when = "loop.pump_speed > 300 and abs(loop.speed_rate) < 25"   # the mode the model is valid in
sigma_measurement = 0.15        # one standard deviation, in the observed channel's unit
sigma_model = 0.25
threshold = 4.0                 # sigmas
persist = 10                    # samples in a row
hysteresis = 1.0
max_input_age_s = 1.0           # older inputs are not used

expected and when use the expression language of the mission file, reading channels and param.<name> of the check's component. Functions with memory are not allowed here: put them in a derived channel and read that.

Requirements #

[[requirement]]
id = "REQ-LOOP-002"
version = 1
text = "After the pump is commanded on, flow shall be within 1 L/min of 12 L/min from 6 s later, for 10 s."
kind = "settles"
component = "FT1"
channel = "flow.q"
unit = "L/min"
trigger = "loop.state == 1"
target = 12.0
tolerance = 1.0
settle_s = 6.0
hold_s = 10.0
Kind Passes when Keys
within every valid sample is between min and max channel, min, max
settles after trigger first becomes true, the channel is within tolerance of target from settle_s later, for hold_s channel, trigger, target, tolerance, settle_s, hold_s
tracks the channel stays within tolerance of reference channel, reference, tolerance
coverage no gap between valid samples longer than max_gap_s channel, max_gap_s
state_observed the channel equals value at some time channel, value
event_occurs, no_event the named check raised an event, or did not check

All take when (only samples taken while it is true count), window_s = [start, end], component, unit, version.

downranged evaluate run.mcap --out verification.json

prints a summary and writes the evidence. The exit code is 2 if anything failed.

Outcome Means
PASS the data was there and met the requirement
FAIL the data was there and did not
INCONCLUSIVE not enough usable data to say: no samples, all invalid, the run ended early, the check never ran
NOT EVALUATED the situation never arose: the trigger never fired, the mode never applied

Missing data never produces a PASS. Each result carries the interval looked at, the number of samples used and set aside, the first violation with its time and value, and the ids of the diagnostic events it rests on.

What is checked, and the error you get #

Problem Error kind
Not TOML, an unknown key, a type or medium that does not exist Corrupt
downrange_system newer than this build reads UnsupportedVersion
The same id used twice, by anything DuplicateId
A parent, port, component or check that is not there MissingReference
A connection joining ports its kind cannot join, or a thing to itself; a parent that is not a subsystem; containment that loops InvalidConnection
A binding whose unit has a different dimension from its channel IncompatibleUnits
A channel the mission does not have UnresolvedChannel
A model that reads the channel it tests, or a name that is neither a channel nor a parameter InvalidDependency
A number that is not finite, a threshold at or below its hysteresis, a requirement missing a key InvalidValue

Units that are not in Downrange's table are not an error. They are reported as "could not be compared", once each.

Time #

Every timestamp in a check or a requirement is vehicle time from the telemetry. Downrange aligns it to the receiving computer's clock and reports drift, and does not correct for it. Two channels are compared using the newest value of each: a 50 Hz channel against a 5 Hz one is up to 0.2 s apart. max_input_age_s bounds that. No uncertainty is attached to a timestamp.

Limits of this version #

  • One system per daemon. No library of reusable component definitions.
  • A component's "state" on a diagram is the state of its data, not of the hardware.
  • No import from DEXPI, XTCE or any other format.
  • Requirements are evaluated after a run, not during it.