Calvin's Blog

Coding is a game

0%

Wearable Motion Capture and Rehabilitation Assessment System

I built a high-precision wearable motion capture & rehabilitation assessment system designed for stroke patients to perform home-based rehab training with 3D motion reconstruction.

The system integrates multiple hardware and software technologies, covering multi-IMU sensing, quaternion-based Kalman fusion, wireless streaming (UART), and a PC-side inverse kinematics (IK) evaluation tool (MATLAB + OpenSim) to visualize motion and quantify joint ROM (Range of Motion). The goal was simple: make rehab feedback more objective, more accessible, and easier to use. 🦾


🧩 System Overview

Workflow: Capture → Fusion → Transmit/Store → IK Analysis → Rehab Metrics

  • Wearable device captures motion using 9-axis IMU modules
  • Firmware performs real-time fusion and outputs limbs angles
  • Data is wirelessly (UART) transmitted to PC and also logged to SD card
  • PC tool performs inverse kinematics Algorithm to replay motion and compute ROM metrics

🧠 Software Development


Kalman Filtering Algorithm

  • Implemented a Quaternion-based Kalman Filtering algorithm to fuse data from accelerometers, gyroscopes, and magnetometers, effectively solving Euler angle gimbal lock and sensor drift issues.
  • Developed the embedded firmware in **C/C++**on the STM32L0 platform, managing task scheduling and low-power operation.
  • Built a host analysis system using MATLAB to perform Inverse Kinematics (IK) Algorithm. This allows for precise reconstruction of limbs motions based on sensor data.
  • Ported the FATFS file system to enable high-speed, real-time offline storage of motion data onto an SD card via the SDIO interface.

⚙️ Hardware and Mechanical Design


Hardware Workflow

  • Designed a distributed hardware architecture using three STM32L071 (Low Power) MCUs. Two units act as sensor nodes (processing IMU data), while the central unit handles data aggregation and transmission.

  • Designed custom PCB boards integrating TPS5430 power management for stable voltage regulation and signal isolation to prevent digital noise from affecting analog measurements.

  • Integrated a 2.4G wireless transmission module (NRF24L01 based) to replace traditional wired connections, allowing patients unrestricted movement range during rehabilitation exercises.

  • Modeled and manufactured 3D-printed PLA enclosures using Fusion360. The design features a magnetic slide-lid mechanism and ergonomic strap mounts for easy patient wearability. (Thanks for my best friend Ruizhe Zhou’s helps!)


    3D-printed PLA enclosures


💡 Key Innovations

  • The system achieves an average knee joint angle measurement error of only through rigorous static and dynamic testing, meeting high accuracy.
  • Inverse Kinematics Integration: Unlike simple angle measurement devices, this system utilizes motion capture data for inversion. This provides doctors with clinically relevant Range of Motion (ROM) data for remote diagnosis.
  • The system focuses on home-based rehabilitation. It is lightweight, wireless, and includes a “push-pull” magnetic switch structure designed specifically for ease of use by stroke patients.


Prototype


Overhead view of the Wearable Device


Hardware PCB


Angle Test


🎥 Competition Video


Demo Video


This project aims to solve the issue of limited medical resources for stroke patients by enabling effective, unsupervised home rehabilitation training. It also demonstrates a full-stack integration of low-power embedded systems, sensor fusion algorithms, and animational modeling to achieve autonomous rehabilitation assessment.