app
AI Flow: Reverse Engineering
Public Made by Adomby adom
Photos of a PCB to a tagged KiCad copy: parts placed, copper and nets with their evidence, a schematic, a measured confidence score, bench tests and a video of the run.
main
Caleb
Add the page README, the run and process video sub-pages, and captions
64663a4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
{
"video": "/adom/ai-flow-reverse-engineering/render/videos/driver-re2-process.mp4",
"title": "Reverse engineering a PCB from photos: the Driver board",
"poster": "/adom/ai-flow-reverse-engineering/render/videos/driver-re2-process-poster.jpg",
"chapters": [
{
"t": 0,
"title": "Intro"
},
{
"t": 5.0,
"title": "The request"
},
{
"t": 16.1,
"title": "A new program"
},
{
"t": 33.43,
"title": "Photos"
},
{
"t": 45.23,
"title": "Scale"
},
{
"t": 60.1,
"title": "Parts"
},
{
"t": 77.03,
"title": "Blocks"
},
{
"t": 93.4,
"title": "The miss"
},
{
"t": 106.0,
"title": "Reading the copper"
},
{
"t": 127.7,
"title": "Vias"
},
{
"t": 152.8,
"title": "The copy"
},
{
"t": 162.3,
"title": "Nets"
},
{
"t": 177.47,
"title": "The router"
},
{
"t": 197.9,
"title": "Layer count"
},
{
"t": 223.43,
"title": "Rules"
},
{
"t": 245.33,
"title": "Review and tests"
},
{
"t": 263.97,
"title": "Not done"
},
{
"t": 283.43,
"title": "The record"
},
{
"t": 289.03,
"title": "Cost"
}
],
"captions": "WEBVTT\n\n00:00:01.952 --> 00:00:05.849\nIt starts with four photos of a motor driver board, and one request.\n\n00:00:05.869 --> 00:00:10.135\nFind the parts, the functional blocks, the pours and the routing.\n\n00:00:10.155 --> 00:00:11.794\nCopy everything you can see.\n\n00:00:11.814 --> 00:00:15.780\nThen work out what you can't, pick a layer count, and say how sure you are.\n\n00:00:16.361 --> 00:00:21.041\nThe first attempt reused the existing AI Flow program, and Caleb called that\n\n00:00:21.061 --> 00:00:21.288\nout.\n\n00:00:21.308 --> 00:00:25.908\nSo this became its own Rust program, with its own copper reader and its own\n\n00:00:25.928 --> 00:00:26.339\nrouter.\n\n00:00:26.359 --> 00:00:29.894\nThe program does the measuring. The AI does the naming.\n\n00:00:29.914 --> 00:00:33.128\nEleven steps, and each one records what it produced.\n\n00:00:33.690 --> 00:00:35.968\nTwo photos of the top, two of the bottom.\n\n00:00:35.988 --> 00:00:39.805\nThe program finds the board edge in each one and straightens it.\n\n00:00:39.825 --> 00:00:44.512\nThen it turns the bottom over to line up with the top. 38 holes agree, 2\n\n00:00:44.532 --> 00:00:44.904\ndon't.\n\n00:00:45.482 --> 00:00:51.031\nScale comes from the board itself. The header rows have known pitches, 2 mm\n\n00:00:51.051 --> 00:00:51.923\nand 2.54 mm.\n\n00:00:51.943 --> 00:00:55.113\nThat gives 46.6 pixels per millimeter.\n\n00:00:55.133 --> 00:00:59.787\nThe driver chip's 6 mm body settles which pitch standard the rows are.\n\n00:01:00.360 --> 00:01:02.841\nThen the parts, 137 of them.\n\n00:01:02.861 --> 00:01:06.374\n103 are placed by their own pads on the photo.\n\n00:01:06.394 --> 00:01:12.507\nMarkings get read where they're legible, like this TI DRV8323S.\n\n00:01:12.527 --> 00:01:16.699\nWhere they aren't, the program says so. 91 parts still need a test.\n\n00:01:17.284 --> 00:01:20.918\nSilkscreen and circuit role sort them into 11 blocks.\n\n00:01:20.938 --> 00:01:26.152\nPower entry, the three-phase power stage, bridge sensing, the logic supply.\n\n00:01:26.172 --> 00:01:31.719\nThe gate driver, the microcontroller, CAN, AUX, the fan, motor temperature and\n\n00:01:31.739 --> 00:01:33.074\nthe mounting holes.\n\n00:01:33.658 --> 00:01:38.749\nThen came the real miss. The first copy had 58 pours, all on the bottom, and\n\n00:01:38.769 --> 00:01:40.026\nnot a single track.\n\n00:01:40.046 --> 00:01:44.773\nCaleb looked at it and said fill and via recognition was completely lacking.\n\n00:01:44.793 --> 00:01:45.676\nThat was correct.\n\n00:01:46.249 --> 00:01:50.301\nSo the reader was rewritten. Under solder mask, copper looks a little lighter\n\n00:01:50.321 --> 00:01:53.209\nthan bare laminate, compared with its own neighborhood.\n\n00:01:53.229 --> 00:01:56.060\nThin dark lines mark the gaps between copper.\n\n00:01:56.080 --> 00:02:02.294\nFollow those gaps and the board falls apart into islands. 1,444 of them.\n\n00:02:02.314 --> 00:02:07.370\nThat became 116 pours and 314 tracks, on both faces.\n\n00:02:07.949 --> 00:02:13.882\nVias are next. 2,681 candidates, and 1,028 kept.\n\n00:02:13.902 --> 00:02:18.031\nThey're tented on the top, so only 45 show on both faces.\n\n00:02:18.051 --> 00:02:22.994\nZoom in and the misses show. Up to a third land on something pale, mostly\n\n00:02:23.014 --> 00:02:24.965\nsilkscreen letters and lines.\n\n00:02:24.985 --> 00:02:29.825\nAnd the 3 read as leading only inward look like ordinary domes in a stitching\n\n00:02:29.845 --> 00:02:32.477\nfield. So that's no proof of inner layers.\n\n00:02:33.050 --> 00:02:37.964\nAll of that goes straight into a KiCad board, as photographed, before anything\n\n00:02:37.984 --> 00:02:38.659\nis guessed.\n\n00:02:38.679 --> 00:02:41.979\nHere's the copy laid over the top photo, and over the bottom.\n\n00:02:42.550 --> 00:02:48.074\nNow for what nobody can see. Datasheets and the circuit fill in the rest of\n\n00:02:48.094 --> 00:02:51.252\nthe nets. 77 nets, 249 connections to make.\n\n00:02:51.272 --> 00:02:56.221\n99 pins disagree with the copper they seem to touch. Those get reported, not\n\n00:02:56.241 --> 00:02:57.136\nquietly fixed.\n\n00:02:57.726 --> 00:03:02.040\nThen the router. It's written for this job, and it uses every inner layer.\n\n00:03:02.060 --> 00:03:06.974\nWhen photographed pours were hard walls, 235 connections stayed open.\n\n00:03:06.994 --> 00:03:11.990\nReal vias pass through pours, so seen copper became expensive to cross instead\n\n00:03:12.010 --> 00:03:12.826\nof forbidden.\n\n00:03:12.846 --> 00:03:17.587\n17 recorded runs later, 6 and 8 layers are down to about 30.\n\n00:03:18.157 --> 00:03:21.244\nThe layer count comes from how hard that is.\n\n00:03:21.264 --> 00:03:27.699\n4 layers: 54 open, and 327 mm cut through copper the photos show.\n\n00:03:27.719 --> 00:03:30.646\n6 layers: 34 open, 24 mm.\n\n00:03:30.666 --> 00:03:37.037\n8 layers: 29 open, 30 mm. That's no real gain, since runs vary by about a\n\n00:03:37.057 --> 00:03:37.737\nquarter.\n\n00:03:37.757 --> 00:03:42.411\nSo the proposal is 6. It's a measure of difficulty. Nobody has seen inside\n\n00:03:42.431 --> 00:03:43.105\nthis board.\n\n00:03:43.693 --> 00:03:48.776\nThe rules were set from the start: KiCad's defaults, 0.2 mm track and\n\n00:03:48.796 --> 00:03:49.516\nclearance.\n\n00:03:49.536 --> 00:03:53.723\nMost of what's left open is fan-out at the two QFN chips.\n\n00:03:53.743 --> 00:04:00.570\nThe same copy at JLC-style rules, 0.127 mm, leaves just 2 open at 6 layers.\n\n00:04:00.590 --> 00:04:05.024\nSo that's mostly a rules limit. That run has no valid design rule check yet.\n\n00:04:05.592 --> 00:04:10.631\nThen it reviews itself, in a loop. 4 passes, and the last one changes nothing.\n\n00:04:10.651 --> 00:04:15.930\nBlocks and placement come out high. Identity, values, copper, vias and layers,\n\n00:04:15.950 --> 00:04:16.406\nmedium.\n\n00:04:16.426 --> 00:04:18.593\nConnectivity is low, and it says why.\n\n00:04:18.613 --> 00:04:23.647\nEverything still unknown gets a test. 119 of them.\n\n00:04:24.218 --> 00:04:25.731\nSo this is not a finished board.\n\n00:04:25.751 --> 00:04:31.262\n34 connections stay open. KiCad counts 76 missing, because some seen copper\n\n00:04:31.282 --> 00:04:33.105\nisn't joined in the copy.\n\n00:04:33.125 --> 00:04:37.466\nThe rails at the upper left of the bottom are largely missing, and signal\n\n00:04:37.486 --> 00:04:39.139\nbundles mostly read as gaps.\n\n00:04:39.159 --> 00:04:43.115\nAnd the inner copper is one way to connect it, not what's actually inside.\n\n00:04:43.682 --> 00:04:48.729\nEvery stage is saved in the flow window. 110 recorded steps you can replay.\n\n00:04:49.308 --> 00:04:54.732\nFrom the first prompt to the report took about 6.5 hours of AI time, with idle\n\n00:04:54.752 --> 00:04:56.756\ngaps over 15 minutes cut out.\n\n00:04:56.776 --> 00:05:05.483\n914,981 output tokens, and 272 million cache reads, across 463 model calls.\n\n00:05:05.503 --> 00:05:10.357\nNext up: real measurements on this board, and a second board, before any of it\n\n00:05:10.377 --> 00:05:11.107\ngoes public.\n\n"
}