A closed-loop feedback control method for functional electrical stimulation
By combining type II fuzzy PID and iterative learning control in a closed-loop feedback control method, the electrical stimulation parameters are dynamically adjusted, which solves the problem of insufficient control precision in functional electrical stimulation in the existing technology. This achieves high-precision tracking and stability of the movement trajectory of the affected limb, and improves the rehabilitation effect of stroke patients.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NINGXIA UNIVERSITY
- Filing Date
- 2025-01-20
- Publication Date
- 2026-04-10
AI Technical Summary
Existing functional electrical stimulation methods have low control precision in the rehabilitation training of stroke patients and cannot correct errors and interferences during the movement process, resulting in insufficient control precision of functional electrical stimulation of the affected limb.
A closed-loop feedback control method for functional electrical stimulation is adopted, which combines type II fuzzy PID and iterative learning control (ILC) algorithm. By monitoring the actual and desired posture of the affected limb in real time, the electrical stimulation parameters are dynamically adjusted, and the learning rate gain of the controller is optimized by using type II fuzzy logic inference to achieve precise control of the affected limb.
It significantly improves the tracking accuracy and stability of the movement trajectory of the affected limb, reduces the historical control experience of iterative learning, can effectively compensate for external interference and nonlinear changes in the muscle system, and enhances the effect of rehabilitation training.
Smart Images

Figure CN119896811B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of biomedical engineering technology, and in particular to a closed-loop feedback control method for functional electrical stimulation. Background Technology
[0002] Some stroke patients experience unilateral limb paralysis after the onset of the stroke, specifically manifested as muscle weakness, abnormal muscle tone, and motor dysfunction in the paralyzed limb. In response to this condition, the engineering field employs functional electrical stimulation (FES) as a common method of rehabilitation training to promote the recovery and functional improvement of the affected muscles.
[0003] In the existing technology, when performing functional rehabilitation training on hemiplegic patients after stroke, a controller is usually used to perform functional electrical stimulation on the affected limb according to pre-set instructions or programs. However, the control accuracy of this method mainly relies on manually adjusting the electrical stimulation parameters according to treatment needs, which cannot correct errors and interferences during the movement process, resulting in low control accuracy of functional electrical stimulation on the affected limb. Summary of the Invention
[0004] Therefore, it is necessary to provide a closed-loop feedback control method for functional electrical stimulation to address the above-mentioned technical problems. This method can improve the control accuracy of functional electrical stimulation of the affected limb.
[0005] The present invention adopts the following technical solution:
[0006] This invention provides a closed-loop feedback control method for functional electrical stimulation, comprising:
[0007] Based on the actual posture and desired posture of the affected limb, determine the target motion trajectory from the actual posture to the desired posture, and divide the target motion trajectory into multiple nodes;
[0008] The optimization of multiple nodes is iterative. In the first iteration, the initial control parameters of multiple nodes are calculated multiple times by a type 2 fuzzy PID controller to obtain candidate control parameters of multiple nodes. Functional electrical stimulation is then performed on the affected limb using the candidate control parameters.
[0009] Starting from the second iteration, the error of the current node is determined based on the actual pose and the desired pose of the current node, and the learning rate gain of the type 2 fuzzy iterative learning controller is updated based on the error of the current node.
[0010] The candidate control parameter of the previous iteration and the error of the historical node of the current iteration are substituted into the type 2 fuzzy iterative learning controller to obtain the candidate control parameter of the current node of the current iteration until the iteration is completed; the candidate control parameter is used for functional electrical stimulation of the affected limb.
[0011] Preferably, the learning rate gain of the type 2 fuzzy iterative learning controller is updated according to the error of the current node, including:
[0012] According to the error of the current node and the error of the previous node, the error change rate of the current node is determined.
[0013] The error change rate and the error are subjected to type 2 fuzzy inference to obtain the learning rate gain of the current node.
[0014] Preferably, the error change rate and the error are subjected to type 2 fuzzy inference to obtain the learning rate gain of the current node, including:
[0015] According to the preset domain and the membership function, the error change rate and the error are fuzzified to obtain the membership of the error change rate and the membership of the error.
[0016] Based on the fuzzy rule table, the expected value of the learning rate gain is determined according to the membership of the error change rate and the membership of the error.
[0017] The expected value of the learning rate gain is converted into the actual value of the learning rate gain according to the interval mapping formula.
[0018] Preferably, the control formula of the type 2 fuzzy iterative learning controller is:
[0019] ;
[0020] Wherein, is the candidate control parameter of the i th node in the j th iteration, and is the candidate control parameter of the i th node in the j th iteration. and are the learning rate gains of the i th node on the trajectory. Preferably, the process of obtaining the actual posture and the expected posture of the affected limb includes:
[0021] The torque of the healthy limb is collected through the inertial measurement unit worn by the healthy limb, and the torque of the healthy limb is determined as the expected posture of the affected limb, and the actual posture of the affected limb is collected through the inertial measurement unit worn by the affected limb.
[0022] The present application provides a kind of functional electrical stimulation closed-loop feedback control device, including:
[0023] The present application provides a kind of functional electrical stimulation closed-loop feedback control device, including:
[0024] The determining module is configured to determine a target motion trajectory from the actual posture to the expected posture of the affected limb according to the actual posture and the expected posture of the affected limb, and divide the target motion trajectory into a plurality of nodes.
[0025] The first iteration module is configured to iteratively optimize the plurality of nodes, and calculate the candidate control parameters of the plurality of nodes by the type-2 fuzzy PID controller for multiple times at the first iteration, and perform functional electrical stimulation on the affected limb by the candidate control parameters.
[0026] The updating module is configured to determine the error of the current node according to the actual posture and the expected posture of the current node from the second iteration, and update the learning rate gain of the type-2 fuzzy iterative learning controller according to the error of the current node.
[0027] The second iteration module is configured to obtain the candidate control parameters of the current node in the current iteration by substituting the candidate control parameters in the previous iteration and the error of the historical node in the current iteration into the type-2 fuzzy iterative learning controller, until the iteration is completed, and the candidate control parameters are used for functional electrical stimulation on the affected limb.
[0028] The application provides a computer readable storage medium, the storage medium stores a computer program, the computer program is executed by the processor of STM32 or other microcontroller to realize the closed-loop feedback control method of functional electrical stimulation.
[0029] The application provides a computer device, including a memory, a processor and a computer program stored on the memory and executable on the processor, the processor is the processor of STM32 or other microcontroller, and the processor realizes the closed-loop feedback control method of functional electrical stimulation when executing the program.
[0030] The above-mentioned at least one technical scheme adopted by the application can achieve the following beneficial effects:
[0031] In the application, when the affected limb is stimulated functionally, the type-2 fuzzy PID controller with faster response speed is used in the initial iteration stage, so that the functional electrical stimulation on the affected limb by the candidate control parameters can make the actual motion trajectory of the affected limb quickly approach the target motion trajectory, and the historical control experience of iteration learning is significantly reduced, and then in the subsequent iteration process, the candidate control parameters of the current node in the current iteration are updated by the type-2 fuzzy iterative learning controller through the candidate control parameters in the previous iteration and the error of the historical node in the current iteration, which is equivalent to gradually improving the tracking accuracy of the motion trajectory of the affected limb to the target motion trajectory by learning the historical control experience. BRIEF DESCRIPTION OF DRAWINGS
[0032] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0033] Figure 1 An application block diagram of a type 2 fuzzy PILC-SO closed-loop feedback control algorithm provided by the present application;
[0034] Figure 2 A flowchart of a closed-loop feedback control method of functional electrical stimulation provided by the present application;
[0035] Figure 3 A simulation flowchart of a type 2 fuzzy PID control algorithm provided by the present application;
[0036] Figure 4 A schematic diagram of an interval type 2 triangular membership function provided by the present application;
[0037] Figure 5 A simulation flowchart of a type 2 fuzzy ILC algorithm provided by the present application;
[0038] Figure 6 A schematic diagram of a type 2 fuzzy PILC-SO closed-loop feedback FES control strategy provided by the present application;
[0039] Figure 7 A simulation flowchart of a type 2 fuzzy PILC-SO algorithm provided by the present application;
[0040] Figure 8 A simulation result schematic diagram of a type 2 fuzzy PILC-SO algorithm provided by the present application;
[0041] Figure 9 A simulation result schematic diagram of another type 2 fuzzy PILC-SO algorithm provided by the present application;
[0042] Figure 10 A schematic diagram of wrist extension trajectory of a healthy subject simulating wrist extension dysfunction provided by the present application;
[0043] Figure 11 A PPMCC coefficient statistical result schematic diagram of lower limb movement trajectory reconstruction under different FES application modes provided by the present application;
[0044] Figure 12 A PPMCC coefficient change trend schematic diagram of actual and target functional movement trajectories under three FES functional modes provided by the present application;
[0045] Figure 13 A schematic diagram of a closed-loop feedback control device of functional electrical stimulation provided by the present application;
[0046] Figure 14 A schematic diagram of a computer device for implementing a closed-loop feedback control method for functional electrical stimulation, as provided by the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0048] When stroke hemiplegic patients use existing open-loop or closed-loop FES systems for functional rehabilitation training, they generally experience problems such as low completion rate of movements, unstable and discontinuous limb movement status, which seriously restricts the recovery effect of limb function during the golden period of rehabilitation training.
[0049] Open-loop controlled feminine elective systems (FES) have significant limitations in promoting movement in paralyzed limbs, primarily in their inability to correct errors and interference during movement, resulting in lower performance. Furthermore, open-loop FES faces challenges such as electrode placement, muscle fatigue, changes in body posture, time-varying muscle dynamics, and external interference. These factors collectively affect the paralyzed limbs' ability to perform stable and smooth functional training movements, thus limiting their rehabilitation effectiveness.
[0050] To overcome the limitations of open-loop control, closed-loop control-based functional endoscopic stimulation (FES) has emerged. Closed-loop systems introduce feedback controllers to monitor muscle responses or limb movement status in real time, thereby more effectively suppressing positional deviations, changes in muscle responses, and fatigue. Based on this feedback information, the system can dynamically adjust electrical stimulation parameters to ensure precise application of charge to the target muscles. This personalized and precise stimulation strategy enables paralyzed limbs to stably and smoothly execute functional movements that match the expected movement trajectory, significantly improving rehabilitation outcomes. However, the design and implementation of closed-loop FES systems also face many challenges, particularly the tracking and control of joint angles. Due to the nonlinearity of the musculoskeletal system and the delayed effect of electrical stimulation response, achieving precise control is especially difficult.
[0051] In the design of closed-loop feedback FES control strategies, the controller and the model are two core elements. Depending on whether the muscle electrical stimulation response model is used to evaluate the performance of the controller, closed-loop feedback FES control strategies are divided into two categories: model-free control and model-based control. Model-free control relies on real-time muscle signals or predicted responses to adjust parameters, has strong adaptability and the ability to handle complex nonlinear relationships, but has high data dependence, high computational resource requirements, and insufficient model interpretability. Model-based control can provide accurate prediction and control when the model is accurate, has strong adaptability and diverse controller selection, but the model is complex to build, susceptible to interference, and computationally intensive.
[0052] Closed-loop feedback control is an intelligent dynamic strategy that uses real-time acquisition of paralyzed limb movement or muscle response as feedback to adjust electrical stimulation parameters for precise stimulation. This strategy uses sensors to monitor muscle activity, joint position, and other parameters, and dynamically adjusts the stimulation signal to ensure more accurate limb movement control. In closed-loop FES, the key is to use appropriate controllers to generate precise electrical stimulation, ensuring that paralyzed limbs can perform high-quality rehabilitation training. Ultimately, whether it is model-free closed-loop feedback or model-based closed-loop feedback control algorithm, it will be deployed in an embedded rehabilitation training system to assist paralyzed patients in performing rehabilitation training tasks and promote the recovery of paralyzed limb function. Model-based closed-loop feedback control algorithms can test their control performance through pre-constructed muscle response models, and compared to model-free closed-loop feedback control algorithms, the latter is less reliable due to its high dependence on data, the need for large computational resources, and insufficient model interpretability. Therefore, model-based closed-loop feedback control algorithms are more reliable.
[0053] Iterative learning control (ILC) is a closed-loop feedback control algorithm that is more suitable for combination with FES technology, which can use the repeatability of rehabilitation training tasks to update the control signal, reduce tracking error, and improve tracking accuracy. However, ILC control algorithms also have challenges in handling nonlinear systems and non-repetitive disturbances, learning rate selection, and real-time performance. To address these challenges, researchers have proposed methods such as multi-model ILC based on estimation and PID-type ILC combined with adaptive network fuzzy inference systems. However, ILC-based closed-loop feedback control algorithms still have issues such as long iteration times, poor real-time performance, learning rate selection, and unstable control performance.
[0054] In summary, the prior art in this field has the following defects: the existing model-free closed-loop feedback FES control algorithm does not rely on pre-built models, so there may be limitations in dealing with physiological characteristics such as muscle response nonlinearity and fatigue, which may lead to inaccurate adjustment of electrical stimulation parameters and affect rehabilitation effectiveness. In addition, the performance of these algorithms is highly dependent on the quality and stability of the feedback signal, and any noise or interference in the signal can affect the accuracy of the control. Finally, due to the lack of in-depth understanding of muscle physiology, these algorithms may not achieve the optimal stimulation strategy, thereby limiting the further improvement of rehabilitation effectiveness.
[0055] Based on this, the present application provides a closed-loop feedback control method for functional electrical stimulation, which uses a synergistically optimized control algorithm combining type-2 fuzzy PID and ILC (PILC-SO) closed-loop feedback FES control strategy. First, the type-2 fuzzy PID control algorithm is used to make the actual movement trajectory of the affected limb output quickly approach the target movement trajectory, significantly reducing the iterative learning history control experience of the present application. Then, the present application uses type-2 fuzzy ILC with PID type learning rate gain to compensate for external disturbances and muscle system nonlinear changes, ensuring smooth and stable movement trajectory of the controlled object, continuously improving tracking accuracy and reducing trajectory error based on the control experience of the last time. The present application proposes a model-based closed-loop feedback control algorithm that combines interval type-2 fuzzy logic reasoning PID and ILC, which can effectively compensate for disturbances and muscle time-varying uncertainty during rehabilitation training, and enhance the control accuracy of the controlled object through iterative learning historical experience.
[0056] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0057] The main purpose of the present application is to develop and deploy a closed-loop feedback-based FES control algorithm to a research and design FES prototype system to assist paralyzed patients in reconstructing smooth, stable, and coherent rehabilitation training movements. The system calculates the movement trajectory error of the controlled limb and the healthy limb in real time, dynamically adjusts the output of the electrical stimulation intensity using the controller algorithm, thereby achieving stable and smooth movement trajectory of the controlled limb, and as much as possible matching the healthy limb.
[0058] In an exemplary embodiment, a closed-loop feedback functional electrical stimulation (FES) control strategy type-2 fuzzy PILC-SO for reconstructing motor function of stroke hemiplegic limbs is provided. As Figure 1As shown, the stimulation frequency, pulse width or current intensity of the functional electrical stimulation FES is determined by the electromyographic signal regulation, and then the muscle response model / human skeletal muscle system (affected limb) is subjected to functional electrical stimulation FES, and the angle / torque of the affected limb is collected N act , and is fed back to the type 2 fuzzy PILC-SO controller, which analyzes the angle / torque N ref and the angle / torque N act to determine the adjustment amount (stimulation frequency, pulse width or current intensity), and adjusts the stimulation frequency, pulse width or current intensity of the functional electrical stimulation FES output by the electromyographic signal regulation. This control strategy can be applied not only to the FES mode regulated by the electromyographic signal (i.e. electromyographic control FES, as shown by the dashed box in the figure), but also to FES applications that rely only on kinematic sensor feedback.
[0059] In an exemplary embodiment, as Figure 2 shown, Figure 2 is a flowchart of a functional electrical stimulation closed-loop feedback control method according to the present application, which specifically includes the following steps:
[0060] S201, determining a target motion trajectory from the actual posture to the desired posture of the affected limb according to the actual posture and the desired posture of the affected limb, and dividing the target motion trajectory into multiple nodes.
[0061] Wherein, the posture can be torque or angle information.
[0062] Optionally, the process of obtaining the actual posture and the desired posture of the affected limb includes: collecting the torque through the inertial measurement unit (IMU) worn by the healthy limb, and determining the torque of the healthy limb as the desired posture of the affected limb, and collecting the actual posture through the inertial measurement unit worn by the affected limb.
[0063] According to the actual posture and the desired posture of the affected limb, a target motion trajectory from the actual posture to the desired posture is determined, and the target motion trajectory is divided into multiple nodes. For example, the target motion trajectory is divided into 300 nodes.
[0064] S202, iterative optimization is performed on the multiple nodes, and in the first iteration, the initial control parameters of the multiple nodes are calculated multiple times by the type 2 fuzzy PID controller to obtain candidate control parameters of the multiple nodes, and the affected limb is subjected to functional electrical stimulation through the candidate control parameters.
[0065] The control parameter can be a stimulation frequency, a pulse width, or a current intensity acting on the affected limb.
[0066] The PID algorithm is integrated in the self-developed embedded rehabilitation training system, so a type 2 fuzzy PID controller is adopted. The position type PID control is not applicable due to the integral error accumulation of the real-time changing healthy limb movement angle of the target torque. On the contrary, the incremental PID control only considers the instantaneous change of the control quantity, and is more suitable for dynamic target values. Therefore, the incremental PID control is selected in the type 2 fuzzy PID controller to ensure the accurate tracking of the target torque of the patient rehabilitation training system.
[0067] Incremental PID control The control quantity at time t is:
[0068] (1)
[0069] Wherein, represents n the control parameter corresponding to time t-1, is n the error between the target torque and the actual posture at time t-1, is the error between the target torque and the actual posture at time t, T is the sampling period, is the integral time constant, is
[0070] the derivative time constant, and is the learning rate gain in the type 2 fuzzy PID controller.
[0071] Let ,
[0072] , is the integral coefficient; is the derivative coefficient, and the above formula is simplified as:
[0073] (3)
[0074] Wherein, is the output of the type 2 fuzzy PID controller, , and is the learning rate gain in the type 2 fuzzy PID controller.
[0075] It should be noted that the error of each node can be calculated multiple times, and for any node, the error of the node can be determined based on the initial control parameters of the node, the error of the first three nodes of the node And Determine The output of the type 2 fuzzy PID controller And the control parameters of the previous node The sum is determined as the candidate control parameter, and finally, the functional electrical stimulation is performed on the affected limb through the candidate control parameter. In formula (3), the Indicates the first
[0076] As Figure 3 shown, Figure 3 is a simulation flowchart of the type 2 fuzzy PID control algorithm, which performs fuzzy logic reasoning and PID calculation through the FuzzyPIDcontroller function Times, wherein, the FuzzyPIDcontroller function is responsible for performing type 2 fuzzy logic reasoning and PID calculation to obtain the increment , And the candidate control parameter of the previous node u Updates the candidate control parameter of the current node u , the TransferFunction function is responsible for applying the candidate control parameter of the current node u To the affected limb to obtain the actual posture. The electrical stimulation parameter and muscle response transfer function are used as the controlled model, and the target torque is set to 0.8 (normalized). The range of PID controller parameters And Is limited to [-0.5, 0.5], The range of is [-0.01, 0.01]. This design aims to use the type 2 fuzzy logic system to realize adaptive adjustment of the electrical stimulation parameter in the embedded rehabilitation training system to meet the expected torque output requirements.
[0077] The type 2 fuzzy PID used in the present application has the advantages of stronger modeling capability, better control effect, wider adaptability, and the combination of fuzzy control and PID control compared to the PID used in the control method in the prior art, which can handle intra- and inter-individual uncertainties, smooth control surfaces near steady state, improve robustness and suppress oscillation, adapt to complex nonlinear systems and automatically adjust control parameters to cope with system changes and external disturbances, and maintain good control performance when facing system parameter changes and external disturbances.
[0078] S203, starting from the second iteration, determines the error of the current node based on the actual and expected pose of the current node, and updates the learning rate gain of the type 2 fuzzy iterative learning controller based on the error of the current node.
[0079] After obtaining the candidate control parameters for each node, functional electrical stimulation can be performed on the affected limb at each node using the candidate control parameters. The actual posture of the affected limb at the corresponding node can be collected, and then the error of the corresponding node can be determined based on the actual posture and target torque of the corresponding node.
[0080] In an exemplary embodiment, updating the learning rate gain of the Type 2 fuzzy iterative learning controller based on the error of the current node includes: determining the error change rate of the current node based on the error of the current node and the error of the previous node; and performing Type 2 fuzzy inference on the error change rate and the error to obtain the learning rate gain of the current node.
[0081] The ratio of the difference between the error of the current node and the error of the previous node to the time difference between two adjacent nodes is determined as the error change rate of the current node.
[0082] Optionally, type 2 fuzzy inference is performed on the error change rate and the error to obtain the learning rate gain of the current node, including: fuzzifying the error change rate and the error according to a preset universe of discourse and membership function to obtain the membership degree of the error change rate and the membership degree of the error; determining the expected value of the learning rate gain based on the fuzzy rule table and the membership degree of the error change rate; and converting the expected value of the learning rate gain into the actual value of the learning rate gain according to the interval mapping formula.
[0083] In this invention, Type 2 fuzzy logic reasoning plays a key role, based on the target torque. and actual posture Error and rate of change of error The learning rate gain of the ILC controller can be dynamically adjusted using either a PID or iterative learning approach. Because the ILC controller employs a PID-type learning rate, the output of the Type 2 fuzzy logic inference encompasses three learning rate gains. , and This enables adaptive tuning of controller parameters, improving the flexibility and performance of the control system.
[0084] Type 2 fuzzy logic reasoning consists of three parts: fuzzification, fuzzy reasoning, and defuzzification. The specific process is as follows:
[0085] Firstly, according to the preset domain and membership function, the error change rate and error are fuzzified to obtain the membership of the error change rate and the membership of the error, including: the error change rate and error are mapped to a unified preset domain to obtain the unified parameters of the error change rate and error, the interval 2 type triangular membership function is used to describe the fuzzy characteristics of the unified parameters of the error change rate and error, and the membership of the error change rate and the membership of the error are obtained.
[0086] Specifically, in order to realize the fuzzification processing, the domain and the membership function are first determined in the present application. The numerical ranges of the input variable and its change rate , and and the output variable are different, the actual numerical value is mapped to a unified domain in the present application, so as to facilitate subsequent processing and analysis. In the present application, the domain is set as [-3, 3] and is uniformly divided into six intervals: [-3, -2], [-2, -1], [-1, 0], [0, 1], [1, 2] and [2, 3]. These intervals correspond to fuzzy sets NB (negative big), NM (negative medium), NS (negative small), ZO (zero), PS (positive small), PM (positive medium) and PB (positive big) respectively. For example, when the input range is [-80, 80] and the value of is 40, the value obtained by mapping is 1.5, which is located in the interval [1, 2], indicating that the point is between positive small (PS) and positive medium (PM). This mapping method helps to convert specific numerical values into fuzzy semantics that can be processed by the fuzzy logic system, thereby realizing adaptive adjustment of the control system parameters. As shown in formula (4), formula (4) is the calculation formula of the unified parameter of error .
[0087] (4)
[0088] Wherein, E is the unified parameter of error, is the maximum value of the domain 3, is the minimum value of the domain -3, M is the maximum value of the actual value of error 80, N is the minimum value of the actual value of error -80. It should be noted that the calculation principle of the unified parameter of the error change rate is the same as that of the unified parameter of the error, which is not described herein.
[0089] The interval 2 type triangular membership function is used to describe the fuzzy characteristics of the input variable, such as Figure 4As shown, this membership function includes upper membership functions (represented in red) and lower membership functions (represented in blue), and its graphical form is shown in the figure. When the input variable... When the mapped value is 1.5, it belongs to both the fuzzy sets PM (median) and PS (smallest). In this case, The upper membership degree corresponding to the value (1.5) and membership degree (1.5) are equal, both being 0.375. This membership function design allows the present invention to capture the uncertainty of input variables in a more flexible and precise way, thereby providing richer information for fuzzy logic reasoning.
[0090] Fuzzy reasoning: The fuzzy reasoning process involves considering input variables and their rates of change. The membership degree is determined by looking up a table to show the magnitude of the output variable. When the input variable is 40 and its rate of change... When the value is -10, this invention maps these values to a predetermined domain through fuzzification. The mapped value 1.5 has a membership degree of 0.375 and belongs to the fuzzy sets PS (positive small) and PM (positive middle). The mapping value -1 has a membership degree of 0.75 and belongs to the fuzzy set NS (negative small). Using these membership values, this invention queries the fuzzy rule table to determine the fuzzy state of the output variable.
[0091] Defuzzing: During the fuzzification process, the values of ZO (zero), NS (negative small), and PS (positive small) were set to 0, -1, and 1, respectively. Membership degrees were calculated to obtain... , and The expected values are respectively , and Considering , The actual value range is [-0.5, 0.5], while The actual value range is [-0.01, 0.01]. This invention uses an interval mapping formula to convert the expected value into the actual value. Accordingly, The actual value is approximately -0.047. The actual value is approximately 0.047. The actual value is approximately 0.0009. This conversion process ensures that the results of fuzzy logic reasoning can be effectively applied to the parameter adjustment of actual control systems.
[0092] For example, when input For 40, It is -10, and the range of [-80, 80], is [-30, 30], and is fuzzed by formula (4), The mapping value of is 1.5, and the membership degrees are 0.375 (PS) and 0.375 (PM), The mapping value of is -1, and the membership degree is 0.75 (NS).
[0093] In the process of defuzzification, the values of ZO (zero), NS (negative small) and PS (positive small) are set as 0, -1 and 1 respectively. According to the rules in Table 1, When the membership degree of is 0.375 (PS), the membership degree of is 0.75 (NS), is ZO; when the membership degree of is 0.375 (PM), the membership degree of is 0.75 (NS), is NS, and thus, The calculation method of is as follows: It should be noted that the calculation methods of and are similar to that of and will not be repeated here.
[0094] Table 1
[0095]
[0096] S204, the candidate control parameter in the previous iteration and the error of the historical node in the current iteration are substituted into the type 2 fuzzy iterative learning controller to obtain the candidate control parameter of the current node in the current iteration, until the iteration is completed; the candidate control parameter is used for functional electrical stimulation of the affected limb.
[0097] Optionally, the control formula of the type 2 fuzzy iterative learning controller is as follows:
[0098] (5)
[0099] wherein, is the candidate control parameter of the i th node in the j th iteration, is the candidate control parameter of the i th node in the j th iteration, , is the learning rate gain of the i th node on the trajectory.
[0100] The type 2 fuzzy ILC algorithm adopted in the application is used for controlling the affected limb, and the simulation process of the algorithm is as follows: Figure 5 is shown, where the FuzzyILCcontroller function is responsible for performing the type-2 fuzzy logic inference and ILC calculation. This function receives the error between the actual output of the node and the target value as input parameters. First, the current error and the error of the previous node are calculated. Then, the rate of change of the error is calculated. Subsequently, type-2 fuzzy inference is performed using and to determine the learning rate gain of the node in the iteration . Finally, the candidate control parameter of the controller output in the iteration is calculated according to equation (5) The TransferFunction function is responsible for applying the output of the type-2 fuzzy ILC controller to the affected limb to obtain the actual posture, and calculating the error between the actual posture and the target torque of the corresponding node .
[0101] In an exemplary embodiment, the mathematical relationship model of the controlled object constructed from the electrical stimulation parameters (including pulse width and stimulation frequency) and the corresponding muscle response data obtained from human experiments is used to test the control performance of the algorithm. In the modeling process, first, the original experimental data is normalized to eliminate dimensional differences. Then, the nonlinear least squares method is used to accurately fit the data to construct a mathematical model that can accurately capture and describe the nonlinear relationship between electrical stimulation parameters and muscle response.
[0102] (6)
[0103] where , and represent the normalized wrist torque, pulse width and stimulation frequency, respectively, and are model parameters Based on in-depth analysis and experimental verification of wrist extension movements, it is ensured that the transfer function model can accurately reflect the response behavior of the wrist muscles when performing extension movements.
[0104] For the type-2 fuzzy PILC-SO closed-loop feedback FES control strategy, as shown in Figure 6 , the control signal (target posture) is derived from the inertial measurement unit IMU1 worn on the healthy limb of the patient, and the feedback signal The actual posture is provided by the inertial measurement unit (IMU2) on the affected limb. The two sets of data are input into the type 2 fuzzy logic inference system and the PID / ILC controller for processing and calculation to generate control output . The output The stimulation intensity is dynamically adjusted by the electrical stimulation parameters (modulation pulse width), thereby achieving precise adjustment of the movement angle of the affected limb.
[0105] In the Matlab simulation environment, the normalized torque is set as the desired target trajectory. To achieve precise control, the target trajectory is decomposed into 300 nodes for iterative learning. During the simulation, the value range of the proportional gain and the integral gain is set to [-0.5, 0.5], and the value range of the differential gain is set to [-0.01, 0.01]. These parameter settings are designed to ensure the stability and performance optimization of the control system.
[0106] The control algorithm of the type 2 fuzzy PILC-SO proposed in the present application is shown in detail in Figure 7 . When tracking the target trajectory for the first time, the type 2 fuzzy PID control algorithm with faster response speed is used to significantly reduce the initial iteration time and iteration learning times, and improve the real-time performance of the control algorithm. Then, on this basis, the type 2 fuzzy ILC algorithm is used to continuously reduce the maximum trajectory error and root mean square error (RMSE) value by learning historical control experience, as shown in Figure 8 and Figure 9 . Among them, Figure 8 the (a) graph and the (b) graph in the (a) graph and the (b) graph respectively represent the comparison between the actual trajectory and the target trajectory Target when using the type 2 fuzzy ILC algorithm and the type 2 fuzzy iterative PILC-SO optimization control algorithm in the first iteration ILC1-13th iteration ILC13, and the corresponding maximum trajectory error diagram after 13 iterations.
[0107] The application is aimed at different FES application modes, and 2-type fuzzy PID algorithm and control algorithm based on 2-type fuzzy PID and ILC collaborative optimization are respectively implemented on a hardware platform. Specifically, the 2-type fuzzy PID algorithm is applied to the contralaterally controlled FES (CCFES) mode to realize high-precision control based on real-time feedback, and the control algorithm based on 2-type fuzzy PID and ILC collaborative optimization is applied to the trajectory tracking FES (TTFES) mode to improve the accuracy of trajectory tracking through the iterative learning mechanism. The hardware implementation of the two algorithms adopts the FreeRTOS real-time operating system, and the task management function of the FreeRTOS is used to ensure efficient execution of the algorithm and reasonable allocation of system resources.
[0108] The application implements the deployment of the 2-type fuzzy PID control algorithm on a self-developed hardware system to support the CCFES mode. The hardware deployment of the algorithm manages tasks through the FreeRTOS real-time operating system, specifically including a 2-type fuzzy PID task (FuzzyPID_task), an IMU1 angle acquisition task (Imu1_task), an IMU2 angle acquisition task (Imu2_task) and a pulse width setting task (SetWidth_task). These tasks are synchronized by binary semaphores (BinarySemaphore_FuzzyPID, BinarySemaphore_IMU1, BinarySemaphore_IMU2, BinarySemaphore_SetWidth) and triggered by software timers (Timer2, Timer3, Timer4).
[0109] On the basis of the hardware deployment of the 2-type fuzzy PID control algorithm, the application further implements the deployment of the 2-type fuzzy PID and ILC collaborative optimization control algorithm. Specifically, in the original task and timer architecture, a 2-type fuzzy ILC control algorithm task (FuzzyILCTask) and a timer (Timer6) are added. Timer6 triggers FuzzyILCTask at a period of 100 ms, and the task not only executes the 2-type fuzzy ILC algorithm, but also is responsible for the entry and storage of trajectory data.
[0110] In the experiment, six subjects were randomly paired, one of which served as a controller, and the other as a controlled patient simulating wrist extension dysfunction by wearing an eye patch. The subjects sat in a chair with their left forearm naturally placed on the table, ensuring that the elbow, wrist, and hand were relaxed. The back of the controller's hand was equipped with an inertial measurement unit (IMU1) to set the target wrist extension angle, while the controlled patient's forearm muscle skin surface was placed with a 4x4 cm water gel electrode, and another inertial measurement unit (IMU2) was placed on the back of the hand to capture the actual wrist extension angle induced by electrical stimulation in real time. The experiment included wrist extension trajectory recording and testing of three different FES function modes to evaluate the performance of general FES, CCFES based on type 2 fuzzy PID control, and TTFES combined with type 2 fuzzy PILC control in reconstructing the function of paralyzed limbs.
[0111] Actual movement trajectory of the controlled person under CCFES based on type 2 fuzzy PID control and TTFES based on type 2 fuzzy PILC-SO control More closely fitted to the target movement trajectory preset by the controller , showing higher tracking accuracy and consistency, as shown in Figure 10 Figure 10 Wrist extension trajectory of a healthy subject simulating wrist extension dysfunction under three electrical stimulation control strategies.
[0112] The Pearson product-moment correlation coefficient (PPMCC) was used to quantify the correlation between the target and actual movement trajectory, and the mean and standard deviation were calculated, as shown in Figure 11 p <0.05). The correlation coefficients between the actual limb movement trajectory of the subjects under type 2 fuzzy PID and type 2 fuzzy PILC-SO control and the target movement trajectory were significantly higher than those under general FES control ( p <0.05). Specifically, the mean correlation coefficient under type 2 fuzzy PID algorithm control was 0.75±0.08, while under type 2 fuzzy PILC-SO control, the mean correlation coefficient was 0.77±0.05.
[0113] The present invention analyzed the PPMCC mean trend between the wrist extension trajectory of 6 subjects simulating wrist extension dysfunction hemiplegic patients under electrical stimulation and the target trajectory, as shown in Figure 12 Figure 12 The PPMCC coefficient variation trend of the actual and target function motion trajectories in the three FES function modes is shown in the figure; it can be observed from the figure that when the "affected side" limb completes 5 wrist extension actions in the ordinary FES control mode, the correlation coefficient of the motion trajectory is about 0.6, and there is no obvious change rule; in the CCFES control mode based on the type 2 fuzzy PID control, the correlation coefficient is maintained at about 0.75 after experiencing initial fluctuation; and in the TTFES mode based on the type 2 fuzzy PILC-SO control, the correlation coefficient is relatively stable, the value is relatively high, about 0.77, and presents an upward trend. This shows that compared with the ordinary FES and the CCFES based on the type 2 fuzzy PID control, the TTFES mode based on the type 2 fuzzy PILC-SO control can more effectively improve the consistency between the wrist extension action trajectory and the target trajectory.
[0114] The application adopts the type 2 fuzzy ILC closed-loop feedback control algorithm to accurately adjust the control parameters through the learning of historical control experience, so that the controlled object (model or patient limb) approaches the target motion trajectory, reduces the target trajectory tracking accuracy and improves the action completion degree of the controlled object; and before the application of the type 2 fuzzy ILC, the application first uses the type 2 fuzzy PID to significantly reduce the error of the reconstructed target motion trajectory of the controlled object, reduces the iteration learning number of the type 2 fuzzy iterative ILC control algorithm and improves the real-time performance of the limb action reconstruction; the type 2 fuzzy PILC-SO closed-loop feedback control algorithm provided by the application will not cause the correlation coefficient of the limb motion trajectory reconstruction to decrease due to the increase of the rehabilitation training action repetition number of the paralyzed limb of the stroke patient.
[0115] When the closed-loop feedback control method of functional electrical stimulation provided by the application is applied, the actual posture of the affected side limb can not be determined according to the actual posture of the affected side limb and the expected posture of the affected side limb. Figure 2 The execution order of each step shown in the figure can be determined according to the needs, and the application does not limit this.
[0116] The above is the closed-loop feedback control method of functional electrical stimulation provided by one or more embodiments of the application, based on the same idea, the application also provides a corresponding closed-loop feedback control device of functional electrical stimulation, as shown in the figure. Figure 13
[0117] Figure 13 The functional electrical stimulation closed-loop feedback control device provided by the application is a schematic diagram of the device 1300, which comprises:
[0118] The determining module 1301 is used for determining the target motion trajectory from the actual posture to the expected posture according to the actual posture and the expected posture of the affected side limb, and dividing the target motion trajectory into multiple nodes;
[0119] The first iteration module 1302 is configured to perform iterative optimization on the plurality of nodes, and in the first iteration, the initial control parameters of the plurality of nodes are calculated by the type 2 fuzzy PID controller for multiple times to obtain candidate control parameters of the plurality of nodes, and the candidate control parameters are used to perform functional electrical stimulation on the affected limb.
[0120] The updating module 1303 is configured to determine the error of the current node according to the actual posture and the expected posture of the current node, and update the learning rate gain of the type 2 fuzzy iterative learning controller according to the error of the current node, starting from the second iteration.
[0121] The second iteration module 1304 is configured to input the candidate control parameters in the previous iteration and the error of the historical node in the current iteration into the type 2 fuzzy iterative learning controller to obtain the candidate control parameters of the current node in the current iteration, until the iteration is completed; and the candidate control parameters are used to perform functional electrical stimulation on the affected limb.
[0122] The specific definition of the functional electrical stimulation closed-loop feedback control device can refer to the definition of the functional electrical stimulation closed-loop feedback control method in the above, which will not be repeated here. The above-mentioned various modules of the functional electrical stimulation closed-loop feedback control device can be realized by software, hardware and combinations thereof. The above-mentioned various modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above-mentioned various modules.
[0123] The application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor of an STM32 or other microcontroller, and can be used to execute the above-mentioned Figure 2 The functional electrical stimulation closed-loop feedback control method.
[0124] The application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor of an STM32 or other microcontroller, and can be used to execute the above-mentioned Figure 14 The structure diagram of the computer device is shown in the figure, and the computer device includes an STM32 or other microcontroller. Figure 14 As shown in the figure, at the hardware level, the computer device includes an STM32 or other microcontroller, which integrates a processor, an internal bus, a network interface, a memory and a non-volatile memory (such as a Flash), and of course can also include other hardware required by the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to realize the above-mentioned Figure 2 The functional electrical stimulation closed-loop feedback control method.
[0125] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed by the processor of the STM32 or other microcontroller, the computer program can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in each embodiment of the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. The volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0126] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of each technical feature in the above-mentioned embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the range disclosed by the present application.
Claims
1. A closed loop feedback control device for functional electrical stimulation, characterized in that, The method comprises the following steps of: determining a target motion trajectory from the actual posture to the expected posture of the affected limb according to the actual posture and the expected posture of the affected limb, and dividing the target motion trajectory into a plurality of nodes; a first iteration module for iterative optimization of the plurality of nodes, wherein the initial control parameters of the plurality of nodes are calculated multiple times by a type-2 fuzzy PID controller in the first iteration to obtain candidate control parameters of the plurality of nodes, and the functional electrical stimulation of the affected limb is performed by using the candidate control parameters; an updating module for determining the error of the current node according to the actual posture and the expected posture of the current node from the second iteration, and updating the learning rate gain of the type-2 fuzzy iterative learning controller according to the error of the current node; a second iteration module for substituting the candidate control parameters of the previous iteration and the error of the historical node of the current iteration into the type-2 fuzzy iterative learning controller to obtain the candidate control parameters of the current node in the current iteration until the iteration is completed; the candidate control parameters are used for functional electrical stimulation of the affected limb.
2. The apparatus of claim 1, wherein, updating the learning rate gain of the type-2 fuzzy iterative learning controller according to the error of the current node, comprising: determining the error change rate of the current node according to the error of the current node and the error of the previous node; performing type-2 fuzzy reasoning on the error change rate and the error to obtain the learning rate gain of the current node.
3. The apparatus of claim 2, wherein, performing type-2 fuzzy reasoning on the error change rate and the error to obtain the learning rate gain of the current node, comprising: fuzzifying the error change rate and the error according to the preset domain and the membership function to obtain the membership of the error change rate and the membership of the error; determining the expected value of the learning rate gain according to the membership of the error change rate and the membership of the error based on the fuzzy rule table; converting the expected value of the learning rate gain into the actual value of the learning rate gain according to the interval mapping formula.
4. The apparatus of claim 1, wherein, The control formula of the type-2 fuzzy iterative learning controller is: ; in, For the first During the nth iteration Candidate control parameters for each node, Let be the candidate control parameters for the node in the iteration; , and Let be the learning rate gain for the i-th node on the trajectory; for n The error between the target torque and the actual attitude at time -1. for The error between the target torque and the actual attitude at a given moment. for n The error between the target torque and the actual attitude at a given moment.
5. The apparatus of claim 1, wherein, The acquisition process of the actual posture and the expected posture of the affected limb comprises: collecting the torque by the inertial measurement unit worn by the healthy limb, and determining the torque of the healthy limb as the expected posture of the affected limb, and collecting the actual posture by the inertial measurement unit worn by the affected limb.