Writing

Controlling a virtual hand with my muscles

This is me controlling a virtual robotic hand with my muscles.

I used three channels from my NPG Lite at 500 Hz and recorded six two-minute blocks of hand movements alongside webcam video. I used MediaPipe to approximate hand-closure labels, and recorded separately for training, validation, and evaluation.

I then adapted yesterday’s 4.3M-parameter transformer to the new sensor, replacing its input layers and prediction head while retaining the pretrained transformer blocks. The new model takes three-channel EMG and predicts one continuous hand-closure command.

On two held-out recordings, it achieved a correlation of 0.75 and reduced closure MAE by about 38% compared with predicting the training average. It also beat an EMG-envelope ridge baseline. A fixed 4 Hz low-pass filter brought the correlation to 0.80 and made the output smoother.

The pretrained model performed better on average than the same architecture trained from scratch, which is promising, though this was only one seed and one electrode session.

After the offline checks, I connected the decoder to the live stream and recorded the demo below. The camera was used for training labels and comparison, while the simulated hand was controlled by EMG.

Real-time control of a simulated robotic hand using three channels of surface EMG.

This is coordinated opening and closing, so all five fingers move together. Independent finger control and reliable transfer after removing and reapplying the electrodes are still ahead.

While it’s far from perfect, controlling the simulation with my own signals feels like a meaningful step toward control with minimal calibration. I’m also considering building a full prosthetic hand to take this into physical hardware.