Electrical stimulation control method for electro-acupuncture
By improving the golf optimization algorithm and combining the Sobol sequence and golden ratio cosine perturbation strategies, the parameters of the PID controller in electroacupuncture are optimized, which solves the stability and accuracy problems of the PID controller in complex systems and improves the performance of electrical stimulation control. and stability, reducing the risk of local optimal solutions.
Patent Information
- Application Number
- CN202411154414.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-08-22
AI Technical Summary
PID controllers may not provide ideal control performance when used in complex systems. Especially in electroacupuncture, it is difficult to ensure the stability and accuracy of electrical stimulation currents, and the golf optimization algorithm has poor stability in complex optimization scenarios. , it is easy to fall into the local optimal solution.
By improving the golf optimization algorithm, the Levy flight strategy integrating Sobol sequence and the golden ratio cosine perturbation strategy are used to improve the initialization and exploration stages, and the non-uniform elite mutation strategy is used in the development stage to improve the global search and local search capabilities of the algorithm. , optimizing the PID controller parameters in electroacupuncture.
It improves the accuracy and stability of electroacupuncture electrical stimulation control, reduces dynamic errors in the parameter tuning process, enhances control accuracy and response speed, reduces the possibility of local optimal solutions, and improves the optimization accuracy and accuracy of the algorithm. Adaptability.
Smart Images

Figure CN118672192A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of PID control optimization, and in particular relates to an electric stimulation control method for electric acupuncture. Background Art
[0002] Electroacupuncture combines traditional acupuncture and modern electrical stimulation technology, using electric current to stimulate specific acupuncture points on the body to enhance the therapeutic effect. Electroacupuncture is not only suitable for the indications of traditional acupuncture, but can also be used for some special treatments, such as muscle electrical stimulation rehabilitation. In electroacupuncture, acupuncture needles are connected to electrodes, and electrodes are connected to electrical stimulation devices. The electrical stimulation devices generate controllable currents, which are conducted into the body through acupuncture needles. Controlling the magnitude of the current is an important part of electrical stimulation. Using a PID controller to control the electrical stimulation current of electroacupuncture can ensure the stability and accuracy of the current.
[0003] PID controller is one of the most commonly used feedback controllers in control systems. It adjusts the control output to achieve the desired target value through three basic parameters: proportion, integration and differentiation. PID controller has the characteristics of simple design and good robustness. It is widely used in industrial control, automation systems and many other fields. However, finding a suitable combination of Kp, Ki, Kd parameters requires experience and repeated experiments, especially for complex systems. For strongly nonlinear systems, PID controller may not provide ideal control performance. By optimizing the parameters of PID controller through intelligent optimization algorithm, the optimal parameter values can be automatically found to improve control performance and scope of application.
[0004] The Golf Optimization Algorithm (GOA) is an innovative intelligent optimization algorithm that draws inspiration from the strategic dynamics of golf and the behavior of players. The algorithm is designed with two stages, namely the exploration and exploitation stages. The Golf Optimization Algorithm has excellent capabilities in both the exploration and exploitation stages, and effectively achieves a balance between the two. Applying the Golf Optimization Algorithm to the optimization of PID controllers can effectively improve the performance of PID controllers. However, like common intelligent optimization algorithms, the Golf Optimization Algorithm is prone to falling into local optimal solutions and has poor stability when facing complex optimization scenarios. Summary of the invention
[0005] The purpose of the present invention is to improve the global search ability of the original golf optimization algorithm in the early stage and the local search ability in the later stage during the optimization process by improving the golf optimization algorithm, reduce the possibility of the original golf optimization algorithm falling into the local optimum, thereby improving the optimization accuracy and response speed of the algorithm, and optimize the three parameters of the PID controller of the electric stimulation by improving the golf optimization algorithm, thereby improving the accuracy and stability of the electric stimulation control of electroacupuncture, and reducing the adverse effects of dynamic errors on the control effect during the parameter setting process.
[0006] To achieve the above-mentioned purpose, the present invention adopts an electric stimulation control method for electroacupuncture, and the specific steps of the method are as follows.
[0007] S1. According to the optimization target of the electric stimulation control of electroacupuncture, an electric stimulation control system model of electroacupuncture is constructed, and the control system model includes: an electric stimulation signal generation module, an electric response monitoring module, an error calculation module, a PID control module, and an improved golf optimization algorithm module.
[0008] S2. Improve the golf optimization algorithm. The specific improvement strategy is: S21. Use a Levy flight strategy that integrates the Sobol sequence to initialize the algorithm's search population, generate uniformly distributed points in the high-dimensional space through the Sobol sequence, and use Levy flight to perturb the generated Sobol sequence with random steps to generate a randomly distributed initial population; S22. Using a cosine perturbation strategy that incorporates the golden ratio to improve the mathematical model of the exploration phase of the golf optimization algorithm, the population position update is perturbed to varying degrees through the golden ratio factor φ and the cosine function; S23. Use the non-uniform elite mutation strategy to improve the mathematical model of the development phase of the golf optimization algorithm. The best individual in the population is used as the elite individual, and the position of the population is updated through the guidance of the elite individual and non-uniform mutation.
[0009] S3. Use the improved golf optimization algorithm to adjust the parameters of the PID controller in the electric stimulation control system of electroacupuncture, and obtain the best three parameters Kp, Ki, and Kd through algorithm optimization.
[0010] S4. The three best PID parameters obtained by optimizing the improved golf optimization algorithm are set as the parameters of the PID controller in the electric stimulation control system of electroacupuncture to optimize the control effect of electric stimulation.
[0011] Preferably, in the electric stimulation control system model of electric acupuncture described in S1, the electric stimulation signal generation module generates an initial electric stimulation pulse signal according to the set pulse size and applies the electric stimulation signal to the skin and human tissue through the electrode, and simulates the electrical conduction between the skin and the electrode through the series model of the resistor R and the capacitor C, and generates the electric stimulation current as shown in formula (1): (1); In formula (1), A represents the amplitude of the pulse signal, f represents the amplitude of the pulse signal, b represents the width of the pulse signal, pulse(t,f,b) represents the function of generating the pulse signal at time t, R represents the resistance of the electrode in contact with the skin, C represents the capacitance of the skin in contact with the electrode, and w represents the angular frequency; The electrical response monitoring module monitors the electrical response E(t) of human tissue in real time through sensors, and calculates the error e(t) through the error calculation module, where e(t)=Ed(t)-E(t), Ed(t) represents the expected response. According to the error e(t), the PID control module performs parameter tuning through the improved golf optimization algorithm module to generate a control signal u(t) to adjust the electrical stimulation signal to make it approach the expected response. Through continuous monitoring and adjustment, the error is minimized until the system reaches a stable state. The calculation formula of u(t) is shown in formula (2): (2); In formula (2), represents the proportional gain, represents the integral gain, Represents the differential gain.
[0012] Preferably, the electrical response of human tissue is modeled as a second-order transfer function, which can more accurately describe its dynamic behavior. The second-order transfer function generated by Laplace transform is G(s), and the specific formula is shown in formula (3): (3); In formula (3), s represents the complex frequency domain variable in Laplace transform, represents the natural frequency, Represents the damping ratio.
[0013] Preferably, the algorithm's search population is initialized using a Levy flight strategy that integrates a Sobol sequence as described in S21. First, the first N positions in the Sobol sequence are taken as the initial population positions, where N is the number of populations in the algorithm. The step size and proportional coefficient of the Levy flight are set to perturb the initial population position, and the perturbed population is used as the initial population of the algorithm. The mathematical model of the Levy flight strategy that integrates the Sobol sequence is shown in formula (4): (4); In formula (4), population represents the initial population, lb represents the lower limit of the search space, ub represents the upper limit of the search space, Sobolset represents the generated Sobol sequence, α represents the proportional system value range [0.1, 0.5], L represents the random step size, and dir represents the moving direction randomly selected as 1 or -1.
[0014] Preferably, the Sobol sequence ensures that the initial population evenly covers the entire search space, which can speed up the initial search phase of the algorithm and reduce the time to find the global optimal solution. The Levy flight can enhance the robustness of the algorithm by introducing irregular jumps, so that it can better adapt to different types of optimization problems. By initializing the population by integrating the Levy flight strategy of the Sobol sequence, the randomness of the population position is guaranteed while improving the population quality, thereby improving the convergence speed and accuracy of the algorithm.
[0015] Preferably, the cosine perturbation strategy integrating the golden ratio described in S22 mainly combines the uniform distribution of the golden ratio factor and the smoothness of the cosine function. The specific improved mathematical model is shown in formula (5): (5); In formula (5), represents the updated position of the i-th search agent in the population, represents the position of the i-th search agent in the population, φ represents the golden ratio factor, , r represents a random number between [0,1], iter represents the current number of iterations, Max_iter represents the maximum number of iterations, Represents the optimal position in the current population, and I represents a random number between [1,2].
[0016] Preferably, a cosine perturbation strategy integrating the golden ratio is used to update the position in the search phase. In the early stage of the algorithm optimization, perturbation is performed using the cosine function of the golden ratio, which helps the global search of the algorithm and helps the algorithm to escape the local optimal solution. In the later stage of the algorithm optimization, fine-tuning is performed in the local area by changing the perturbation with different amplitudes, which is conducive to local fine search and improves the quality of the solution.
[0017] Preferably, the non-uniform elite mutation strategy described in S23 takes the best individual in the population as a guide and performs different update mutations according to the selection of the random mutation value F. The specific improved mathematical model is shown in formula (6): (6); In formula (6), represents the updated position of the i-th search agent in the population, represents the position of the i-th search agent in the population, It represents the optimal position in the current population, lb represents the lower limit of the search space, ub represents the upper limit of the search space, iter represents the current number of iterations, Max_iter represents the maximum number of iterations, b represents the shrinkage factor value of 3, and F represents the random mutation value, which is randomly selected from 0 or 1.
[0018] Preferably, the non-uniform elite mutation strategy balances the search and development capabilities by using two mutation methods. The convergence speed and accuracy of the algorithm can be improved by guiding the dominant individuals. The adaptability and flexibility of the algorithm are improved while increasing the diversity of the update strategy. In complex controlled scenarios, it can quickly adapt to position changes in the optimization process, find the local range of the optimal solution at a faster speed, and reduce the impact of instability in the optimization process.
[0019] Preferably, the specific steps of using the improved golf optimization algorithm to perform parameter tuning on the PID controller in the electric stimulation control system of electroacupuncture and obtaining the best three parameters of Kp, Ki and Kd through algorithm optimization as described in S3 are: S31, encoding the parameters Kp, Ki, Kd of the PID controller into a position vector of the improved golf optimization algorithm; S32, initializing the parameters of the improved golf optimization algorithm, including the algorithm population size N, the problem dimension dim, the maximum number of iterations max_iter, the upper limit ub and the lower limit lb of the search space; S33, according to the initialized parameters, the search population of the algorithm is initialized using the Levy flight strategy fused with the Sobol sequence, and the mathematical model of the population initialization is shown in formula (4); S34, calculate the fitness value of the improved golf optimization algorithm population individual, and select the current optimal individual according to the fitness value , the calculation formula of fitness value is shown in formula (7): (7); In formula (7), J represents the fitness value, ref(t) represents the target output value at time t, act(t) represents the actual output value at time t, and T represents the total operating time of the system; S35, updating the position of the search agent in the population by improving the mathematical model of the golf optimization algorithm, and searching for the best individual by updating the position; S36. Determine whether the current number of iterations has reached the maximum number of iterations. If not, continue to search for the best solution. Otherwise, exit the search for the best solution and use the output as the optimization to obtain the best three parameters Kp, Ki, and Kd.
[0020] Preferably, the updating of the position of the search agent in the population by improving the mathematical model of the golf optimization algorithm described in S35 is mainly divided into an exploration phase and a development phase. The specific steps are: Step 1, exploration phase: Use the cosine perturbation strategy with golden ratio to update the position of the algorithm's initial population. The mathematical model of the update strategy is shown in formula (5). Compare the fitness value of the updated position with the original position, and retain the position with better fitness value; Step 2, development phase: Use the non-uniform elite mutation strategy to update the position of the algorithm's initial population. The mathematical model of the update strategy is shown in formula (6). Compare the fitness value of the updated position with the original position, and retain the position with a better fitness value; Step 3: Perform range detection on the update position. If the update position is not within the upper and lower limits of the search space, set the penalty fitness value pf. The specific formula is shown in formula (8): (8); In formula (8), represents the fitness value of the i-th update position, nq represents the number of dimensions that do not meet the constraints, and the penalty fitness value is set to the fitness value of the position that does not meet the constraints to avoid the optimal individual found not meeting the actual situation; Step 4: Update the optimal individual position in the population, and continue to execute step 1-step 4 within the maximum iteration range to search for the optimal individual.
[0021] By adopting the above technical scheme, the beneficial effects of the present invention are as follows: the performance of the algorithm is improved by improving the golf optimization algorithm, a Levy flight strategy integrating the Sobol sequence is used to initialize the search population of the algorithm, the quality of the initial population is improved, and the robustness of the algorithm is enhanced, a cosine perturbation strategy integrating the golden ratio is used to improve the algorithm search capability, and the possibility of falling into the local optimal solution during the algorithm optimization process is reduced, and the use of a non-uniform elite mutation strategy can improve the adaptability of the algorithm, increase the convergence speed and optimization accuracy of the algorithm, and apply the improved golf optimization algorithm to the optimization of the PID controller parameters of the electrical stimulation, thereby improving the stability and control accuracy of the electrical stimulation control of the electroacupuncture, and can better exert the therapeutic effect of the electroacupuncture. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 The present invention is a flow chart of an electrical stimulation control method for electroacupuncture.
[0023] Figure 2 This is a comparison chart of the fitness values of the improved golf optimization algorithm and the original golf optimization algorithm during the optimization process.
[0024] Figure 3 A comparison chart of the changes in parameter value Kp during the tuning process of the improved golf optimization algorithm and the original golf optimization algorithm.
[0025] Figure 4 A comparison chart of the changes in parameter value Ki during the tuning process of the improved golf optimization algorithm and the original golf optimization algorithm.
[0026] Figure 5A comparison chart of the change in parameter value Kd during the tuning process of the improved golf optimization algorithm and the original golf optimization algorithm.
[0027] FIG6 is a comparison diagram of the effects of the electric stimulation control system of electroacupuncture under the action of the PID controller optimized by the improved golf optimization algorithm and the original golf optimization algorithm. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0029] The present invention provides a technical solution: an electric stimulation control method for electroacupuncture, which specifically includes the following steps: Figure 1 shown.
[0030] S1. According to the optimization target of the electric stimulation control of electroacupuncture, an electric stimulation control system model of electroacupuncture is constructed, and the control system model includes: an electric stimulation signal generation module, an electric response monitoring module, an error calculation module, a PID control module, and an improved golf optimization algorithm module.
[0031] Furthermore, in the electric stimulation control system model of electric acupuncture described in S1, the electric stimulation signal generation module generates an initial electric stimulation pulse signal according to the set pulse size and applies the electric stimulation signal to the skin and human tissue through the electrode, and simulates the electrical conduction between the skin and the electrode through the series model of the resistor R and the capacitor C, and generates the electric stimulation current as shown in formula (1): (1); In formula (1), A represents the amplitude of the pulse signal, f represents the amplitude of the pulse signal, b represents the width of the pulse signal, pulse(t,f,b) represents the function of generating the pulse signal at time t, R represents the resistance of the electrode in contact with the skin, C represents the capacitance of the skin in contact with the electrode, and w represents the angular frequency; The electrical response monitoring module monitors the electrical response E(t) of human tissue in real time through sensors, and calculates the error e(t) through the error calculation module, where e(t)=Ed(t)-E(t), Ed(t) represents the expected response. According to the error e(t), the PID control module performs parameter tuning through the improved golf optimization algorithm module to generate a control signal u(t) to adjust the electrical stimulation signal to make it approach the expected response. Through continuous monitoring and adjustment, the error is minimized until the system reaches a stable state. The calculation formula of u(t) is shown in formula (2): (2); In formula (2), represents the proportional gain, represents the integral gain, Represents the differential gain.
[0032] Furthermore, the electrical response of human tissue is modeled as a second-order transfer function, which can more accurately describe its dynamic behavior. The second-order transfer function generated by Laplace transform is G(s), and the specific formula is shown in formula (3): (3); In formula (3), s represents the complex frequency domain variable in Laplace transform, represents the natural frequency, Represents the damping ratio.
[0033] S2. Improve the golf optimization algorithm. The specific improvement strategy is: S21. Use a Levy flight strategy that integrates the Sobol sequence to initialize the algorithm's search population, generate uniformly distributed points in the high-dimensional space through the Sobol sequence, and use Levy flight to perturb the generated Sobol sequence with random steps to generate a randomly distributed initial population; S22. Using a cosine perturbation strategy that incorporates the golden ratio to improve the mathematical model of the exploration phase of the golf optimization algorithm, the population position update is perturbed to varying degrees through the golden ratio factor φ and the cosine function; S23. Use the non-uniform elite mutation strategy to improve the mathematical model of the development phase of the golf optimization algorithm. The best individual in the population is used as the elite individual, and the position of the population is updated through the guidance of the elite individual and non-uniform mutation.
[0034] Furthermore, S21 uses a Levy flight strategy that integrates the Sobol sequence to initialize the search population of the algorithm. First, the first N positions in the Sobol sequence are taken as the initial population positions, where N is the number of populations in the algorithm. The step size and proportional coefficient of the Levy flight are set to perturb the initial population position, and the perturbed population is used as the initial population of the algorithm. The population is initialized by the Levy flight strategy that integrates the Sobol sequence, which improves the population quality while ensuring the randomness of the population position, thereby improving the convergence speed and accuracy of the algorithm. The mathematical model of the Levy flight strategy that integrates the Sobol sequence is shown in formula (4): (4); In formula (4), population represents the initial population, lb represents the lower limit of the search space, ub represents the upper limit of the search space, Sobolset represents the generated Sobol sequence, α represents the proportional system value range [0.1, 0.5], L represents the random step size, and dir represents the moving direction randomly selected as 1 or -1.
[0035] Furthermore, the cosine perturbation strategy integrating the golden ratio described in S22 mainly combines the uniform distribution of the golden ratio factor and the smoothness of the cosine function. In the early stage of algorithm optimization, the cosine function of the golden ratio is used for perturbation, which is helpful for the global search of the algorithm and helps the algorithm to jump out of the local optimal solution. In the later stage of algorithm optimization, the perturbation changes of different amplitudes are used to make fine adjustments in the local area, which is conducive to local fine search and improves the quality of the solution. The specific improved mathematical model is shown in formula (5): (5); In formula (5), represents the updated position of the i-th search agent in the population, represents the position of the i-th search agent in the population, φ represents the golden ratio factor, , r represents a random number between [0,1], iter represents the current number of iterations, Max_iter represents the maximum number of iterations, Represents the optimal position in the current population, and I represents a random number between [1,2].
[0036] Furthermore, a non-uniform elite mutation strategy described in S23 takes the best individual in the population as a guide, and performs different update mutations according to the selection of the random mutation value F. By using two mutation methods, the search and development capabilities are balanced. The convergence speed and accuracy of the algorithm can be improved by guiding the dominant individuals. While increasing the diversity of the update strategy, the adaptability and flexibility of the algorithm are improved. The specific improved mathematical model is shown in formula (6): (6); In formula (6), represents the updated position of the i-th search agent in the population, represents the position of the i-th search agent in the population, It represents the optimal position in the current population, lb represents the lower limit of the search space, ub represents the upper limit of the search space, iter represents the current number of iterations, Max_iter represents the maximum number of iterations, b represents the shrinkage factor value of 3, and F represents the random mutation value, which is randomly selected from 0 or 1.
[0037] S3. Use the improved golf optimization algorithm to adjust the parameters of the PID controller in the electric stimulation control system of electroacupuncture, and obtain the best three parameters Kp, Ki, and Kd through algorithm optimization. The specific steps are: S31, encoding the parameters Kp, Ki, Kd of the PID controller into a position vector of the improved golf optimization algorithm; S32, initializing the parameters of the improved golf optimization algorithm, including the algorithm population size N, the problem dimension dim, the maximum number of iterations max_iter, the upper limit ub and the lower limit lb of the search space; S33, according to the initialized parameters, the search population of the algorithm is initialized using the Levy flight strategy fused with the Sobol sequence, and the mathematical model of the population initialization is shown in formula (4); S34, calculate the fitness value of the improved golf optimization algorithm population individual, and select the current optimal individual according to the fitness value , the calculation formula of fitness value is shown in formula (7): (7); In formula (7), J represents the fitness value, ref(t) represents the target output value at time t, act(t) represents the actual output value at time t, and T represents the total operating time of the system; S35, updating the position of the search agent in the population by improving the mathematical model of the golf optimization algorithm, and searching for the best individual by updating the position; S36. Determine whether the current number of iterations has reached the maximum number of iterations. If not, continue to search for the best solution. Otherwise, exit the search for the best solution and use the output as the optimization to obtain the best three parameters Kp, Ki, and Kd.
[0038] Furthermore, the updating of the position of the search agent in the population by improving the mathematical model of the golf optimization algorithm described in S35 is mainly divided into an exploration phase and a development phase. The specific steps are: Step 1, exploration phase: Use the cosine perturbation strategy with golden ratio to update the position of the algorithm's initial population. The mathematical model of the update strategy is shown in formula (5). Compare the fitness value of the updated position with the original position, and retain the position with better fitness value; Step 2, development phase: Use the non-uniform elite mutation strategy to update the position of the algorithm's initial population. The mathematical model of the update strategy is shown in formula (6). Compare the fitness value of the updated position with the original position, and retain the position with a better fitness value; Step 3: Perform range detection on the update position. If the update position is not within the upper and lower limits of the search space, set the penalty fitness value pf. The specific formula is shown in formula (8): (8); In formula (8), represents the fitness value of the i-th update position, nq represents the number of dimensions that do not meet the constraints, and the penalty fitness value is set to the fitness value of the position that does not meet the constraints to avoid the optimal individual found not meeting the actual situation; Step 4: Update the optimal individual position in the population, and continue to execute step 1-step 4 within the maximum iteration range to search for the optimal individual.
[0039] Furthermore, in order to verify that the electric stimulation control method for electroacupuncture proposed in the present invention has better performance than other methods, the present invention will conduct simulation experiments through Matlab and Simulink to compare the PID controller optimized by the improved golf optimization algorithm and the original golf optimization algorithm. First, the mathematical model of the golf optimization algorithm is improved by Matlab, and the electric stimulation control system for electroacupuncture is constructed by Simulink. The control system includes an electric stimulation signal generation module, an electric response monitoring module, an error calculation module, a PID control module, and an improved golf optimization algorithm module. The second-order transfer function of the electric response of human tissue in the control system is Set to 2, Set to 1.5, Initialize the parameters of the improved golf optimization algorithm, where the population size N=200, the problem dimension dim=3, and the maximum number of iterations is 50. Run the Matlab program to obtain a comparison chart of the fitness values of the improved golf optimization algorithm and the original golf optimization algorithm during the optimization process, as shown in Figure 2. In the first five iterations, the fitness value of the improved golf optimization algorithm drops rapidly to near the optimal fitness value. Compared with the original algorithm, the optimization speed is faster. After about the 15th iteration, the fitness value tends to be stable, and compared with the original algorithm, the optimization accuracy is better, which can better improve the current output accuracy of electrical stimulation, thereby achieving better medical effects.
[0040] Furthermore, if Figure 3-5 As shown in the figure, the improved golf optimization algorithm and the original golf optimization algorithm are used to adjust the parameters of the PID controller of the electro-acupuncture electric stimulation control system model. The best PID algorithm parameters obtained by the improved algorithm are Kp=22.05, Ki=1.29, Kd=9.23, and the best PID parameters obtained by the original algorithm are Kp=30.54, Ki=1.91, Kd=4.26; the optimal control parameters are input into the PID controller model of the electro-acupuncture electric stimulation control system model to obtain the control effect of electric stimulation. Figure 6This is a comparison chart of the effects of the electric stimulation control system of electroacupuncture under the action of the PID controller optimized by the improved golf optimization algorithm and the original golf optimization algorithm. The target value of the control amount of electric stimulation is set to 1 unit. It can be seen from Figure 6 that the overshoot of the response curve optimized by the improved golf optimization algorithm is lower and the response speed is faster. Compared with the parameters of the PID controller optimized by the original golf optimization algorithm, it has better control effects on the electric stimulation of electroacupuncture. The fast response speed and lower overshoot can reduce the impact of dynamic errors, make the electric stimulation current quickly reach a stable state, and improve the adaptability and robustness of the system.
Claims
1. An electrical stimulation control method for electroacupuncture, characterized in that: The specific steps are: S1. According to the optimization target of the electric stimulation control of the electric acupuncture, an electric stimulation control system model of the electric acupuncture is constructed, wherein the control system model comprises: an electric stimulation signal generation module, an electric response monitoring module, an error calculation module, a PID control module, and an improved golf optimization algorithm module; S2. Improve the golf optimization algorithm. The specific improvement strategy is: S21. Use a Levy flight strategy that integrates the Sobol sequence to initialize the algorithm's search population, generate uniformly distributed points in the high-dimensional space through the Sobol sequence, and use Levy flight to perturb the generated Sobol sequence with random steps to generate a randomly distributed initial population; S22. Using a cosine perturbation strategy that incorporates the golden ratio to improve the mathematical model of the exploration phase of the golf optimization algorithm, the population position update is perturbed to varying degrees through the golden ratio factor φ and the cosine function; S23. Use the non-uniform elite mutation strategy to improve the mathematical model of the development stage of the golf optimization algorithm, take the best individual in the population as the elite individual, and update the position of the population through the guidance of the elite individual and non-uniform mutation; S3. Using the improved golf optimization algorithm to adjust the parameters of the PID controller in the electric stimulation control system of electroacupuncture, the optimal three parameters Kp, Ki, and Kd are obtained through algorithm optimization; S4. The three best PID parameters obtained by optimizing the improved golf optimization algorithm are set as the parameters of the PID controller in the electric stimulation control system of electroacupuncture to optimize the control effect of electric stimulation.
2. The electric stimulation control method for electroacupuncture according to claim 1, characterized in that: The electric stimulation control system model of electric acupuncture described in S1, wherein the electric stimulation signal generation module generates an initial electric stimulation pulse signal according to the set pulse size and applies the electric stimulation signal to the skin and human tissue through the electrode, and simulates the electrical conduction between the skin and the electrode through the series model of the resistor R and the capacitor C, and generates the electric stimulation current size as shown in formula (1): (1); In formula (1), A represents the amplitude of the pulse signal, f represents the amplitude of the pulse signal, b represents the width of the pulse signal, pulse(t,f,b) represents the function of generating the pulse signal at time t, R represents the resistance of the electrode in contact with the skin, C represents the capacitance of the skin in contact with the electrode, and w represents the angular frequency; The electrical response monitoring module monitors the electrical response E(t) of human tissue in real time through sensors, and calculates the error e(t) through the error calculation module, where e(t)=Ed(t)-E(t), Ed(t) represents the expected response. According to the error e(t), the PID control module performs parameter tuning through the improved golf optimization algorithm module to generate a control signal u(t) to adjust the electrical stimulation signal to make it approach the expected response. Through continuous monitoring and adjustment, the error is minimized until the system reaches a stable state. The calculation formula of u(t) is shown in formula (2): (2); In formula (2), represents the proportional gain, represents the integral gain, Represents the differential gain.
3. The electric stimulation control method for electroacupuncture according to claim 2, characterized in that: S21 uses a Levy flight strategy that integrates the Sobol sequence to initialize the search population of the algorithm. First, the first N positions in the Sobol sequence are taken as the initial population positions, where N is the number of populations in the algorithm. The step size and proportional coefficient of the Levy flight are set to perturb the initial population position, and the perturbed population is used as the initial population of the algorithm. The mathematical model of the Levy flight strategy that integrates the Sobol sequence is shown in formula (4): (4); In formula (4), population represents the initial population, lb represents the lower limit of the search space, ub represents the upper limit of the search space, Sobolset represents the generated Sobol sequence, α represents the proportional system value range [0.1, 0.5], L represents the random step size, and dir represents the moving direction randomly selected as 1 or -1.
4. The electric stimulation control method for electroacupuncture according to claim 3, characterized in that: The cosine perturbation strategy integrating the golden ratio described in S22 mainly combines the uniform distribution of the golden ratio factor and the smoothness of the cosine function. The specific improved mathematical model is shown in formula (5): (5); In formula (5), represents the updated position of the i-th search agent in the population, represents the position of the i-th search agent in the population, φ represents the golden ratio factor, , r represents a random number between [0,1], iter represents the current number of iterations, Max_iter represents the maximum number of iterations, Represents the optimal position in the current population, and I represents a random number between [1,2].
5. The electric stimulation control method for electroacupuncture according to claim 4, characterized in that: The non-uniform elite mutation strategy described in S23 takes the best individual in the population as a guide and performs different update mutations according to the selection of the random mutation value F. The specific improved mathematical model is shown in formula (6): (6); In formula (6), represents the updated position of the i-th search agent in the population, represents the position of the i-th search agent in the population, It represents the optimal position in the current population, lb represents the lower limit of the search space, ub represents the upper limit of the search space, iter represents the current number of iterations, Max_iter represents the maximum number of iterations, b represents the shrinkage factor value of 3, and F represents the random mutation value, which is randomly selected from 0 or 1.
6. The electric stimulation control method for electroacupuncture according to claim 5, characterized in that: The specific steps of using the improved golf optimization algorithm to adjust the parameters of the PID controller in the electric stimulation control system of electroacupuncture described in S3 and obtaining the optimal three parameters of Kp, Ki, and Kd through algorithm optimization are as follows: S31, encoding the parameters Kp, Ki, Kd of the PID controller into a position vector of the improved golf optimization algorithm; S32, initializing the parameters of the improved golf optimization algorithm, including the algorithm population size N, the problem dimension dim, the maximum number of iterations max_iter, the upper limit ub and the lower limit lb of the search space; S33, according to the initialized parameters, the search population of the algorithm is initialized using the Levy flight strategy fused with the Sobol sequence, and the mathematical model of the population initialization is shown in formula (4); S34, calculate the fitness value of the improved golf optimization algorithm population individual, and select the current optimal individual according to the fitness value , the calculation formula of fitness value is shown in formula (7): (7); In formula (7), J represents the fitness value, ref(t) represents the target output value at time t, act(t) represents the actual output value at time t, and T represents the total operating time of the system; S35, updating the position of the search agent in the population by improving the mathematical model of the golf optimization algorithm, and searching for the best individual by updating the position; S36. Determine whether the current number of iterations has reached the maximum number of iterations. If not, continue to search for the best solution. Otherwise, exit the search for the best solution and use the output as the optimization to obtain the best three parameters Kp, Ki, and Kd.
7. The electric stimulation control method for electroacupuncture according to claim 6, characterized in that: The position of the search agent in the population is updated by improving the mathematical model of the golf optimization algorithm as described in S35, which is mainly divided into the exploration phase and the development phase. The specific steps are: Step 1, exploration phase: Use the cosine perturbation strategy with golden ratio to update the position of the algorithm's initial population. The mathematical model of the update strategy is shown in formula (5). Compare the fitness value of the updated position with the original position, and retain the position with better fitness value; Step 2, development phase: Use the non-uniform elite mutation strategy to update the position of the algorithm's initial population. The mathematical model of the update strategy is shown in formula (6). Compare the fitness value of the updated position with the original position, and retain the position with a better fitness value; Step 3: Perform range detection on the update position. If the update position is not within the upper and lower limits of the search space, set the penalty fitness value pf. The specific formula is shown in formula (8): (8); In formula (8), represents the fitness value of the i-th update position, nq represents the number of dimensions that do not meet the constraints, and the penalty fitness value is set to the fitness value of the position that does not meet the constraints to avoid the optimal individual found not meeting the actual situation; Step 4: Update the optimal individual position in the population, and continue to execute step 1-step 4 within the maximum iteration range to search for the optimal individual.
Citation Information
Patent Citations
Power transmission tower angle steel bearing capacity prediction method based on African vulture intelligent algorithm
CN117634286A
Control method based on programmable electric load shoulder pushing trainer
CN117950310A
Walking aid control method based on improved group optimization algorithm
CN117970785A
Infant acupuncture instrument spur control method based on improved homonuclear subalgorithm
CN118050982A
Electrical stimulation adaptive control method for electrical stimulation rehabilitation instrument
CN118203762A
Cited By
Posture adjustment control optimization method for electric standing bed
CN119247750A
