Charge and Discharge

The cycler software's plot of the run: pack voltage and current as the cycle goes, over the faint profile still to come.

STATIONCLI/PROCEDURECharge and Discharge

Charge and discharge

PASS00:22.86Charge and discharge (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 battery-cycle

The procedure

procedure.yaml
name: Charge and Dischargeversion: 1.0.0plugs:  - key: cycler    name: Battery cycler    python: plugs.cycler:BatteryCyclermain:  - key: plot    name: Charge and discharge    python: phases.battery_cycle:charge_and_discharge    measurements:      - key: end_of_discharge_voltage        name: Lowest voltage of the discharge        unit: "V"        validators:          - operator: ">="            expected_value: 39.0    ui:      panel: panels/cycle.html

The panel

panels/cycle.html
<div class="inst"><svg viewBox="0 0 320 210" role="img"><rect x="1" y="1" width="318" height="208" rx="10" fill="#0d1014" stroke="#20262c" stroke-width="1.5"/><text x="24" y="30" text-anchor="start" style="font: 600 7.5px system-ui, sans-serif; letter-spacing: .16em; fill: #7d8791">PACK V · A</text><text x="296" y="30" text-anchor="end" style="font: 600 8px ui-monospace, Menlo, monospace; fill: #4aa8ff"><tspan data-bind="ui.v" data-format="0.00">0.00</tspan> V · <tspan style="fill: #9aa3ad" data-bind="ui.i" data-format="0.0">0.0</tspan><tspan style="fill: #9aa3ad"> A</tspan></text><path d="M30 176.0H286" stroke="#1a1f25"/><path d="M30 145.0H286" stroke="#1a1f25"/><path d="M30 114.0H286" stroke="#1a1f25"/><path d="M30 83.0H286" stroke="#1a1f25"/><path d="M30 52.0H286" stroke="#1a1f25"/><text x="68.4" y="190" text-anchor="middle" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4b545d">CC</text><path d="M106.8 52V176" stroke="#1a1f25" stroke-dasharray="2 3"/><text x="128.1" y="190" text-anchor="middle" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4b545d">CV</text><path d="M149.5 52V176" stroke="#1a1f25" stroke-dasharray="2 3"/><text x="160.1" y="190" text-anchor="middle" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4b545d">REST</text><path d="M170.8 52V176" stroke="#1a1f25" stroke-dasharray="2 3"/><text x="213.5" y="190" text-anchor="middle" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4b545d">DSG</text><path d="M256.1 52V176" stroke="#1a1f25" stroke-dasharray="2 3"/><text x="271.1" y="190" text-anchor="middle" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4b545d">REST</text><text x="24" y="54.5" text-anchor="end" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4aa8ff">56</text><text x="24" y="116.5" text-anchor="end" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4aa8ff">50</text><text x="24" y="178.5" text-anchor="end" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4aa8ff">44</text><text x="291" y="54.5" text-anchor="start" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #7d8791">+100</text><text x="291" y="116.5" text-anchor="start" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #7d8791">0</text><text x="291" y="178.5" text-anchor="start" style="font: 600 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #7d8791">−100</text><path d="M30.0 83.0L31.3 82.8L32.6 82.9L33.9 83.0L35.1 83.0L36.4 83.2L37.7 83.1L39.0 82.9L40.3 82.9L41.6 82.9L42.9 82.9L44.2 83.1L45.4 83.1L46.7 83.0L48.0 83.0L49.3 82.9L50.6 82.8L51.9 83.0L53.2 83.1L54.4 83.1L55.7 83.1L57.0 83.0L58.3 82.8L59.6 82.9L60.9 83.0L62.2 83.0L63.4 83.1L64.7 83.1L66.0 82.9L67.3 82.9L68.6 82.9L69.9 82.9L71.2 83.1L72.5 83.2L73.7 83.0L75.0 83.0L76.3 82.9L77.6 82.8L78.9 83.0L80.2 83.1L81.5 83.1L82.7 83.1L84.0 83.0L85.3 82.8L86.6 82.9L87.9 83.0L89.2 83.0L90.5 83.1L91.7 83.1L93.0 82.9L94.3 82.9L95.6 82.9L96.9 82.9L98.2 83.1L99.5 83.2L100.8 83.0L102.0 83.0L103.3 83.0L104.6 82.8L105.9 82.9L107.2 83.0L108.5 85.7L109.8 88.1L111.0 90.4L112.3 92.4L113.6 94.2L114.9 95.9L116.2 97.4L117.5 98.8L118.8 100.0L120.1 101.2L121.3 102.2L122.6 103.1L123.9 104.0L125.2 104.8L126.5 105.5L127.8 106.1L129.1 106.7L130.3 107.2L131.6 107.7L132.9 108.1L134.2 108.5L135.5 108.9L136.8 109.2L138.1 109.5L139.3 109.8L140.6 110.0L141.9 110.2L143.2 110.4L144.5 110.6L145.8 110.8L147.1 110.9L148.4 111.1L149.6 111.2L150.9 114.0L152.2 114.0L153.5 114.0L154.8 114.0L156.1 114.0L157.4 114.0L158.6 114.0L159.9 114.0L161.2 114.0L162.5 114.0L163.8 114.0L165.1 114.0L166.4 114.0L167.6 114.0L168.9 114.0L170.2 114.0L171.5 160.4L172.8 160.4L174.1 160.3L175.4 160.6L176.7 160.8L177.9 160.6L179.2 160.5L180.5 160.5L181.8 160.3L183.1 160.3L184.4 160.5L185.7 160.7L186.9 160.6L188.2 160.6L189.5 160.6L190.8 160.3L192.1 160.2L193.4 161.8L194.7 165.6L195.9 168.7L197.2 170.7L198.5 171.2L199.8 169.9L201.1 167.5L202.4 164.3L203.7 160.4L205.0 160.5L206.2 160.7L207.5 160.7L208.8 160.5L210.1 160.5L211.4 160.4L212.7 160.3L214.0 160.4L215.2 160.7L216.5 160.7L217.8 160.6L219.1 160.6L220.4 160.5L221.7 160.2L223.0 160.3L224.3 160.6L225.5 160.6L226.8 160.6L228.1 160.7L229.4 160.5L230.7 160.3L232.0 160.3L233.3 160.4L234.5 160.4L235.8 160.6L237.1 160.8L238.4 160.6L239.7 160.4L241.0 160.4L242.3 160.4L243.5 160.3L244.8 160.5L246.1 160.7L247.4 160.6L248.7 160.5L250.0 160.5L251.3 160.3L252.6 160.2L253.8 160.5L255.1 160.6L256.4 160.6L257.7 114.0L259.0 114.0L260.3 114.0L261.6 114.0L262.8 114.0L264.1 114.0L265.4 114.0L266.7 114.0L268.0 114.0L269.3 114.0L270.6 114.0L271.8 114.0L273.1 114.0L274.4 114.0L275.7 114.0L277.0 114.0L278.3 114.0L279.6 114.0L280.9 114.0L282.1 114.0L283.4 114.0L284.7 114.0L286.0 114.0" fill="none" stroke="#7d8791" stroke-width="1" opacity=".22"/><path d="M30.0 153.3L31.3 153.1L32.6 152.9L33.9 152.5L35.1 152.1L36.4 151.6L37.7 151.1L39.0 150.5L40.3 149.8L41.6 149.1L42.9 148.3L44.2 147.5L45.4 146.7L46.7 145.8L48.0 144.8L49.3 143.8L50.6 142.8L51.9 141.7L53.2 140.6L54.4 139.5L55.7 138.3L57.0 137.1L58.3 135.8L59.6 134.5L60.9 133.2L62.2 131.9L63.4 130.5L64.7 129.1L66.0 127.6L67.3 126.1L68.6 124.6L69.9 123.1L71.2 121.5L72.5 119.9L73.7 118.3L75.0 116.6L76.3 114.9L77.6 113.2L78.9 111.5L80.2 109.7L81.5 107.9L82.7 106.1L84.0 104.2L85.3 102.3L86.6 100.4L87.9 98.5L89.2 96.5L90.5 94.5L91.7 92.5L93.0 90.5L94.3 88.4L95.6 86.3L96.9 84.2L98.2 82.1L99.5 79.9L100.8 77.7L102.0 75.5L103.3 73.3L104.6 71.0L105.9 68.8L107.2 66.5L108.5 66.5L109.8 66.5L111.0 66.5L112.3 66.5L113.6 66.5L114.9 66.5L116.2 66.5L117.5 66.5L118.8 66.5L120.1 66.5L121.3 66.5L122.6 66.5L123.9 66.5L125.2 66.5L126.5 66.5L127.8 66.5L129.1 66.5L130.3 66.5L131.6 66.5L132.9 66.5L134.2 66.5L135.5 66.5L136.8 66.5L138.1 66.5L139.3 66.5L140.6 66.5L141.9 66.5L143.2 66.5L144.5 66.5L145.8 66.5L147.1 66.5L148.4 66.5L149.6 66.5L150.9 66.5L152.2 66.6L153.5 66.9L154.8 67.2L156.1 67.6L157.4 68.1L158.6 68.6L159.9 69.2L161.2 69.8L162.5 70.3L163.8 70.9L165.1 71.4L166.4 71.8L167.6 72.2L168.9 72.4L170.2 72.6L171.5 78.9L172.8 79.7L174.1 80.5L175.4 81.3L176.7 82.1L177.9 82.9L179.2 83.7L180.5 84.5L181.8 85.3L183.1 86.1L184.4 86.9L185.7 87.7L186.9 88.5L188.2 89.3L189.5 90.2L190.8 91.0L192.1 91.8L193.4 93.2L194.7 95.9L195.9 98.3L197.2 100.0L198.5 101.1L199.8 101.4L201.1 101.0L202.4 100.2L203.7 99.1L205.0 99.9L206.2 100.7L207.5 101.5L208.8 102.4L210.1 103.2L211.4 104.0L212.7 104.9L214.0 105.7L215.2 106.6L216.5 107.4L217.8 108.3L219.1 109.2L220.4 110.1L221.7 111.0L223.0 111.9L224.3 112.8L225.5 113.8L226.8 114.7L228.1 115.7L229.4 116.7L230.7 117.7L232.0 118.8L233.3 119.9L234.5 121.0L235.8 122.1L237.1 123.3L238.4 124.5L239.7 125.8L241.0 127.1L242.3 128.4L243.5 129.8L244.8 131.3L246.1 132.8L247.4 134.4L248.7 136.0L250.0 137.7L251.3 139.5L252.6 141.4L253.8 143.4L255.1 145.5L256.4 147.6L257.7 149.1L259.0 149.1L260.3 148.9L261.6 148.7L262.8 148.4L264.1 148.1L265.4 147.7L266.7 147.3L268.0 146.8L269.3 146.3L270.6 145.7L271.8 145.2L273.1 144.6L274.4 144.1L275.7 143.5L277.0 143.0L278.3 142.6L279.6 142.1L280.9 141.8L282.1 141.5L283.4 141.2L284.7 141.0L286.0 140.9" fill="none" stroke="#4aa8ff" stroke-width="1" opacity=".22"/><g class="pt i" data-bind="ui.ih0" style="--x: 30.0px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih1" style="--x: 34.3px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih2" style="--x: 38.7px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih3" style="--x: 43.0px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih4" style="--x: 47.4px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih5" style="--x: 51.7px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih6" style="--x: 56.0px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih7" style="--x: 60.4px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih8" style="--x: 64.7px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih9" style="--x: 69.1px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih10" style="--x: 73.4px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih11" style="--x: 77.7px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih12" style="--x: 82.1px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih13" style="--x: 86.4px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih14" style="--x: 90.7px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih15" style="--x: 95.1px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih16" style="--x: 99.4px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih17" style="--x: 103.8px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih18" style="--x: 108.1px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih19" style="--x: 112.4px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih20" style="--x: 116.8px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih21" style="--x: 121.1px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih22" style="--x: 125.5px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih23" style="--x: 129.8px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih24" style="--x: 134.1px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih25" style="--x: 138.5px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih26" style="--x: 142.8px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih27" style="--x: 147.2px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih28" style="--x: 151.5px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih29" style="--x: 155.8px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih30" style="--x: 160.2px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih31" style="--x: 164.5px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih32" style="--x: 168.8px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih33" style="--x: 173.2px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih34" style="--x: 177.5px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih35" style="--x: 181.9px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih36" style="--x: 186.2px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih37" style="--x: 190.5px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih38" style="--x: 194.9px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih39" style="--x: 199.2px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih40" style="--x: 203.6px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih41" style="--x: 207.9px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih42" style="--x: 212.2px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih43" style="--x: 216.6px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih44" style="--x: 220.9px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih45" style="--x: 225.3px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih46" style="--x: 229.6px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih47" style="--x: 233.9px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih48" style="--x: 238.3px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih49" style="--x: 242.6px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih50" style="--x: 246.9px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih51" style="--x: 251.3px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih52" style="--x: 255.6px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih53" style="--x: 260.0px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih54" style="--x: 264.3px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih55" style="--x: 268.6px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih56" style="--x: 273.0px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih57" style="--x: 277.3px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih58" style="--x: 281.7px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt i" data-bind="ui.ih59" style="--x: 286.0px"><rect x="-2" y="-.9" width="4" height="1.8" rx=".9"/></g><g class="pt v" data-bind="ui.vh0" style="--x: 30.0px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh1" style="--x: 34.3px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh2" style="--x: 38.7px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh3" style="--x: 43.0px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh4" style="--x: 47.4px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh5" style="--x: 51.7px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh6" style="--x: 56.0px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh7" style="--x: 60.4px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh8" style="--x: 64.7px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh9" style="--x: 69.1px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh10" style="--x: 73.4px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh11" style="--x: 77.7px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh12" style="--x: 82.1px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh13" style="--x: 86.4px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh14" style="--x: 90.7px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh15" style="--x: 95.1px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh16" style="--x: 99.4px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh17" style="--x: 103.8px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh18" style="--x: 108.1px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh19" style="--x: 112.4px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh20" style="--x: 116.8px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh21" style="--x: 121.1px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh22" style="--x: 125.5px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh23" style="--x: 129.8px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh24" style="--x: 134.1px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh25" style="--x: 138.5px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh26" style="--x: 142.8px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh27" style="--x: 147.2px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh28" style="--x: 151.5px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh29" style="--x: 155.8px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh30" style="--x: 160.2px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh31" style="--x: 164.5px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh32" style="--x: 168.8px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh33" style="--x: 173.2px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh34" style="--x: 177.5px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh35" style="--x: 181.9px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh36" style="--x: 186.2px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh37" style="--x: 190.5px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh38" style="--x: 194.9px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh39" style="--x: 199.2px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh40" style="--x: 203.6px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh41" style="--x: 207.9px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh42" style="--x: 212.2px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh43" style="--x: 216.6px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh44" style="--x: 220.9px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh45" style="--x: 225.3px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh46" style="--x: 229.6px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh47" style="--x: 233.9px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh48" style="--x: 238.3px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh49" style="--x: 242.6px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh50" style="--x: 246.9px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh51" style="--x: 251.3px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh52" style="--x: 255.6px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh53" style="--x: 260.0px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh54" style="--x: 264.3px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh55" style="--x: 268.6px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh56" style="--x: 273.0px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh57" style="--x: 277.3px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh58" style="--x: 281.7px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g><g class="pt v" data-bind="ui.vh59" style="--x: 286.0px"><rect x="-2.2" y="-1.2" width="4.4" height="2.4" rx="1.2"/></g></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); }  .pt { opacity: 0; transition: opacity .2s; }  .pt[data-value] { opacity: 1; }  .pt.v rect { fill: #4aa8ff; }  .pt.i rect { fill: #9aa3ad; }  .pt.v { transform: translate(var(--x), calc(176px - (clamp(44, var(--value, 44), 56) - 44) / 12 * 124px)); }  .pt.i { transform: translate(var(--x), calc(176px - (clamp(-100, var(--value, 0), 100) + 100) / 200 * 124px)); }</style>

The phase

phases/battery_cycle.py
"""Charges and discharges the pack and plots the run. Each of `ui.vh0` to`ui.vh59` and `ui.ih0` to `ui.ih59` is one point of the voltage and currenttraces, sent once when the run reaches it. The run records the lowest voltageof the discharge."""import timePOINTS = 60def charge_and_discharge(ui, measurements, cycler):    total, low = cycler.length(), 99.0    for n in range(total):        s = cycler.read()        volts, amps = s["voltage"], s["current"]        ui.v = round(volts, 2)        ui.i = round(amps, 1)        point = n * POINTS // total        if point != (n - 1) * POINTS // total or n == 0:            setattr(ui, f"vh{point}", round(volts, 2))            setattr(ui, f"ih{point}", round(amps, 1))        if s["step"] == "DSG":            low = min(low, volts)        time.sleep(0.1)    measurements.end_of_discharge_voltage = round(low, 2)    time.sleep(1.5)

The mocked instrument

plugs/cycler.py
"""Mock instrument replaying a simulated 13S NMC, 50 Ah pack through a CC-CVcharge, a rest and a 75 A discharge."""import mathCELL_OFFSETS = [-0.42, 0.18, 0.05, -0.12, 0.5, -0.3, 0.1, 0.32, -0.05, -0.5, 0.24, 0.0, -0.2]SENSORS = [("CELL 1", -1.5), ("CELL 4", 0.0), ("CELL 7", 1.2), ("BUSBAR", 4.6),           ("CELL 10", -0.8), ("CELL 13", 0.4), ("INLET", -2.0), ("OUTLET", 0.9)]STEPS = [("CC", 0, 18), ("CV", 18, 28), ("REST", 28, 33), ("DSG", 33, 53), ("REST", 53, 60)]CYCLE_S, DT = 60, 0.3def _lerp(a, b, x):    return a + (b - a) * min(1.0, max(0.0, x))def _ease(x):    return 0.5 - 0.5 * math.cos(math.pi * min(1.0, max(0.0, x)))def _wob(t, k):    return math.sin(t * k) * 0.5 + math.sin(t * k * 2.3) * 0.25def pack_state(t):    """The simulated 13S NMC, 50 Ah pack at cycle time t (s): CC 50 A to    54.6 V, CV to 2.5 A, rest, 75 A discharge with a current spike, rest."""    bleed = False    if t < 18:        x = t / 18        soc, i = _lerp(20, 78, x), 50 + _wob(t, 3) * 0.4        v, temp, delta = 46.2 + 8.4 * x ** 1.6, _lerp(24, 31, x), _lerp(8, 14, x)    elif t < 28:        x = (t - 18) / 10        soc, i = _lerp(78, 99, _ease(x)), 2.5 + 47.5 * math.exp(-3.2 * x)        v, temp = 54.6, _lerp(31, 33, x)        delta = _lerp(14, 26, _ease(x * 1.4)) - _lerp(0, 8, (x - 0.6) / 0.4)        bleed = True    elif t < 33:        x = (t - 28) / 5        soc, i, v = 99, 0.0, _lerp(54.6, 54.0, _ease(x))        temp, delta, bleed = _lerp(33, 30, x), _lerp(18, 10, x), x < 0.6    elif t < 53:        x = (t - 33) / 20        spike = -17 * math.sin(math.pi * (t - 38) / 2.5) if 38 < t < 40.5 else 0.0        soc, i = _lerp(99, 22, x), -75 + spike + _wob(t, 2.7) * 0.6        v = 53.4 - 5.2 * x - 1.6 * x ** 6 + spike * 0.03        temp, delta = _lerp(30, 50, x ** 0.9), _lerp(10, 58, x ** 2.2)    else:        x = (t - 53) / 7        soc, i, v = 22, 0.0, _lerp(46.6, 47.4, _ease(x))        temp, delta = _lerp(50, 47, x), _lerp(58, 44, x)    step = next((name for name, a, b in STEPS if a <= t < b), "REST")    temps = [temp + o * (0.4 + (temp - 24) / 30) + _wob(t + k, 1.1) * 0.15 for k, (_, o) in enumerate(SENSORS)]    cells = [v / 13 + o * delta / 1000 for o in CELL_OFFSETS]    balancing = [bleed and o > 0.15 for o in CELL_OFFSETS]    acir = 9.6 * (1 - 0.006 * (temp - 25)) + 0.02 * math.sin(t * 2.3)    return {"step": step, "soc": soc, "voltage": v, "current": i, "temperatures": temps,            "cells": cells, "balancing": balancing, "acir_mohm": acir}class _Replay:    def __init__(self):        self.t = 0.0    def length(self):        return int(CYCLE_S / DT)    def _next(self):        state = pack_state(self.t)        self.t += DT        return stateclass BatteryCycler(_Replay):    """Mock battery cycler channel. Replace it with your cycler's driver."""    def read(self):        """The channel and the pack it reads: step, SOC %, V, A (charge        positive), cell voltages and balancing from the BMS."""        return self._next()

Run your first test in minutes