Rehabilitation training spasm detection method based on servo motor and electronic equipment
By creating a muscle tone model and comparing it with the feedback data of the torque sensor, the problem of high recognition error rate caused by insufficient identification basis of existing spasm detection methods is solved, and a higher precision spasm detection is achieved, which is suitable for implementation in a microcontroller.
Patent Information
- Application Number
- CN202411998287.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing spasm detection methods are insufficiently judged, resulting in a high recognition error rate, and it is impossible to accurately determine whether the spasm occurs or does not occur.
The rehabilitation training spasm detection method based on servo motor is adopted to create a muscle tone model through partial least squares regression analysis, and the dependent variable group and independent variable group are established using observation data and prediction data. The principal components are extracted for regression analysis, the regression algorithm coefficient is calculated, the independent variable and dependent variable are updated, the muscle tone model is constructed, and the muscle tone model is compared with the feedback data of the torque sensor to determine whether spasm occurs.
It improves the accuracy of spasm detection, reduces the possibility of error recognition, and can obtain ideal prediction results when the number of samples is small. It is suitable for implementation in a microcontroller and is convenient for integration into embedded systems.
Smart Images

Figure CN120048534A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rehabilitation medical equipment detection, and particularly relates to a rehabilitation training spasm detection method and an electronic device based on a servo motor. Background Art
[0002] When a lower limb rehabilitation training device conducts lower limb training, due to insufficient leg muscle strength of the user, muscle spasm is inevitably prone to occur. When spasm occurs, the lower limb rehabilitation training device will still continue to work to complete active and passive training, and it is easy to cause sports injuries to the user during this period. Therefore, when spasm occurs, the training device should actively stop training to allow the user to make timely adjustments.
[0003] When spasm occurs, the irregular shaking of the user's limb will affect the motor output of the lower limb rehabilitation training device, so the motor torque output value is irregular. Existing spasm detection means include using a sensor to detect the real-time torque of the motor, setting a current threshold in the controller, and if the detected value reaches the current threshold once or multiple times, it is determined that spasm has occurred, and the controller controls the lower limb rehabilitation training device to stop. Such as the "Method for Detecting Lower Limb Spasm" disclosed in CN107280912A.
[0004] Existing spasm detection means use simple threshold exceeding judgment as the basis for spasm occurrence, with insufficient discrimination basis and high error recognition rate. Problems such as misjudging spasm occurrence or not detecting that the user's leg has spasm easily occur.
[0005] Therefore, there is an urgent need for a spasm detection method that integrates multiple factors as the basis for spasm determination. Summary of the Invention
[0006] In order to solve the problem of incorrect spasm recognition caused by insufficient discrimination basis in the existing spasm judgment method, the present invention proposes a rehabilitation training spasm detection method and an electronic device based on a servo motor, creates a muscle tension model based on partial least squares regression analysis, and judges whether spasm occurs during rehabilitation training based on the predicted value of the muscle tension model.
[0007] To achieve the above object, the first aspect of the present invention proposes a rehabilitation training spasm detection method based on a servo motor, including:
[0008] Step 1: Obtain the observation data of the servo motor as independent variables, set the prediction data as dependent variables, and select p dependent variables and m independent variables to establish n times of standardized observation data matrices X and Y for the dependent variable group and the independent variable group;
[0009] Step 2: Extract the principal components, extract g components from X, where the range of i is 0 to g, and perform weighted summation on X to obtain T;
[0010] Step 3: Calculate the regression algorithm coefficient C through T i and P j , and update the independent variable and the dependent variable. If C i does not meet the output condition, repeat Step 2 for iterative calculation;
[0011] Step 4: If C i meets the output condition, obtain the muscle tension model parameters, and compare the muscle tension model parameters with the feedback data of the torque sensor;
[0012] Step 5: When there is a large gap between the muscle tension model parameters and the feedback data of the torque sensor, it indicates that spasm occurs;
[0013] When the consistency between the muscle tension model parameters and the feedback data of the torque sensor is high, it indicates that the training is normal.
[0014] Furthermore, the p dependent variables in Step 1 are y 1 ,…,y p , and the m independent variables are x 1 ,…,x m , and X and Y are as shown in Formula (1):
[0015]
[0016] Furthermore, the observed data includes the servo motor output torque current value, the motor trapezoidal acceleration / deceleration value, the torque sensor feedback value, and the spasm sensitivity value;
[0017] The predicted data includes the predicted value of the muscle tension model for the motor output torque.
[0018] Using multiple factors such as the servo motor output torque current value, the motor trapezoidal acceleration / deceleration value, the torque sensor feedback value, and the spasm sensitivity value as the input values of the muscle tension model, there is a multiple correlation to provide a data basis for detecting spasm.
[0019] Furthermore, the weighted summation of X in Step 2 is as shown in Formulas (2) to (3):
[0020]
[0021] where W i is the weighted weight;
[0022] T i = X (i) W i (3).
[0023] Furthermore, Step 3 includes calculating the coefficient C of the regression algorithm of T to Y through Formula (4) i :
[0024]
[0025] Further, step 3 includes calculating the coefficient P of the T-to-X regression algorithm through formula (5). j :
[0026]
[0027] Further, according to formula (4) and formula (5), the updated independent variable and dependent variable in step 3 are as shown in formulas (6) to (7):
[0028]
[0029] Y (i+1) = Y (i) - T i C i (7).
[0030] Where X (i+1) is the updated independent variable, and Y (i+1) is the updated dependent variable.
[0031] Further, the output condition in step 3 and step 4 is C i < 0.085.
[0032] The method of the present invention can still obtain an ideal prediction effect even when the number of samples is small, because it emphasizes the relationship between variables rather than the number of samples.
[0033] The second aspect of the present invention proposes an electronic device, including a processor and a memory; wherein, when the processor executes the computer program stored in the memory, it implements a rehabilitation training spasm detection method based on a servo motor.
[0034] Further, the processor includes a single-chip microcomputer. When the single-chip microcomputer executes a rehabilitation training spasm detection method based on a servo motor, g = 2 in the g components in step 2.
[0035] The computing power of the single-chip microcomputer is limited. Using g = 2 for algorithm transplantation can reduce the computing workload of the single-chip microcomputer and prompt the single-chip microcomputer to output the prediction value in a timely manner.
[0036] Through the above technical solutions, the beneficial effects of the present invention are as follows:
[0037] 1. The present invention establishes a muscle tension model, compares the predicted value of the muscle tension model with the feedback data of the torque sensor to determine whether spasm occurs. In step 1, a dependent variable group and an independent variable group are established from the observed data and the predicted data to form an n - time standardized observed data matrix X and Y. The observed data includes four parameters: the torque current value output by the servo motor, the trapezoidal acceleration / deceleration value of the motor, the feedback value of the torque sensor, and the spasm sensitivity value. All four parameters change during spasm and there is multiple correlation. Compared with the existing simple threshold judgment, using multiple factors for partial least - squares regression analysis method to build a model improves the accuracy of spasm detection;
[0038] In step 2, g components are extracted from X, and weighted summation is performed on X to achieve effective regression analysis by extracting the principal components. In step 3, the iteration end condition is set, and the regression algorithm coefficients C i and P j are calculated. In step 4, the regression algorithm coefficients C i and P j at the end of iteration are taken to update the independent variable and the dependent variable to obtain the muscle tension model. This process realizes dimensionality reduction operation through an iterative algorithm, extracts relevant information and constructs a prediction model, enabling accurate spasm detection in step 5.
[0039] 2. The method of the present invention has low requirements for the number of sample data, so the calculation is simple and can be transplanted into a single - chip microcomputer. The single - chip microcomputer is convenient to be integrated into an embedded system, thus realizing spasm detection during training. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is the step flow chart of a spasm detection method for rehabilitation training based on a servo motor according to the present invention.
[0041] Figure 2 is one of the model prediction diagrams of a spasm detection method for rehabilitation training based on a servo motor according to the present invention.
[0042] Figure 3 is another model prediction diagram of a spasm detection method for rehabilitation training based on a servo motor according to the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0043] The present invention will be further described below in conjunction with the drawings and the detailed implementation manners:
[0044] Example 1
[0045] As Figure 1 shown, a spasm detection method for rehabilitation training based on a servo motor includes:
[0046] Step 1: Obtain the observed data of the servo motor as independent variables, set the predicted data as dependent variables, select p dependent variables and m independent variables, and establish the n - th standardized observed data matrices X and Y for the dependent variable group and the independent variable group;
[0047] Step 2: Extract the principal components. Extract g components from X, where the range of i is 0 to g, and perform weighted summation on X to obtain T;
[0048] Step 3: Calculate the regression algorithm coefficients C i and P j , and update the independent variables and dependent variables. If C i does not meet the output conditions, repeat Step 2 for iterative calculation;
[0049] Step 4: If C i meets the output conditions, obtain the muscle tension model parameters, and compare the muscle tension model parameters with the feedback data of the torque sensor;
[0050] Step 5: When there is a large gap between the muscle tension model parameters and the feedback data of the torque sensor, it indicates that spasm occurs;
[0051] When the consistency between the muscle tension model parameters and the feedback data of the torque sensor is high, it indicates that the training is normal.
[0052] The p dependent variables in Step 1 are y 1 ,…,y p , and the m independent variables are x 1 ,…,x m , and X and Y are as shown in formula (1):
[0053]
[0054] The observed data includes the servo motor output torque current value, the motor trapezoidal acceleration / deceleration value, the torque sensor feedback value, and the spasm sensitivity value;
[0055] The predicted data includes the predicted value of the muscle tension model for the motor output torque.
[0056] The weighted summation of X in Step 2 is as shown in formulas (2) to (3):
[0057]
[0058] Among them, W i is the weighted weight;
[0059] T i =X (i) W i (3).
[0060] Step 3 includes calculating the coefficient C of the T-to-Y regression algorithm through formula (4). i :
[0061]
[0062] Step 3 includes calculating the coefficient P of the T-to-X regression algorithm through formula (5). j :
[0063]
[0064] According to formula (4) and formula (5), the updated independent variable and dependent variable in step 3 are shown in formulas (6) to (7):
[0065]
[0066] Y (i+1) = Y (i) - T i C i (7).
[0067] Where X (i+1) is the updated independent variable, and Y (i+1) is the updated dependent variable.
[0068] The output condition described in step 3 and step 4 is C i < 0.085.
[0069] Embodiment 2
[0070] Based on the servo-motor-based rehabilitation training spasm detection method in Embodiment 1, an electronic device is proposed in this embodiment, which executes the servo-motor-based rehabilitation training spasm detection method, including a processor and a memory;
[0071] The processor includes a single-chip microcomputer. When the single-chip microcomputer executes the servo-motor-based rehabilitation training spasm detection method, g = 2 in the g components described in step 2.
[0072] The input end of the single-chip microcomputer is connected to a torque sensor.
[0073] Embodiment 3
[0074] To prove the effect of the method of the present invention, the following comparative experiments are made:
[0075] Based on the servo-motor-based rehabilitation training spasm detection method in Embodiment 1, the predicted values when g = 2 and the predicted values when g = 4 are obtained;
[0076] As Figure 2 and 3 shown, Figure 2 and Figure 3The green "-" represents the predicted value of the muscle tension model when g = 2, the red "." represents the predicted value of the muscle tension model when g = 4, and the blue "+" represents the real-time feedback value of the torque sensor.
[0077] Figure 2 Among them, the curve of the predicted value of the muscle tension model when g = 2, the curve of the predicted value of the muscle tension model when g = 4, and the curve of the real-time feedback value of the torque sensor basically coincide, indicating that no spasm has occurred.
[0078] Figure 3 Among them, the curve of the predicted value of the muscle tension model when g = 2 and the curve of the predicted value of the muscle tension model when g = 4 basically coincide, while there are many deviations between the curve of the real-time feedback value of the torque sensor and the curve of the predicted value of the muscle tension model when g = 2 and the curve of the predicted value of the muscle tension model when g = 4, indicating that spasm has occurred.
[0079] Thus, it can be seen that the method of the present invention can achieve muscle spasm detection.
[0080] The described embodiments are only preferred embodiments of the present invention and do not limit the scope of implementation of the present invention. Therefore, any equivalent changes or modifications made according to the structure, characteristics, and principles described in the scope of the present invention patent should be included in the scope of the patent application of the present invention.
Claims
1. A servo motor-based rehabilitation training spasm detection method, characterized in that: include: Step 1: Obtain the observed data of the servo motor and use it as the independent variable, set the predicted data and use it as the dependent variable, select p dependent variables and m independent variables to establish n-time standardized observed data matrices X and Y of the dependent variable group and the independent variable group; Step 2: Extract the principal components. Extract g components from X, where i ranges from 0 to g. Perform weighted summation on X to obtain T. Step 3: Calculate the regression algorithm coefficient C through T i and P j , and update the independent and dependent variables. If C i If the output condition is not met, repeat step 2 for iterative calculation; Step 4: If C i When the output conditions are met, the muscle tension model parameters are obtained, and the muscle tension model parameters are compared with the feedback data of the torque sensor; Step 5: When there is a large gap between the muscle tension model parameters and the torque sensor feedback data, it indicates that spasm occurs; When the muscle tension model parameters are highly consistent with the torque sensor feedback data, it means that the training is normal.
2. A servo motor-based rehabilitation training spasticity detection method according to claim 1, characterized in that: The p dependent variables in step 1 are y1,…,y p , the m independent variables are x1,…,x m , X and Y are as shown in formula (1):
3. A servo motor-based rehabilitation training spasm detection method according to claim 2, characterized in that: The observation data include the servo motor output torque current value, the motor trapezoidal acceleration / deceleration value, the torque sensor feedback value and the spasm sensitivity value; The prediction data include the predicted values of the motor output torque by the muscle tension model.
4. A servo motor-based rehabilitation training spasticity detection method according to claim 1, characterized in that: The weighted summation of X in step 2 is shown in formulas (2) to (3): Among them, W i is the weighted weight; T i =X (i) W i (3)。 5. The method for detecting spasm in rehabilitation training based on a servo motor according to claim 1, characterized in that: Step 3 involves calculating the coefficient C of the T-to-Y regression algorithm using formula (4): i :
6. A servo motor-based rehabilitation training spasticity detection method according to claim 5, characterized in that: Step 3 involves calculating the coefficient P of the T-to-X regression algorithm using formula (5): j :
7. A servo motor-based rehabilitation training spasticity detection method according to claim 6, characterized in that: According to formula (4) and formula (5), the updating of independent variables and dependent variables in step 3 is shown in formulas (6) to (7): Y (i+1) =Y (i) -T i C i (7); Where X (i+1) is the updated independent variable, Y (i+1) is the updated dependent variable.
8. The method for detecting spasm in rehabilitation training based on a servo motor according to claim 1, characterized in that: The output condition in steps 3 and 4 is C i <0.
085.
9. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, it implements a servo motor-based rehabilitation training spasm detection method as described in any one of claims 1 to 8.
10. An electronic device according to claim 9, characterized in that: The processor comprises a single chip microcomputer. When the single chip microcomputer executes the method for detecting spasm in rehabilitation training based on a servo motor according to any one of claims 1 to 8, g in the g components in step 2 is 2.
Citation Information
Patent Citations
Detection method for spasticity on lower limbs
CN107280912A
Spasm detection method for user based on rehabilitation robot
CN109326342A
Apparatus and method for assessing huntington's disease (HD)
CN114423336A
Rehabilitation system
US20180108271A1