💾 Archived View for rawtext.club › ~hut › psylink-fzero.gmi captured on 2023-09-08 at 17:56:05. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

PsyLink: F-Zero

The look of the first device was way too unprofessional, so I pulled out my sewing machine and made a custom tailored sleeve from comfortable modal fabric.

Image: photo

On the inside, I attached some recycled studs that served as electrodes. Who needs that expensive stuff they sell as electrodes when a piece of iron suffices?

Image: photo

This time it had 4 electrodes. I targeted the middle and the distal end of two muscles, the Brachioradialis and the Extensor carpi radialis longus. I picked those muscles at random, because I honestly don't know what the fuck I am doing.

Extensor carpi radialis longus

Brachioradialis

Software-wise, I played around with moving average and got reasonable signals, but it was clear that there was too much noise.

moving average

How to filter, though? I'm not going to solder some bandpass filter, that's too slow and inflexible. There are simple algorithms for doing it in software (link 1, link 2), but something seemed off about this method. In the end, I decided to learn how to do a Fourier transform on the Arduino.

link 2

link 1

With this code (inspired by this post), I took 64 samples at a sampling rate of 1kHz, performed the Fourier transform, cut out anything under 30% and over 50% of my frequency range, and then summed up the amplitudes of the remaining frequencies to generate the output.

this post

this code

Still very crude, but it allowed me to get distinctive signal patterns for various positions of my arm:

Image: screenshot

I was genuinely surprised that I got information of this fidelity and usefulness from just hooking up 4 ADC's to semi random places of my forearm and a software bandpass filter. This was good enough to use it as a basic input device!

I wondered, can I control a racing car game with this?

To test that, I built readserial.py to read out the signals and convert certain ranges of values to keyboard presses of the keys **Left** and **Right**. The value ranges need to be calibrated before each use: I held my left arm like I'm grabbing an invisible steering wheel, moved it left and right, and looked hard at the signal values to find correlations like "signal A is always below X if and only if I steer left". Once the calibration is done, the invisible steering wheel turned into a magical keyboard with 2 keys =D

readserial.py

Right away I tried it out to steer in my favorite racing game, F-Zero:

Video link: data/myo/video2.webm

Note that in addition to the steering wheel, I used my other hand to accelerate.

I loved it, but there is still a lot of work to be done. The calibration is a pain, especially since it needs to be repeated if the electrodes move too much, which happens a lot with this kind of sleeve. Also I want more electrodes, better signal processing, and data transfer via Bluetooth so I can run it off a battery.

Navigation panel

View the entire blogchain "psylink"

Previous post in blogchain: Baby Steps

Next post in blogchain: Adding some AI

Blog

About

Projects

RSS Feed

Written on 2021-04-09 by hut