Intelligent detection method and system based on safety helmet
By integrating multiple sensors on the smart safety helmet and adopting multiple data processing methods, the problems of inaccurate estimation of attitude information and poor pre-processing of magnetometer data in the prior art are solved, and accurate monitoring of the wearer's attitude, motion state and position is achieved.
Patent Information
- Application Number
- CN202411869825.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing intelligent detection method based on safety helmets is difficult to accurately estimate the attitude information of an object in a dynamic environment, and the preprocessing effect of magnetometer data is not ideal, resulting in low accuracy in motion state judgment and position positioning.
By installing an accelerometer, gyroscope and magnetometer, the magnetometer data is calibrated by the least squares method, multi-sensor data is fused to estimate attitude information, and the magnetometer data is processed through dynamic sliding window filtering and DTW algorithm, combining genetic algorithms and dead estimation methods to monitor and calculate the wearer's position and motion trajectory in real time.
It significantly improves the accuracy of posture information and the accuracy of motion state judgment, reduces noise interference, enhances the stability and real-time nature of the system, and can more accurately reflect the wearer's movement.
Smart Images

Figure CN119803452A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and in particular to an intelligent detection method and system based on a safety helmet. Background Art
[0002] In the existing intelligent detection method based on safety helmets, there are some defects in the data processing after the data is detected.
[0003] For example, when fusing accelerometer, gyroscope and magnetometer data, some existing methods have difficulty in accurately estimating the attitude information of an object, especially in a dynamic environment. The calculation errors of roll angle, pitch angle and yaw angle will accumulate, which will affect the subsequent motion state judgment and position positioning accuracy.
[0004] In addition, some existing methods use simple sliding window filtering for preprocessing after collecting magnetometer data. Although this method can reduce data noise to a certain extent, its filtering effect is not ideal when processing dynamically changing data, which easily leads to the loss of useful information. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an intelligent detection method and system based on a safety helmet, which realizes accurate monitoring of the wearer's posture, motion state and position.
[0006] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0007] In a first aspect, an intelligent detection method based on a safety helmet comprises:
[0008] The accelerometer, gyroscope, and front and rear magnetometers installed on the smart helmet can obtain raw acceleration data, angular velocity data, and magnetic field data in real time;
[0009] The magnetometer data is calibrated by using the least square method to obtain calibrated magnetometer data;
[0010] Fuse accelerometer data, gyroscope data, and calibrated magnetometer data to estimate the object's attitude information, including roll, pitch, and yaw angles;
[0011] According to the posture information of the object, magnetometer data is collected and preprocessed through dynamic sliding window filtering to obtain preprocessed magnetometer data;
[0012] The wearer's movement speed is estimated by combining the pre-processed magnetometer data with the DTW algorithm;
[0013] Continuously monitor accelerometer data, gyroscope data, and processed magnetometer data to obtain the wearer's motion status;
[0014] Based on the posture information of the object and the motion state of the wearer, a genetic algorithm combined with the dead reckoning method is used to integrate the velocity at each moment to determine the wearer's real-time position and motion trajectory.
[0015] Furthermore, the accelerometer data, gyroscope data and calibrated magnetometer data are integrated to estimate the object's attitude information, including roll angle, pitch angle and yaw angle, including:
[0016] Quaternions are used to represent the posture of an object. A state equation is established that includes quaternions and gyroscope random drift vectors. The state equation describes the evolution of the object's posture over time.
[0017] The accelerometer data is used to construct the measurement equation to correct the roll angle and pitch angle in the system state, and the calibrated magnetometer data is incorporated into the measurement equation to assist in calculating the yaw angle;
[0018] By fusing the measurement information, the state equation is updated to obtain the final attitude estimation;
[0019] In the filtering process, the covariance matrix of process noise and measurement noise is set, and a series of optimized attitude quaternions are obtained by fusing multi-sensor data through iterative update of extended Kalman filter;
[0020] The optimized quaternion is converted into Euler angles to output the final attitude information, where the Euler angles include roll angle, pitch angle, and yaw angle.
[0021] Furthermore, quaternions are used to represent the attitude of the object, and a state equation containing quaternions and gyroscope random drift vectors is established, including:
[0022] The state equation is established with quaternion and gyroscope random drift vector as state vector, and the state variable is:
[0023] x(k)=[q0(k),q1(k),q2(k),q3(k),b wx (k),b wy (k),b wz (k)];
[0024] Among them, q0(k), q1(k), q2(k), q3(k) are attitude quaternions; b wx (k),b wy (k),b wz (k) are the random drift vectors generated by the gyroscope about the roll axis, pitch axis and yaw axis respectively; the drift of the gyroscope is a random constant and conforms to the following relationship:
[0025] bwx (k) = b wx (k-1);
[0026] b wy (k) = b wy (k-1);
[0027] b wz (k) = b wz (k-1);
[0028] The state equation is:
[0029]
[0030] in,
[0031] Find the Jacobian matrix of f(x(k-1),k-1) to get:
[0032]
[0033] , where W(k-1) is the system process noise, T is the data sampling period, and k is the time; ω x ,ω y ,ω z It is the three-axis data of the accelerometer, q0, q1, q2, q3 represent quaternion.
[0034] Furthermore, the accelerometer data is used to construct a measurement equation to correct the roll angle and pitch angle in the system state, and the calibrated magnetometer data is incorporated into the measurement equation to assist in calculating the yaw angle, including:
[0035] Using the preprocessed accelerometer data, the first part of the measurement equation is constructed to correct the roll and pitch angles in the system state;
[0036] Calculate an estimate of gravity acceleration based on the direction cosine matrix; subtract the estimate of gravity acceleration from the accelerometer measurement to obtain the residual as part of the measurement equation;
[0037] Incorporating the calibrated magnetometer data into the second part of the measurement equation to assist in calculating the yaw angle;
[0038] The magnetometer readings are transformed from the vehicle coordinate system to the navigation coordinate system using the direction cosine matrix;
[0039] Calculate an estimate of the yaw angle based on the converted magnetometer readings;
[0040] The observation variables of the extended Kalman filter are defined as gravity acceleration and yaw angle; according to the constructed measurement equation, the observation model of the filter is set, and in the filtering process, the system state equation and the measurement equation are combined to optimize the attitude estimation through iterative update; the Jacobian matrix is used to linearize the measurement equation to obtain the system measurement matrix, and the filter is updated according to the set process noise and measurement noise covariance matrix;
[0041] By extending the quaternion optimized by Kalman filtering, the roll angle, pitch angle and yaw angle are calculated, and the final attitude information including roll angle, pitch angle and yaw angle is output.
[0042] Furthermore, the estimated value of gravity acceleration is calculated based on the direction cosine matrix, including:
[0043] Use the direction cosine matrix to get an estimate of the gravity acceleration:
[0044]
[0045] in, represents the estimated gravitational acceleration, is the direction cosine matrix.
[0046] Furthermore, an estimate of the yaw angle is calculated based on the converted magnetometer readings, including:
[0047] The yaw angle is calculated from the magnetometer readings as follows:
[0048]
[0049] in is the magnetometer 3-axis reading, is the direction cosine matrix, is the magnetometer reading in the navigation coordinate system, and the yaw angle is to derive; to substitute make The yaw angle is 0, and we get:
[0050]
[0051] in is the estimated yaw angle; ψ is the yaw angle, θ is the pitch angle, is the roll angle, and b is the carrier coordinate system.
[0052] Furthermore, the measurement equation is:
[0053]
[0054] By obtaining the Jacobian matrix for h(x(k),k), we can obtain the system measurement matrix:
[0055]
[0056] in:
[0057]
[0058] A1=2(q1q2+q0q3);
[0059] A2=1-2q2 2 -2q3 2 ;
[0060] Where V(k) represents the measurement noise and x(k) represents the state variable at time k.
[0061] In the second aspect, an intelligent detection system based on a safety helmet comprises:
[0062] An acquisition module is used to acquire raw acceleration data, angular velocity data and magnetic field data in real time through an accelerometer, a gyroscope and front and rear magnetometers installed on the smart helmet;
[0063] A calibration module, used for calibrating the magnetometer data by using a least square method to obtain calibrated magnetometer data;
[0064] A fusion module is used to fuse accelerometer data, gyroscope data and calibrated magnetometer data to estimate the object's attitude information, including roll angle, pitch angle and yaw angle;
[0065] The acquisition module is used to collect magnetometer data according to the posture information of the object, and pre-process it through dynamic sliding window filtering to obtain pre-processed magnetometer data;
[0066] A matching module is used to estimate the wearer's movement speed by combining the pre-processed magnetometer data with the DTW algorithm;
[0067] A monitoring module, used to continuously monitor the accelerometer data, gyroscope data and processed magnetometer data to obtain the wearer's motion status;
[0068] The calculation module is used to integrate the velocity at each moment based on the posture information of the object and the motion state of the wearer, using a genetic algorithm combined with a dead reckoning method to determine the real-time position and motion trajectory of the wearer.
[0069] According to a third aspect, a computing device includes:
[0070] one or more processors;
[0071] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described.
[0072] In a fourth aspect, a computer-readable storage medium stores a program, and when the program is executed by a processor, the method described is implemented.
[0073] The above scheme of the present invention includes at least the following beneficial effects.
[0074] By calibrating the magnetometer data based on the least squares method, this method can significantly reduce the impact of surrounding magnetic field interference on data accuracy, ensuring that the acquired magnetometer data is more accurate and reliable.
[0075] By fusing the accelerometer, gyroscope and calibrated magnetometer data, the present invention can more accurately estimate the attitude information of the object, including the roll angle, pitch angle and yaw angle.
[0076] The magnetometer data is preprocessed using dynamic sliding window filtering. This method can not only effectively reduce the noise in the data, but also better retain useful information.
[0077] The wearer's movement speed is estimated by combining the DTW algorithm with the preprocessed magnetometer data. This method shows high accuracy and robustness when processing high-noise and nonlinear data, thus being able to more accurately reflect the wearer's actual movement.
[0078] By continuously monitoring the data of accelerometers, gyroscopes and magnetometers, the method can obtain the wearer's motion state in real time, and integrate the speed at each moment by combining genetic algorithms and dead reckoning methods, so as to accurately determine the wearer's real-time position and motion trajectory. By comprehensively using multiple sensors and advanced data processing methods, the present invention not only improves the accuracy and efficiency of data processing, but also enhances the stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a flowchart of an intelligent detection method based on a safety helmet provided by an embodiment of the present invention.
[0080] Figure 2 It is a schematic diagram of an intelligent detection system based on a safety helmet provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0081] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0082] like Figure 1 As shown, an embodiment of the present invention proposes an intelligent detection method based on a helmet, and the method comprises the following steps:
[0083] Step 11, obtaining original acceleration data, angular velocity data and magnetic field data in real time through the accelerometer, gyroscope and front and rear magnetometers installed on the smart helmet;
[0084] Step 12, calibrating the magnetometer data using a least square method to obtain calibrated magnetometer data;
[0085] Step 13, fusing the accelerometer data, the gyroscope data and the calibrated magnetometer data to estimate the attitude information of the object, including the roll angle, the pitch angle and the yaw angle;
[0086] Step 14, collecting magnetometer data according to the posture information of the object, and preprocessing it through dynamic sliding window filtering to obtain preprocessed magnetometer data;
[0087] Step 15, estimating the wearer's movement speed by combining the pre-processed magnetometer data with the DTW algorithm;
[0088] Step 16, continuously monitoring the accelerometer data, the gyroscope data and the processed magnetometer data to obtain the wearer's motion state;
[0089] Step 17, based on the posture information of the object and the motion state of the wearer, a genetic algorithm combined with a dead reckoning method is used to integrate the velocity at each moment to determine the real-time position and motion trajectory of the wearer.
[0090] In an embodiment of the present invention, step 11, by installing an accelerometer, gyroscope and front and rear magnetometers on the smart helmet, the wearer's original motion data, including acceleration, angular velocity and magnetic field data, can be captured in real time and accurately. Step 12, the magnetometer data is calibrated based on the least squares method, which can effectively reduce or eliminate the data deviation caused by environmental magnetic field interference and improve the accuracy and reliability of the magnetometer data. Step 13, by fusing the data of multiple sensors, including accelerometers, gyroscopes and calibrated magnetometer data, the wearer's motion state can be more comprehensively analyzed, so as to more accurately estimate the object's posture information (roll angle, pitch angle and yaw angle). Step 14, the magnetometer data is preprocessed using dynamic sliding window filtering, which can effectively smooth the data, reduce noise interference, and retain key motion features, which improves the quality and availability of the data. Step 15, the wearer's motion speed is estimated by combining the preprocessed magnetometer data with the DTW algorithm, which can accurately track nonlinear and variable speed motion. The flexibility of the DTW algorithm enables this method to adapt to various complex motion patterns, provide accurate velocity estimation, and help to more fully understand the wearer's motion state. Step 16, by continuously monitoring the accelerometer, gyroscope and magnetometer data, the wearer's motion state changes can be obtained in real time. Step 17, based on the object's posture information and the wearer's motion state, the genetic algorithm combined with the dead reckoning method is used to integrate the velocity, which can accurately determine the wearer's real-time position and motion trajectory. At the same time, the real-time nature of this positioning technology also ensures the timeliness and effectiveness of the information.
[0091] The above step 11 may specifically include:
[0092] Accelerometers, gyroscopes, and front and rear magnetometers are installed on the smart helmet to ensure that these sensors can accurately capture the wearer's motion data. The sensors are configured to collect data at a certain frequency (for example, tens to hundreds of hertz) to ensure that sufficient details can be captured. The accelerometer measures and outputs acceleration data in three axes (X, Y, Z) in real time, reflecting the wearer's linear motion state. The gyroscope measures and outputs angular velocity data in three axes in real time, describing the dynamic behavior of the wearer's rotation; the front and rear magnetometers detect the components of the geomagnetic field in three axes to determine the direction.
[0093] Ensure that the data obtained from each sensor is synchronized in time for subsequent data fusion and analysis. Integrate acceleration data, angular velocity data, and magnetic field data to form a complete data set.
[0094] The above step 12 may specifically include:
[0095] Collect magnetometer data at different positions and directions to obtain enough sample points. Record the raw magnetic field data, including the magnetic field strength in the three axes of X, Y, and Z. Fit the collected magnetometer data using the least squares method to determine the bias and scale factor of the magnetometer. The least squares method calibrates the magnetometer data by finding the best fitting parameters by minimizing the sum of squares of the errors. Based on the fitting results, adjust the raw magnetometer data to eliminate bias and nonlinear errors. The calibrated magnetometer data will be closer to the true value and provide accurate data for subsequent attitude solution. Verify the calibration effect by comparing the data before and after calibration. If the calibration effect is not ideal, you can collect data again for calibration until a satisfactory accuracy is achieved.
[0096] Through the above two steps, accurate acceleration, angular velocity and magnetic field data can be obtained from the sensors on the smart helmet in real time, and the magnetometer data can be calibrated by the least squares method to provide reliable basic data for subsequent posture solution and motion trajectory analysis.
[0097] In another preferred embodiment of the present invention, in the above step 12, the magnetometer data is preliminarily calibrated based on the least square method. In order to calibrate the magnetometer more accurately and reduce the influence of various errors, the error analysis and calibration method of the magnetometer can be further refined.
[0098] For example, in order to calibrate the magnetometer more accurately, a magnetometer calibration model including various error factors can be established. The model takes into account factors such as scale factor error, non-orthogonality error, soft magnetic error, hard magnetic error, and bias error, which can be expressed as the following formula:
[0099]
[0100] Among them, M b is the output of the magnetometer in the carrier coordinate system, S is the equivalent soft magnetic error matrix, is the strapdown matrix, M n is the ideal output of the magnetometer in the geographic coordinate system, h is the equivalent hard magnetic error matrix, and n is the independent and identically distributed broadband Gaussian noise.
[0101] First, magnetometer data are collected at different positions and directions to obtain enough sample points. Then, these sample points and the calibration model are used to estimate various error parameters (such as scale factor, non-orthogonality error, soft magnetic error, hard magnetic error and bias error) through optimization algorithms (such as least squares method).
[0102] After the error parameters are estimated, fine calibration is performed. Based on the estimated error parameters, the raw magnetometer data is calibrated to obtain a more accurate magnetometer output. This step is a deepening of the initial calibration, aiming to further improve the accuracy of the magnetometer data.
[0103] In order to further improve the accuracy of magnetometer data, the nonlinear least squares method will be used to optimize the calibration based on the previous fine calibration.
[0104] The magnetometer calibration problem is further modeled as a nonlinear least squares problem. The objective function F(x) is defined as:
[0105]
[0106] Where G is the modulus of the Earth's magnetic field strength, M' bx , M' by and M' bz are the three components of the magnetometer data in the carrier coordinate system after calibration in the previous step. The goal is to find a set of optimized parameters x that minimizes F(x).
[0107] Solve a nonlinear least squares problem:
[0108] The Levenberg-Marquardt (LM) algorithm is used to solve the nonlinear least squares problem. First, the Jacobian matrix J(x) of the objective function F(x) is calculated, and then the optimization parameters are updated using the iterative formula of the LM algorithm until the convergence condition is met.
[0109]
[0110] Among them, x k is the parameter vector at the kth iteration, in the magnetometer calibration; x k+1 is the updated parameter vector after the k+1th iteration; J k is the Jacobian matrix of the objective function F(x) with respect to the parameter vector x at the kth iteration; is the transpose of the Jacobian matrix; F k is the objective function value at the kth iteration; μ k is a positive number, called the damping factor or regularization parameter. k When μ is large, the algorithm behaves more like a gradient descent method, while k When is smaller, the behavior of the algorithm is closer to Newton's method; I is the identity matrix, whose dimension is the same as the parameter vector x; The Jacobian matrix is calculated as follows:
[0111]
[0112] in, This symbol represents the components of F(x) F1(x), F2(x), ..., F m (x) For each component x1, x2, ..., x of the parameter vector x, n Find the partial derivatives, which constitute the elements of the Jacobian matrix; F'(x) or J(x) is the Jacobian matrix of the objective function F(x), which is an m×n matrix.
[0113] The magnetometer data, which has been further finely calibrated by the nonlinear least squares method, will be applied to subsequent posture calculation, motion trajectory analysis, etc. This will significantly improve the accuracy and reliability of the intelligent detection method and provide users with more accurate position and motion information.
[0114] In step 13, the accelerometer data, the gyroscope data and the calibrated magnetometer data are integrated to estimate the attitude information of the object, including the roll angle, the pitch angle and the yaw angle, including:
[0115] Quaternions are used to represent the posture of an object. A state equation is established that includes quaternions and gyroscope random drift vectors. The state equation describes the evolution of the object's posture over time.
[0116] The accelerometer data is used to construct the measurement equation to correct the roll angle and pitch angle in the system state, and the calibrated magnetometer data is incorporated into the measurement equation to assist in calculating the yaw angle;
[0117] By fusing the measurement information, the state equation is updated to obtain the final attitude estimation;
[0118] In the filtering process, the covariance matrix of process noise and measurement noise is set, and a series of optimized attitude quaternions are obtained by fusing multi-sensor data through iterative update of extended Kalman filter;
[0119] The optimized quaternion is converted into Euler angles to output the final attitude information, where the Euler angles include roll angle, pitch angle, and yaw angle.
[0120] In an embodiment of the present invention, by fusing the data of the accelerometer, gyroscope and calibrated magnetometer, the method can comprehensively utilize the advantages of different sensors, so as to more accurately estimate the attitude information of the object. This multi-sensor fusion method can effectively reduce the influence of single sensor error on attitude estimation. Since multiple sensor data are used, when a sensor fails or the data is abnormal, the data of other sensors can still provide effective information for attitude estimation, thereby improving the stability and reliability of the entire system. By combining the accelerometer and magnetometer data, the method can not only measure dynamic attitude changes, but also accurately measure the yaw angle in static or low dynamic conditions, and realize accurate measurement of the full attitude. The extended Kalman filter is used for iterative update, which can quickly fuse multi-sensor data and output attitude information in real time to meet the application scenarios with high real-time requirements. The method does not depend on a specific sensor model or brand. As long as the sensor can provide acceleration, angular velocity and magnetic field data, the method can be applied for attitude estimation, so it has wide applicability. By setting the covariance matrix of process noise and measurement noise, the method can reasonably allocate the weights of different sensor data in the filtering process, thereby optimizing resource utilization and improving data processing efficiency.
[0121] Furthermore, quaternions are used to represent the attitude of the object, and a state equation containing quaternions and gyroscope random drift vectors is established, including:
[0122] The state equation is established with quaternion and gyroscope random drift vector as state vector, and the state variable is:
[0123] x(k)=[q0(k),q1(k),q2(k),q3(k),b wx (k),b wy (k),b wz (k)];
[0124] Among them, q0(k), q1(k), q2(k), q3(k) are attitude quaternions; b wx (k),b wy (k),b wz (k) are the random drift vectors generated by the gyroscope about the roll axis, pitch axis and yaw axis respectively; the drift of the gyroscope is a random constant and conforms to the following relationship:
[0125] b wx (k) = b wx (k-1);
[0126] b wy (k) = b wy (k-1);
[0127] b wz (k) = bwz (k-1);
[0128] The state equation is:
[0129]
[0130] in,
[0131] Find the Jacobian matrix of f(x(k-1),k-1) to get:
[0132]
[0133] , where W(k-1) is the system process noise; T is the data sampling period, k is the time; ω x ,ω y ,ω z It is the three-axis data of the accelerometer, q0, q1, q2, q3 represent quaternion.
[0134] Furthermore, the accelerometer data is used to construct a measurement equation to correct the roll angle and pitch angle in the system state, and the calibrated magnetometer data is incorporated into the measurement equation to assist in calculating the yaw angle, including:
[0135] Using the preprocessed accelerometer data, the first part of the measurement equation is constructed to correct the roll and pitch angles in the system state;
[0136] Calculate an estimate of gravity acceleration based on the direction cosine matrix; subtract the estimate of gravity acceleration from the accelerometer measurement to obtain the residual as part of the measurement equation;
[0137] Incorporating the calibrated magnetometer data into the second part of the measurement equation to assist in calculating the yaw angle;
[0138] The magnetometer readings are transformed from the vehicle coordinate system to the navigation coordinate system using the direction cosine matrix;
[0139] Calculate an estimate of the yaw angle based on the converted magnetometer readings;
[0140] The observation variables of the extended Kalman filter are defined as gravity acceleration and yaw angle; according to the constructed measurement equation, the observation model of the filter is set, and in the filtering process, the system state equation and the measurement equation are combined to optimize the attitude estimation through iterative update; the Jacobian matrix is used to linearize the measurement equation to obtain the system measurement matrix, and the filter is updated according to the set process noise and measurement noise covariance matrix;
[0141] By extending the quaternion optimized by Kalman filtering, the roll angle, pitch angle and yaw angle are calculated, and the final attitude information including roll angle, pitch angle and yaw angle is output.
[0142] In an embodiment of the present invention, by combining accelerometer data and calibrated magnetometer data to construct a measurement equation, the roll angle and pitch angle in the system state can be corrected more accurately, and the yaw angle can be assisted in calculating. This method comprehensively considers multiple data sources, thereby improving the accuracy and reliability of attitude estimation. The integration of magnetometer data provides important information for the calculation of yaw angle. Through calibrated magnetometer data, the direction of the object can be more effectively determined, and the yaw angle can be accurately estimated, which is crucial for applications requiring precise navigation and positioning. Since this method integrates multiple sensor data, even if a sensor has a temporary failure or error, the system can continue to provide relatively accurate attitude estimation based on other sensor data, thereby enhancing the robustness of the system. By optimizing attitude estimation through an extended Kalman filter, the method can converge quickly and output accurate attitude information. The extended Kalman filter performs well in dealing with nonlinear problems, can effectively integrate multi-source sensor data, and optimize attitude estimation through iterative updates.
[0143] Furthermore, the estimated value of gravity acceleration is calculated based on the direction cosine matrix, including:
[0144] Use the direction cosine matrix to get an estimate of the gravity acceleration:
[0145]
[0146] in, represents the estimated gravitational acceleration, is the direction cosine matrix.
[0147] Furthermore, an estimate of the yaw angle is calculated based on the converted magnetometer readings, including:
[0148] The yaw angle is calculated from the magnetometer readings as follows:
[0149]
[0150] in is the magnetometer 3-axis reading, is the direction cosine matrix, is the magnetometer reading in the navigation coordinate system, and the yaw angle is to derive; to substitute make The yaw angle is 0, and we get:
[0151]
[0152] in is the estimated yaw angle; ψ is the yaw angle, θ is the pitch angle, is the roll angle, and b is the carrier coordinate system.
[0153] In an embodiment of the present invention, by using the direction cosine matrix to calculate the estimated value of gravity acceleration, the attitude change of an object in three-dimensional space can be more accurately reflected. This method can comprehensively consider the rotation and attitude angle of the object, thereby providing a more accurate estimation of gravity acceleration. By converting the magnetometer reading to the navigation coordinate system and combining the direction cosine matrix to calculate the estimated value of the yaw angle, the influence of environmental interference on the magnetometer reading can be effectively reduced, and the accuracy of the yaw angle estimation can be improved. The method combines accelerometer data and magnetometer data, and realizes the effective fusion of multi-sensor data by constructing measurement equations and system state equations. This fusion method can make full use of the advantages of different sensors and improve the accuracy and stability of attitude estimation. Accurate attitude information is the basis of attitude control system. By providing accurate gravity acceleration estimation and yaw angle estimation, the method can optimize the performance of the attitude control system, improve the response speed and stability of the system, and thus meet more demanding attitude control tasks.
[0154] Furthermore, the measurement equation is:
[0155]
[0156] By obtaining the Jacobian matrix for h(x(k),k), we can obtain the system measurement matrix:
[0157]
[0158] in:
[0159]
[0160]
[0161] A1=2(q1q2+q0q3);
[0162] A2=1-2q2 2 -2q3 2 ;
[0163] Where V(k) represents the measurement noise and x(k) represents the state variable at time k.
[0164] In an embodiment of the present invention, by constructing an accurate measurement equation and using the Jacobian matrix to linearize and approximate the system, the state variables can be estimated more effectively. The Jacobian matrix reflects the local sensitivity of the measurement equation to the state variables, which helps to more accurately update the value of the state variables during filtering or estimation, thereby improving the estimation accuracy. In nonlinear filtering algorithms (such as extended Kalman filter EKF), the introduction of the Jacobian matrix can improve the performance of the filter. By using the Jacobian matrix to approximate the local linearization of the nonlinear function, the error propagation in the filtering process can be reduced, so that the filtering result is closer to the real state. In a control system or estimation system, the introduction of the Jacobian matrix can provide a more accurate description of the system dynamics, thereby helping to design a more stable controller or estimator. By accurately capturing the rate of change of the system state variables, the control strategy or estimation strategy can be adjusted in time to maintain the stability of the system. The calculation of the Jacobian matrix is usually much more efficient than directly solving nonlinear equations. In real-time systems, computational efficiency is crucial. By using the Jacobian matrix for linearization approximation, the amount of calculation can be significantly reduced and the real-time performance can be improved. This method is not only applicable to specific nonlinear system estimation problems, but also can be adapted to different scenarios and requirements by adjusting and optimizing algorithm parameters. Therefore, it has wide applicability and scalability. In complex dynamic environments, the robustness of the system is crucial. By introducing the Jacobian matrix to optimize the estimation process, the impact of external interference and noise on system performance can be reduced, thereby improving the robustness of the system.
[0165] The above step 14 may specifically include:
[0166] When the posture of an object changes, magnetometer data is particularly important for determining direction. Therefore, according to the change of posture information, determine when to collect magnetometer data. You can set a certain posture change threshold. When the posture change exceeds the threshold, the collection of magnetometer data is triggered. Through the magnetometer sensor, the magnetic field data under the current posture is collected in real time. Magnetometer data usually includes magnetic field strength values in three axes: X, Y, and Z. Ensure that the collected magnetometer data is synchronized in time with the corresponding posture information; mark the collected data so that the data points corresponding to the specific posture can be identified in subsequent processing.
[0167] Define a sliding window, the size of which determines the smoothness of the filter. The window size can be adjusted according to the actual application requirements. The window is used to store the most recent magnetometer data points for subsequent statistical processing. When new magnetometer data arrives, it is added to the tail of the sliding window. At the same time, the oldest data point in the window is removed to keep the window size unchanged. Perform statistical processing on the magnetometer data in the sliding window, such as calculating the mean, median, etc. Through this statistical processing, the noise and outliers in the data can be smoothed out to obtain more stable magnetometer data. After dynamic sliding window filtering, the preprocessed magnetometer data is output, which will be used for subsequent algorithm processing or decision-making. Through the above steps, magnetometer data can be collected in a targeted manner according to the posture information of the object, and the data can be preprocessed using the dynamic sliding window filtering method to improve the stability and reliability of the data.
[0168] In an embodiment of the present invention, the wearer's movement speed is estimated by combining the pre-processed magnetometer data with the DTW algorithm, including:
[0169] When estimating the wearer's real-time movement speed, the current preprocessed magnetometer data is matched with the reference template using the DTW algorithm. The DTW algorithm finds the final matching path by nonlinearly aligning the two time series and minimizing the distance between the preprocessed magnetometer data and the reference template.
[0170] According to the final matching path, a reference template matching the current magnetometer data is found, and the speed tag corresponding to the reference template is read as an estimate of the wearer's current movement speed.
[0171] In an embodiment of the present invention, the wearer's movement speed is estimated by combining the DTW algorithm with the preprocessed magnetometer data, so that the accurate capture of complex and nonlinear movement patterns can be achieved. The DTW algorithm can flexibly align the time series, so as to more accurately match the current magnetometer data with the reference template, thereby improving the accuracy of the speed estimation. Different people may have slight differences in their magnetometer data when performing the same type of exercise. By matching the DTW algorithm with the reference template, the system can adapt to this individual difference and provide personalized speed estimation for each wearer. The DTW algorithm has high efficiency in processing time series data, and combined with the preprocessed magnetometer data, real-time movement speed estimation can be achieved. This is crucial for application scenarios that require instant feedback (such as sports monitoring, health tracking, etc.). This method can not only be applied to magnetometer data, but also can be combined with other types of sensor data (such as accelerometers, gyroscopes, etc.) to further improve the accuracy and robustness of speed estimation. In addition, by updating or expanding the reference template library, the system can adapt to more types of sports and scenarios.
[0172] When applied, the specific steps include:
[0173] Preprocessed magnetometer data is magnetometer data that has been preprocessed by filtering, denoising, etc. It reflects the change in magnetic field under the wearer's current motion state. The reference template library is a template library containing magnetometer data at various motion speeds. Each template is associated with a specific motion speed label. These templates are samples of magnetometer data collected and preprocessed at different speeds.
[0174] DTW algorithm application:
[0175] Initialization: Set the parameters of the DTW algorithm, such as distance measurement (usually Euclidean distance), constraints on the regular path, etc.
[0176] Data alignment: Align the current preprocessed magnetometer data (called the test sequence) with each template in the reference template library (called the reference sequence). The DTW algorithm aligns the two sequences by nonlinearly warping the time axis so that similar parts can match without being affected by inconsistent sequence lengths or changes in time scale.
[0177] Distance calculation: During the alignment process, the distances between corresponding points in the test sequence and the reference sequence are calculated and accumulated to form a distance matrix. The goal of the DTW algorithm is to find a path through the distance matrix with the minimum sum of distances on the path.
[0178] Path Search: Use dynamic programming techniques to search for the best matching path in the distance matrix. This path defines the best alignment between the test sequence and the reference sequence.
[0179] Determine the best match: After searching all reference templates, the template with the smallest cumulative distance is selected as the best match to the current magnetometer data.
[0180] Read speed label: Extract the corresponding speed label from the best matching reference template. This label represents the motion speed that is most similar to the current magnetometer data.
[0181] Speed estimation output: The extracted speed tag is output as an estimate of the wearer's current motion speed.
[0182] In this way, the DTW algorithm can effectively handle the temporal variability and pattern similarity in the magnetometer data, thereby achieving an accurate estimate of the wearer's movement speed. This method is particularly suitable for scenarios where the movement pattern is complex and changeable and it is difficult to directly predict the speed through a simple model.
[0183] The specific implementation process of step 16 is as follows:
[0184] The output of the accelerometer is continuously monitored. This data reflects the wearer's acceleration and is an important basis for determining the wearer's motion state. The output of the gyroscope is also monitored, which provides information about the wearer's angular velocity, which helps to understand the wearer's turning and rotation movements. The magnetometer data processed in the previous steps is also included in the monitoring range. This data provides directional information, which is crucial for determining the wearer's direction of movement.
[0185] Ensure that the data collected from the accelerometer, gyroscope, and magnetometer are synchronized in time so that they accurately reflect the motion state at the same moment. Extract key features from the collected data, such as the amplitude and frequency of acceleration, the change in angular velocity of the gyroscope, and the change in direction of the magnetometer. Fuse the data from different sensors to obtain more comprehensive motion state information. For example, the acceleration and angular velocity data can be combined to determine whether the wearer is performing linear or curved motion. Based on the extracted features, use a preset algorithm or model to identify the wearer's specific motion state, such as walking, running, jumping, etc. Set appropriate thresholds to determine different motion states. For example, when the acceleration reaches a certain threshold, it may indicate that the wearer is running. The system continuously monitors sensor data and updates the judgment of the wearer's motion state based on real-time data. Output the identified motion state in the form of visualization or data for use by users or subsequent systems. As needed, the system can provide real-time feedback, such as prompts or alarms for changes in motion state.
[0186] In summary, the implementation process of step 16 involves the collection, fusion and analysis of multi-sensor data, as well as the motion state judgment and output based on these data. This process is dynamic and continuous, and aims to accurately reflect the wearer's real-time motion state.
[0187] like Figure 2 As shown, an embodiment of the present invention further provides an intelligent detection system based on a helmet, comprising:
[0188] An acquisition module is used to acquire raw acceleration data, angular velocity data and magnetic field data in real time through an accelerometer, a gyroscope and front and rear magnetometers installed on the smart helmet;
[0189] A calibration module, used for calibrating the magnetometer data by using a least square method to obtain calibrated magnetometer data;
[0190] A fusion module is used to fuse accelerometer data, gyroscope data and calibrated magnetometer data to estimate the object's attitude information, including roll angle, pitch angle and yaw angle;
[0191] The acquisition module is used to acquire magnetometer data according to the posture information of the object, and pre-process the magnetometer data through dynamic sliding window filtering to obtain pre-processed magnetometer data;
[0192] A matching module is used to estimate the wearer's movement speed by combining the pre-processed magnetometer data with the DTW algorithm;
[0193] A monitoring module, used to continuously monitor the accelerometer data, gyroscope data and processed magnetometer data to obtain the wearer's motion status;
[0194] The calculation module is used to integrate the velocity at each moment based on the posture information of the object and the motion state of the wearer, using a genetic algorithm combined with a dead reckoning method to determine the real-time position and motion trajectory of the wearer.
[0195] It should be noted that the system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0196] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0197] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0198] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An intelligent detection method based on a helmet, characterized in that: The method comprises: Step 11, obtaining original acceleration data, angular velocity data and magnetic field data in real time through the accelerometer, gyroscope and front and rear magnetometers installed on the smart helmet; Step 12, calibrating the magnetometer data using a least square method to obtain calibrated magnetometer data; Step 13, fusing the accelerometer data, the gyroscope data and the calibrated magnetometer data to estimate the attitude information of the object, including the roll angle, the pitch angle and the yaw angle; Step 14, collecting magnetometer data according to the posture information of the object, and preprocessing it through dynamic sliding window filtering to obtain preprocessed magnetometer data; Step 15, estimating the wearer's movement speed by combining the pre-processed magnetometer data with the DTW algorithm; Step 16, continuously monitoring the accelerometer data, the gyroscope data and the processed magnetometer data to obtain the wearer's motion state; Step 17, based on the posture information of the object and the motion state of the wearer, a genetic algorithm combined with a dead reckoning method is used to integrate the velocity at each moment to determine the real-time position and motion trajectory of the wearer.
2. The intelligent detection method based on safety helmet according to claim 1, characterized in that: Fuse accelerometer data, gyroscope data, and calibrated magnetometer data to estimate the object's attitude information, including roll, pitch, and yaw angles, including: Quaternions are used to represent the posture of an object. A state equation is established that includes quaternions and gyroscope random drift vectors. The state equation describes the evolution of the object's posture over time. The accelerometer data is used to construct the measurement equation to correct the roll angle and pitch angle in the system state, and the calibrated magnetometer data is incorporated into the measurement equation to assist in calculating the yaw angle; By fusing the measurement information, the state equation is updated to obtain the final attitude estimation; In the filtering process, the covariance matrix of process noise and measurement noise is set, and a series of optimized attitude quaternions are obtained by fusing multi-sensor data through iterative update of extended Kalman filter; The optimized quaternion is converted into Euler angles to output the final attitude information, where the Euler angles include roll angle, pitch angle, and yaw angle.
3. The intelligent detection method based on safety helmet according to claim 2, characterized in that: Quaternions are used to represent the attitude of the object, and a state equation containing quaternions and gyroscope random drift vectors is established, including: The state equation is established with quaternion and gyroscope random drift vector as state vector, and the state variable is: x(k)\[q0(k),q1(k)\q2(k),q3(k)\b wx (k),b wy (k),b wz (k)]; Among them, q0(k), q1(k), q2(k), q3(k) are attitude quaternions; b wx (k), b wy (k), b wz (k) are the random drift vectors generated by the gyroscope about the roll axis, pitch axis and yaw axis respectively; the drift of the gyroscope is a random constant and conforms to the following relationship: b wx (k)=b wx (k-1); b wy (k)=b wy (k-1); b wz (k)=b wz (k-1); The state equation is: in, Compute the Jacobian matrix for f(x(k-1), k-1) to obtain: Where W(k-1) is the system process noise, T is the data sampling period, k is the time; ω x ,ω y ,ω z It is the three-axis data of the accelerometer, q0, q1, q2, q3 represent quaternion.
4. The intelligent detection method based on safety helmet according to claim 3 is characterized in that: The accelerometer data is used to construct the measurement equation to correct the roll angle and pitch angle in the system state. The calibrated magnetometer data is incorporated into the measurement equation to assist in calculating the yaw angle, including: Using the preprocessed accelerometer data, the first part of the measurement equation is constructed to correct the roll and pitch angles in the system state; Calculate an estimate of gravity acceleration based on the direction cosine matrix; subtract the estimate of gravity acceleration from the accelerometer measurement to obtain the residual as part of the measurement equation; Incorporating the calibrated magnetometer data into the second part of the measurement equation to assist in calculating the yaw angle; The magnetometer readings are transformed from the vehicle coordinate system to the navigation coordinate system using the direction cosine matrix; Calculate an estimate of the yaw angle based on the converted magnetometer readings; Defining Extended Kalma n The observed variables of the filter are gravity acceleration and yaw angle; according to the constructed measurement equation, the observation model of the filter is set. During the filtering process, the system state equation and the measurement equation are combined to optimize the attitude estimation through iterative update; Jacobia is used n The measurement equation is linearized by matrix to obtain the system measurement matrix, and the filter is updated according to the set process noise and measurement noise covariance matrix; By extending the quaternion optimized by Kalman filtering, the roll angle, pitch angle and yaw angle are calculated, and the final attitude information including roll angle, pitch angle and yaw angle is output.
5. The intelligent detection method based on safety helmet according to claim 4 is characterized in that: Calculate the estimated value of gravity acceleration based on the direction cosine matrix, including: Use the direction cosine matrix to get an estimate of the gravity acceleration: in, represents the estimated gravitational acceleration, is the direction cosine matrix.
6. The intelligent detection method based on safety helmet according to claim 5, characterized in that: Calculate an estimate of the yaw angle from the converted magnetometer readings, including: The yaw angle is calculated from the magnetometer readings as follows: in is the magnetometer 3-axis reading, is the direction cosine matrix, is the magnetometer reading in the navigation coordinate system, and the yaw angle is to derive; to substitute make The yaw angle is 0, and we get: in is the estimated yaw angle; ψ is the yaw angle, θ is the pitch angle, is the roll angle, and b is the carrier coordinate system.
7. The intelligent detection method based on safety helmet according to claim 6, characterized in that: The measurement equation is: By obtaining the Jacobian matrix for h(x(k), k), we can obtain the system measurement matrix: in: A1=2(q1q2+q0q3); <h2 style=";text-align:left;direction:ltr">A2=1-2q2<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> -2q3<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> ; Where V(k) represents the measurement noise and x(k) represents the state variable at time k.
8. An intelligent detection system based on a helmet, characterized in that: The system is used to implement the method according to any one of claims 1 to 7, comprising: An acquisition module is used to acquire raw acceleration data, angular velocity data and magnetic field data in real time through an accelerometer, a gyroscope and front and rear magnetometers installed on the smart helmet; A calibration module, used for calibrating the magnetometer data by using a least square method to obtain calibrated magnetometer data; A fusion module is used to fuse accelerometer data, gyroscope data and calibrated magnetometer data to estimate the object's attitude information, including roll angle, pitch angle and yaw angle; The acquisition module is used to collect magnetometer data according to the posture information of the object, and pre-process it through dynamic sliding window filtering to obtain pre-processed magnetometer data; A matching module is used to estimate the wearer's movement speed by combining the pre-processed magnetometer data with the DTW algorithm; A monitoring module, used to continuously monitor the accelerometer data, gyroscope data and processed magnetometer data to obtain the wearer's motion status; The calculation module is used to integrate the velocity at each moment based on the posture information of the object and the motion state of the wearer, using a genetic algorithm combined with a dead reckoning method to determine the real-time position and motion trajectory of the wearer.
9. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Inertial pedestrian positioning method based on self adaptive zero-velocity interval adjustment
CN108362282A
User posture measuring and calculating method
CN110864684A
Calibration or adjustment of a magnetometer
CN112639402A
MARG attitude calculation method with motion acceleration compensation
CN112683269A
Motion posture recognition method and device, wearable equipment and storage medium
CN113936337A