buck-converter: the draft controller against the accepted one

Scenario s1: 12 V in, 4 ohm load halving to 2 ohm at 10 ms. Target 5 V. Both runs come from the built plimsoll/sandbox-sim image through the project API; the fingerprints below are the SHA-256 of each trajectory as recorded from that image.

The simulator is written in C, compiled to WebAssembly and shipped in that image: its source, EXTERNAL · source repo ↗. A controller is a separate program that reads the simulator's observations each tick and sets its input. This page runs two hand-written controllers against it: a draft that makes a plausible mistake and fails, and an accepted one that passes the environment's scoring program. Published: the accepted controller, EXTERNAL · source repo ↗; its C port (the same trajectory to the bit), EXTERNAL · source repo ↗; and all four scenarios with their fingerprints, EXTERNAL · source repo ↗. The draft controller and the scoring program are not published. Every simulator in the image, EXTERNAL · source repo ↗.

Work in progress. These charts show two hand-written reference controllers. No AI-generated controller is plotted for this environment yet.

Draft controllerovercurrentmax v 9.975, max abs i 10.254, overvoltage at 0, overcurrent at 0, band fraction 0.055
Accepted controllerscore 0.908max v 5.062, max abs i 2.505, overvoltage at none, overcurrent at none, band fraction 0.908
Draft controllerAccepted controllerhard limit
Output voltage overvoltage, 6 V 05610 05101520 milliseconds volts regulation, 5 plus or minus 0.1 V Inductor current overcurrent, 10 A 0510 05101520 milliseconds amps
Table view (100 rows)
millisecondsdraft output_voltage_Vdraft inductor_current_Adraft actionaccepted output_voltage_Vaccepted inductor_current_Aaccepted action
00.00000.00001.00000.00000.00000.0000
0.29.92101.40260.00000.18900.21810.0202
0.41.72992.48371.00000.53140.31090.0495
0.67.9802-1.32210.00000.89240.40100.0785
0.84.36116.67691.00001.24280.48300.1076
14.5368-4.66001.00001.58310.56400.1360
1.27.54453.37770.00001.91800.64610.1639
1.43.23922.94401.00002.25100.72900.1917
1.65.6705-3.16870.00002.58380.81220.2194
1.87.08083.72980.00002.91680.89560.2472
23.46512.97801.00003.25000.97900.2749
2.25.2598-3.40200.00003.58331.06240.3027
2.47.16692.70160.00003.91661.14570.3305
2.63.97504.33751.00004.25001.22900.3583
2.84.3226-3.15021.00004.58331.31240.3860
37.15351.13610.00004.91671.39570.4138
3.24.95656.07220.58705.06101.26090.4214
3.43.5691-1.09171.00005.05191.25120.4199
3.66.7312-0.69270.00005.02431.24470.4187
3.86.17115.26080.00005.00721.24600.4174
43.36281.28421.00005.00021.24830.4167
4.25.8672-2.40710.00004.99871.24960.4166
4.46.93703.41810.00004.99901.25000.4166
4.63.76653.62901.00004.99961.25010.4166
4.84.6367-3.55971.00004.99991.25010.4167
57.13371.46550.00005.00001.25000.4167
5.24.77795.77600.94425.00001.25000.4167
5.43.6431-1.27731.00005.00001.25000.4167
5.66.7424-0.57910.00005.00001.25000.4167
5.86.14175.25230.00005.00001.25000.4167
63.38331.32871.00005.00001.25000.4167
6.25.7766-2.51820.00005.00001.25000.4167
6.46.95733.22140.00005.00001.25000.4167
6.63.90213.91541.00005.00001.25000.4167
6.84.4140-3.18791.00005.00001.25000.4167
77.09161.08130.00005.00001.25000.4167
7.25.08306.19580.33415.00001.25000.4167
7.43.5101-0.77841.00005.00001.25000.4167
7.66.6026-0.97330.00005.00001.25000.4167
7.86.35934.89010.00005.00001.25000.4167
83.39471.78151.00005.00001.25000.4167
8.25.5816-2.80470.00005.00001.25000.4167
8.47.02992.87260.00005.00001.25000.4167
8.64.02514.28741.00005.00001.25000.4167
8.84.2360-2.81871.00005.00001.25000.4167
97.04970.73820.00005.00001.25000.4167
9.25.29706.35810.00005.00001.25000.4167
9.43.4555-0.35011.00005.00001.25000.4167
9.66.4582-1.30970.00005.00001.25000.4167
9.86.51174.57630.00005.00001.25000.4167
103.39412.23381.00004.88981.25440.4378
10.25.3120-1.05780.00004.53632.41330.3648
10.46.32702.04750.00004.68842.45230.3967
10.66.12834.05540.00004.86262.49080.4065
10.85.68845.23840.00004.95122.50460.4127
115.19285.81580.11434.98802.50430.4156
11.24.85485.29970.79044.99972.50240.4166
11.44.60564.56391.00005.00192.50100.4168
11.64.43603.87671.00005.00142.50030.4168
11.84.35153.31871.00005.00072.50010.4167
124.26142.75411.00005.00032.50000.4167
12.24.21641.81541.00005.00012.50000.4167
12.44.33061.02901.00005.00002.50000.4167
12.64.45310.34941.00005.00002.50000.4167
12.84.7050-0.45311.00005.00002.50000.4167
135.0058-0.53750.48855.00002.50000.4167
13.25.2766-0.04260.00005.00002.50000.4167
13.45.53120.50390.00005.00002.50000.4167
13.65.72921.07460.00005.00002.50000.4167
13.85.87981.64840.00005.00002.50000.4167
145.98152.24630.00005.00002.50000.4167
14.26.02252.84750.00005.00002.50000.4167
14.46.00643.44730.00005.00002.50000.4167
14.65.92724.04580.00005.00002.50000.4167
14.85.78254.63060.00005.00002.50000.4167
155.57225.19750.00005.00002.50000.4167
15.25.29335.74040.00005.00002.50000.4167
15.44.98235.61000.53545.00002.50000.4167
15.64.70184.89271.00005.00002.50000.4167
15.84.48194.15011.00005.00002.50000.4167
164.32833.38921.00005.00002.50000.4167
16.24.24562.61701.00005.00002.50000.4167
16.44.23831.84041.00005.00002.50000.4167
16.64.31041.06761.00005.00002.50000.4167
16.84.46510.30651.00005.00002.50000.4167
174.7049-0.43461.00005.00002.50000.4167
17.24.9983-0.55230.50345.00002.50000.4167
17.45.2833-0.03650.00005.00002.50000.4167
17.65.52840.50570.00005.00002.50000.4167
17.85.72911.07000.00005.00002.50000.4167
185.88111.65170.00005.00002.50000.4167
18.25.98032.24570.00005.00002.50000.4167
18.46.02322.84650.00005.00002.50000.4167
18.66.00633.44840.00005.00002.50000.4167
18.85.92704.04520.00005.00002.50000.4167
195.78284.63050.00005.00002.50000.4167
19.25.57205.19780.00005.00002.50000.4167
19.45.29345.74020.00005.00002.50000.4167
19.64.98245.61020.53525.00002.50000.4167
19.84.70184.89251.00005.00002.50000.4167

Fingerprints, scenario s1 (12, 4, 0.01)

draft: 47088af604d881f25629d234b5de86f7e36b154bb4a1c08df70022d5923706c3

accepted: 9bcc0a3a963d11853ba0bd1a7bc3850a00d55115b6a2ee3de2cdd51ad69006f7