Built alone from an empty CARGO_HOME, its tests passed, and flowrsc checked, ran and exported a document from the conformance corpus; the export built alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
137 lines
3.6 KiB
TOML
137 lines
3.6 KiB
TOML
# flowRS's bench for the test-station template (flowrs_station::spec::TEMPLATE), simulated: a
|
|
# Rigol DP832 powering a power board, a meter on the board's 1.2 V core rail, a relay matrix in
|
|
# front of a second meter that scans the board's test points, and a scope on the rail's ripple.
|
|
# Written for flowRS (Apache-2.0); the format is spec/flowrs-bench-sim-1.md.
|
|
#
|
|
# The supply and the first meter are catalogue instruments (`model`): every line the catalogue
|
|
# defines for them is answered (a setpoint reads back what was set), and the file adds what the
|
|
# catalogue's mock cannot: an output that settles in 30 ms after it changes, a board that draws
|
|
# current as a resistive load and holds its rail with a regulator, noise from fixed seeds.
|
|
|
|
[[visa.instrument]]
|
|
resource = "SIM::PSU0"
|
|
model = "Rigol DP832"
|
|
match = "scpi"
|
|
latency_ms = 2
|
|
|
|
[visa.instrument.measure]
|
|
"MEASure[:VOLTage][:DC]? CH1" = "out1"
|
|
"MEASure:CURRent[:DC]? CH1" = "load1"
|
|
|
|
# Channel 1's output: what the supply is set to while it is on, reached in 30 ms.
|
|
[visa.instrument.quantity.out1]
|
|
follows = "voltage@1"
|
|
settle_ms = 30
|
|
noise = 0.0004
|
|
seed = 11
|
|
|
|
# The board on channel 1, a 58.8 ohm load: 85 mA at 5 V.
|
|
[visa.instrument.quantity.load1]
|
|
source = "SIM::PSU0.out1"
|
|
scale = 0.017
|
|
noise = 0.0008
|
|
seed = 12
|
|
|
|
# The unit under test: no commands, only what it does.
|
|
[[visa.instrument]]
|
|
resource = "SIM::BOARD0"
|
|
idn = "SIM,BOARD,PB-1200,1.0"
|
|
|
|
# Its 1.2 V regulator: follows its input up to 1.2 V.
|
|
[visa.instrument.quantity.core]
|
|
source = "SIM::PSU0.out1"
|
|
clamp = [0.0, 1.2]
|
|
|
|
# Its input rail, through a 2:1 divider to a test point.
|
|
[visa.instrument.quantity.input_tp]
|
|
source = "SIM::PSU0.out1"
|
|
scale = 0.5
|
|
|
|
[[visa.instrument]]
|
|
resource = "SIM::DMM0"
|
|
model = "Generic SCPI DMM"
|
|
match = "scpi"
|
|
latency_ms = 5
|
|
|
|
[visa.instrument.measure]
|
|
"MEASure[:VOLTage][:DC]?" = "input"
|
|
|
|
# `:CONF:VOLT:DC 10` picks the 10 V range, as the template's step sends it.
|
|
[visa.instrument.range]
|
|
"CONFigure[:VOLTage][:DC]" = "input"
|
|
|
|
[visa.instrument.quantity.input]
|
|
source = "SIM::BOARD0.core"
|
|
noise = 0.002
|
|
seed = 13
|
|
ranges = [0.1, 1, 10, 100, 1000]
|
|
range = 10
|
|
|
|
# A relay multiplexer: one channel closed at a time.
|
|
[[visa.instrument]]
|
|
resource = "SIM::MUX0"
|
|
idn = "SIM,MUX,0,1.0"
|
|
match = "scpi"
|
|
|
|
[visa.instrument.switch]
|
|
channels = ["101", "102", "103", "104"]
|
|
exclusive = true
|
|
|
|
# A second meter, behind the multiplexer: 101 is the core rail, 102 the input's divider.
|
|
[[visa.instrument]]
|
|
resource = "SIM::DMM1"
|
|
idn = "SIM,DMM,1,1.0"
|
|
match = "scpi"
|
|
latency_ms = 5
|
|
|
|
[visa.instrument.measure]
|
|
"MEASure[:VOLTage][:DC]?" = "scan"
|
|
|
|
[visa.instrument.quantity.scan]
|
|
noise = 0.002
|
|
seed = 14
|
|
|
|
[visa.instrument.quantity.scan.routes]
|
|
"SIM::MUX0@101" = "SIM::BOARD0.core"
|
|
"SIM::MUX0@102" = "SIM::BOARD0.input_tp"
|
|
|
|
# A scope on the core rail: its level, and the regulator's 100 kHz switching ripple.
|
|
[[visa.instrument]]
|
|
resource = "SIM::SCOPE0"
|
|
idn = "SIM,SCOPE,0,1.0"
|
|
match = "scpi"
|
|
latency_ms = 1
|
|
|
|
[visa.instrument.set]
|
|
"TIMebase:SCALe" = "timebase"
|
|
|
|
[visa.instrument.waveform."WAVeform:DATA? CH1"]
|
|
quantity = "ch1"
|
|
points = 500
|
|
timebase = "timebase"
|
|
shape = "sine"
|
|
frequency_hz = 100000
|
|
amplitude = 0.004
|
|
noise = 0.0002
|
|
seed = 21
|
|
|
|
[visa.instrument.statistic."MEASure:VPP? CH1"]
|
|
waveform = "WAVeform:DATA? CH1"
|
|
of = "vpp"
|
|
|
|
[visa.instrument.statistic."MEASure:VAVerage? CH1"]
|
|
waveform = "WAVeform:DATA? CH1"
|
|
of = "mean"
|
|
|
|
[visa.instrument.statistic."MEASure:FREQuency? CH1"]
|
|
waveform = "WAVeform:DATA? CH1"
|
|
of = "frequency"
|
|
|
|
[visa.instrument.quantity.ch1]
|
|
source = "SIM::BOARD0.core"
|
|
|
|
# Seconds per division: ten divisions, 500 points, so 10 us/div is 200 ns a sample.
|
|
[visa.instrument.quantity.timebase]
|
|
value = 0.00001
|
|
min = 0.000000001
|
|
max = 100
|