Development of an Inertial Measurement Unit based Finger Flexion Measurement System for Functional Electrical Stimulation based Finger Assistive System

Purpose – This research study examines the use of Inertial Measurement Unit (IMU) sensors for measuring finger range of motion (ROM) as an initial phase towards the creation of an effective feedback system for FES applications. Method – In this paper, a mounting system for IMU sensors designed for stroke patients has been developed. A calibration technique and an orientation estimation algorithm for


INTRODUCTION
The World Health Organization reports that around 15 million individuals worldwide suffer from stroke each year, with 5 million resulting in deaths and another 5 million resulting in lifelong disabilities (World Health Organization, 2022). Patients with disabilities suffer from hemiparesis (one-sided weakening) or hemiplegia (one-sided paralysis), this happens when the brain's connection to the different nerves of the body is damaged, impacting the functionality of the whole side of the body or specific body parts such as the face, arm, and leg. If these disabilities are not addressed through therapy, this increases the risk of muscular atrophy (weakening or loss of muscle mass) and joint contraction (stiffening of the joints) (Ding et al., 2018). The use of Functional Electrical Stimulation (FES) is one option for rehabilitating stroke patients.
FES is a procedure that involves applying an electrical current to the skin with the goal of stimulating nerves to induce muscle movement and control specific muscles or muscle groups, its applications include assistance in standing, limited ambulation, cycling, manual grasping, bowel and bladder control, male sexual and reproductive assistance, breath control, and airway clearance (Bhatia et al., 2011). Physical therapists employ the use of FES to increase muscle strength, range of motion, inhibit spasticity, and reeducate voluntary muscles (Kawashima et al, 2013).  Figure 1 is an FES based finger assistive system that Benatiro et al. (2020) and Poticar et al. (2022) proposed. The proposed system comprises of a matrix of electrodes controlled by a switching network and stimulation circuit that sends electrical impulses to the nerves to induce finger bending. The FES system's feedback method utilizes flexible bend sensors; when finger bending happens, the data is recorded and transmitted as a feedback signal to a microcontroller unit, which utilizes it to quantify the amount of finger flexion and for reinforcement learning.
The functional range of motion (ROM) of the finger joints is a variable that can be quantified to be able to evaluate and monitor FES induced finger rehabilitation. The finger ROM can be quantified in two ways: manually through traditional goniometry, and automated electronic methods. The numerous advantages and disadvantages of each method is discussed in the following sections.

Figure 2. Traditional Goniometry
Traditional Goniometry is a method utilized by physiotherapists to assess finger ROM as shown in Figure 2, it is a proven method for measuring the finger ROM and considered as the gold standard for measuring finger ROM (Hazman et al., 2020); however, goniometry is impractical in FES-based applications since an automated measurement system is required.

Electronic Methods for measuring finger Range of Motion
There are currently various electronic technologies for quickly quantifying finger ROM that are utilized by multiple studies, these include the use of flexible bend sensors, Camera/Depth-based sensors, and Inertial Measurement Unit (IMU) sensors.   Figure 3a., is a type of sensor for measuring flexion. As the sensor is bent or flexed, the top resistive layer and bottom digitating layer changes the resistance value of the sensor (Raol & Gopal, 2016). The advantage of using Flexible bend sensors for measuring finger ROM is that they are thin, lightweight, easily accessible, and low-cost. This means that it can easily be integrated in rehabilitation systems for measuring finger ROM due to its thin and lightweight nature. The disadvantage, however, is that it is made out of plastic material which was found to be a problem in terms of flexibility and its ability to revert to its initial position after being bent numerous times (Benatiro et al., 2020;Hazman et al., 2020). This can cause inconsistent and inaccurate measurements which can affect the efficacy of the rehabilitation systems. Moreover, it is only limited to the gross measurement of finger flexion, it cannot measure individual joint angles.
Camera/Depth-based sensors, shown in Figure 3b., is a type of non-contact method that employs the use of a camera for measuring finger ROM using motion capture analysis, these are regarded as the mature and dominant technology for measuring finger ROM. This type of system is advantageous in terms of its accuracy, which is essential in finger rehabilitation systems in order to track finger rehabilitation progress effectively.

2041
The disadvantage of this system is that it requires a time-consuming preparation, requires a wide area or laboratory setting to collect data, is largely dependent on its environment and lighting conditions, and is costly (Ye et al., 2016). The numerous disadvantages make this method an unsuitable option for measuring finger ROM that is portable and low-cost.
An IMU sensor, shown in Figure 3c., is an electronic device composed of an accelerometer, gyroscope, and magnetometer, these measure specific data such as linear acceleration, angular velocity, and magnetic field, respectively. This method measures orientation to establish hand and finger kinematics to assess finger ROM. This type of method is advantageous in terms of its cost, weight, and accessibility. Additionally, IMU sensors can be easily incorporated into glove-based designs for rehabilitation patients' ease of use. A common issue among IMU sensors is integration drift, and it is caused by the integration of the data captured from the IMU to obtain orientation (Latt et al., 2011). This issue, however, can be reduced if not eliminated by applying filters that other researchers have developed such as Madgwick, Kalman, and Complementary filters (Gui et al., 2015;Madgwick et al., 2011;Li & Wang, 2013).
From the methods discussed, the IMU sensor method is the most appropriate method for measuring finger ROM. It is easily accessible, low-cost, lightweight, and it can be easily integrated in a glove-based design that is useful for FES applications. Although IMU sensors have known issues of integration drift, it can be corrected by using techniques and technologies that other researchers have already developed.
Several studies for measuring hand and finger ROM incorporate the use of IMU sensors. Connolly et al. (2017) developed iSEG-Glove, an electronic goniometric glove for clinical finger movement analysis which used IMU sensors. Similarly, Lin et al. (2018) developed a modular data glove system that was capable of capturing finger and hand motion using IMU sensors. In another study by Lee et al. (2020), a clip-on IMU-based system was developed to evaluate age-related changes in hand functioning, the study's findings revealed that as people get older, slower hand movement is observed and there is more variances and kinematic changes in their hand functions. These studies were developed in glove-like form for ease of use and proved that IMU sensors can be an effective and consistent way of measuring finger ROM.
There are numerous research and advances involving IMU-based measurement of finger ROM; however, the majority of these are focused on non-FES applications. This is owing to the fact that studies on FES application for finger movements are limited due to its complexity, since there are more than 30 muscles involved in performing hand-related essential daily activities (Van Duinen & Gandevia, 2011). Hence, there is a need for further research with regards to an IMU-based measuring method for FES-induced finger ROM that can complement the current FES system.
To achieve an effective FES based finger assistive rehabilitation system necessitates an effective feedback method. This research study examines the use of IMU sensors for measuring finger ROM as an initial phase towards the creation of an effective feedback system for FES applications. The development includes an IMU mounting system, the IMU Calibration technique, and the joint angle measurement algorithm. To validate the joint angle measurement system and to guarantee that the measurement method is accurate, single IMU data validation, and dynamic angle verification using motion capture analysis is employed. The proposed measurement system has the potential for effectively monitoring finger rehabilitation progress for FES applications.

Calibration
A Magnetometer is an instrument that measures the strength of a magnetic field which can be utilized to determine direction. Magnetometers are helpful to obtain the heading of an object; however, magnetometers' data are often prone to offsets and distortion which require calibration.  Figure 4 shows the readings of the magnetometer pre-calibration. The data shows that the measurements are centered away from the origin and elliptical in shape indicating a data with offset and affected by distortion, respectively. Hence, there is a need to calibrate the magnetometer.
The magnetometer data is affected by two types of errors: hard and soft iron bias. Hard Iron bias comes from permanent magnetic fields such as magnets or magnetized materials, high-current wires, etc. which causes magnetometer sensor output to shift 2043 away from the origin. Soft iron bias comes from paramagnetic materials and ferrous materials that causes the entire sensor output to distort causing an ellipsoid shaped data.

Equation 1
To calibrate the magnetometer readings eq. 1 is used to obtain the calibrated magnetometer measurements , where is the pre-calibrated magnetometer measurements. The hard iron correction is first applied by removing the hard iron bias and then multiplying that to a symmetric matrix that accounts for the soft iron, scale factor, and misalignment corrections.
To identify the parameters for correction, a method called Least squares ellipsoid specific fitting algorithm developed by Li and Griffiths (2004) is employed, it is a method to obtain the best ellipsoid data and thereby, used to determine the parameters to correct the pre-calibrated magnetometer data.  Figure 5 shows the calibrated magnetometer data. The calibrated data is centered around the origin and the shape of the data is more spherical instead of elliptical, showing less distortion compared to the uncalibrated magnetometer data. The earth's magnetic field in the absence of any strong local magnetic fields is around 20 and 60 uT. In the calibrated magnetometer data, the maximum value is 45 uT which confirms that the method employed, and the resulting data is correct. Figure 6. Estimated Orientation Algorithm Prior to calculating the joint angle, the IMU sensors' orientation is estimated using the proposed estimation algorithm as shown in Figure 6. Ideally, the IMU sensors' orientation when laid perfectly flat is ; however, the IMU sensors when mounted to the hand and fingers are not flat. For this reason, the algorithm starts by capturing and storing the initial orientation of the sensors in the form of the initial gravity vectors . Sensor fusion is then applied to the IMU sensor data through a Sensor Fusion algorithm where the estimated Euler angles roll ( ), pitch ( ), and yaw ( ) is obtained. The estimated Euler angles are then used in the rotation matrix in conjunction with the initial gravity vectors wherein the result is the estimated orientation represented in a vector . The orientation estimation algorithm is implemented on all the IMU sensors. Equation 3 Equation 4 2045 Suppose there are two IMU sensors and mounted in two succeeding finger limbs shown in Figure 7, where their estimated orientation vectors are and , respectively. In obtaining the joint angle , the cross-product vector ( ) of the axis of rotation vector ( ) and the estimated orientation of the two IMUs ( and ) are calculated as shown in eq. 2. Then, the dot product of the resultant cross product vectors and is calculated as shown in eq. 3. Finally, the joint angle is calculated as shown in eq. 4. To validate the calibrated IMU data readings, the Euler Angles computed from the calibrated IMU data is compared to that with a protractor and potentiometer. As shown in Figure 8, the IMU sensor is attached to a potentiometer that is also attached to a protractor with varying position such that all the Euler Angles are included in the tests. Data is recorded from the readings of the IMU and protractor pointer every 10°. The resulting RMSE is then computed to check the performance.  Figure 9. Single IMU Data Validation Euler Angles Verification Plot Shown in Figure 9 are the plots of the Single IMU Data Validation where the Actual and Estimated Euler Angles are recorded every 10 degrees. Table 1 shows the RMSE of each Euler Angle recording. The result shows that the Pitch and Roll angles has a <1° RMSE while the Yaw angle has a higher 2° RMSE. The Pitch and Roll angles are dependent on the Accelerometer and Gyroscope readings while the Yaw Angle is dependent on the Accelerometer, Gyroscope, and Magnetometer readings. Although the Yaw Angle RMSE has a higher 2° RMSE compared to the Pitch and Roll angle RMSE which are far lower, it is already sufficient for our application. Hence, the calibration technique for the IMU sensor is effective. The design of the IMU mounting system in this study is aimed at customization, extensibility, and stability. The mounting system consists of 3 main parts: the IMU holder, the finger ring, and the dorsal semi-glove. The goal of the mounting system is to be able to attach IMU sensors on the fingers and hand of the rehabilitation patients.

IMU Mounting System
As shown in Figure 10, the IMU holder is used to keep the IMU sensor and its connecting wires in place. The finger ring is worn by the users in their fingers. For customizability, the finger rings are designed in varying finger size/diameter from 10 mm to 20 mm, this allows users to choose specific sizes that are suitable to them. The finger ring is printed using an extensible/flexible material to provide extra comfort to the users and reduce disruptions during hand and finger movements. Once the users get their suitable ring size, the IMU holder is then attached to the finger ring and locked in place at the mount by twisting, this ensures the stability of the IMUs during finger and hand movements such that the sensors do not slip to avoid errors in finger ROM data. Figure 11. IMU Mount As shown in Figure 11, the final IMU mounts are 3D printed and attached on the hand and fingers. The dorsal semi-glove is locked in placed using a Velcro for ease of use. The finger rings are worn by the users with ease depending on their ring size. Once the dorsal semi-glove and finger rings are worn, the IMU sensors are locked in place.
In this study, the mounting designs were created by considering the intended users which are, stroke patients. Although there are numerous studies (Connolly et al., 2017;Lin et al., 2018;Lee et al., 2020) that have incorporated IMU sensors for measuring finger ROM, their designs were glove-based. Glove-based designs covers the whole hand which is bulky and a hassle to attach to patients suffering from stroke since stroke patients' fingers and hands are stiff; for that reason, a ring design and a dorsal side semi-glove is created which can be easily worn by stroke patients with the assistance of rehabilitation professionals.  Figure 12 shows the setup of the validation of the joint angle measurement algorithm, the IMU sensors are mounted on the glove and rings. The setup consists of a camera that will capture the flexion of the fingers. For the purpose of motion capture analysis, markers are placed on each finger joint to identify the position of the finger joints which is then used to measure the joint angles for validation. The validation is implemented by using the IMU sensors and motion capture to measure finger joint angles from their relaxed to fully flexed state. The data of the two methods are then validated by measuring the Root Mean Squared Error (RMSE) and Pearson's correlation coefficient which shows the validity of the developed method.  Figure 13 is the Joint Angle Measurement validation plot result using the motion capture and IMU data. The resulting RMSE is 5.3° while the Pearson's correlation coefficient is 0.9979. There is a significant RMSE but a very high positive correlation. It can be observed in the extremities of the plot that there is a constant offset which causes the RMSE of 5.3°.

CONCLUSIONS AND RECOMMENDATIONS
This research study examines the use of IMU sensors for measuring finger ROM as an initial phase towards the creation of an effective feedback system for FES applications.
In this paper, an IMU mounting system intended for ease of use of stroke patients that is not present in current systems has been developed. It is customizable to cater different user sizes and is flexible for user comfort. Compared to prior research, which employed glove-based designs that are bulky, it is more convenient to use. Although the design is sufficient and working for experiment purposes, the grip of the ring designs can still be improved, which can affect the accuracy of the joint angle measurement data.
The calibration procedures and orientation estimation algorithm developed and applied to the IMU sensors have great performance, as indicated by a <1° RMSE for the pitch and roll angles, and a 2° RMSE for the yaw angle in the single IMU data validation findings. Regarding the accuracy of the developed IMU-based joint angle measurement system the RMSE is at 5.3° with a Pearson correlation coefficient of 0.9979. Although the results show that there is a significant RMSE, there is also a very high positive correlation, indicating that the IMU and Motion Capture data have a strong linear correlation wherein the data have the same changes in terms of strength and direction specifically the value of the joint angle. It can be observed in the validation data results that there is a systematic offset which influences the 5.3° RMSE, which could be caused by the imperfect attachment of the markers; this can be fixed by improving the motion capture analysis calibration.