MagFit Prosthetics
A residual limb changes volume through the day. The socket is supposed to change with it.
WHAT IT IS
A prosthetic socket that adjusts itself as a residual limb changes volume, using magnetorheological fluid and electropermanent magnets. It started as a student project and is working toward becoming a startup.
WHAT I OWN
- The firmware architecture, interrupt driven, with one rule everything else follows from
- Force sensing resistor handling, plus the scaffolding for battery management, Bluetooth, PID and motor control
- A non-blocking printing and logging API, because nothing suitable existed
- The breadboard build of the signal board, and the firmware for the rig that characterizes the fluid
THE RULE
Nothing except initialization is allowed to block. A socket that stalls while someone is walking on it is not acceptable, so the rule is written into the code rather than into a document.
/*
* Runs before osKernelStart(). Creating FreeRTOS objects here is fine;
* blocking on them is not, and neither is any HAL call that waits.
* Anything that needs the scheduler belongs in app_main().
*/app.cpp, at the top of init
Printing follows the same rule. A formatted string goes into a stream buffer under a mutex, and a background task drains it over UART in interrupt mode. Nothing sits and waits on a serial port.

The firmware runs ahead of the hardware. The board is not fabricated yet, so everything is tested against a breadboard signal board.
THE RIG
Before you can control the fluid, you have to know how it behaves. I wrote the firmware for the rig that measures it.
One loop holds motor speed constant as the fluid stiffens. A second trims coil current until it hits setpoint. Torque, both branch currents, speed and field all get logged together at every setpoint.
Getting there meant three mixed-signal problems. The Hall sensor output is analog and swings to 5V, but the Pico reads it on a 3V3 ADC pin, which tops out below what the sensor can put out. Encoder logic levels. And star grounding, to keep the motor return currents off the analog ground.

The rig that measures how the fluid behaves under a field. I wrote its firmware.
WHERE IT IS NOW
Development runs on an STM32L432KC while the final board, built around a G474, is still in design. The G474 was picked because ST’s tooling can train and run models on low power hardware, which is what makes all day battery life realistic for someone actually wearing this.