Simulation of gymnastics performance based on MEMS sensor

The development and progress of multi-sensor data fusion theory and methods have also laid the foundation for the research of human body posture tracking system based on inertial sensing. The main research in this paper is the simulation of gymnastics performance based on MEMS sensors. In the preprocessing to reduce noise interference, this paper mainly uses median filtering to remove signal glitches. This article uses virtual character models for gymnastics performances. The computer receives sensor data from the sink node of the motion capture device through a Bluetooth communication module. The unit calculates the quaternion output from the dynamic link library of sensor data processing, calculates the rotation amount and coordinate offset of each sensor node’s limb, and uses the character model to realize the real-time rendering of the virtual character model. At the same time, it controls the storage of sensor data, the drive of the model, and the display of the graphical interface. When a gesture action is about to occur, a trigger signal is given to the system to mark the beginning of the action, so as to obtain the initial data of each axis signal of the MEMS sensor. When the gesture action is completed, give the system a signal to end the action. Mark the end of the action, so that you can capture the original signal data during the beginning and end of the gesture action. In order to ensure the normal communication between PS and PL, it is necessary to test the key interfaces involved. Because the data received by the SPI acquisition module is irregular, it is impossible to verify whether the data is wrong, so the SPI acquisition module is replaced with a module that automatically increments data, and the IP core is generated, and a test platform is built for testing. The data shows that the average measurement error of X-axis displacement of the space tracking system is 8.17%, the average measurement error of Y-axis displacement is 7.51%, the average measurement error of Z-axis displacement is 9.72%, and the average error of three-dimensional space measurement is 8.7%. The results show that the MEMS sensor can accurately recognize the action with high accuracy.


Introduction
At present, new forms of human-computer interaction terminals such as smart clothing, smart accessories, and other wearable computing systems such as mobile Internet, cloud computing, and the Internet of Things have become fashionable consumer electronic products.In addition, the cross integration of wearable computing and emotional computing, physiological computing, and social computing will enrich the research content of big data, human-computer interaction, and intelligent sensing; wearable computing is deeply applied to health care, digital media, mobile communications, and textiles and clothing will also bring new industrial chains.Basic gymnastics gradually evolved from the initial simple to complex, making people's pursuit of the artistic nature of gymnastics more and more intense, and the aesthetic orientation tends to be diversified.Basic gymnastics moves from the initial simple and complex cultural system, people's aesthetic orientation tends to be diversified, and the pursuit of artistry is becoming stronger and stronger.
For the rapid acquisition of the posture information of the integrated navigation, the completion of all the calculations on the PC can no longer meet the requirements, and the hardware platform is built to realize the posture information calculation through the hardware platform.MEMS inertial sensor motion capture system's motion posture calibration.In fact, the inertial sensor is used to collect real-time human motion data, and convert it into the motion posture data of the three-dimensional human skeleton model established by the system, and then use the human skeleton model to achieve human motion simulation.
The application of MEMS sensors in gymnastics performances has very good practical significance.K Józef proposed and verified a calibration method for a threedimensional acoustic vector sensor (AVS) for direction of arrival (DoA) estimation.The AVS device based on the p-p principle can be composed of a standard pressure sensor and a signal processing system.First, perform an amplitude calibration to compensate for the difference in amplitude between the pairs of microphones located on each axis.In order to verify the validity of the calibration method, he used a low-cost MEMS microphone and DSP board to construct a reference AVS.In order to verify the calibration method, he compared the accuracy of the calibration sensor with the commercial AVS and conducted a series of experiments.Although his research is innovative, there are some flaws in the verification process [1].Kim Y discussed the stress caused by humidity saturation after a micromechanical system (MEMS) sensor device undergoes a temperature cycle.He characterized the wet, temperature, and time material properties of the molding compound used in MEMS devices.He used the dynamic mechanical analysis (DMA) method to conduct a series of stress relaxation tests to obtain the viscoelastic properties of the molding compound.He used experimental data to perform numerical simulations and estimated the temperature and humidity stress of the MEMS sensor device under temperature cycles.Although his research is more accurate, it lacks necessary experimental data [2].Park DH studied the influence of the MEMS airbag sensor package module on the signal.In order to eliminate the impact of shell vibration, he introduced a new sensor package on the flexible circuit board, which was directly pasted on the surface of the frame structure with an adhesive.For the signal characteristics, impact tests were carried out on traditional sensor packaging and direct connection sensors using aluminum channels and car side frames.In order to understand the vibration effects of packaged components and structures, he also performed numerical analysis.Although he proved that the vibration characteristics of the frame structure and the module housing and the module installation position have a significant impact on the generation of shock signals, the content of numerical analysis is lacking [3].Huang H believes that the dual-axis scanning mirror assembly (TSAY) is a key component of the optoelectronic system, which is usually used for precise positioning, tracking, scanning and stabilization of the line of sight (LOS).He designed and developed a TSAY prototype.In order to improve the control bandwidth, he optimized the structural topology of the TSAY elliptical mirror to reduce the moment of inertia while maintaining the surface flatness.He uses flexible hinges to achieve a wide range of angles.In order to suppress the angular disturbance caused by the linear vibration of the base, he constructed an adaptive feedforward loop with a base-integrated microelectromechanical system (MEMS) accelerator to enhance the TSAY feedback loop.Although his research is relatively comprehensive, some of his expositions are not accurate enough [4].
This paper analyzes the random drift error of the gyroscope sensor, carries on the random drift error data modeling method based on the time series model and the random drift error compensation method based on the Kalman filter.The posture calculation is performed on the processed sensor signal, and the posture angle calculated by the angular velocity signal is fused and corrected with the posture angle signal calculated by the acceleration signal, and finally a high-precision attitude angle is given.

MEMS sensor
The physical picture of MEMS sensor is shown as in Fig. 1.The micro-control processing chip used in this article is STMicroelectronics' STM32L151.The chip uses a high- performance ultra-low-power 32-bit MCU with a high-performance ARMCortexM3-RISC core.The operating frequency is between 32KHz and 32MHz.It integrates USB connection power and memory.Protection unit (MPU), high-speed embedded memory (512KB flash memory and 80KBRAM), and enhanced I/O and peripherals connected to two APB buses.The chip has excellent real-time performance, superior efficiency, and maximum integration and is suitable for use in wearable smart devices [5,6].
Assuming that the probability density function at k-1 time is p( , and the states x k and Y k − 1 are independent of each other [7].
Integrate x k − 1 to get the CK equation: where p(x k | x k − 1 ) is the state transition probability, which is determined by the system state transition equation and including state noise [8].
Use Bayes' formula to update the prior probability density to obtain the posterior probability density, the expression is as follows [9]: According to the observation equation, y k is only related to x k and noise, and the expression is as follows [10]: ) is the likelihood probability, representing the current system state, and the similarity with the actual measured value, determined by the observation state equation, including observation noise [11].
When collecting data, factors such as whether the sensor is stable, where the sensor is worn and other factors have a certain relationship with the classification and recognition of gait.The sensor's wearing part is different, and the collected acceleration data is also different, so it will directly affect the effectiveness of recognition and classification.Acceleration sensors are often worn on the arms, wrists, waist, chest, and other positions.Energy consumption also affects the size of the sensor power supply module and the overall module size.In addition, the data acquisition module must have sufficient memory space to store the collected data and related software programs [12,13].
Take three consecutive frames of human motion image sequence and mark them as k+1 frame, k frame, and k-1 frame, respectively.The frame difference method is calculated as [14]: In the formula, G(x, y) is the three-frame difference image, f k (x, y) is the gray component of the human motion image sequence, and (x, y) is the position representation of the pixel [15].
Since the carrier interference magnetic field error has a greater impact on the accuracy of the magnetometer output, the error modeling is carried out for this error, and its expression is as follows [16]: Among them, ψ m is the heading output by the magnetometer, A is the circular deviation, and B sin ψ m + C cos 2ψ m is the semicircular deviation [7].

Gymnastics performance
Performing gymnastics is a form of sports performance that integrates gymnastics event elements and performing arts.It is based on gymnastics event elements, with performance as the purpose, and through artistic performance methods, sports content is used as performance material to reflect sports.Culture is a form of sports culture and art.In addition to mastering the correct technical factors, the development of athletes' difficult movements is also closely related to whether they have the physical fitness level that matches the completion of the difficult movements [17].
Physical stamina is an important condition that determines the formation of technical movements, and the improvement of physical stamina is the basis for completing higherlevel difficult movements.Special quality is an important condition that determines the formation of technical movements.Without the improvement of the level of special quality, it is impossible to complete higher levels of difficult movements.Every new development and every update of difficult movements is based on special physical quality based on the creation of corresponding athlete performance.Therefore, special physical fitness plays a vital role in the process of athletes completing a series of movements, and it is the basis and guarantee for athletes to complete difficult movements [18,19].
Performing gymnastics is a form of expression that specializes in sports culture and sports art using sports performances as artistic materials.Aerobics, cheerleading, sports dance, group gymnastics, recreational gymnastics, rhythmic gymnastics, and other items of technical movements, costumes, props, music, and other items constitute the main elements of performing gymnastics.The understanding of performing gymnastics in this study is to weaken its competitive nature, pay more attention to its performance, and make it more visible and entertaining [20,21].
Through the means of artistic performance, the content and theme of the performance are reflected, and the content of the theme is deeply expressed through the display of the theme, and the three-dimensional picture is displayed, allowing people to experience its deeper influence and immersive.Through vivid body language to express cultural connotations, music, and clothing are often ignored by the choreographers, only to cater to the needs of the performance theme and to meet the needs of the performance [22].Gymnastics movements are colorful, different levels have different movements, and different levels of difficulty.It is difficult for teachers to demonstrate every level or every set of movements, and the specifications of the movements they can do are not necessarily high, and it is also impossible to remember every knowledge of gymnastics theory has trouble in the process of demonstrating and explaining to students [23].

Motion capture
Different camera equipment and different shooting scenes will have different effects on the effect of image collection.Moreover, the image sensor will also have a greater impact on the results of the detection of moving human bodies.The choice of light source in the shooting scene will also have a direct impact on the image preprocessing process [24].
Using the one-dimensional center template, the expressions of the gradients in the x and y directions corresponding to the pixels at the position (x, y) are as follows [25].
where H represents an image and H(x, y) represents the gray value of the image at the pixel point (x, y).The gradient value at the pixel (x, y) can be calculated by the following formula [26].
The gradient direction of the pixel (x, y) in the sample is: The motion capture system based on MEMS sensors completely relies on inertial sensors for the collection of human motion data.In this way, when the human body is collected, the sensor must be installed on the moving limbs according to the captured part.This will inevitably cause There are many data collection and data transmission lines attached to the limbs of the human body during motion capture, which undoubtedly has an inevitable restriction on the movement of the human body [27].
The schematic diagram of human action capture is shown in Fig. 2. Deploying the sensor nodes of the motion capture device on the human body is the basic link to achieve the effect of human motion capture.The location and number of sensor nodes deployed on the human body are directly related to the accuracy of action capture effect [28].According to different practical uses and needs, the accuracy required for human motion capture is also different, but when motion capture devices are used in medical rehabilitation, film and television production, and other applications, the higher the accuracy, the better.The higher the accuracy is, the more sensor nodes are needed, so the more data flow is generated, and the more data the computer needs to calculate.As the central node, data sink node plays a role of data aggregation and transfer.The sink node reads the sensor data collected by each sensor node in a certain order, and packages it according to a certain format.The data sink node also has a wireless transmission module, which can send the packaged results to the computer terminal in real time.The upper computer program mainly realizes the operation of the sensor data sent by the sink node, which is used for the processing of sensor data and the synthesis of human body posture data [29].It drives the 3D human body model to make the same action with the user synchronously and plays the role of a large number of sensor data operation and human body action simulation.
3 Gymnastics performance simulation experiment

Sensor parameter setting
This article uses 3-DoFMEMS accelerometer and 3-DoFMEMS gyroscope.MPU-6000 uses three 16-bit ADCs to convert the analog signals measured by the accelerometer and gyroscope into digital signals that can be output.In order to accurately measure fast and slow motion, the measurement range of MPU-6000 is artificially controllable, the measurement range of the accelerometer is ±2g, ±4g, ±8g, and ±16g; the measurement range of the gyroscope is ±250°/s (dps), ±500(dps), ±1000(dps), and ±2000(dps).

Sensor data preprocessing
In reality, the MEMS motion sensor is full of various interferences in the process of taking motion data.There is also noise interference in the acceleration signal transmission process.The jitter of the mobile device will also generate new noise, which makes the collected motion the sensor data contains not only the acceleration information of human behavior but also other interference information.Since the acceleration sensor signal collected when the human body is moving includes the noise part, the gravitational acceleration part and the behavior signal part of the actual human motion, the noise bandwidth of the accelerometer is much larger than the frequency bandwidth of the acceleration signal, and the high frequency signal is filtered out and the low frequency is retained.The signal can then remove noise.In the preprocessing to reduce noise interference, median filtering is mainly aimed at filtering and reducing noise of nonlinear signals, which can effectively remove signal glitches.The expression of the Butterworth low-pass filter is as follows: In the formula, N is the order of the filter; ω c is the cutoff frequency, that is, the frequency when the amplitude drops to -3db; ω p is the edge frequency of the passband, which can be determined according to the spectral characteristics of the signal.

Motion capture of gymnastics performance
In the experimental design of the motion capture device, the software used to display the motion capture effect selects visual C++ 6.0 launched by Microsoft as the development environment.Perform gymnastics performances using virtual character models.The computer receives sensor data from the sink node of the motion capture device through a Bluetooth communication module.The unit calculates the quaternion output from the dynamic link library of sensor data processing, calculates the rotation amount and coordinate offset of each sensor node's limb, and uses the character model to realize the real-time rendering of the virtual character model.At the same time, it controls the storage of sensor data, the drive of the model, and the display of the graphical interface.In the process of debugging and improving the algorithm of human motion capture, since the fusion processing process of sensor data has been encapsulated into a dynamic link library, the application program directly calls the output result of the DLL.Therefore, if you need to adjust the data fusion processing algorithm, you only need to adjust the data processing DLL without modifying the application.

Signal acquisition
The gesture recognition system based on MEMS sensors uses a total of 14 MEMS sensors in a single hand to collect single-hand gesture signals.The node gesture signals of 14 sensors at the same time node constitute the complete gesture signal of the time node.Therefore, ensuring the synchronization of signal transmission and the consistency of transmission rate is the key to ensuring the accurate collection of gesture signals.The two IC data lines SDA and SCL interfaces of each BMI055 sensor module are connected to the multi-channel signal selection chip to ensure that the gesture signals of 14 MEMS sensors are obtained at the same time, so as to realize the collection and synthesis of the gesture signals of the key nodes of the hand into a complete gesture signal.When a gesture action is about to occur, a trigger signal is given to the system to mark the beginning of the action, so as to obtain the initial data of each axis signal of the MEMS sensor.When the gesture action is completed, give the system a signal to end the action.Mark the end of the action, so that you can capture the original signal data during the beginning and end of the gesture action.

Communication test
In order to ensure the normal communication between PS and PL, it is necessary to test the key interfaces involved.When the system is powered on and running, the AXIDMA core transmits the attitude information collected by the PL part to the DDR3SDRAM through the AXIHP bus.When the amount of data sent reaches the number 1MB set in AXIDMA, AXIDMA will generate an interrupt and send it to PS interrupt information.Then, you can view the posture information received sequentially from the initial address 0x10300000 in the memery window.Since the data received by the SPI acquisition module is irregular, it is impossible to verify whether the data is wrong, so replace the SPI acquisition module with a data that automatically increments.The module generates IP core and builds a test platform for testing.After testing, the data transmission rate is 298MB/s, realizing high-speed data transmission.Data transmission is correct, and AXIDMA realizes the correct communication between PS and PL.

Sensor performance analysis
The effect of magnetometer before and after compensation is shown in Fig. 3.It can be seen from Fig. 3a that the raw data fluctuation of the X-axis of the magnetometer without error compensation is as high as 720μT, and the fluctuation of the original value of the X-axis of the magnetometer after compensation is reduced to 50μT.It can be seen from Fig. 3b that in 10 repetitive experiments, the amplitude of the average output of the magnetometer X-axis after compensation fluctuates little, and the output value of the X-axis of the magnetometer is around 911μT.The experimental results show that the magnetometer has enhanced the stability of the magnetometer in the environment of magnetic interference and improved the anti-noise ability of the magnetometer after error compensation.
The comparison of the weighted average coefficients corresponding to different recognizers is shown in Fig. 4. From the correlation coefficients in the table, it can be found that the recognition accuracy of the corresponding recognizers is from high to low in order: traditional decision tree recognizer, two-layer decision tree-based recognizer, Bayesian recognizer, support vector machine recognizer, but from the algorithm complexity of the system, the complexity based on the two-layer decision tree is absolutely reduced; and when the detected behavior appears stationary and walking that are common in daily behavior, the system is it only needs to extract the data of the gyroscope sensor without mentioning the data of the angular velocity sensor, so the energy consumption of the system is also greatly reduced.
When the system is placed in a real measurement scenario, the system output is the dynamic output.Due to the effective filtering method, the stability of the dynamic output of the system will prove the effectiveness of the filtering.When the dynamic output tends to diverge, the algorithm is invalid, and when the dynamic output of the system tends to be stable, the algorithm is proved to be effective.The dynamic test results are shown in Table 1.It can be seen from the test results that after effective static data compensation and dynamic filtering, the posture display in this article starts from a certain position and finally returns to the approximate original position, and the curve is smooth and complete.At the same time, when the more obvious external vibration is artificially added, the posture capture curve can be more clearly reflected and captured, and the dynamic characteristics are good.
The experimental results of multi-level threshold detection are shown in Table 2.The results show that the specificity of the multi-level threshold detection method is relatively high, reaching 93.33%, indicating that the detection effect of normal behavior is better.The detection rates of jumping and running in daily behavior were both 85%.The detection rate of fall behavior was 91%, and the detection rate of lateral fall behavior was higher than that of before and after falls.Specifically, the detection rate of lateral falls was 94%, and the detection rate of front and rear falls was 88%.The reason for this result is that when the human body falls back and forth, the cushioning effect of the hands before the human body collides with a lowpower object is more significant than that of a lateral fall.The fall lead time of different fall and fall behaviors is slightly different, and the overall fall is between 0.28 and 0.35S.Among them, the lead time of a lateral fall is greater than that of a front-to-back fall.

Action simulation results
The results of the system's three-dimensional space tracking experiment are shown in Fig. 5.The average measurement error of X-axis displacement of the space tracking  system is 8.17%, the average measurement error of Y-axis displacement is 7.51%, the average measurement error of Z-axis displacement is 9.72%, and the average error of three-dimensional space measurement is 8.7%.Compared with the magnetic space tracking system and the laser space tracking system, the error of the system is relatively large.In the magnetic and laser tracking system, the external reference system can improve the precise spatial coordinate position of the system.At the same time, their measurement range is also restricted by the external reference system.The space tracking system based on MEMS acceleration sensor breaks through the external restrictions and can realize free space measurement.
The data processing effect of the magnetoresistive sensor is shown in Table 3. From the experimental results, it can be seen that the rectified magnetoresistive sensor can accurately calculate the heading angle, and the error is within 1°, which can meet the accuracy requirements of the human body motion capture.
The average value of the pitch angle measurement angle is shown in Fig. 6.When the given pitch angle of the three-axis turntable is within ±80°, the pitch angle measurement error of the attitude measurement unit can basically be kept within 0.1°, and then the measurement error increases slightly with the increase of the given pitch angle of the three-axis turntable.When the given pitch angle of the three-axis turntable increases to ±85°, the measurement error rises to about 1°.When the given pitch angle of the three-axis turntable reaches around ±90°, the measurement error drops slightly.In general, after the MEMS acceleration, the pitch angle measurement accuracy of the attitude measurement unit after taking into account the calibration of the MEMS gyroscope can basically meet the measurement error of 0.1°.At the same time, the test result is the same as the result obtained by MATLAB simulation, indicating that the full-angle attitude estimation algorithm and attitude measurement given in this article are used.The equipment can realize the high-precision static measurement function of the pitch angle.Table 4 shows the calibration results of the accelerometer's zero offset and scale factor in different attitudes.After many experiments, statistics found that the X-axis bias error can be reduced to 22.5mg, the scaling factor error is reduced to −0.15%~0.5%; the Y-axis bias error is reduced to 8.2mg, and the scaling factor error is 0.25%.Floating within the range of ~1.3%; the zero deviation error of the Z-axis can be reduced to 37.83mg, and the scale factor error is within the range of −1.85%~0.43%.The accuracy of the accelerometer zero offset and scale factor has been significantly improved.

Sensor error analysis
Figure 7 shows the comparison before and after data processing of the acceleration sensor.After processing, the waveform output by the acceleration sensor only contains the fundamental signal and a small amount of low-frequency signals.On the surface, much of the effective information in the output signal of the acceleration sensor is lost, but in fact, the information lost here can be obtained from the angular velocity sensor in the subsequent complementary filtering process.
The performance index of motion recognition is shown in Fig. 8. From the experimental results, the precision rate and recall rate indicators under several schemes did not deviate seriously, and the classification results of the model are credible.Further analysis of the experimental results shows that the feature-based recognition scheme in offline mode can achieve higher recognition accuracy and can flexibly adjust the feature combination according to actual needs; for online action recognition, the convolutional neural network algorithm can show that the data the robustness of the displacement, in fact, the translation expansion of the data set improves the recognition performance of the network, and does not need to greatly increase the training time.Therefore, the scheme based on deep learning can better cooperate with the simple sliding window sampling method to achieve action recognition.The amplitude comparison before and after correction of the acceleration of gravity is shown in Table 5.The average output value of the actual accelerometer reaches 1.06g.After the static error correction is performed by the least squares method, the average output amplitude of the accelerometer becomes 0.957g, and the average amplitude error is reduced by 70% from the original value.The static error correction is performed by the ant colony algorithm.The average value of the corrected acceleration value is almost the same as the acceleration of gravity.The variance of the acceleration value after correction by the ant colony algorithm is reduced by 70% compared with the original data.The error correction effect is obvious, which also proves the effectiveness of the ant colony algorithm.
The training and recognition results of the two-classification pattern are shown in Table 6.It can be seen from the table that SVC has excellent performance in the realization of two classification recognition.Not only does the CV accuracy rate reach 100% when all optimization algorithms are used, but the final recognition accuracy rate is also 100%, that is to say achieve complete recognition of the test set.However, the number of support vectors and parameter optimization results obtained in the training and optimization process are different.That is to say, the recognition accuracy has reached the maximum value, but the parameters c and g are not necessarily the best.In this case, it is impossible to analyze the pros and cons of the optimization algorithm and the performance of SVC.Therefore, the experimental research of multiclassification mode should be continued.

Conclusions
With the gradual increase of people's attention to sports and the continuous enhancement of the concept of healthy life, the MEMS-based human movement information collection system has extremely important application value.People can use this system to get more professional sports guidance.In the process of participating in sports, to prevent sports injuries, and at the same time, combining the system with big data technology can achieve more comprehensive sports information analysis functions.This paper analyzes the working principles of acceleration sensors, gyroscopes, and magnetic sensors based on MEMS technology and selects a low-pass filtering method according to the working characteristics of the sensors to complete the preprocessing of sensor data.Subsequently, the error models of the three sensors are analyzed separately, and the sensor data is calibrated to improve the data accuracy.According to the principle of micro-inertial devices, the human body motion capture needs are analyzed, the  experimental platform is built, the CAN protocol is used to realize the communication problems between electronic devices, and the XBee-WIFI wireless communication technology is used to solve the problems of device wearing and movement restrictions.

Fig. 3
Fig. 3 Effect before and after magnetometer compensation

Fig. 4
Fig. 4 Comparison of weighted average coefficients corresponding to different recognizers

Table 1
Dynamic test results

Table 2
Experimental results of multi-level threshold detection

Table 3
Data processing effect of magnetoresistive sensor Average value of pitch angle measurement

Table 4
Accelerometer's zero offset and scale factor calibration results in different attitudes Acceleration sensor data processing before and after comparison Chen et al.EURASIP Journal on Advances in Signal Processing (2021) 2021:47

Table 5
Comparison of amplitude before and after correction of acceleration of gravity Correction method Amplitude average performance comparison Standard deviation comparison of amplitude Average value Compared to the original Variance Compared to the original

Table 6
Two-classification pattern training and recognition results Chen et al.EURASIP Journal on Advances in Signal Processing (2021) 2021:47 Page 15 of 16