Skip to content

MengLinMaker/Hip-Motion-Capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hip Motion Capture - Demo

Aims

  • To provide additional information for diagnosing fall injuries and identify preventions.
  • To allow data scientists to collect labelled data and train better fall detection algorithms.
 
GitHub

Basic hip motion visualiser based on the IMU-Webserial-Visualiser. A total of three quaternions are used to represent orientations for the hip and two thighs. Capable of record accelerometer, gyroscope, magnetometer and quaternion data simultaneously at a rate of 120hz.

Made using Three.js, which is a WebGL wrapper, and the experimental Web Serial API. An ESP32 microctontroller interfaces with FXOS8700 + FXAS21002, and two BMX160 IMUs and calculates the orientation using a Madgwick Filter. Finally the data is parsed into an array and streamed to the visualisation website.

 
 
 
 
 

Requirements for usage

This demo requires a physical construction of the hip and thigh motion capture device. Placement of sensors are shown below:

Please contruct a similar or equivalent device to fully use this web visualiser.

 

Instructions

Live Visualisation Streaming

  1. Select baud rate.
  2. Click connect and choose COM port. Recording Serial Data
  3. Choose buffer size for saving CSV (Optional).
  4. Click save and enter file name to save (Optional). Note: Choose a reasonable value for CSV buffer size: under 10^6.
 
 
 
 
 

Development Process

The aim of this mini project is to create a physical device and visualise live motion data. Due to the complexity of the project, it is best approached by breaking the project into subsystems

Overall there are 3 major subsystems:

  • Hardware: Physical device for strapping around waist and thigh, housing microcontroller and battery, plus interfacing with sensors.
  • Firmware: Data collection and fusionto obtain quaternion orientations. The final data is then streamed to another ESP32 or strait to PC.
  • Software: A website visualiser with data recording capabilities.

Since some parts between subsystems depend on each other, it is best to approach the project in different stages:

  1. Create simple data stream from one sensor to website.
  2. Develop a simple 3D visualisation to debug the orientation algorithm. Create a 3D printed housing for microcontroller and battery.
  3. Integrate multiple sensors in hardware, firmware and software visualisation.
 

Hardware

Since harware development is more risky, this is prioritised.

A battery is needed for the device for wireless transmission of data. Prototyping various charger designs determine the best dimensions for the battery case. This knowledge can also be applied to the device design.

A I2C sensor hub relays all the sensor data to the microcontroller. I2C reduces the number of wires needed and transfers data fast enough to reach over 100Hz samples from all three sensors. Flexible silicone prevents wire breakage.

Finally, the sensors need to be attached to the thigh and waist. Straps can secure the sensors, albeit with slipping issues. Pins can also be used to secure the placement of straps.

 

Firmware

Data streaming is required for fast data collection and debugging. Wireless streaming is ideal since using wires could be hazardous during a fall, disconnect and suffer signal integrity issues. Madgwick filter is used to determine the orientation.

 

Software

The website intefaces with serial USB using the webserial API. Three.js enables 3D visualisation. Overall, the software can be descibed in this block diagram.

 
 
 
 
 

Credits

This code was modified from Mike Molinari's serialTerminal.com: https://github.com/mmiscool/serialTerminal.com Reskinned UI and refactored the original code. Added ability to save CSV file and determine last full line, stored in "currentData". Access the original webserial terminal here: https://www.serialterminal.com