With two CAN links disconnected, our three controllers still agreed on network state. The largest measured timing difference between the front and rear lamps was 15.5 µs over ten rising edges.
CAD render of the controller board on the test vehicle chassis.
In this build
My contribution. I worked on PCB power and ground routing, qualified CAN timestamps for clock synchronization, and fixed Raft log catch-up after follower resets. Our CMU 18-449 team integrated the system and ran the bench tests.
Bench fault tests
Three controllers talk over two wired networks called CAN buses. One controller leads and sets the timing for both lamps. The diagram simulates two bench tests and shows the original oscilloscope photos after each fault.
CAD render of the four-layer controller PCB and Raspberry Pi mounted on the test vehicle chassisThe simulated lamp flashes and relay pulse are slowed for visibility.
Yellow is the front lamp. Green is the rear. The gap between the upward steps shows how far apart the lamps turned on. The front and rear lamps turned on within 15.5 µs of each other across all ten measured flashes.Bench scope captureCockpit stopped
Both lamp signals go from one flash about every 500 ms to one every 250 ms. The scope is set to 500 ms per division.Bench scope captureCockpit restarted
After the cockpit restarts, both traces settle low as the hazards clear. The scope is set to 500 ms per division.
With both jumpers pulled, the front and rear controllers still communicated through the Pi. The rear stayed in sync, and all three controllers agreed on the network log.
Three controllers, two buses
The Raspberry Pi ran the cockpit on SocketCAN. Two STM32s running Zephyr handled steering and the drivetrain. Each controller had a connection to both independent 500 kbit/s CAN buses.
Each node kept a map of which links were up. A shared bus gave two controllers a direct path. During our split test, the front controller sent on CAN A, the Pi forwarded onto CAN B, and the rear controller received there. The Pi also relayed the leader’s clock references.
In simulation, a restored CAN link could be reported as down again because other controllers still had stale information. I changed link reporting so each controller reports only its own connections.
Consensus and clock synchronization
Raft replicated changes to the network map. Two of the three controllers could commit an update, and each node applied committed entries in the same order. I fixed the catch-up path so a follower could recover missing entries after a reset and rejoin with the same map.
The leader sent a time reference every 20 ms. Followers compared their receive timestamps with the leader’s timestamp for the same frame to correct clock offset and drift. I worked on qualifying those timestamps. When the Pi relayed a reference, it accounted for the time the frame spent at the bridge. The front and rear STM32s could then schedule their lamp edges against the same clock.
Raft bench setup with a Raspberry Pi, two STM32 Nucleo boards, and breadboarded CAN wiring.
Four-layer controller PCB
Our four-layer board integrates both STM32 zones, the Raspberry Pi cockpit interfaces, and six CAN interfaces. Separate rails supply logic, the Pi, and the steering servo. I reinforced the power paths and revised the servo current-sense routing and the ground reference under the SPI and ADC signals.
Pointer: drag to pan and wheel to zoom. Touch: drag and pinch. Keyboard: Tab to the labeled viewer controls or switch views below.
Copper layers
The board passed the configured layout checks and was checked for fit in CAD. The timing result above came from the lab kit. Physical fit and powered testing of the custom PCB are still pending.