Human Motion Intention Detection for an Active Rail-Driven Rehabilitation System

In this study, we propose a human motion intention detection algorithm for an automated rail-driven gait rehabilitation system. The automated rehabilitation system, under development by the authors, provides gait rehabilitation that supports a subject’s body weight with an active driving rail and an attachment to the ceiling. To provide proper body weight support and to monitor information according to the gait rehabilitation exercise, detecting the subject’s motional intent would be useful. The proposed detection algorithm uses a sensor unit, which includes a three-axis accelerometer, a gyroscope, and a magnetometer. The algorithm begins by estimating the sensor’s orientation with the sensor signals; the orientation is then transformed to a global frame from a sensor frame. The global frame acceleration signal is subtracted from 1 g to calculate motional acceleration. A specific cyclic pattern of global vertical acceleration is derived. The cyclic pattern is tracked with a state machine to detect standing up, sitting down, and walking. Standing up and sitting down motions are identified with downward and upward vertical velocity relations. The motions of walking, walking down stairs, and walking up stairs are discriminated with horizontal over vertical velocity ratios. The proposed algorithm was implemented on a PC and its functional feasibility was tested successfully on three healthy subjects.

In this study, we propose a human motion intention detection algorithm for an automated raildriven gait rehabilitation system. The automated rehabilitation system, under development by the authors, provides gait rehabilitation that supports a subject's body weight with an active driving rail and an attachment to the ceiling. To provide proper body weight support and to monitor information according to the gait rehabilitation exercise, detecting the subject's motional intent would be useful. The proposed detection algorithm uses a sensor unit, which includes a three-axis accelerometer, a gyroscope, and a magnetometer. The algorithm begins by estimating the sensor's orientation with the sensor signals; the orientation is then transformed to a global frame from a sensor frame. The global frame acceleration signal is subtracted from 1 g to calculate motional acceleration. A specific cyclic pattern of global vertical acceleration is derived. The cyclic pattern is tracked with a state machine to detect standing up, sitting down, and walking. Standing up and sitting down motions are identified with downward and upward vertical velocity relations. The motions of walking, walking down stairs, and walking up stairs are discriminated with horizontal over vertical velocity ratios. The proposed algorithm was implemented on a PC and its functional feasibility was tested successfully on three healthy subjects.

Introduction
Recently, inertial sensors based on low-cost micro-electromechanical systems (MEMS) have been used in various applications including human motion analysis. (1)(2)(3)(4)(5)(6)(7) A human motion intention detection algorithm is expected to provide useful information for an automated rail-driven gait rehabilitation system. The automated rehabilitation system, under development by the authors, provides gait rehabilitation that supports a subject's body weight with an active driving rail and an attachment to the ceiling. To provide proper body weight support and monitoring information according to the rehabilitation exercise, detecting the subject's motional intent is useful.
Various methods have been proposed to detect human motion with inertial sensors. (3,4) Static and dynamic states have been detected by motional acceleration, and the states were classified by tilt angle and motion acceleration level. (3) However, identifying the motions of standing up, sitting down, walking down stairs, and walking up stairs is still challenging, especially in real-time.
Ideally, motional acceleration in the global frame can be double-integrated to produce relative position with inertial navigation technology. (5) However, even small offsets are also integrated and produce severe unbounded position growth, known as drift, especially when low-cost MEMS inertial sensors are used. (6) However, more stable velocity information from the single integration of acceleration should provide useful information. In the case of a standing-up motion, it is considered that a large downward velocity precedes a large upward velocity. The relation is opposite in the motion of sitting down. It is also natural that the ratio of horizontal to vertical velocity is thought to be more dominant in the walking motion than in walking down stairs or walking up stairs.
In this study, we propose a human motion intention detection algorithm based on a sensor unit consisting of a three-axis accelerometer, a gyroscope, and a magnetometer. The targeted motions include standing up, sitting down, walking, walking down stairs, and walking up stairs. Motional acceleration based on a global frame is utilized to detect motions and classify their type.

Motion acceleration calculation
The proposed detection algorithm uses a sensor unit, which includes a three-axis accelerometer, a gyroscope, and a magnetometer (LSM9DS0, STMicroelectronics, Switzerland). The algorithm begins by estimating the sensor's orientation with the sensor signals; the orientation is then transformed to the global frame from the sensor frame. In this study, a computation effective 3D estimation algorithm is used as follows. The gyroscope's angular velocity is integrated to a relative 3D orientation. Because the gyroscope's offset is also integrated, the estimated orientation drifts as time passes. To compensate for this drift, another 3D orientation is calculated with the accelerometer and the earth magnetometer. (7) This second orientation is stable but inaccurate, especially when there is any motional acceleration or magnetic distortion. Therefore, these two orientations are averaged with a weighting in quaternion form. The orientation from the gyroscope is weighted more when the accelerometer output norm deviates significantly from 1 g.
The accelerometer output is rotated by the estimated 3D orientation from the sensor frame to the global frame. Then the global acceleration is subtracted from 1 g in the vertical axis to determine the pure motional acceleration. The motional acceleration in the global frame is used to detect human motion.

Human motion intention detection algorithm
In this study, the targeted human motions include standing up, sitting down, walking, walking up stairs, and walking down stairs. A specific cyclic pattern in vertical global acceleration is derived to detect these motions. In the case of standing up, the pattern shows small downward, large upward, large downward, and small upward acceleration peaks in sequence (Fig. 1). In the case of sitting down, it shows large downward, large upward, small downward, and small upward acceleration peaks (Fig. 2).
One cycle is divided into four sections (DOWN, UP, DOWN 2, and UP 2) according to the sign of the vertical acceleration. The boundaries of these sections are when the acceleration crosses zero as shown with arrows in Figs. 1 and 2. In some cases, the acceleration does not cross zero as shown with the first arrow in Fig. 1. In this case, pseudo-zero-crossing is used when the acceleration crosses a small threshold (0.02 g in this study).
The derived cycle is tracked with a state machine (Fig. 3). The state machine includes INIT, DOWN, UP, DOWN 2, UP 2, and STAND/SIT states. Basically, standing up and sitting down motions are tracked with a single cycle. Motions of walking, walking down stairs, and walking up stairs repeat the cycles for each walking stride consisting of two steps. Exceptionally but expectedly, some motions do not follow the full cycle. A time-out state is inserted to handle these cases.
During the DOWN, UP, DOWN 2, and UP 2 states, vertical and horizontal acceleration are integrated. These integrated accelerations correspond to relative velocities for the states and are used to identify the motion types. The STAND/SIT state corresponds to the state in which standing up or sitting down motion is tracked. Standing up and sitting down are discriminated by upward and downward velocity relations. If the DOWN 2 velocity is greater than the DOWN velocity, if the UP velocity is greater than UP 2 velocity, and if the UP velocity is greater than the DOWN 2 velocity, the motion is identified as standing up. A sitting down motion is identified in a similar manner.
To discriminate between walking, walking down stairs, and walking up stairs, the ratio of horizontal to vertical velocity is used. The absolute vertical and the horizontal velocities are summed during a stride. If the velocity ratio is greater than a threshold, the stride is identified as walking. If the velocity ratio is less than another threshold, the stride is identified as walking up stairs. Otherwise, the stride is identified as walking down stairs.

Experimental protocol
A motion set was designed to include the motions of standing up, sitting down, walking, walking down stairs, and walking up stairs (Fig. 4). All the motions except walking up and down stairs were repeated twice in a set. The motion set was repeated 12 times by three healthy subjects. For the stair walking motions, there were 11 stairs. The sensor was attached alternately to the subject's chest, front beltline, and right beltline.
The experimental procedure was explained to the subjects and they all signed an informed consent form before experiments. Raw sensor signals were transmitted to a PC and saved as text files. The saved data were processed with MATLAB (MATLAB 8.6, Mathworks, USA). Actual motional states were identified subjectively from the data display considering the experiment protocol. Motional states detected by the proposed algorithm were compared with the actual states.

Results and Discussion
All the standing up, sitting down, and walking strides were detected by the proposed algorithm. Some of the walking strides during the turning motions were tracked up to the STAND/SIT state but were rejected when their maximum acceleration magnitudes were checked. Standing up motions (216) and sitting down motions (215) were detected and identified correctly by the upward and downward velocity relations. One sitting down motion was not counted, since its data saving was finished before the motion ended.
The ratio of horizontal to vertical velocity for the motions of walking, walking down stairs, and walking up stairs shows significant but insufficient differences (Fig. 5). The box plot of a motion set shows an overall difference among the three types of motion. However, there were some overlapping data between the motion groups.
The accuracies for walking, walking down stairs, and walking up stairs were 87.4, 76.2, and 94.6%, respectively (Table 1). Walking down stairs shows the highest accuracy, while walking accuracy is the poorest. In particular, the walking up stairs with the sensor attached to the right beltline showed the poorest accuracy for subject 2. These results imply that the proposed algorithm is feasible but insufficient for discriminating the motions of walking, walking up stairs, and walking down stairs.

Conclusions
In this study, we proposed a human motion intention detection algorithm based on a sensor unit consisting of a three-axis accelerometer, a gyroscope, and a magnetometer. Standing up, sitting down, and walking stride were exactly detected by the proposed cyclic pattern. Standing up and sitting down motions were identified exactly from their vertical upward and downward velocity relations. Strides for walking, walking down stairs, and walking up stairs were classified by their horizontal to vertical velocity ratio. The results demonstrate feasibility but insufficient accuracy.