Gait Identifier

Gait Identifier

Introduction

My gait identifier consisted of 3 components: UnoQ battery, UnoQ holder, and ankle attachment. The UnoQ holder and battery were placed by the user’s waist, while the ankle attachment was placed on the outside of the user’s right ankle. The Raspberry Pi Pico W would collect the inputs from the IMU, and send the information to the UnoQ over Bluetooth. From this information, the UnoQ would compare the values to a kNN model, before outputing its predicted state on the LED matrix. The LED matrix was chosen as the display because it allowed me to use the gait identifier in conditions when using a computer isn’t ideal (Aka, frisbee).

Ankle attachment on the right ankle

Ankle attachment on the right ankle

Design

The ankle holder consisted of a Raspberry Pi Pico W, 2 AAA batteries, and the MPU-6050. Along with the microcontroller, the UnoQ holder also contained an attachment point for the IMU, in the event that the Pico didn’t work. All three holders had attachment points for either rope or velcro straps. To protect the electronics, tops were friction fit to easily slide in without risk of sliding off. Square extrusions were added to allow for easier grip when removing the tops. A hole was cut into the UnoQ top to allow a visual on the LED matrix.

CAD model of ankle attachment

CAD model of ankle attachment

CAD model of the UnoQ and battery holders

CAD model of the UnoQ and battery holders

Components were 3D printed using PLA.

Inside of ankle attachment

Inside of ankle attachment

Inside of UnoQ holder

Inside of UnoQ holder

To show which state the UnoQ was in, a mini animation with the LED matrix was showed, mirroring the predicted state (standing still, walking, running, biking). The LED matrix also showed which model the UnoQ was using to make the prediction.

LED display shows animation of predicted state

LED display shows animation of predicted state

Model

Video demonstration

Video demonstration

My gait identifier used kNN to detect the differences in IMU data for each state. When initializing the program, the user needs to calibrate each state by recording 2 minutes of them standing still, walking, running, and biking. Additionally, the user needs 5 trials of them tapping their foot 3 times in quick succession, to train the UnoQ on model change commands. From there, the UnoQ recieves the IMU data from the Pico in 10 ms. To smooth out the data, the UnoQ waits for a 2.56 second window, averages the distances of the raw IMU data with a z-score, before comparing with the neighbors of the dataset. It then compares the result with the previous 2, and uses the LED matrix to display the state that at least 2/3 agree on, as shown in the figure below. Although this smooths the displayed result, it also causes a roughly 5-6 second delay from the user change to display.

kNN model prediction

kNN model prediction

Code

the notable programs are main.py in the pico folder and the gain folder in unoq_app. For main.py in the pico, it would read the IMU data, and output them to the UnoQ over BLE. the gait folder inside unoq_app consisted of the classifier, sensor information, windowing, knn, training, and other conditions.

ME-193-AI-Mobile-Robotics/Gait at main · ryancole208/ME-193-AI-Mobile-Robotics