Development of a Wearable Glove System with Multiple Sensors for Hand Kinematics Assessment

In traditional hand function assessment, patients and physicians always need to accomplish complex activities and rating tasks. This paper proposes a novel wearable glove system for hand function assessment. A sensing system consisting of 12 nine-axis inertial and magnetic unit (IMMU) sensors is used to obtain the acceleration, angular velocity, and geomagnetic orientation of human hand movements. A complementary filter algorithm is applied to calculate the angles of joints after sensor calibration. A virtual hand model is also developed to map with the glove system in the Unity platform. The experimental results show that this glove system can capture and reproduce human hand motions with high accuracy. This smart glove system is expected to reduce the complexity and time consumption of hand kinematics assessment.


Introduction
Hand function assessment plays an essential role in the recovery of stroke patients. Rehabilitation of hand function always requires long-term training after medical treatment. Traditional hand function assessment methods that have been used by physicians include Fugl-Meyer assessment (FMA), the action research arm test (ARAT), Jebsen-Taylor test (JTT), or Wolf motor function test (WMFT) [1][2][3][4][5]. With these methods, the patients must carry out some prescribed actions to showcase their hand function, and rating scores are given according to the patients' performance. However, assessment with these methods often takes several hours to complete and does not reveal enough details during the rehabilitation process. Therefore, it is important to develop hand function assessment equipment that can help physicians make a quantitative analysis of patients' rehabilitation status.
One obvious solution to get hand gesture information is using a visual camera system [6][7][8]. The advantage of using such a system is that it does not require the patients to wear any equipment and it can capture the gesture information of multiple patients at the same time. The disadvantage is that it can only work effectively in good light conditions and its shooting angle is highly restricted by the local environment. IR or radar sensors can be another non-contact alternative for hand gesture capture or recognition [9,10].
In recent years, data gloves have been widely used in human-computer interaction studies [11]. With the advancement of sensor technology, the cost of data gloves has been greatly reduced to suit daily medical rehabilitation needs [12]. Depending on their working mechanism, data gloves can generally be divided into these main types: mechanical, flexible sensing, optical fiber sensing, and inertial sensing. A mechanical data glove can be considered as a type of glove-like haptic device with force feedback. Blake et al. proposed a haptic glove for virtual reality applications based on magnetorheological (MR) brakes in 2009 [13]. Ma et al. developed a five-finger haptic glove using a worm-geared motor in 2015 [14]. Chiri et al. developed a multi-phalange finger module for post-stroke rehabilitation in 2012 [15]. Gu et al. presented a low-cost exoskeleton glove with passive force feedback in 2016 [16]. Unlike that of mechanical data gloves, the performance of flexible sensing data gloves largely depends on the repeatability and linearity of the sensor itself. Kostas et al. presented a data glove with flexible sensors early in 2003 [17]. Togetti et al. presented a sensing glove made of conductive elastomer materials in 2006 [18]. Shen et al. also developed a soft stretchable bending data glove that incorporates a sensor based on ethylene propylene rubber (EPR) in 2016 [19]. However, the most successful commercial data glove systems today are mainly based on optical fiber sensors, such as CyberGlove and 5DT data gloves. Innovations have also occurred in the research community for the design of optical fiber data gloves. Fujiwara et al. discussed a low-cost and flexible optical fiber glove to measure joint angles in 2014 [20]. Da Silva et al. developed a sensing glove based on optical fiber Bragg grating (FBG) sensors in 2011 [21]. Although optical fiber-based data gloves such as CyberGlove and 5DT data gloves can provide sufficiently precise joint angle data for rehabilitation applications, they are still too expensive for daily rehabilitation at home. Low-cost MEMS-based inertial sensors have been investigated in a number of studies on data gloves or human interactions due to their ability to provide stable attitudes in a three-dimensional (3D) space and ease of integration with PCBs. Lin et al. presented a data glove system with six-axis inertial sensors for stroke evaluation [22,23]. Choi et al. developed a low-cost inertial measurement unit (IMU) wearable sensing glove [24]. Liu et al. designed a novel inertial and magnetic unit (IMMU)-based data glove with an optimized sensor layout [25]. The data glove system discussed in this paper aims to help physicians evaluate patients' hand function during rehabilitation. To get the joint angles of hand attitudes, 12 nine-axis inertial sensors are integrated with the Micro Controller Unit (MCU) and Universal Asynchronous Receiver/Transmitter (UART) modules on the glove. Several calibration algorithms are implemented to avoid errors caused by the accelerometer, gyroscope, and magnetometer. In addition, a human-computer interaction module is developed in the Unity platform. A grasping ball experiment is conducted to demonstrate how the glove system can be used to evaluate dynamic hand functions.

System Architecture
The workflow of our data glove system is demonstrated in Figure 1. First, the sensor units installed on the data glove obtain the raw information of hand movements. Then, the MCU controller initializes the data acquisition process, in which the sensor data are received with a Serial Peripheral Interface (SPI) bus and transmitted to the computer through a USB connection line or a Bluetooth transmitter. Finally, the data processing module verifies the data frames and calculates the angles of joints for hand function evaluation. Moreover, the human-computer interaction module uses the joint angle data to drive hand modeling in the Unity platform.

Hardware Design
The hardware of our data glove system includes several parts: (1) some IMMUs for capturing the angles of hand joints; (2) a microcontrol unit for data collection and transmission; (3) a USB connection wire or wireless Bluetooth transmitter; and (4) a PC or laptop for receiving sensor data and reconstructing hand motions. The MEMS-based sensors are uniquely suited for wearable applications due to their advantages of low power consumption, compactness, and high precision. MPU-9250 units from InvenSense, Inc. are used to capture the angles of joints when hand exercises are done. The nine-axis sensor MPU-9250 can be considered as a combination of a six-axis IMU and a three-axis compass, one is the six-axis IMU MPU6515, the other is the AK8963 3-axis magnetometer from Asahi Kasei Microdevices (AKM). The angular velocity range of the gyroscope is set to ±1000 • /s and the acceleration range of the accelerometer is set to ±8 g. The sample rate is set to 100 Hz for all the sensors, which is high enough to capture most human hand motions. To achieve better fusion performance, a multi-sensor fusion algorithm is developed to work with the onboard motion fusion processor that comes with MPU-9250. A Leonardo microprocessor chip is used to collect data from the IMMUs. The microprocessor controller has 21 in-out digital ports, 7 Pulse Width Modulation (PWM) ports and 6 analog input ports to connect with 12 sensors via an SPI bus, as shown in Figure 2. Both the wired UART connection and Bluetooth wireless connection are tested in our glove system. The results show that the wired UART connection is more efficient and reliable than Bluetooth wireless connection, especially at a high transmission rate.

Hardware Design
The hardware of our data glove system includes several parts: (1) some IMMUs for capturing the angles of hand joints; (2) a microcontrol unit for data collection and transmission; (3) a USB connection wire or wireless Bluetooth transmitter; and (4) a PC or laptop for receiving sensor data and reconstructing hand motions. The MEMS-based sensors are uniquely suited for wearable applications due to their advantages of low power consumption, compactness, and high precision. MPU-9250 units from InvenSense, Inc. are used to capture the angles of joints when hand exercises are done. The nine-axis sensor MPU-9250 can be considered as a combination of a six-axis IMU and a three-axis compass, one is the six-axis IMU MPU6515, the other is the AK8963 3-axis magnetometer from Asahi Kasei Microdevices (AKM). The angular velocity range of the gyroscope is set to ±1000°/s and the acceleration range of the accelerometer is set to ±8 g. The sample rate is set to 100 Hz for all the sensors, which is high enough to capture most human hand motions. To achieve better fusion performance, a multi-sensor fusion algorithm is developed to work with the onboard motion fusion processor that comes with MPU-9250. A Leonardo microprocessor chip is used to collect data from the IMMUs. The microprocessor controller has 21 in-out digital ports, 7 Pulse Width Modulation (PWM) ports and 6 analog input ports to connect with 12 sensors via an SPI bus, as shown in Figure 2. Both the wired UART connection and Bluetooth wireless connection are tested in our glove system. The results show that the wired UART connection is more efficient and reliable than Bluetooth wireless connection, especially at a high transmission rate.

Hardware Design
The hardware of our data glove system includes several parts: (1) some IMMUs for capturing the angles of hand joints; (2) a microcontrol unit for data collection and transmission; (3) a USB connection wire or wireless Bluetooth transmitter; and (4) a PC or laptop for receiving sensor data and reconstructing hand motions. The MEMS-based sensors are uniquely suited for wearable applications due to their advantages of low power consumption, compactness, and high precision. MPU-9250 units from InvenSense, Inc. are used to capture the angles of joints when hand exercises are done. The nine-axis sensor MPU-9250 can be considered as a combination of a six-axis IMU and a three-axis compass, one is the six-axis IMU MPU6515, the other is the AK8963 3-axis magnetometer from Asahi Kasei Microdevices (AKM). The angular velocity range of the gyroscope is set to ±1000°/s and the acceleration range of the accelerometer is set to ±8 g. The sample rate is set to 100 Hz for all the sensors, which is high enough to capture most human hand motions. To achieve better fusion performance, a multi-sensor fusion algorithm is developed to work with the onboard motion fusion processor that comes with MPU-9250. A Leonardo microprocessor chip is used to collect data from the IMMUs. The microprocessor controller has 21 in-out digital ports, 7 Pulse Width Modulation (PWM) ports and 6 analog input ports to connect with 12 sensors via an SPI bus, as shown in Figure 2. Both the wired UART connection and Bluetooth wireless connection are tested in our glove system. The results show that the wired UART connection is more efficient and reliable than Bluetooth wireless connection, especially at a high transmission rate.

Analysis of Hand Joints and Layout of Sensors
Human hand motions can be represented by the rotation of hand joints, so the number and position of IMMU sensors can be determined according to the anatomical struc-

Analysis of Hand Joints and Layout of Sensors
Human hand motions can be represented by the rotation of hand joints, so the number and position of IMMU sensors can be determined according to the anatomical structures of the hand. A human hand includes several types of bones and tissues such as muscles and ligaments. As shown in Figure 3, the joints of the index finger, middle finger, ring finger, and little finger of a human hand can be divided into three main categories: distal interphalangeal joint (DIP), proximal interphalangeal joint (PIP), and metacarpophalangeal joint (MP). As for the thumb, it only has two joints: interphalangeal joint (IP) and MP. The MP is connected to the carpometacarpal joint (CM) for hand rotation. IMMU sensors should be placed near the abovementioned joints to measure the bending status of fingers. An understanding of the parent-child relationship between joints is a prerequisite for analyzing finger motions. The movement of the parent joints has a knock-on effect on all the child joints. The local x-y-z coordinates should be established to describe the rotation of each joint, as shown in Figure 4. The bending of a finger can be defined as a rotation around the x-axis. Empirically, the bending angle of the DIP joint can be approximately considered as 1/3 of the bending angle of the PIP joint, which has no obvious influence on the reconstruction of hand gestures.
alyzing finger motions. The movement of the parent joints has a knock-on effect on all the child joints. The local x-y-z coordinates should be established to describe the rotation of each joint, as shown in Figure 4. The bending of a finger can be defined as a rotation around the x-axis. Empirically, the bending angle of the DIP joint can be approximately considered as 1/3 of the bending angle of the PIP joint, which has no obvious influence on the reconstruction of hand gestures. Therefore, 12 IMMU sensors are placed on hand phalanges and one IMMU sensor is placed on the back of the hand, as shown in Figure 4. Joint angles and hand gestures can be estimated by the orientation of 11 IMMU sensors. Two generations of data gloves have been developed in our lab. For the 1st generation glove, all the sensors are connected by soft wires; it is easy to fabricate but may suffer from sealing off and bad contact problems. For the 2nd generation data glove, a flexible PCB design is adopted to enhance the system's stability and reliability, as shown in Figure 5. The IMMU sensors are directly soldered on the flexible PCB without using any wire. Moreover, the flexible PCB is coated with a silicone layer to protect the electronic components from being corroded by moisture and sweat. The thickness of the silicone layer is set to 2 mm so as not to impair the flexibility of hand movements. The plug-in connector of the flexible PCB can be easily linked to a controller board. In this paper, the 1st generation data glove is used to demonstrate the feasibility of our algorithm and software.

Sensor Data Processing
The data processing is as follows: The microcontroller of the data glove sends the data from IMMU sensors to the computer frame by frame, and then the received data are Therefore, 12 IMMU sensors are placed on hand phalanges and one IMMU sensor is placed on the back of the hand, as shown in Figure 4. Joint angles and hand gestures can be estimated by the orientation of 11 IMMU sensors. Two generations of data gloves have been developed in our lab. For the 1st generation glove, all the sensors are connected by soft wires; it is easy to fabricate but may suffer from sealing off and bad contact problems. For the 2nd generation data glove, a flexible PCB design is adopted to enhance the system's stability and reliability, as shown in Figure 5. The IMMU sensors are directly soldered on the flexible PCB without using any wire. Moreover, the flexible PCB is coated with a silicone layer to protect the electronic components from being corroded by moisture and sweat. The thickness of the silicone layer is set to 2 mm so as not to impair the flexibility of hand movements. The plug-in connector of the flexible PCB can be easily linked to a controller board. In this paper, the 1st generation data glove is used to demonstrate the feasibility of our algorithm and software.

Sensor Data Processing
The data processing is as follows: The microcontroller of the data glove sends the data from IMMU sensors to the computer frame by frame, and then the received data are preprocessed by parity frame check and frame decoding. The raw sensor data must be calibrated before they can be fused. Since the environmental influence on accelerometers and gyroscopes is mostly negligible, the calibration parameters of the accelerometer and gyroscope can be used for a long time after initial calibration. Unlike the accelerometer and gyroscope, the magnetometer needs to be recalibrated because it is subjected to the disturbance from environmental ferromagnetic materials. The attitude of each IMMU sensor can be estimated with a multi-sensor fusion algorithm using calibrated acceleration, angular velocity, and geomagnetism data. The orientation of the IMMU sensors on the glove of left hand is as defined in Figure 6 with the International Society of Biomechanics (ISB) recommendations on definitions of joint coordinates [26].

Sensor Data Processing
The data processing is as follows: The microcontroller of the data glove sends the data from IMMU sensors to the computer frame by frame, and then the received data are preprocessed by parity frame check and frame decoding. The raw sensor data must be calibrated before they can be fused. Since the environmental influence on accelerometers and gyroscopes is mostly negligible, the calibration parameters of the accelerometer and gyroscope can be used for a long time after initial calibration. Unlike the accelerometer and gyroscope, the magnetometer needs to be recalibrated because it is subjected to the disturbance from environmental ferromagnetic materials. The attitude of each IMMU sensor can be estimated with a multi-sensor fusion algorithm using calibrated acceleration, angular velocity, and geomagnetism data. The orientation of the IMMU sensors on the glove of left hand is as defined in Figure 6 with the International Society of Biomechanics (ISB) recommendations on definitions of joint coordinates [26].

Sensor Calibration
Gyroscopes can be used to measure the rotation of hand joints with angular velocity. The angle of joint rotation can be calculated by integrating the angular velocity data over time. However, the error of angular velocity will accumulate after a long measurement process, resulting in a drift in the angle. Theoretically, the output value of a gyroscope should be zero after calibration without any motions. The zero deviation caused by the random error of the gyroscope can be estimated using the average filtering method. The corrected value of each axis can be obtained by subtracting the zero deviation error from the measured value. The error model of the gyroscope can be represented as follows: (1)

Sensor Calibration
Gyroscopes can be used to measure the rotation of hand joints with angular velocity. The angle of joint rotation can be calculated by integrating the angular velocity data over time. However, the error of angular velocity will accumulate after a long measurement process, resulting in a drift in the angle. Theoretically, the output value of a gyroscope should be zero after calibration without any motions. The zero deviation caused by the random error of the gyroscope can be estimated using the average filtering method. The corrected value of each axis can be obtained by subtracting the zero deviation error from the measured value. The error model of the gyroscope can be represented as follows: (1) where g x , g y , and g z denote the raw data of the gyroscope; g x_c , g y_c , and g z_c the corrected angular velocity data; g x_e , g y_e , and g z_e the zero bias of three axes. Possible errors of the accelerometer include zero deviation error, scale factor error, and non-orthogonal error. The accelerometer error model can be represented as follows [27]: where a i (i = x, y, z) denotes the raw data of the accelerometer; a i_c (i = x, y, z) the corrected acceleration data; b i (i = x, y, z) the zero bias; m ij (i = x, y, z; i = j) the scale error factor; m ij (i = x, y, z; j = x, y, z; i = j) the non-orthogonal error factor. The calibration error e(m xx , . . . , m zz , a x e , . . . , a z_e ) is defined as the residual between the squared sum of corrected acceleration and squared gravitational acceleration: Gauss-Newton's method is applied to estimate the unknown calibration parameters (m xx , . . . , m zz , a x_e , . . . , a z_e ) in this part. The iteration of calibration error can be represented by the following equation: where β k is the damping control factor, which is used to control the convergence speed of the iteration algorithm. A larger β k value means a faster convergence speed but lower accuracy. d k is defined as the iterative direction: where matrix J is defined as the Jacobian matrix of calibration error: When the iteration time reaches its maximum or the convergence condition is satisfied, the unknown calibration parameters can be estimated. With ε defined as the convergence threshold, the convergence condition can be represented as follows: e m xx , . . . , m zz , a x_e , . . . , a z_e < ε The external interference of a magnetic field can be divided into hard magnetic interference and soft magnetic interference. The hard magnetic interference would cause the measured data to deviate from the sphere origin as a whole. The soft magnetic interference would cause the shape of data distribution to change from a standard sphere to an ellipsoid. The error model of the magnetometer can be represented as follows: where m i (i = x, y, z) denotes the raw data of the magnetometer; m i_c (i = x, y, z) the corrected magnetic field data; c i (i = x, y, z) the hard magnetic calibration parameters; k i (i = x, y, z) the soft magnetic calibration parameters. The magnetometer should be rotated in all directions to find out the maximum and minimum values of each axis. The geomagnetic calibration parameters can be calculated as follows: where X max , X min , Y max , Y min , Z max , and Z min are the maximum and minimum values of three axes.

Sensor Fusion
Several methods are available for representing attitudes in space, such as Euler angle, direction cosine, and quaternion. The direction cosine method can be used to solve matrix transformations, but it requires extensive calculations. The Euler angle method is easy to understand, but it may cause the gimbal lock problem. The quaternion method is more efficient and requires fewer calculations compared to the other two methods. Since the update of the quaternion depends on the previous state, the acceleration and geomagnetism data in the static state is used to calculate the initial quaternion attitude. The initial pitch angle θ 0 and roll angle γ 0 can be calculated using the following equation:    θ 0 = arcsin a n y γ 0 = −arctan a n x a n z (11) Specifically, a n x a n y a n z T is the projection of gravitational acceleration from reference frame to carrier frame. Then, the initial yaw angle can be calculated with θ 0 , γ 0 , and the projection of magnetic field data m n x m n y m n z T as follows: When θ 0 γ 0 ϕ 0 T is confirmed, the initial quaternion can be calculated using the following equations: As proven by the calculation process of the initial Euler angle, the yaw, pitch, and roll angles can be calculated directly from the acceleration, angular velocity, and magnetic field data in the static state. However, when the sensor is in motion, extra linear acceleration is introduced, resulting in inaccurate calculation of the sensor's attitude. In addition, the integral drift still exists when angular velocity is used to calculate the attitude after sensor calibration. In this paper, a complementary filter algorithm is applied to solve the multi-sensor fusion problem [28,29]. The essence of multi-sensor fusion is to use the proportional-integral (PI) method to calculate the error between the estimated and measured values of acceleration and geomagnetism, and apply this error to correct the updated quaternion. The sensor fusion process is as shown in Figure 7.
As proven by the calculation process of the initial Euler angle, the yaw, pitch, and roll angles can be calculated directly from the acceleration, angular velocity, and magnetic field data in the static state. However, when the sensor is in motion, extra linear acceleration is introduced, resulting in inaccurate calculation of the sensor's attitude. In addition, the integral drift still exists when angular velocity is used to calculate the attitude after sensor calibration. In this paper, a complementary filter algorithm is applied to solve the multi-sensor fusion problem [28,29]. The essence of multi-sensor fusion is to use the proportional-integral (PI) method to calculate the error between the estimated and measured values of acceleration and geomagnetism, and apply this error to correct the updated quaternion. The sensor fusion process is as shown in Figure 7. is defined as the error caused by the acceleration data in carrier coordinates; it can be expressed as follows: where is the estimated acceleration in carrier coordinates. is defined as the error caused by the geomagnetic field data in carrier coordinates; it can be expressed as follows: where is the estimated geomagnetic field data in carrier coordinates. Then, the total error can be defined as: where v x v y v z T is the estimated acceleration in carrier coordinates.
where n x n y n z T is the estimated geomagnetic field data in carrier coordinates.
Then, the total error can be defined as: The angular velocity can be fixed using the following equations: where ω x ω y ω z T is the measured angular velocity from a gyroscope, and ω x ω y ω z T is the fixed angular velocity to update the quaternion matrix. The updated quaternion attitude q 0 q 1 q 2 q 3 T can be represented as follows: Finally, the Euler angle can be obtained using the following equations: where θ, γ, and ϕ are the pitch, roll, and yaw angles of a single IMMU sensor.

Experimental Results of Sensor Calibration and Fusion
Since all the IMMU sensors on the data glove are of the same model (MPU-9250), one of these sensors is used to demonstrate the experimental results of sensor calibration and fusion.
The comparisons of angular velocity data before and after calibration are shown in Figure 8. It can be seen that the zero bias of the gyroscope is reduced. However, the integral drift of the gyroscope still fails to be eliminated after a long period of time, which needs to be corrected by fusing the acceleration and geomagnetism data.
The comparisons of normalized acceleration data before and after calibration are shown in Figure 9. The theoretical value of normalized gravitational acceleration in the static state should be equal to 1. The accuracy of local gravitational acceleration is improved after calibration.
The geomagnetic field data should lie on the sphere equidistant from the center. The 3D scatter plots of the geomagnetic field data are shown in Figure 10. The comparisons of the geomagnetic field data on X-Y, X-Z, and Y-Z planes are shown in Figure 11. It can be seen that the data are distributed in a nearly elliptical shape before calibration, and in a nearly standard spherical shape after calibration.
As discussed earlier, the attitude angles of the inertial sensor can be calculated using a complementary filter algorithm. The attitude angles of the IMMU sensor in the static state are shown in Figure 12. The static accuracy of attitude angles is smaller than 1 • , which satisfies the application requirement of our data glove system.
The angular velocity can be fixed using the following equations: where is the measured angular velocity from a gyroscope, and is the fixed angular velocity to update the quaternion matrix. The updated quaternion attitude can be represented as follows: Finally, the Euler angle can be obtained using the following equations: where , , and are the pitch, roll, and yaw angles of a single IMMU sensor.

Experimental Results of Sensor Calibration and Fusion
Since all the IMMU sensors on the data glove are of the same model (MPU-9250), one of these sensors is used to demonstrate the experimental results of sensor calibration and fusion.
The comparisons of angular velocity data before and after calibration are shown in Figure 8. It can be seen that the zero bias of the gyroscope is reduced. However, the integral drift of the gyroscope still fails to be eliminated after a long period of time, which needs to be corrected by fusing the acceleration and geomagnetism data.
(a) The comparisons of normalized acceleration data before and after calibration are shown in Figure 9. The theoretical value of normalized gravitational acceleration in the static state should be equal to 1. The accuracy of local gravitational acceleration is improved after calibration. The geomagnetic field data should lie on the sphere equidistant from the center. The 3D scatter plots of the geomagnetic field data are shown in Figure 10. The comparisons of the geomagnetic field data on X-Y, X-Z, and Y-Z planes are shown in Figure 11. It can be seen that the data are distributed in a nearly elliptical shape before calibration, and in a The comparisons of normalized acceleration data before and after calibration are shown in Figure 9. The theoretical value of normalized gravitational acceleration in the static state should be equal to 1. The accuracy of local gravitational acceleration is improved after calibration. The geomagnetic field data should lie on the sphere equidistant from the center. The 3D scatter plots of the geomagnetic field data are shown in Figure 10. The comparisons of the geomagnetic field data on X-Y, X-Z, and Y-Z planes are shown in Figure 11. It can be seen that the data are distributed in a nearly elliptical shape before calibration, and in a nearly standard spherical shape after calibration.  As discussed earlier, the attitude angles of the inertial sensor can be calculated a complementary filter algorithm. The attitude angles of the IMMU sensor in the state are shown in Figure 12. The static accuracy of attitude angles is smaller tha which satisfies the application requirement of our data glove system.  As discussed earlier, the attitude angles of the inertial sensor can be calculated usi a complementary filter algorithm. The attitude angles of the IMMU sensor in the sta state are shown in Figure 12. The static accuracy of attitude angles is smaller than which satisfies the application requirement of our data glove system. The commercial HCM365B E-compass is used to evaluate the dynamic performanc of the IMMU sensor, as shown in Figure 13a. The output attitude angle curves o HCM365B and the IMMU sensor are very close, while the roll angle changes from 0° t 200°.  The commercial HCM365B E-compass is used to evaluate the dynamic performance of the IMMU sensor, as shown in Figure 13a. The output attitude angle curves of HCM365B and the IMMU sensor are very close, while the roll angle changes from 0 • to 200 • .
Micromachines 2021, 12, x FOR PEER REVIEW 12 of 19 Figure 12. Pitch, roll, and yaw angles in the static state (when pitch angle is set to 30°).
The commercial HCM365B E-compass is used to evaluate the dynamic performance of the IMMU sensor, as shown in Figure 13a. The output attitude angle curves of HCM365B and the IMMU sensor are very close, while the roll angle changes from 0° to 200°.

Human-Computer Interaction Using Data Glove
Real-time human-computer interaction is also a required function for patients while doing rehabilitation exercises at home. A series of virtual scenes needs to be established by the human-computer interaction module, including a virtual hand, movable virtual items, lights, and a background. After the virtual scenes are built, all the 12 IMMU sensors will be mapped to the joints of the virtual hand by converting sensor attitude angles into finger rotation angles. In this paper, a virtual hand is established in the Unity platform, as shown in Figure 14.

Human-Computer Interaction Using Data Glove
Real-time human-computer interaction is also a required function for patients while doing rehabilitation exercises at home. A series of virtual scenes needs to be established by the human-computer interaction module, including a virtual hand, movable virtual items, lights, and a background. After the virtual scenes are built, all the 12 IMMU sensors will be mapped to the joints of the virtual hand by converting sensor attitude angles into finger rotation angles. In this paper, a virtual hand is established in the Unity platform, as shown in Figure 14. The human interaction module includes the following three parts: (1) Virtual scene design: The virtual hand should be established according to the skeletal structure of the human hand. Some virtual items are also provided for practicing hand grasping motions.
(2) Sensor-joints mapping: 12 IMMU sensors need to be mapped to the corresponding joints. (3) Scripts: The scripts include finding joint objects in the hierarchical view, mapping sensors to model joints, receiving attitude angles, and displaying animations. The bending angles of the joints of the virtual hand are limited to a range that fits in with daily human hand motions. A schematic diagram showing the bending angles of different joints is provided in Figure 15.  The human interaction module includes the following three parts: (1) Virtual scene design: The virtual hand should be established according to the skeletal structure of the human hand. Some virtual items are also provided for practicing hand grasping motions.
(2) Sensor-joints mapping: 12 IMMU sensors need to be mapped to the corresponding joints. (3) Scripts: The scripts include finding joint objects in the hierarchical view, mapping sensors to model joints, receiving attitude angles, and displaying animations. The bending angles of the joints of the virtual hand are limited to a range that fits in with daily human hand motions. A schematic diagram showing the bending angles of different joints is provided in Figure 15.

Human-Computer Interaction Using Data Glove
Real-time human-computer interaction is also a required function for patients while doing rehabilitation exercises at home. A series of virtual scenes needs to be established by the human-computer interaction module, including a virtual hand, movable virtual items, lights, and a background. After the virtual scenes are built, all the 12 IMMU sensors will be mapped to the joints of the virtual hand by converting sensor attitude angles into finger rotation angles. In this paper, a virtual hand is established in the Unity platform, as shown in Figure 14. The human interaction module includes the following three parts: (1) Virtual scene design: The virtual hand should be established according to the skeletal structure of the human hand. Some virtual items are also provided for practicing hand grasping motions.
(2) Sensor-joints mapping: 12 IMMU sensors need to be mapped to the corresponding joints. (3) Scripts: The scripts include finding joint objects in the hierarchical view, mapping sensors to model joints, receiving attitude angles, and displaying animations. The bending angles of the joints of the virtual hand are limited to a range that fits in with daily human hand motions. A schematic diagram showing the bending angles of different joints is provided in Figure 15.  To validate the joint angle obtained by the data glove, the digital goniometer is used to measure the angle, as shown in Figure 16. One problem of using such a steel goniometer is that the magnetometer inside the IMMU sensor may be disturbed by nearby ferromagnetic materials. Therefore, the digital goniometer should be placed on the finger after the angle data have been exported from the data glove. To validate the joint angle obtained by the data glove, the digital goniometer is used to measure the angle, as shown in Figure 16. One problem of using such a steel goniomete is that the magnetometer inside the IMMU sensor may be disturbed by nearby ferromag netic materials. Therefore, the digital goniometer should be placed on the finger after th angle data have been exported from the data glove. The comparison of measurement results is represented in Table 1. The angles meas ured by goniometer and data glove are recorded when the index finger is held in fou different positions. The average error rate is less than 2% and the maximum deviation i nearly 1.4°. The accuracy of the data glove will be enough for most wearable applications Hand rehabilitation assessment, by the total active range of motion (TAM) method for example, requires the bending angle data of the joints, which can be calculated with the attitude angles of sensors on the data glove. Since the DIP joint has no sensor placed on it, its bending angle is empirically set to 1/3 that of the PIP joint. The relationship be tween the bending angles of joints and the attitude angles of sensors is represented in Table 2.  The comparison of measurement results is represented in Table 1. The angles measured by goniometer and data glove are recorded when the index finger is held in four different positions. The average error rate is less than 2% and the maximum deviation is nearly 1.4 • . The accuracy of the data glove will be enough for most wearable applications. Hand rehabilitation assessment, by the total active range of motion (TAM) method, for example, requires the bending angle data of the joints, which can be calculated with the attitude angles of sensors on the data glove. Since the DIP joint has no sensor placed on it, its bending angle is empirically set to 1/3 that of the PIP joint. The relationship between the bending angles of joints and the attitude angles of sensors is represented in Table 2. Specifically, S i (i = 1, 2, · · · , 12) represents the attitude angles of IMMU sensors around the x-axis. The experimental results of three hand gestures showing the numbers "2", "5", and "10" are provided in Figure 17. The hand gestures are captured and reconstructed with the virtual hand in Unity with high accuracy. The gesture data can be saved and exported by physicians for off-line diagnosis, as shown in Table 3. Specifically, ( = 1, 2, ⋯ , 12) represents the attitude angles of IMMU sensors around the x-axis. The experimental results of three hand gestures showing the numbers "2", "5", and "10" are provided in Figure 17. The hand gestures are captured and reconstructed with the virtual hand in Unity with high accuracy. The gesture data can be saved and exported by physicians for off-line diagnosis, as shown in Table 3.
between the physical ball and hand. The subject needs to pick up the ball and flip the hand several times. The changes in hand posture can be reviewed from the data of Sensor 8 on the back of the hand, as shown in Figure 19. The recovery status can be estimated from the recorded data, for example, the time taken for an action, the accuracy of an action, and the degree of hand tremor. The dynamic ball grasping experiment is demonstrated in Figure 18. The virtual ball and hand should be set in such original positions that their distance is the same as that between the physical ball and hand. The subject needs to pick up the ball and flip the hand several times. The changes in hand posture can be reviewed from the data of Sensor 8 on the back of the hand, as shown in Figure 19. The recovery status can be estimated from the recorded data, for example, the time taken for an action, the accuracy of an action, and the degree of hand tremor.   Four different data glove systems are compared with our proposed IMMU data glove, as listed in Table 4. It can be found that both the optical fiber sensor-based glove system and IMMU sensor-based data glove system can provide a good performance while measuring the joint angle. However, the cost of IMMU sensors is much less than optical fiber sensors for massive commercial wearable applications. Four different data glove systems are compared with our proposed IMMU data glove, as listed in Table 4. It can be found that both the optical fiber sensor-based glove system and IMMU sensor-based data glove system can provide a good performance while measuring the joint angle. However, the cost of IMMU sensors is much less than optical fiber sensors for massive commercial wearable applications.

Conclusions
This paper presents a novel data glove system to assess hand function during hand rehabilitation. 12 nine-axis inertial sensors are integrated in a data glove to obtain the angles of hand joints. The error models of the accelerometer, gyroscope, and magnetometer are analyzed. The least square principle is used to solve the correction parameters of the accelerometer. The validity of the calibration process is verified by comparing raw sensor data and calibrated data. A quaternion-based complementary filtering algorithm is applied to fuse the acceleration, angular velocity and geomagnetism data. A commercial Ecompass is also used to verify the stability and dynamic performance of our fusion algorithm.
Real-time and high-precision human-computer interaction is realized with the data glove and Unity. A virtual hand model, a ball model, and some virtual scenes are established in Unity, and then the attitude angles of 12 sensors are transformed into the rotation angles of hand joints. The experimental results show that the glove system can effectively measure hand postures and joint angles in motion, and it is expected to be used to develop a variety of rehabilitation scenarios to get patients more engaged in the long-term rehabilitation process.
Author Contributions: F.F. and D.Y. conceptualized the project; F.F. and G.Z. designed the methodology; S.X. and X.X. worked with the software; K.Y. and G.Z. performed validation; C.W. made the formal analysis; F.F. conducted investigation; F.F. provided the resources; F.F. performed data Figure 19. Hand posture changes during ball grasping experiment. Table 4. Comparison of proposed data glove and other data glove systems.

Conclusions
This paper presents a novel data glove system to assess hand function during hand rehabilitation. 12 nine-axis inertial sensors are integrated in a data glove to obtain the angles of hand joints. The error models of the accelerometer, gyroscope, and magnetometer are analyzed. The least square principle is used to solve the correction parameters of the accelerometer. The validity of the calibration process is verified by comparing raw sensor data and calibrated data. A quaternion-based complementary filtering algorithm is applied to fuse the acceleration, angular velocity and geomagnetism data. A commercial E-compass is also used to verify the stability and dynamic performance of our fusion algorithm.
Real-time and high-precision human-computer interaction is realized with the data glove and Unity. A virtual hand model, a ball model, and some virtual scenes are established in Unity, and then the attitude angles of 12 sensors are transformed into the rotation angles of hand joints. The experimental results show that the glove system can effectively measure hand postures and joint angles in motion, and it is expected to be used to develop a variety of rehabilitation scenarios to get patients more engaged in the long-term rehabilitation process.