Seven Months Later
Last time I said I'd be posting updates as things progress. Then the repo went quiet from May until the end of September. Oops.
But look at this.
The digital twin, recorded today. 21 simulated node boards running the real firmware, drawn with the real CAD parts.
That is not an animation. Every macaroni in that video is a simulated circuit board running the actual firmware I'd flash onto the chip, turning a simulated motor, lighting LEDs whose colours the firmware computed. The Python controller is talking to all 21 of them over a simulated RS485 bus and has no idea it isn't real hardware.
Before anyone gets too excited: nothing physical exists yet. No board has been ordered, no part has been printed, no motor has spun for this design. Everything in this post is designed and simulated. I'll be very clear about which is which, because the gap between those two is exactly where the next chapter is.
AI: From Companion to Head of Engineering
This is the real story of this post, more than any motor or PCB.
Before
Back in April I used AI the way most people did. It was a companion. I asked it questions. I had it edit some code. But I did the engineering. I read every line, I made every wire-up decision, and I spent my evenings getting one cheap TT motor to turn and one RS485 link to work. 27 commits in April, and I could have told you what was in each of them.
Now
At the end of September I tried something different. I stopped steering line by line and handed over the whole thing: here's the goal, go be the engineer.
The first commit that came back is literally named "Full digital twin by Opus 5.5". Since then there have been 25 commits, and they contain:
- Firmware: a portable node firmware with a Modbus slave, FOC motor control, a motion planner, and the smart effects from my last post. It builds for the RP2350, the RP2040, and for my PC.
- A simulator: C++ motor physics and a byte-accurate RS485 bus that the firmware runs inside.
- A PCB: schematic and 4-layer layout in KiCad, generated from scripts, with a BOM where every line is a part number I can actually order.
- Parametric CAD: the whole node in FreeCAD scripts, for four different motors, with automatic collision and fit checks.
- The web twin you saw above, plus tests, docs, assembly instructions, and a drilling template for the backboard.
About 16,000 lines of code and scripts in the repo now. I have not read most of them. I no longer look at the code.
I need to say how strange and how incredible that feels. I set direction and I make the calls: which motor, what bus voltage, what I'm willing to pay per node. The AI does the engineering, end to end, and then checks its own work against datasheets and tests. My job went from writing a PD loop to answering "do you want a 12 V or a 24 V bus, and here's why I'd pick 12."
It audits itself
The part that sold me was September 29th. I asked for a build-readiness audit: schematic against the datasheets, CAD against the assembly steps, firmware against real-hardware timing. It came back with a checklist of its own mistakes. A few of my favourites:
- The encoder was being read in the wrong SPI clock phase, one bit late. The simulator couldn't show this (a simulated encoder is polite). The datasheet timing diagram could.
- The firmware erased a flash sector every time the turn count changed. That freezes interrupts for up to 400 ms and would have worn the flash out in months. Now it's an append-only log that only writes while the node is idle.
- One pin of an inductor in the chip's core regulator was on the wrong net.
Then it fixed them, one commit each, and ticked them off. That list lives in the repo and it's how I know where the project really stands.
The honest limits
The AI made every one of those mistakes in the first place. Its own checks caught them, which is great, but it means there are certainly more that no check has caught yet. And it can't hold a caliper. Measuring a real motor, test-fitting a print, powering a board for the first time: that's all still me, and none of it has happened.
The Big Design Decisions, Resolved
Last post ended with a pile of open questions. Here's how they landed.
| April | Now | |
|---|---|---|
| Motor | Torn between $1.50 TT and $12 gimbal | Brushless gimbal. GB4114 is the reference, a cheaper 2804 is a variant |
| Power to the rotor | Slip ring vs wire wrapping | Neither! A clock spring |
| Bus voltage | 48 V | 12 V |
| Microcontroller | RP2040 | RP2350A |
| Encoder | AS5600, 12-bit | MT6701, 14-bit |
| LEDs | WS2812B or APA102? | WS2812B-2020, 18 per macaroni |
| Addressing | Daisy chain or DIP switch? | Daisy chain |
Gimbal motors won
I suspected they would. The node is now designed around a hollow-shaft gimbal motor driven directly, no gears. The rotor gets a counterweight so its centre of mass sits on the axis, which means the motor only fights friction instead of gravity. The cheap TT motor lives on as the bring-up prototype.
The clock spring
This is my favourite decision and I didn't come up with it. Slip rings were $10 and 30% of the BOM. Wire wrapping was sketchy. The answer is the thing in your car's steering column: a flat cable coiled around the motor, so the macaroni can turn 3 full turns either way from the middle. And the art never needs more, because every valid pattern position repeats every 120°. The controller just picks the nearest equivalent angle that keeps the cable inside its budget.
About $2 of flat cable instead of a $10 slip ring.
The rest
- 12 V bus: a standard protection diode can clamp a 12 V bus safely below the regulator's 36 V limit. At 24 V it can't.
- RP2350A: about the same price as the RP2040, with a hardware floating point unit for the motor maths.
- MT6701: sits on the PCB under the motor and reads a magnet on a carbon rod that runs down through the hollow shaft.
- Daisy-chain addressing: it tells the controller the physical order of the nodes for free. No DIP switches.
The Digital Twin, Layer by Layer
I wanted the simulation to be as close to reality as I could get without owning the hardware. Here's the whole system.
Everything, and how it connects. The simulator slots in exactly where the wall would be. (Tap to enlarge.)
Layer 1: the real firmware
The node firmware is written against a small hardware interface. On the chip, that interface talks to real pins. In the simulator, the same source files are compiled for my PC and talk to a simulated board. 21 copies of it run at once. If the firmware has a bug, the twin has the bug.
Layer 2: the bus
The real Python controller uses pymodbus, exactly as it would with a USB-RS485 adapter. Its bytes go to a simulated RS485 pair at 1 Mbaud with real byte timing. Every node hears every byte, like on a real shared wire, and collisions are counted. The nodes even self-address over a simulated daisy-chain UART when they boot.
Click a node and you get what its firmware reports over the bus. The panel on the right shows the bus load and the node chain.
Node 11: chain position, angle vs target, cable wind, frames received, CRC errors. All of it read from the firmware over Modbus.
Layer 3: motor physics
Each simulated board drives a simulated motor. The firmware outputs three phase voltages. The physics turns those into currents (resistance, inductance, back-EMF), then torque, then motion. On top of that: cogging, bearing friction, the clock spring pushing back, leftover imbalance against gravity, rotor inertia taken from the CAD, a 14-bit encoder with noise, a randomly rotated encoder magnet on every board, supply sag and winding heat.
That random magnet matters. Each board has to find its own motor alignment at power-on, the same as a real one will.
One simulated move, measured today: 94° of travel, inside ±0.25° after 387 ms, peak current under 40 mA.
Some of those physics numbers come from datasheets and CAD. Others, like cogging and friction, are honest guesses until I have a motor on the bench.
Layer 4: one command, 378 answers
Remember the smart effects idea from last post? "Pulse from center, color blue" and every macaroni works out its own timing? That's real firmware now. The controller broadcasts one command, something like:
Each node knows where it hangs on the wall, what time it is, and how far its macaroni has turned, and computes where each of its 18 LEDs is pointing, 100 times a second.
A handful of broadcast commands drive this whole sequence. The ripples and motion waves are computed by each node on its own.
Layer 5: the web twin
The browser view from last post grew up. It now draws the actual CAD parts, at the angles the physics says, lit with the colours the firmware says. Press X and the tiles disappear so you can watch the insides work.
X-ray mode: motors, drums, clock springs and boards behind the tiles.
What the tests prove
115 automated tests pass today: 15 run the real firmware inside the simulator, 80 cover the controller, 20 cover the web view. The firmware ones check things like:
- Every board calibrates its motor at power-on and takes the right address from the chain.
- "Face left" puts every macaroni within 0.25° of the commanded direction.
- Shove a rotor and it comes back to within 0.25°.
- The cable budget is never exceeded, however hard you ask.
- A motor driver fault gets retried, and reported if it won't clear.
The Hardware (On Paper)
One node, exploded. Front to back: diffuser shell, LED board, carrier, cap, wall tile, clock-spring drum, motor, node PCB.
One node
A node is 39.1 mm deep from the backboard to the front of its tile, and the motor is 83% of that. The PCB is the motor mount. Everything printed is designed to print without supports.
Section through the CAD. The black rod carries the encoder magnet down the hollow shaft to the chip on the PCB. The orange band is the clock spring.
Just the electronics: node board, motor, flat-cable clock spring, and the LED board that rides on the macaroni.
The CAD is a script, not a drawing. Change a number, re-run, and it re-checks everything: 54 collision, fit and balance checks pass for the reference design, including sweeping the rotor through 12 angles against every component on the PCB.
The node board
90 × 90 mm, 4 layers, designed for JLCPCB assembly. RP2350A, a DRV8313 three-phase motor driver, the MT6701 encoder, a THVD1450 RS485 transceiver, and a 12 V → 5 V → 3.3 V power chain with reverse-polarity and surge protection.
The schematic (tap to enlarge). A script checks it against the firmware's pin map: 99 parts, 310 pins, 61 nets, all matching.
The board as it stands today. Yes, the silkscreen text is a mess. Read on.
It is not ready to order. The design check today says: no copper errors, but 3 connections still unrouted, 3 leftover vias, and 406 silkscreen complaints (you can see them). Close. Not done.
What a node costs
These are estimates for prototype quantities, not quotes.
| Part | Est. cost |
|---|---|
| Node PCBA (assembled) | ~$16 |
| LED board for the macaroni top | ~$2 |
| Two LED side strips | ~$3 |
| Clock-spring flat cable | ~$2 |
| Bus cable, motor plug | ~$1.20 |
| Screws, magnets, carbon rod, counterweight | ~$2.10 |
| 3D-printed parts (filament) | ~$1.50 |
| Node without motor | ≈ $28 |
| Motor | $10 – $36 |
So roughly $38 a node with the budget motor and about $45 with the GB4114. A 21-node wall with everything else (Pi, power supply, plywood) is estimated around $930 to $1,070. Motors are now the expensive part and the hard-to-buy part: the GB4114 was out of stock when the BOM was written.
Side quest: the light cage
A different LED layout I'm exploring: more LEDs on one flat board, with a printed cage that fans each LED's light out to the diffuser.
18 LEDs through a thin diffuser might look dotty. This is a prototype of a denser layout. It's a CAD experiment, not part of the main design yet.
Real vs Simulated, Honestly
| Status | |
|---|---|
| Firmware | Builds for the real chip. Only ever run in the simulator |
| Controller + web twin | Running, tested against the simulator |
| Node PCB | Designed, 3 connections from routed. Never ordered |
| LED board | Designed, fabrication files exported. Never ordered |
| Printed parts | Designed, checked in CAD. Never printed |
| Motor physics | Partly datasheet, partly guesses |
| Real hardware so far | The TT-motor prototype from April. That's it |
The simulator also has known blind spots. No electrical noise on the bus. Perfect power wiring. A flawless clock spring that never wears. Those are on the list.
What's Next
The to-do list splits cleanly in two.
For the head of engineering: finish routing the board and clean it up until it's genuinely orderable. Then turn a critical eye on the whole project. I've asked it to review and rate every part of its own work, and fix the worst of what it finds.
For me: the stuff that needs hands. Measure a real motor. Print the fit-test parts. Order five boards, not fifty. Wind a clock spring and cycle it until I trust it. And then the scary one: power up the first board and find out how much of the twin was telling the truth.
I can't wait.