A human gait detection method based on MEMS inertial sensor
Patent Information
- Application Number
- CN202311305400.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-10-10
AI Technical Summary
然而,由于噪声积累以及数据漂移等因素的影响,现有的行人惯性导航技术往往无法长时间对人体姿态进行精确跟踪
[0047]1、本发明针对利用惯性传感器数据进行的人体行进轨迹跟踪和相关步态信息提取中存在的问题,通过将传统的均值滤波、惯性滤波、零速检测算法、梯度下降算法和卡尔曼滤波算法以及创新提出的基于上述算法的姿态角线性偏移校正算法和速度校正算法有机地融合在一起,依次对数据进行滤波和校正,可以有效减少误差和噪声对数据带来的影响,使得数值积分后的位移数据保持相对稳定而不产生发散的结果,从而能够有效解决数据处理中遇到的传感器姿态角数据存在线性偏移的问题以及传感器加速度数据、速度数据和位移数据存在较大误差的问题。
Smart Images

Figure CN117297592B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pedestrian inertial navigation technology, specifically relating to a human gait detection method based on MEMS inertial sensors. Background Technology
[0002] Inertial sensors are used to detect and measure acceleration, tilt, impact, vibration, rotation, and multi-degree-of-freedom motion, and are crucial components for navigation, orientation, and control of moving vehicles. Micro-Electro-Mechanical Systems (MEMS) inertial sensors, characterized by their small size, low power consumption, and low cost, have become a hot research topic. Common MEMS inertial sensors include MEMS accelerometers and MEMS gyroscopes. MEMS accelerometers measure linear acceleration, while MEMS gyroscopes measure rotational angular velocity.
[0003] Pedestrian inertial navigation refers to the use of inertial sensors to measure information such as acceleration and angular velocity during human movement, combined with the principles of inertial navigation, to measure human motion. However, due to factors such as noise accumulation and data drift, existing pedestrian inertial navigation technologies often cannot accurately track human posture for extended periods. Summary of the Invention
[0004] In view of this, the present invention provides a human gait detection method based on MEMS inertial sensors, which realizes the tracking of human walking trajectory and the acquisition of relevant data such as step frequency, stride length and walking speed.
[0005] This invention provides a human gait detection method based on MEMS inertial sensors, comprising the following steps:
[0006] Step 1: Initially remove high-frequency noise from the original acceleration and angular velocity data, calculate the magnitudes of acceleration and angular velocity respectively, and then calculate the acceleration variance in a set series of frames based on the magnitudes of acceleration and angular velocity. and angular velocity variance
[0007] Step 2: Establish acceleration magnitude criterion, acceleration magnitude variance criterion, angular velocity magnitude criterion, and angular velocity magnitude variance criterion using the zero-velocity detection method. When the acceleration variance... and angular velocity variance If all four criteria are met, the current time is determined to be within the zero-speed interval;
[0008] Step 3: For attitude angle data along any axis, starting from time zero, calculate the average value of the attitude angle along that axis in each zero-velocity interval, and record the average value of the corresponding zero-velocity interval duration. Correct the linear offset of the attitude angles in the three axes;
[0009] Step 4: Establish the iterative relationship of sensor attitude quaternions:
[0010]
[0011] Where, q k and q k+1 T respectively k Time and T k+1 Time sensor attitude quaternion; Δt = T k+1 -T k , For q k The transformation matrix in quaternion multiplication; establishing the error function E when the sensor is stationary or moving slowly. g (q), the error function E is solved using the gradient descent method. g (q) The smallest quaternion q is the quaternion q closest to the true value; then the corrected sensor attitude quaternion q is converted into the corresponding attitude angle θ. q The new attitude angle is obtained by fusing it with the attitude angle obtained in step 3.
[0012] Step 5: Starting from time zero, sequentially calculate the acceleration within each zero-velocity interval. The correction is set to zero, and at the same time, acceleration is compensated using data from adjacent motion intervals. Deviations arising during the correction process;
[0013] Step 6: Use Kalman filtering to estimate the acceleration deviation. Deviation from speed The measured values obtained in step 5 are compared separately. Calculated values of speed Summing yields a more accurate estimate of the acceleration. and speed estimates
[0014] Step 7: Assume the ending times of the (k-1)th zero-velocity interval and the kth zero-velocity interval are respectively and The duration of the gait cycle consisting of the kth zero-velocity interval and the kth movement interval is:
[0015]
[0016] The reciprocal of the gait period is the step frequency of that gait period;
[0017] Suppose that the displacements corresponding to the final moments of the (k-1)th zero-velocity interval and the kth zero-velocity interval are respectively and The stride length of the gait cycle consisting of the kth zero-velocity interval and the kth movement interval is:
[0018]
[0019] The step size L of the gait cycle k With respect to the duration ΔT of the gait cycle k Dividing by this, we can obtain the gait speed for this gait cycle:
[0020]
[0021] If the duration of the current zero-speed interval does not exceed the threshold, the result of uniformly filtering the step frequency, stride length, and step speed is the human gait, and the process ends; otherwise, the step frequency, stride length, and step speed are all set to zero as the human gait, and the process ends.
[0022] Furthermore, the initial method for removing high-frequency noise from the original acceleration and angular velocity data is to use inertial filtering and mean filtering.
[0023] Furthermore, the acceleration modulus criterion zs 1,k As shown in the following formula:
[0024]
[0025]
[0026] Where k is the sampling time, |a k | represents the magnitude of acceleration at time k, a x,k a y,k and a z,k These are the acceleration information along the x, y, and z axes at time k; and These are the maximum and minimum threshold values for the acceleration modulus, respectively.
[0027] Furthermore, the acceleration magnitude variance criterion zs 2,k As shown in the following formula:
[0028]
[0029]
[0030] in, Let k be the variance of the acceleration magnitude at the midpoint of the sampling time. Let |a| be the mean of the acceleration magnitudes. i | represents the acceleration magnitude at sampling time i. This is the maximum threshold for the variance of the acceleration magnitude.
[0031] Furthermore, the angular velocity magnitude criterion zs 3,k As shown in the following formula:
[0032]
[0033]
[0034] Where, ω x,k ω y,k and ω z,k These are the angular velocity components along the x, y, and z axes at time k, respectively, |ω k | represents the magnitude of the angular velocity, ω th The maximum threshold value of angular velocity magnitude.
[0035] Furthermore, the angular velocity magnitude variance criterion zs 4,k As shown in the following formula:
[0036]
[0037]
[0038] in, Let k be the variance of the magnitude of the angular velocity at the midpoint of the sampling time. The mean of the angular velocity magnitude, |ω i | represents the magnitude of the angular velocity at sampling time i. This is the maximum threshold for the variance of the angular velocity magnitude.
[0039] Furthermore, step 3, which involves correcting the linear offset of the attitude angles along the three axes, specifically includes the following steps:
[0040] Step 3.1: Starting from time zero, select the first zero-velocity interval and obtain the duration T of this zero-velocity interval. zs ;
[0041] Step 3.2: Determine if the zero-speed interval is the last zero-speed interval. If it is, proceed to step 3.3; otherwise, when the length T... zs Time T exceeding the maximum threshold max If the time interval is T, it is determined that the human body is not walking but standing, and the data of the previous continuous motion needs to be corrected, proceeding to step 3.3; when the duration T of a certain zero-speed interval... zs The maximum threshold time T has not been exceeded max If the time is right, it is determined that the human body is in a continuous walking state, the next zero-speed interval is selected, and the duration T of the zero-speed interval is obtained. zs Proceed to step 3.2;
[0042] Step 3.3: Using the least squares method, the average attitude angles of the first m zero-velocity intervals are successively fitted with straight lines. and duration The relationship between them is maintained until the fitting error exceeds the maximum threshold θ. max If the fitting continues, the straight line obtained from the most recent fitting will be used as the offset, and the offset will be removed from the attitude angle to complete the attitude angle correction.
[0043] Furthermore, in step 4, the new attitude angle is obtained by fusing it with the attitude angle obtained in step 3. The specific method is as follows:
[0044]
[0045] Where, θ zs The attitude angle after zero-velocity interval correction in step 3 is η∈(0,1), which is the fusion parameter and can be adjusted according to the fusion effect.
[0046] Beneficial effects:
[0047] 1. This invention addresses the problems in human trajectory tracking and gait information extraction using inertial sensor data. By organically integrating traditional mean filtering, inertial filtering, zero-velocity detection algorithms, gradient descent algorithms, and Kalman filtering algorithms, along with innovative attitude angle linear offset correction algorithms and velocity correction algorithms based on the above algorithms, the data is filtered and corrected sequentially. This effectively reduces the impact of errors and noise on the data, ensuring that the displacement data after numerical integration remains relatively stable without diverging. Thus, it effectively solves the problems of linear offset in sensor attitude angle data and large errors in sensor acceleration, velocity, and displacement data encountered in data processing.
[0048] 2. This invention proposes a linear attitude angle offset correction algorithm based on the zero-speed interval. By calculating the average time and the average angle of each axial attitude angle within the zero-speed interval, the data is fitted using the least squares algorithm and removed as a linear error. This provides a solution to the linear attitude angle offset problem and effectively solves the problem that subsequent data cannot be properly processed and calculated due to linear data drift.
[0049] 3. This invention proposes a speed correction algorithm based on the zero-speed interval. By setting the speed data in the zero-speed interval to zero and distributing the deviation generated by the "zeroing" operation between two adjacent zero-speed intervals evenly within the motion interval, it solves the problem of zero-speed interval data error. This eliminates the error in the zero-speed interval while ensuring a certain degree of data continuity, improves the accuracy of the data, and lays a good data foundation for subsequent Kalman filtering and numerical integration. Attached Figure Description
[0050] Figure 1 The flowchart illustrates a human gait detection method based on a MEMS inertial sensor provided by this invention.
[0051] Figure 2 This is a schematic diagram illustrating the effect of the zero-velocity detection algorithm of the human gait detection method based on MEMS inertial sensors provided by the present invention.
[0052] Figure 3 This is a schematic diagram of the attitude angle change curve before correction.
[0053] Figure 4 This is a schematic diagram of the attitude angle change curve after correction using the human gait detection method based on MEMS inertial sensors provided by the present invention.
[0054] Figure 5 This is a schematic diagram of the acceleration change curve before correction.
[0055] Figure 6 This is a schematic diagram of the acceleration change curve after correction using the human gait detection method based on MEMS inertial sensors provided by the present invention.
[0056] Figure 7 This is a schematic diagram of the human body's walking trajectory curve.
[0057] Figure 8 This is a schematic diagram of the waveform curve of human gait information after correction using the human gait detection method based on MEMS inertial sensors provided by the present invention. Detailed Implementation
[0058] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0059] For ease of describing the technical solution provided by this invention, the following definitions are used:
[0060] In the process of human gait detection, the posture sensor is fixed to the ankle to detect the human walking process. The navigation coordinate system is established with the standing position of the human before walking as the origin, and the positive directions of the X-axis, Y-axis and Z-axis as the front, right and bottom of the human body when standing vertically. Then, the carrier coordinate system is established with the center of the inertial sensor chip as the origin, and the positive directions of the X-axis, Y-axis and Z-axis as the right, front and top of it.
[0061] In the established carrier coordinate system, assume T k-1 The acceleration of the time sensor in the carrier coordinate system is... angular velocity is The rotation matrix from the vehicle coordinate system to the navigation coordinate system is R. k-1So in T k The following expression holds true at time:
[0062]
[0063]
[0064]
[0065]
[0066] Where, Δt=T k -T k-1 ;R k For T k The rotation matrix at time step; For T k The value of the acceleration experienced by the time sensor in the navigation coordinate system; For T k The value of the acceleration experienced by the sensor at any given time in the carrier coordinate system; g is the acceleration due to gravity; For T k The speed of the time sensor in the navigation coordinate system; For T k-1 The speed of the time sensor in the navigation coordinate system; For T k-1 The value of the acceleration experienced by the time sensor in the navigation coordinate system; For T k Displacement of the time sensor in the navigation coordinate system; For T k-1 The displacement of the time sensor in the navigation coordinate system; [·] × Let be the cross product transformation matrix of vectors, for any satisfy Its specific transformation rules are as follows:
[0067]
[0068] in, For vectors The cross product transformation matrix.
[0069] This invention provides a human gait detection method based on MEMS inertial sensors, the process of which is as follows: Figure 1 As shown, the specific steps include:
[0070] Step 1: Initially remove high-frequency noise from the original acceleration and angular velocity data using inertial filtering and mean filtering methods. The processing steps are shown in formulas (1) and (2):
[0071]
[0072]
[0073] Where x represents a physical quantity, specifically the acceleration value a or angular velocity value ω along each axis; k Let x be the original value of the physical quantity x at time k; Let x be the filtered value of the physical quantity x at time k; α and m are the relevant parameters for inertial filtering and mean filtering, respectively.
[0074] Step 2: Calculate the magnitudes of acceleration and angular velocity respectively, and then use the zero-velocity detection method to establish acceleration magnitude criterion, acceleration magnitude variance criterion, angular velocity magnitude criterion, and angular velocity magnitude variance criterion. When all four criteria are met, it is determined that the current moment is within the zero-velocity interval.
[0075] Among them, the acceleration magnitude, acceleration magnitude variance criterion, angular velocity magnitude criterion, and angular velocity magnitude variance criterion established using the zero-velocity detection method are as follows:
[0076] Acceleration Magnitude Criterion zs 1,k As shown in formulas (3) and (4):
[0077]
[0078]
[0079] Where k is the sampling time, |a k | represents the magnitude of acceleration at time k, a x,k a y,k and a z,k These are the acceleration information along the x, y, and z axes at time k; and These are the maximum and minimum threshold values for the acceleration modulus, respectively.
[0080] Acceleration magnitude variance criterion zs 2,k As shown in formulas (5) and (6):
[0081]
[0082]
[0083] in, Let k be the variance of the acceleration magnitude at the midpoint of the sampling time. Let |a| be the mean of the acceleration magnitudes. i | represents the acceleration magnitude at sampling time i. This represents the maximum threshold for the variance of the acceleration magnitude.
[0084] Angular velocity magnitude criterion zs3,k As shown in formulas (7) and (8):
[0085]
[0086]
[0087] Where, ω x,k ω y,k and ω z,k These are the angular velocity components along the x, y, and z axes at time k, respectively, |ω k | represents the magnitude of the angular velocity, ω th The maximum threshold for the magnitude of angular velocity;
[0088] Angular velocity magnitude variance criterion zs 4,j As shown in formulas (9) and (10):
[0089]
[0090]
[0091] in, Let k be the variance of the magnitude of the angular velocity at the midpoint of the sampling time. The mean of the angular velocity magnitude, |ω i | represents the magnitude of the angular velocity at sampling time i. This is the maximum threshold for the variance of the angular velocity magnitude.
[0092] Human walking is typically a continuous, alternating, and periodic movement. Therefore, the gait characteristics of both feet are usually similar. For each leg, a gait cycle is generally divided into a motion interval and a zero-speed interval. In the zero-speed interval, the foot remains relatively stationary with respect to the ground, experiencing only gravitational acceleration. At this time, the foot's velocity should be zero. Furthermore, the posture of the foot should remain unchanged within a zero-speed interval. Therefore, the zero-speed interval during human walking can be determined using acceleration magnitude criterion, acceleration magnitude variance criterion, angular velocity magnitude criterion, and angular velocity magnitude variance criterion.
[0093] First, the magnitudes of acceleration and angular velocity can be obtained using formulas (11) and (12) respectively. and |ω k |:
[0094]
[0095]
[0096] For example, by taking m = 7, the acceleration magnitude can be obtained separately. and angular velocity magnitude |ω k|Acceleration variance in 15 consecutive frames of data and angular velocity variance
[0097]
[0098]
[0099] Then, based on the above four criteria, formula (15) can be used to determine whether the current moment is within the zero velocity interval, that is:
[0100] zs k =zs 1,k ×zs 2,k ×zs 3,k ×zs 4,k (15)
[0101] Among them, zs k Let zs be the state judgment variable in the zero-velocity interval at time k. k A value of 1 indicates that time k is within the zero velocity range, when zs k A value of 0 indicates that time k is not within the zero velocity range.
[0102] For example, take respectively ω th =200、 This yields the zero-speed state determination variable. To ensure the continuity of the zero-speed interval and movement interval within each gait cycle, and to guarantee that there is only one zero-speed interval within each gait cycle, the zero-speed state determination variable needs to be uniformly filtered, and the filtered data rounded to obtain the following result: Figure 2 The adjusted zero-speed state judgment variable is shown. When the zero-speed state judgment variable is 1, it means that the sensor-wearing leg is in the zero-speed range during walking; when the zero-speed state judgment variable is 0, it means that the sensor-wearing leg is in the motion range during walking.
[0103] Step 3: Correct the linear offset of attitude angles based on the zero-speed interval.
[0104] Because sensors inherently exhibit zero-point drift and are susceptible to high-frequency noise, even calculating the sensor attitude angle θ using simple matrix multiplication will result in time-varying behavior. Figure 3 As shown, further correction is needed. Furthermore, because the performance of the gyroscopes and the disturbances they experience differ across the three axes, the degree of attitude angle data offset also varies in each axis. Therefore, the attitude angles in each of the three axes need to be corrected separately to further reduce the offset error.
[0105] For attitude angle data along a single axis, starting from time zero, the average attitude angle along that axis is calculated sequentially within each zero-velocity interval, and the average duration of the corresponding zero-velocity interval is recorded. In this invention, the average attitude angle of the k-th zero-velocity interval is denoted as... θ is the attitude angle, and the average value of the corresponding zero-velocity interval duration is denoted as .
[0106] T k Rotation matrix R corresponding to the attitude angle of the time sensor k for:
[0107]
[0108] The linear attitude angle offset correction based on zero-velocity interval includes the following steps:
[0109] Step 3.1: Starting from time zero, select the first zero-velocity interval and obtain the duration T of this zero-velocity interval. zs .
[0110] Step 3.2: Determine if the zero-speed interval is the last zero-speed interval. If it is, proceed to step 3.3; otherwise, compare the duration T of the zero-speed interval. zs With the set threshold T max The size relationship. When the length T zs Time T exceeding the maximum threshold max If the time interval is T, it is determined that the human body is not walking but standing, and the data of the previous continuous motion needs to be corrected, proceeding to step 3.3; when the duration T of a certain zero-speed interval... zs The maximum threshold time T has not been exceeded max If the time is right, it is determined that the human body is in a continuous walking state, the next zero-speed interval is selected, and the duration T of the zero-speed interval is obtained. zs Proceed to step 3.2.
[0111] Step 3.3: Using the least squares method, the average attitude angles of the first m zero-velocity intervals are successively fitted with straight lines. and duration The relationship between them is maintained until the fitting error exceeds the maximum threshold θ. max If the walking path turns at this point, the fitting will stop and the straight line obtained in the previous fitting round will be used as the offset. The offset will be removed from the attitude angle to complete the attitude angle correction.
[0112] Specifically, when the human body walks along a straight line, the fitting error is usually not too large; however, when the human body turns during walking, fitting the angle sequence as a straight line will produce a large error. Therefore, this invention calculates the fitting error for each longer time period (t1-t2, t1-t3, t1-t4, etc.) until the fitting error (e.g., the fitting error for the t1-t100 time period) exceeds a set threshold. Then, it is determined that the human body started to turn at t100, and the human body's walking path is a straight line during the t1-t99 time period. Therefore, the straight line fitted during the t1-t99 time period is removed as a linear offset of the whole.
[0113] The attitude angle waveform curve after correction using the above steps is as follows: Figure 4 As shown.
[0114] Step 4: Correct the attitude angle based on the gradient descent method.
[0115] Based on the angular velocity ω measured by the gyroscope, the rotational relationship between the carrier coordinate system and the navigation coordinate system can be represented using quaternions. Then, the quaternion differential equations related to the sensor attitude changes can be established as follows:
[0116]
[0117] Where q = q0 + q1i + q2j + q3k is the attitude quaternion; q ω =0+ω x i+ω y j+ω z k is the angular velocity ω=[ω x ω y ω z ] T Quaternion form in the carrier coordinate system; Ω ω For q ω The transformation matrix in quaternion multiplication is related to the angular velocity ω as follows:
[0118]
[0119] Since the data in the human gait detection process of this invention is discrete data, the iterative form of the sensor attitude quaternion can be obtained as follows:
[0120]
[0121] Where, q k and q k+1 T respectively k Time and T k+1 Time sensor attitude quaternion; Δt = T k+1 -T k .
[0122] Using the "Northeast Earth" coordinate system as the commonly used navigation coordinate system, and assuming that the sensor is only subjected to gravitational acceleration g in this commonly used navigation coordinate system, the quaternion representation is q. g =[0 0 0 1] T Then, through the quaternion q of the attitude angle g The direction vector of gravitational acceleration g in the carrier coordinate system can then be calculated as follows:
[0123]
[0124] Where, q * =q0-q1i-q2j-q3k is the conjugate quaternion of q.
[0125] When the sensor is stationary or moving slowly, an error function E can be established. g (q), the expression is as follows:
[0126]
[0127] in, and The acceleration and its modulus are measured by the sensor in the carrier coordinate system, respectively.
[0128] Therefore, the problem of finding a quaternion q that is closer to the true value can be transformed into finding a quaternion E that makes the error function E g (q) A smaller quaternion q. The specific solution process is as follows:
[0129] Based on the relevant knowledge of gradient descent, the error function E is first obtained. g (q) The Jacobian matrix for the quaternion q is:
[0130]
[0131] Then the error function E g The gradient of (q) with respect to the quaternion q is:
[0132]
[0133] Its mold length is:
[0134]
[0135] This leads to the error function E. g The gradient direction of (q) with respect to the quaternion q is:
[0136]
[0137] In summary, the iterative equation for the optimal estimation of quaternions based on gradient descent is:
[0138]
[0139] Where λ is the step size. If the step size λ is too small, then E g (q) converges slowly; if the step size λ is too large, then E g (q) may diverge, therefore the adaptive step size λ is chosen as:
[0140]
[0141] The corrected sensor attitude quaternion q is converted into the corresponding attitude angle θ. q This is then fused with the corrected attitude angle obtained in step 3 to obtain a more accurate attitude angle. The specific method is as follows:
[0142]
[0143] in, The fused attitude angle; θ zs The attitude angle after zero-velocity interval correction in step 3; η∈(0,1) is the fusion parameter, which can be adjusted according to the fusion effect.
[0144] Then convert it into the corresponding rotation matrix R for subsequent coordinate transformations and attitude angles. The transformation relationship between the rotation matrix R and the rotation matrix R is as follows:
[0145]
[0146] Step 5: Correct acceleration based on the zero-velocity interval.
[0147] Acceleration in navigation coordinate system The calculation is performed using formula (30):
[0148]
[0149] Among them, R k Let be the rotation matrix at time k. Let k be the acceleration measured by the sensor in the carrier coordinate system at time k.
[0150] During human movement, within the zero-speed range, the feet remain relatively stationary with respect to the ground. Besides the acceleration due to gravity (g), the acceleration... It should be zero. Because the sensor itself exhibits zero-point drift and is affected by high-frequency noise, the acceleration in the navigation coordinate system obtained solely through simple matrix multiplication is incorrect. Within the zero-speed range, non-zero values may occur, such as... Figure 5 As shown, further correction is needed.
[0151] Starting from time zero, the accelerations in each zero-velocity interval are sequentially recorded. The correction is set to zero. Simultaneously, to maintain the continuity of acceleration data, the acceleration within the zero-velocity range is... The deviation caused by a zero correction is compensated by data from adjacent motion intervals. Assume the end time of the kth zero-velocity interval... The acceleration is The starting time of the (k+1)th zero-speed interval The acceleration is Then, calculate the acceleration at each moment in the motion interval between the k-th zero-velocity interval and the (k+1)-th zero-velocity interval. Correction is performed using formula (31):
[0152]
[0153] It is worth noting that the left and right sides of the equals sign They have different meanings, namely T j The acceleration before and after the time correction, and The corrected acceleration change curve is as follows Figure 6 As shown.
[0154] Step 6: Correct acceleration and velocity based on Kalman filtering.
[0155] Velocity in navigation coordinate system The calculation is performed using formula (32):
[0156]
[0157] During human movement, within the zero-speed range, the feet remain relatively stationary with respect to the ground. At this point, the speed of the feet' movement... It should be zero. Due to the sensor's inherent zero-point drift and the influence of high-frequency noise, the velocity in the navigation coordinate system obtained solely through numerical integration is incorrect. The value may be non-zero in the zero-speed range, so further correction is required.
[0158] Let the state variable x be the measured value of the acceleration of the human body in the navigation coordinate system during the movement. Calculated values of speed Each of them is related to its true value a n and v n The deviation x between them is Let the observed value z be the calculated velocity of the human body in the navigation coordinate system during its movement. With the true value v n The deviation between them, that is,
[0159] During human movement, within the zero-speed range, the feet remain relatively stationary with respect to the ground. At this point, the speed of the feet should be zero, i.e., v. n =0, therefore:
[0160]
[0161] Within the range of motion, the actual speed of the human foot cannot be directly obtained, and therefore, the speed within the range of motion cannot be directly calculated. The value of . Assuming speed deviation The velocity deviation increases linearly with time T, so the velocity deviation of the intermediate motion interval can be indirectly calculated from the velocity deviation of two adjacent zero-velocity intervals.
[0162] Assume the end time of the kth zero-velocity interval speed deviation is The starting time of the (k+1)th zero-speed interval speed deviation is The velocity deviation at each moment in the motion interval between the k-th zero-velocity interval and the (k+1)-th zero-velocity interval is:
[0163]
[0164] Among them, z j and T respectively j The observed quantity and velocity deviation at time, and
[0165] Therefore, the state equation and observation equation of this linear system can be expressed as follows:
[0166]
[0167]
[0168] Among them, W k =[W a,k W v,k ] T The process noise is Gaussian white noise with covariance Q; V k The observation noise is Gaussian white noise with covariance R.
[0169] The prediction equation for the Kalman filter is then:
[0170]
[0171] P k|k-1 =FP k-1|k-1 F T +Q (38)
[0172] Among them, P k-1|k-1 For x k-1|k-1 The covariance matrix of P; k|k-1 For x k|k-1 The covariance matrix.
[0173] The update equation for the Kalman filter is:
[0174] K k =P k|k-1 H T HP k|k-1 H T +R) -1 (39)
[0175]
[0176] P k|k =(IK k H)P k|k-1 (41)
[0177] Among them, K k This is the Kalman gain.
[0178] The deviation of acceleration in the navigation coordinate system estimated by Kalman filtering Deviation from speed The measured values of acceleration in the navigation coordinate system respectively Calculated values of speed Summation, i.e. To obtain more accurate acceleration estimates and speed estimates Right now
[0179] Step 7: Calculate displacement and extract gait data.
[0180] The estimated displacement in the navigation coordinate system is:
[0181]
[0182] Based on displacement in the navigation coordinate system Components on the three coordinate axes and To draw the trajectory of a human body, such as... Figure 7 As shown.
[0183] Assume the ending times of the (k-1)th zero-velocity interval and the kth zero-velocity interval are respectively and The duration of the gait cycle consisting of the kth zero-velocity interval and the kth movement interval is:
[0184]
[0185] Taking its reciprocal gives the step frequency of the gait period:
[0186]
[0187] Suppose that the displacements corresponding to the final moments of the (k-1)th zero-velocity interval and the kth zero-velocity interval are respectively and The step length of the gait cycle, which consists of the kth zero-velocity interval and the kth movement interval, is:
[0188]
[0189] The step length L of the gait cycle formed by the k-th zero-velocity interval and the k-th movement interval. k With respect to the duration ΔT of the gait cycle k Dividing by this, we can obtain the gait speed for this gait cycle:
[0190]
[0191] After uniformly filtering the above step frequency, step length, and step speed information, the following can be obtained: Figure 8 The corresponding gait information waveform is shown. If the duration of a certain zero-velocity interval is... Time T exceeding a certain threshold max If it is determined that the human body is not walking but standing, then its step frequency, stride length, and step speed information are all set to zero.
[0192] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for human gait detection based on MEMS inertial sensors, characterized in that, Includes the following steps: Step 1: Initially remove high-frequency noise from the original acceleration and angular velocity data, calculate the magnitudes of acceleration and angular velocity respectively, and then calculate the acceleration variance in a set series of frames based on the magnitudes of acceleration and angular velocity. and angular velocity variance Step 2: Establish acceleration magnitude criterion, acceleration magnitude variance criterion, angular velocity magnitude criterion, and angular velocity magnitude variance criterion using the zero-velocity detection method. When the acceleration variance... and angular velocity variance If all four criteria are met, the current time is determined to be within the zero-speed interval; Step 3: For attitude angle data along any axis, starting from time zero, calculate the average value of the attitude angle along that axis in each zero-velocity interval, and record the average value of the corresponding zero-velocity interval duration. Correct the linear offset of the attitude angles in the three axes; Step 4: Establish the iterative relationship of sensor attitude quaternions: Where, q k and q k+1 T respectively k Time and T k+1 Time sensor attitude quaternion; Δt = T k+1 -T k , For q k The transformation matrix in quaternion multiplication; establishing the error function E when the sensor is stationary or moving slowly. g (q), the gradient descent method is used to solve for the error function E. g (q) The smallest quaternion q is the quaternion q closest to the true value; then the corrected sensor attitude quaternion q is converted into the corresponding attitude angle θ. q The new attitude angle is obtained by fusing it with the attitude angle obtained in step 3. Step 5: Starting from time zero, sequentially calculate the acceleration within each zero-velocity interval. The correction is set to zero, and at the same time, acceleration is compensated using data from adjacent motion intervals. Deviations arising during the correction process; Step 6: Use Kalman filtering to estimate the acceleration deviation. Deviation from speed The measured values obtained in step 5 are compared separately. Calculated values of speed Summing yields a more accurate estimate of the acceleration. and speed estimates Step 7: Assume the ending times of the (k-1)th zero-velocity interval and the kth zero-velocity interval are respectively and The duration of the gait cycle consisting of the kth zero-velocity interval and the kth movement interval is: The reciprocal of the gait period is the step frequency of that gait period; Suppose that the displacements corresponding to the final moments of the (k-1)th zero-velocity interval and the kth zero-velocity interval are respectively and The stride length of the gait cycle consisting of the kth zero-velocity interval and the kth movement interval is: The step size L of the gait cycle k With respect to the duration ΔT of the gait cycle k Dividing by this, we can obtain the gait speed for this gait cycle: If the duration of the current zero-speed interval does not exceed the threshold, the result of uniformly filtering the step frequency, stride length, and step speed is the human gait, and the process ends; otherwise, the step frequency, stride length, and step speed are all set to zero as the human gait, and the process ends.
2. The human gait detection method according to claim 1, characterized in that, The initial method for removing high-frequency noise from the original acceleration and angular velocity data is to use inertial filtering and mean filtering.
3. The human gait detection method according to claim 1, characterized in that, The acceleration modulus criterion zs 1,k As shown in the following formula: Where k is the sampling time, |a k | represents the magnitude of acceleration at time k, a x,k a y,k and a z,k These are the acceleration information along the x, y, and z axes at time k; and These are the maximum and minimum threshold values for the acceleration modulus, respectively.
4. The human gait detection method according to claim 1, characterized in that, The acceleration modulus variance criterion zs 2,k As shown in the following formula: in, Let k be the variance of the acceleration magnitude at the midpoint of the sampling time. Let |a| be the mean of the acceleration magnitudes. i | represents the acceleration magnitude at sampling time i. This is the maximum threshold for the variance of the acceleration magnitude.
5. The human gait detection method according to claim 1, characterized in that, The angular velocity magnitude criterion zs 3,k As shown in the following formula: Where, ω x,k ω y,k and ω z,k These are the angular velocity components along the x, y, and z axes at time k, respectively, |ω k | represents the magnitude of the angular velocity, ω th The maximum threshold value of angular velocity magnitude.
6. The human gait detection method according to claim 1, characterized in that, The angular velocity magnitude variance criterion zs 4,k As shown in the following formula: in, Let k be the variance of the magnitude of the angular velocity at the midpoint of the sampling time. The mean of the angular velocity magnitude, |ω i | represents the magnitude of the angular velocity at sampling time i. This is the maximum threshold for the variance of the angular velocity magnitude.
7. The human gait detection method according to claim 1, characterized in that, Step 3, which involves correcting the linear offset of the attitude angles along the three axes, specifically includes the following steps: Step 3.1: Starting from time zero, select the first zero-velocity interval and obtain the duration T of this zero-velocity interval. zs ; Step 3.2: Determine if the zero-speed interval is the last zero-speed interval. If it is, proceed to step 3.3; otherwise, when the length T... zs Time T exceeding the maximum threshold max If the time interval is T, it is determined that the human body is not walking but standing, and the data of the previous continuous motion needs to be corrected, proceeding to step 3.3; when the duration T of a certain zero-speed interval... zs The maximum threshold time T has not been exceeded max If the time is right, it is determined that the human body is in a continuous walking state, the next zero-speed interval is selected, and the duration T of the zero-speed interval is obtained. zs Proceed to step 3.2; Step 3.3: Using the least squares method, the average attitude angles of the first m zero-velocity intervals are successively fitted with straight lines. and duration The relationship between them is maintained until the fitting error exceeds the maximum threshold θ. max If the fitting continues, the straight line obtained from the most recent fitting will be used as the offset, and the offset will be removed from the attitude angle to complete the attitude angle correction.
8. The human gait detection method according to claim 1, characterized in that, In step 4, the new attitude angle is obtained by fusing it with the attitude angle obtained in step 3. The specific method is as follows: Where, θ zs The attitude angle after zero-velocity interval correction in step 3 is η∈(0,1), which is the fusion parameter and can be adjusted according to the fusion effect.
Citation Information
Patent Citations
Indoor inertial navigation algorithm based on posture recognition and step length model
CN106705968A
Quasi-real-time stepping pedestrian navigation method based on bidirectional filtering and smoothing technology
CN108592907A