Using Inertial Measurement Units to Calculate Knee Flexion Angle

Using Inertial Measurement Units to Calculate Knee Flexion Angle

  • Melissa Boswell

  • Hannah O'Day

Project Video

Description

Inertial Measurement Unit (IMU) sensors are electronic devices that measure and report a body's specific force, angular rate, and sometimes the magnetic field surrounding the body, using a combination of accelerometers, gyroscopes and magnetometers. Most people interact with these devices daily, via the IMU in their smartphone that allows them accurate navigating ability. Recent advances in wearable IMU technology, however, are allowing users to capture and store hours of  kinematic data. Traditionally, kinematic data was only attainable in motion capture laboratories equipped with multiple cameras that tracked a subject's motion via reflective markers worn on the body.  With wearable, wireless IMU sensors, we have a unique opportunity - the ability to capture human motion in "natural" settings (outside of the laboratory) lasting multiple hours.  One such IMU company, Xsens, uses a 3D accelerometer, 3D gyroscope, and 3D magnetometer in each of their IMU sensors to capture full 6 degree-of-freedom tracking of body segments.

In this study, we started with a simple application using two Xsens IMUs to measure knee angle.  Our experiment calculated the knee angle as a person is sitting in a chair with their initial knee flexion angle at 0 degrees (full extension) and flexing to 90 degrees at frequencies similar to that of walking and running.  The knee flexion angle is calculated with measurements from IMUs attached to the shank and thigh. Using 2D video, markers and a goniometer, the subject's leg motion was be measured with video analysis to obtain a "ground truth" knee angle measurement. This was compared to the knee angle determined from the IMU sensor data combined with the Xsens biomechanical model, output as a data file of joint angles over time.  The knee joint angles was then input into OpenSim to observe the motion.  In addition to directly outputting the joint angles, each individual IMU sensor's orientation was output prior to feedback from the Xsens biomechanical model.  These orientations, output as quaternions, were transformed into rotation matrices and input into an OpenSim Inverse Kinematics (IK) script.  IK in OpenSim determined the positions that best matched the input rotation matrices at each time step, and the resulting knee angle was observed.  Once model kinematics were successfully reconstructed in OpenSim, we validated the determined knee joint angle from both the Xsens biomechanical model and using IK in OpenSim with our ground truth motion capture data.  

The goal of this project was to determine if knee angle could be measured accurately with the IMU sensors.  The motivation for this goal is that if validated, the IMUs can be used for more complex movements, such as gait, to characterize kinematics without the restrictions of a motion capture system.  Many questions can be addressed with the ability to analyze kinematics in a natural setting and for long periods of time.

Research Questions

  1. Can knee joint angle be calculated accurately with two IMU's?

  2. Can the IMU data be input into OpenSim to reconstruct movement kinematics?

  3. Can kinematics be reconstructed in OpenSim with IMU measurements in real-time?

Project Overview

I.  Pipeline for Processing IMU Data

II. Knee flexion experiment (IMU and 2D video marker tracking)

III. Reconstructing motion in OpenSim using Xsens-estimated knee joint angle

IV. Reconstructing motion in OpenSim from Inverse Kinematics using Xsens IMU orientation data

 

I. Pipeline for Processing IMU Data: How to go from real world motion to model segment kinematics

In the pipeline for processing IMU data, the IMU sensors are used first to obtain linear acceleration (from the accelerometer), angular velocity (from the gyroscope), and magnetometer readings of the desired motion or activity.  The IMU sensors we used were sampling at 60 Hz and were small and lightweight (47x30x13 mm, 16 g). Xsens developed a sensor fusion algorithm, a Kalman filter called XKF-3, such that orientation and position of the IMU sensors can be accurately estimated.

Following the lower pathway, you see that Xsens estimates kinematics using a combination of orientation and position data from the IMUs and their biomechanical model which incorporates joint characteristics and external contacts. In this way, they can update joint uncertainties and feedback updated orientation and position information to the sensor fusion algorithms. Xsens then outputs these estimated model kinematics, including the joint angles of the model at each time step. In our study, we were specifically looking at knee joint angle, so we extracted the Xsens-estimated knee rotation about the X,Y,Z axes.

We also worked through the upper pathway, using sensor orientation from the Xsens processing (prior to feedback with the biomechanical model) to estimate joint angles. This orientation data, output as quaternions, was translated into rotation matrices and input into an OpenSim IK C++ script that output various model kinematics. We specifically looked at the knee joint angle and used the gait10dof18musc OpenSim model (see below for a comparison of the Xsens vs. OpenSim knee model).


Comparing biomechanical models: Xsens vs. OpenSim Knee Model

Xsens Knee Model [1]

OpenSim Knee Model [2]

Xsens Knee Model [1]

OpenSim Knee Model [2]

  •  "Soft Hinge"

  • Allows for rotation in all planes
    but sagittal plan more statistically likely

  •  Single degree-of-freedom

  • Femoral, tibial, patellar transformations
    functions of knee angle


II. Knee Flexion Experiment

Experiment Set-up: Sitting Knee Flexion

  1. Open MVN Studio

  2. Attach the IMU straps with placement as instructed by Xsens

  3. Place the IMU sensors on the straps and sync with MVN Studio

  4. Insert subject's body measurements (initial estimates of joint positions)

  5. Calibrate IMUs in neutral pose (to express segment kinematics in the global frame the kinematics of the sensors must be subjected to a step of calibration wherein the orientation of the sensor module with respect to the segment and the relative distances between the joints are determined).

  6. Attach goniometer to the outside of the leg such that the center of rotation is at approximately the center of the knee joint

  7. Attach markers to rigid body segments to be used as tracking points 

  8. Set up camera to capture all markers and sagittal knee motion

  9. Have subject seated on high enough seat so that leg does not touch ground when knee is flexed at 90 degrees

  10. Subject should start with knee fully extended at ~0 degrees.  Flex knee at the following rates (cueing with metronome) for a full 10 seconds:
          Slow: 40 beats per minute
          Medium: 80 beats per minute
          Fast: 120 beats per minute

  11. To synchronize Xsens system with video marker data, we took another external video to get the time of button press when Xsens started and the time of the button press when the video started. With the external camera recording at 30 frames per second, we are able to synchronize our data by quantifying the number of frames between the start of each system. (See code below for more detail).

  12. In MVN Studio, export IMU data in an .mvnx file, ensuring that you include "Joint Angle" and "Motion Tracker Orientation" (check the boxes next to these selections)

Experimental Set-Up

Experimental Set-Up

Camera captures sagittal knee rotation.

Marker placement on leg.

~5 deg

~90 deg

2D video screen captures of the marker tracking for the subject's leg at knee angle in the fully extended position (~5 deg) versus fully flexed (~90 deg).

OpenSim is supported by the Mobilize Center , an NIH Biomedical Technology Resource Center (grant P41 EB027060); the Restore Center , an NIH-funded Medical Rehabilitation Research Resource Network Center (grant P2C HD101913); and the Wu Tsai Human Performance Alliance through the Joe and Clara Tsai Foundation. See the People page for a list of the many people who have contributed to the OpenSim project over the years. ©2010-2024 OpenSim. All rights reserved.