Theo Parker

Electrical engineering & computer science · UC Berkeley

Scroll ↓
Theo Parker

EECS at Berkeley. I design rocket engine avionics with STAR, do control research in the MPC Lab, and build cool projects for fun.

STAR

DAQ communication protocol

I designed the wire protocol between the ESP32-S3 sensor and actuator boards on the liquid rocket engine at STAR (Space Technologies and Rocketry) and the ground DAQ server. One C++ library is compiled into both the firmware and the server, so the two sides cannot drift apart.

  • Packed binary over UDP/Ethernet: a 6-byte header, a typed body, and 512 bytes at most.
  • Chunked sensor data, so one packet carries several timestamped readings for each sensor.
  • Safety built into the protocol: abort and clear-abort, plus a board-to-board abort when the server link drops.
  • It grew from my original 9 packet types to 17 as the team built on it.
Sensor packet
System Pressure transducer boardESP32-S3 · daq-protocolLoad cell boardESP32-S3 · daq-protocolRTD boardESP32-S3 · daq-protocolThermocouple boardESP32-S3 · daq-protocolActuator boardESP32-S3 · daq-protocolboard ↔ board: NO_CONNECTION_ABORT when the server link dropsEthernet switchUDPsensor data · heartbeatsconfig · commands · abortDAQ serverC++ · links daq-protocolstate machine · logging · console
STAR

Avionics firmware

Firmware for the engine's ESP32-S3 sensor and actuator boards. I wrote the board state machine (waiting for config, connection loss and the abort sequence) and split each board's single blocking loop into two FreeRTOS tasks.

  • If the server goes quiet, the designated abort controller vents everything, checks the pressure transducers, then closes the valves and tells every board the abort is done. The other boards follow it.
  • The state machine is plain C++ with no hardware attached, so 106 host tests drive real abort sequences through the same code the boards run.
  • Sampling and networking run on separate cores. Collecting a chunk used to block the network for up to 1.25 s and let heartbeats go silent.
  • Every data-ready wait times out, a dead ADC is re-initialised, and a 5 s task watchdog reboots a hung board with its valves held where they were.
Board states Waiting for serverSETUPActivestreaming · commandsconfigConnection lossserver silentno heartbeat 5 sheartbeatNo-connection abortvent all · ping PTs10 s · controllerFollowerobey the controller10 s · other boardsPT abortwait for pressure dropPTs reportingNo-PT abortvent, then waitno PT dataafter 2 sAbort finishedclosed · ABORT_DONEpressure lowor 10 s10 sCLEAR_ABORT → Active
Two tasks Core 0Core 1DAQ serverUDPW5500Ethernet · SPINetwork taskevery packet, every 1 msheartbeats · sends · OTA gateADS1262 ADCSPI · data readyADC taskDRDY timeout · re-initbatches chunkschunksdrop-oldest queuecommandsconfig queueTask watchdog5 s · reboot if hung

Sensor boards. The actuator board uses the same split, with a 1 ms control task owning the state machine and every output pin.

STAR

Live video link

The test stand's video transmitter and receiver only had Windows tools, so I wrote macOS software for them from scratch: a user-space USB driver, a low-latency decoder and a link dashboard. It is wired into the DAQ console next to the sensor data.

  • No kernel driver. I rebuilt the USB transport and RF tuning from the vendor's Windows driver.
  • Each frame is shown the moment it is complete, instead of waiting on timestamps.
  • A link monitor detects each failure state and recovers on its own.
Link states
No receiverreopen, with back-off
No signalretune after 8 s
Signal, can't decoderetune after 8 s
Locked, no datarestart stream, then reopen
Locked, no videoresync, then restart
Receiving—
Architecture HDMI camerasourceHV-320H.264 → DVB-TUT-130USB receivervendor software: Windows only1280 MHz over the airUser spacelibusb driverhides_rx.c · tuning · mixerTS demuxSwift · align + demuxVideoToolboxdecode, frame-as-readyViewer · DAQ consolelive videoLinkMonitorclassify · recoverstatus 1/sretune · restart · reopenUDP outOBS · VLC · ffmpegAudioQueueaudio
MPC Lab

Safe-input set computation

Which inputs keep a constrained system safe, and how expensive is that question to answer online? I built a MATLAB pipeline that compares projecting future inputs out of the safe set against lifting them in. It times both an online safety check and a safety-filter QP.

For a fixed horizon every choice of m gives the same safe inputs, so m only trades storage against online speed. In higher dimensions the best choice lies in between: keeping 14 of 20 inputs stores fewer rows and filters faster than either full projection or the fully lifted set.

Six panels against inputs kept: rows stored, online LP and QP time, and offline build time, for state dimensions 2 through 6Results
Formulation
𝒮N,m = Π(x, u0, …, um−1)(ℒN)

Keep the first m of N safe inputs.

rows(m) = m(cx + cu) + f(𝒦N−m)

Lifted constraints plus the projected tail.

rowsfilter QPoffline
m = 637845.7 ms~660 s
m = 142229.1 ms~0.5 s
m = 2028616.7 ms—

Integrator chain, nx = 6, N = 20, 𝒳f = {0}.

MPC Lab

Race car tire identification

I fitted a Pacejka magic-formula tire model to data from the Berkeley Autonomous Race Car, repeating runs across friction and load conditions. The fitted model feeds the vehicle model the car's MPC controllers plan with.

B
5.00
C
1.67
μ
0.92
Measured lateral force against slip angle, with the fitted magic-formula curve
Tire curve
Board + firmware

sACN → DMX512 node

A two-universe lighting node. I designed the board around a CH32V208 RISC-V microcontroller and wrote its bare-metal C firmware. It takes sACN over Ethernet and drives two DMX512 ports, and DIP switches set the universe live.

  • Powered over USB-C or PoE, with each DMX output galvanically isolated.
  • Register-level drivers for DMX timing, Ethernet, the watchdog and fault reporting.
  • Multi-source priority and HTP merge, holding the last look when a source drops.
  • The parser and merge logic are hardware-free and tested on a laptop under sanitizers.
3D render of the DMX node board with two XLR outputs and an Ethernet jack
Firmware Host-testedEthernethw/eth · MAClwIPnet · UDP multicastsACN parserlogic/sacnMergepriority · HTP · holdDMX driverhw/dmx · break, MABXLR A / B2 universesDIP switcheshw/dipDebouncelogic/debounceuniverse → join groupsource countWatchdoghw/fault · trap dumpStatus LEDslogic/status
Power schematic: USB-C and PoE inputs, protection, source OR-ing, 3.3 V LDOPower MCU schematic around the CH32V208MCU DMX port schematic: isolated supply, digital isolator, RS-485 transceiver and protectionDMX port
Reverse engineering

Eos DMX tap

ETC's Eos lighting software computes DMX levels even in Offline mode, but never puts them on the wire, so a packet sniffer sees nothing. I traced the output path through the binary to the one place every level is written, and tapped it live.

  • Two routines write the output buffer, both through one shared store: the normal level path and a watermark injector that flashes the whole universe about once a minute.
  • A Frida gadget is injected at launch, which the app's own entitlements allow.
  • The tap hooks that shared store and reads each write's return address. Writes from the injector are dropped; real level changes are printed the frame they happen.
Captured fade 01282550 s1 s2 s3 s4 s5 s

Real output from the tap: three addresses updated every ~24 ms over five seconds.

Architecture Eos processShow modelcues · subs · liveFrame dispatchlevels per slotNormal level pathreal level changesFlash injectorwatermark · ~60 sSlot writerone shared storeUniverse buffer512 bytes · ~44 HzNetworkskipped offlineinline hookRead callerreturn addressCaller checkflash → dropLive logprint on change
Board + firmware

Gater.link

A home automation device that puts a landline-controlled gate on Wi-Fi. The gate's call box expects a phone line, so the board acts as one: an ESP32 drives a telephone modem chip and a hook switch to send the open command over the line.

  • I wrote the CMX865A driver: C-BUS register reads and writes over SPI for reset, power-up and DTMF transmit.
  • The modem couples to the line through an isolation transformer, with TVS protection at the jack.
  • The hook switch is an optocoupler driving a MOSFET across tip and ring, so the ESP32 never touches the line.
3D render of the Gater.link board: ESP32-S3 module, phone jacks and modem chip
C-BUS write
Address0xE1Transmit Mode register
MSBbits 15–8
LSBbits 7–0

Chip select low, the address byte, then 16 data bits MSB first. Power-up is two writes to 0xE0 (General Control): set the power-up and reset bits, wait 20 ms, then clear reset.

Gater.link schematic: USB-C power, ESP32-S3 module, CMX865A modem with crystal, line transformer, optocoupled hook switch and line protectionSchematic
Tool

Gradescope → Calendar

It mirrors every Gradescope assignment into Google Calendar and keeps it in sync. Deadlines move when Gradescope changes them, and each event flips to submitted when I turn it in. It runs headless on GitHub Actions every 30 minutes.

Calendar
MON 12
WED 14
FRI 16
Pipeline GitHub Actionscron · every 30 mingradescope.pylog in · scrape assignmentscalendar_sync.pyupsert by gradescope_idGoogle Calendar⬜ Due → ✅ Submittedre-runs update events in place, never duplicate