fms

Live feeder telemetry

Commission an operator RTU, follow a shadow proposal and reproduce it offline.

Where the data comes from🔗

The grid operator supplies the station and feeder register, topology, equipment ratings and commissioned control assignments. Load the feeder as a version 2 model with empty or omitted rows. Supply a second file that maps the RTU’s common address and information object address to an asset or premises in that feeder revision. Measurements arrive over IEC 60870-5-104. A household EMS can receive a control limit through a separately commissioned delivery path. It has no role in supplying the operator’s topology.

Follow an overload in the lab🔗

Build both programs in the checkout and start the development outstation in one terminal. It waits for the controller, reports 8 kW, increases load to 25 kW and disconnects. The sample age brings the five-minute freshness boundary into a short exercise.

cargo build --locked --release -p fmsd -p fms-lab
target/release/fms-lab iec104-station --port 24040 --sample-age-secs 295

In a second terminal at the workspace root, prepare a new capture directory and start the edge service. Supply a private sign-in password when prompted.

run="$(mktemp -d)"
target/release/fmsd example telemetry-model --out "$run/model.json"
target/release/fmsd example telemetry-map --out "$run/points.json"
printf 'Local desk password: '
read -rs FMS_REVIEW_TOKEN
echo
export FMS_REVIEW_TOKEN
target/release/fmsd monitor --model "$run/model.json" --map "$run/points.json" \
  --station 127.0.0.1:24040 --capture "$run/capture.json" \
  --port 0 --tick-seconds 1 --ticks 12

Open the printed Telemetry URL and sign in as operator with that password. The transformer T1 and premises H1 observe the same load at different points. When the lab station disconnects, the last good readings remain fresh until their age exceeds five minutes. The decision clock keeps running. Restarting the station on the same port during a longer session supplies fresh readings.

T1 and H1 still have fresh 25 kW readings immediately after the station disconnects.

Inspect recent measurements🔗

The Active power trend above the point cards keeps the station’s 8 kW and 25 kW readings available even if you open the desk after the rise. Choose View trend on a point card to inspect its channel and source times. Pause updates holds the live view while the monitor continues recording. Reopen the captured bundle to inspect the same source rows offline. Read a signed power trend

Explain a proposed limit🔗

Under Proposed limits, expand a target. Start with three questions.

Operator questionWhere to look
Why did FMS propose a limit?Compare the decision’s estimate with its operating threshold. In this lab the transformer is rated at 18 kW and its 90% trigger is 16.2 kW. T1 and H1 both report 25 kW. Thermal estimates use kW. Voltage estimates use per unit (p.u.).
What would the target receive?Read the proposed ceiling, the protected floor, the reason and the expiry. This run computes shadow proposals. Confirmation of equipment response belongs to a delivery record.
Which observations supported it?Inspect the source, target, measured kW, measurement time and receiver arrival time in the expanded proposal. These values stay tied to that decision as the current point cards go stale or receive newer samples.

The desk retains the latest 20 proposals. Each explanation shows up to 12 referenced observations, with the constraining thermal asset and addressed premises first when the command cites them. If an exact observation is unavailable, its identity and source time remain visible. The replayed evidence record carries the full reference list.

Record 6 proposes 9.326 kW for ems-1 with a 7.56 kW floor. The estimated transformer load is nearly 25 kW against the 16.2 kW threshold. Both original meter readings are 25 kW.

Locate a voltage drop🔗

Open the two-branch example in a fresh directory with the installed service.

fmsd example voltage-drop --out west.json
fmsd serve --bundle west.json --port 0

In Incidents, open the limit for ems-west. H1 supplied a 25 kW active-power reading. FMS estimates 0.9033 p.u. at west-end, below the 0.928 p.u. operating threshold. The resulting proposal is 13.517 kW for ems-west, with a 4.2 kW protected floor. Open the node in the feeder topology to see its supply path through L-west. The second branch ends at east-end. An independent AC power flow for these synthetic inputs gives 0.9031 p.u. at west-end and 1.0000 p.u. at east-end. pandapower bus results

Command evidence for ems-west. The voltage node links to west-end in the same feeder. The panel separates estimated voltage and its threshold from the proposed limit and protected floor.

To reproduce the voltage decision with live IEC 104 input, start the lab station again. In another terminal with the same private desk credential as above, prepare a fresh directory and run the monitor. This uses jq to remove the recorded inputs so the station supplies the new readings.

run="$(mktemp -d)"
fmsd example voltage-drop --out "$run/example.json"
jq 'del(.rows)' "$run/example.json" > "$run/model.json"
fmsd example voltage-map --out "$run/points.json"
fmsd monitor --model "$run/model.json" --map "$run/points.json" \
  --station 127.0.0.1:24040 --capture "$run/capture.json" --port 0 --tick-seconds 1 --ticks 12

Expand the live proposal, note the node and record number, then verify the capture below. Earlier voltage evidence can lack a recorded node. The desk marks its location as unrecorded.

Verify the handoff🔗

After Capture complete, open Evidence head and choose Copy evidence head. Keep the head and the proposal’s record number together. A head from an earlier checkpoint may differ from the completed one. Press Ctrl-C, then run the following in the same terminal. Paste the completed head at the prompt.

printf 'Completed evidence head: '
read -r expected_head
target/release/fmsd replay-input "$run/capture.json" --expect-head "$expected_head" \
  --evidence "$run/evidence.jsonl" > "$run/report.json"

A matching head produces the run report and a new evidence file. A mismatch exits with an error before emitting a report or creating the evidence file. To inspect one decision, enter its record number and read that line from the verified JSON Lines file.

printf 'Proposal record number: '
read -r seq
jq -c --argjson seq "$seq" 'select(.seq == $seq) | .event' "$run/evidence.jsonl"

The command records its target, floor and expiry. Find its original input references under reason.inputs. The capture rows give the local time the engine admitted each input. The live desk also shows when the receiver read it from the wire. To explore the entire network model and coverage in the replay desk, run target/release/fmsd serve --bundle "$run/capture.json" --port 0. To verify the exact input file bytes as well as the resulting decisions, supply its independently recorded SHA-256 with --expect-sha256.

Commission a source🔗

The commissioning examples use common address 1, IOA 100 for T1 and IOA 101 for H1. Each binding declares W, kW or MW and the import or export sign convention. The monitor validates unique addresses, unique destinations and the exact feeder and topology revision before connecting. One session observes one station. The map format allows 512 entries. Each must resolve to a distinct commissioned destination. The current feeder model supports one transformer, up to 256 line sections and up to 128 premises.

Use periodic or spontaneous timestamped short floating-point active power (M_ME_TF_1) with good quality. CP56Time2a is UTC unless the map sets "time_zone": "cet-cest". Then a tag is CET, or CEST when it carries the summer-time (SU) flag. A tag whose SU flag disagrees with the calendar, or any tag with SU on a UTC map, is refused as invalid-time. The desk shows the source measurement time and the time the receiver read the point. The capture orders engine inputs by local admission time. A new unusable observation withdraws the previous admitted value for that point. Older or repeated readings cannot refresh it. After a link loss the monitor reconnects after 1 s, doubling to 60 s. It never interrogates the station: an untimed reply would withdraw a good reading. The monitor receives observations and computes shadow proposals locally. The lab exercises the published Rust implementation on both ends. Field qualification requires the operator’s commissioned RTU, point list and clock convention. IEC 60870 protocol implementation

Connect over IEC 62351-3🔗

To read a station over the network, give the monitor its IEC 62351-3 identity: a directory with the trust anchors (ca.pem), the master's certificate chain (cert.pem) and its key (key.pem). The station's certificate must chain to the anchors and carry --tls-server-name, which defaults to the station's IP address. Both sides authenticate; TLS 1.2 and 1.3 with AEAD suites only, on the registered port 19998.

target/release/fms-lab iec104-identities --out ids
target/release/fms-lab iec104-station --port 19998 --tls-dir ids/station &
target/release/fmsd monitor --model feeder.json --map map.json --station 127.0.0.1:19998 \
  --tls-dir ids/master --tls-server-name station.localhost --capture capture.json --port 0

The North station's desk over IEC 62351-3. Below Recording · Station connected, the session reads TLSv1_3, TLS13_AES_256_GCM_SHA384 and CN=station; T1 and H1 show fresh 8 kW readings.

The desk's status names the session, for example IEC 62351-3 · TLSv1_3 · TLS13_AES_256_GCM_SHA384 · CN=station, or the refusal of the last handshake, which happens before any IEC 104 frame. Plain IEC 104 reaches only a numeric loopback address, such as the local end of a protected forward. The monitor receives only; it never sends a command. Profile deviations

Access the desk🔗

The desk and its GET /api/v1/telemetry endpoint require the same private credential. Clients can use a bearer token and retrieve the service contract at /openapi.json. The desk retains the latest 20 proposals and the total count.

Every completed tick atomically checkpoints the model and ordered inputs. Choose a new output file for each session. A capture ends at the replay budget of 10,000 rows or 8 MiB. If recording fails, the desk displays the cause and the last checkpoint stays available for replay. Store captures in an operator-controlled directory.