Spacecraft Power Supply

The EGSE supply feeding a spacecraft's 28 V bus: voltage and current through switch-on, the inrush, and the load steps as subsystems power up.

Gauges & metersAerospace & defense
STATIONCLI/PROCEDURESpacecraft Power Supply

Power on

PASS00:20.69Power on (1/1)Passed

Run It

Every instrument is mocked, so the example runs without hardware.

bash
git clone https://github.com/tofupilot/panelscd panelstofupilot run spacecraft-power-supply

The procedure

procedure.yaml
name: Spacecraft Power Supplyversion: 1.0.0plugs:  - key: supply    name: EGSE power supply    python: plugs.power_supply:PowerSupplymain:  - key: power    name: Power on    python: phases.spacecraft_power_supply:power_on    measurements:      - key: bus_voltage        name: Lowest bus voltage under load        unit: "V"        validators:          - operator: ">="            expected_value: 22          - operator: "<="            expected_value: 36      - key: steady_current        name: Steady-state current        unit: "A"        validators:          - operator: "<="            expected_value: 1.5    ui:      panel: panels/supply.html

The panel

panels/supply.html
<div class="inst"><svg viewBox="0 0 320 210" role="img"><defs><linearGradient id="fp" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#e6e8eb"/><stop offset="1" stop-color="#c9cdd2"/></linearGradient><linearGradient id="win" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#000" stop-opacity=".55"/><stop offset=".14" stop-color="#000" stop-opacity="0"/></linearGradient></defs><rect x="1" y="1" width="318" height="208" rx="10" fill="url(#fp)" stroke="#9aa1a8" stroke-width="2"/><circle cx="12" cy="12" r="3.2" fill="#aeb4ba" stroke="#9aa1a8"/><circle cx="308" cy="12" r="3.2" fill="#aeb4ba" stroke="#9aa1a8"/><circle cx="12" cy="198" r="3.2" fill="#aeb4ba" stroke="#9aa1a8"/><circle cx="308" cy="198" r="3.2" fill="#aeb4ba" stroke="#9aa1a8"/><text x="18" y="24" text-anchor="start" style="font: 700 7.5px system-ui, sans-serif; letter-spacing: .14em; fill: #3a4048">SPACECRAFT POWER SUPPLY</text><text x="302" y="24" text-anchor="end" style="font: 600 7px ui-monospace, Menlo, monospace; letter-spacing: .04em; fill: #5a6068">28 V BUS</text><rect x="16" y="32" width="288" height="152" rx="6" fill="#050807" stroke="#2f3533" stroke-width="2"/><rect x="16" y="32" width="288" height="152" rx="6" fill="url(#win)"/><g class="vfd"><g class="d7" data-bind="ui.v0" transform="translate(46.0 44.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="d7" data-bind="ui.v1" transform="translate(86.6 44.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="d7" data-bind="ui.v2" transform="translate(127.1 44.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="d7" data-bind="ui.v3" transform="translate(167.7 44.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="dp on" transform="translate(116.7 44.0) skewX(-7)"><rect x="0" y="45.8" width="6.2" height="6.2" rx="2.1"/></g><text x="290" y="94" text-anchor="end" style="font: 700 22px system-ui, sans-serif; letter-spacing: .14em; fill: #7ff5d6">V</text><g class="d7" data-bind="ui.i0" transform="translate(46.0 108.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="d7" data-bind="ui.i1" transform="translate(86.6 108.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="d7" data-bind="ui.i2" transform="translate(127.1 108.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="d7" data-bind="ui.i3" transform="translate(167.7 108.0) skewX(-7)"><rect class="sa" x="4.4" y="0.0" width="19.2" height="6.2" rx="3.1"/><rect class="sd" x="4.4" y="45.8" width="19.2" height="6.2" rx="3.1"/><rect class="sg" x="4.4" y="22.9" width="19.2" height="6.2" rx="3.1"/><rect class="sf" x="0.0" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="se" x="0.0" y="27.3" width="6.2" height="20.3" rx="3.1"/><rect class="sb" x="21.8" y="4.4" width="6.2" height="20.3" rx="3.1"/><rect class="sc" x="21.8" y="27.3" width="6.2" height="20.3" rx="3.1"/></g><g class="dp on" transform="translate(76.2 108.0) skewX(-7)"><rect x="0" y="45.8" width="6.2" height="6.2" rx="2.1"/></g><text x="290" y="158" text-anchor="end" style="font: 700 22px system-ui, sans-serif; letter-spacing: .14em; fill: #7ff5d6">A</text><g class="ann" data-bind="ui.cv"><text x="34" y="176" text-anchor="start" style="font: 700 8px ui-monospace, Menlo, monospace; letter-spacing: .06em">CV</text></g><g class="ann" data-bind="ui.cc"><text x="76" y="176" text-anchor="start" style="font: 700 8px ui-monospace, Menlo, monospace; letter-spacing: .06em">CC</text></g><g class="limann"><g class="ann" data-bind="ui.limit"><text x="118" y="176" text-anchor="start" style="font: 700 8px ui-monospace, Menlo, monospace; letter-spacing: .06em">LIMIT</text></g></g><g class="ann" data-bind="ui.out"><text x="262" y="176" text-anchor="start" style="font: 700 8px ui-monospace, Menlo, monospace; letter-spacing: .06em">OUT</text></g></g><text x="18" y="200" text-anchor="start" style="font: 600 6.5px system-ui, sans-serif; letter-spacing: .14em; fill: #5a6068">0–40 V · 0–10 A · REMOTE SENSE</text></svg></div><style>  .inst { width: min(560px, 100%); margin: 0 auto; }  .inst svg { display: block; width: 100%; height: auto; }  .inst text { font-family: system-ui, sans-serif; }  .dp rect { fill: var(--off); }  .dp.on rect, .dp[data-value=true] rect { fill: var(--on); }  .led circle { fill: #2a2f35; transition: fill .15s; }  .led[data-value=true] circle { fill: var(--led, #38e07a); }  .ann text { fill: var(--off); transition: fill .15s; }  .ann[data-value=true] text { fill: var(--on); }  .d7 rect { fill: var(--off); transition: fill .08s; }  .d7[data-value="0"] :is(.sa, .sb, .sc, .sd, .se, .sf) { fill: var(--on); }  .d7[data-value="1"] :is(.sb, .sc) { fill: var(--on); }  .d7[data-value="2"] :is(.sa, .sb, .sd, .se, .sg) { fill: var(--on); }  .d7[data-value="3"] :is(.sa, .sb, .sc, .sd, .sg) { fill: var(--on); }  .d7[data-value="4"] :is(.sb, .sc, .sf, .sg) { fill: var(--on); }  .d7[data-value="5"] :is(.sa, .sc, .sd, .sf, .sg) { fill: var(--on); }  .d7[data-value="6"] :is(.sa, .sc, .sd, .se, .sf, .sg) { fill: var(--on); }  .d7[data-value="7"] :is(.sa, .sb, .sc) { fill: var(--on); }  .d7[data-value="8"] :is(.sa, .sb, .sc, .sd, .se, .sf, .sg) { fill: var(--on); }  .d7[data-value="9"] :is(.sa, .sb, .sc, .sd, .sf, .sg) { fill: var(--on); }  .d7[data-value="-"] :is(.sg) { fill: var(--on); }  .d7[data-value="E"] :is(.sa, .sd, .se, .sf, .sg) { fill: var(--on); }  .d7[data-value="U"] :is(.sb, .sc, .sd, .se, .sf) { fill: var(--on); }  .d7[data-value="r"] :is(.se, .sg) { fill: var(--on); }  .vfd { --on: #7ff5d6; --off: #0f2620; }  .limann { --on: #ff6b6b; }</style>

The phase

phases/spacecraft_power_supply.py
"""Switches the spacecraft on from the EGSE supply on its 28 V bus. `ui.v*`and `ui.i*` drive the display, `ui.cv` and `ui.cc` the regulation mode,`ui.limit` lights outside the 22-36 V bus input range. The run records thelowest bus voltage under load and the steady-state current."""import timedef show(ui, prefix, text):    """One 7-segment glyph per character, decimal points left to the panel."""    for k, ch in enumerate(c for c in text if c != "."):        setattr(ui, f"{prefix}{k}", "_" if ch == " " else ch)INPUT_RANGE_V = (22.0, 36.0)def power_on(ui, measurements, supply):    low, last = 99.0, 0.0    for n in range(supply.length()):        volts, amps = supply.read()        show(ui, "v", f"{volts:5.2f}")        show(ui, "i", f"{amps:5.3f}")        on = volts > 1        ui.out = on        ui.cv = on and amps < 3        ui.cc = amps >= 3        ui.limit = on and n > 15 and not INPUT_RANGE_V[0] <= volts <= INPUT_RANGE_V[1]        if amps > 0.1:            low, last = min(low, volts), amps        time.sleep(0.1)    measurements.bus_voltage = round(low, 2)    measurements.steady_current = round(last, 2)    time.sleep(1.5)

The mocked instrument

plugs/power_supply.py
"""Mock EGSE power supply on the spacecraft's 28 V bus: switch-on, theinrush, then load steps as subsystems power up. Replace it with your supply'sdriver."""import mathclass PowerSupply:    def __init__(self):        self.k = 0    def length(self):        return 180    def read(self):        """[bus voltage in V, current in A]"""        k = self.k        self.k += 1        if k < 15:            return [0.0 if k < 10 else 28.0 * (k - 9) / 5, 0.0]        t = k - 15        load = 0.62 + (0.35 if t > 50 else 0) + (0.18 if t > 110 else 0)        amps = load + (2.6 * math.exp(-t / 2.5) if t < 15 else 0.0) + 0.02 * math.sin(k * 1.9)        return [28.05 - 0.35 * amps + 0.03 * math.sin(k * 1.3), amps]

Run your first test in minutes