[go: up one dir, main page]

CN101837165B - Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller - Google Patents

Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller Download PDF

Info

Publication number
CN101837165B
CN101837165B CN201010193427XA CN201010193427A CN101837165B CN 101837165 B CN101837165 B CN 101837165B CN 201010193427X A CN201010193427X A CN 201010193427XA CN 201010193427 A CN201010193427 A CN 201010193427A CN 101837165 B CN101837165 B CN 101837165B
Authority
CN
China
Prior art keywords
kfuzzi
ant
genetic
algorithm
fuzzy controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201010193427XA
Other languages
Chinese (zh)
Other versions
CN101837165A (en
Inventor
明东
张广举
邱爽
徐瑞
朱韦西
刘秀云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datian Medical Science Engineering Tianjin Co ltd
Original Assignee
Tianjin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University filed Critical Tianjin University
Priority to CN201010193427XA priority Critical patent/CN101837165B/en
Publication of CN101837165A publication Critical patent/CN101837165A/en
Application granted granted Critical
Publication of CN101837165B publication Critical patent/CN101837165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Feedback Control In General (AREA)

Abstract

本发明涉及康复训练领域。为优化模糊控制器的量化因子、比例因子以及模糊控制规则,继而准确稳定实时地控制FES系统的电流模式,并可有效地提高FES系统准确性和稳定性,本发明采用的技术方案是:基于遗传蚁群融合模糊控制器的助行电刺激精密控制方法,包括下列步骤:首先将模糊控制决策变量的选择转化为遗传与蚁群算法适用的组合优化问题,并对决策变量进行编码以及随机产生n个个体组成的染色体;其次利用遗传算法产生蚁群算法中的初始信息素分布,利用蚂蚁随机搜索优化模糊控制器的隶属函数以及量化因子和比例因子;依据前述输出反复自学习与自调整过程,最终用于FES系统。本发明主要应用于康复训练。

Figure 201010193427

The invention relates to the field of rehabilitation training. In order to optimize the quantization factor, proportional factor and fuzzy control rules of the fuzzy controller, and then accurately and stably control the current mode of the FES system in real time, and can effectively improve the accuracy and stability of the FES system, the technical scheme adopted in the present invention is: based on The precise control method of walking-assisting electrical stimulation based on genetic ant colony fusion fuzzy controller includes the following steps: first, the selection of fuzzy control decision variables is transformed into a combinatorial optimization problem applicable to genetic and ant colony algorithms, and the decision variables are coded and randomly generated Chromosomes composed of n individuals; secondly, use the genetic algorithm to generate the initial pheromone distribution in the ant colony algorithm, and use the ant random search to optimize the membership function, quantization factor and proportional factor of the fuzzy controller; repeat the self-learning and self-adjusting process according to the aforementioned output , and ultimately used in the FES system. The present invention is mainly applied to rehabilitation training.

Figure 201010193427

Description

基于遗传蚁群融合模糊控制器的助行电刺激精密控制方法Precise control method of electrical stimulation for walking aid based on genetic ant colony fusion fuzzy controller

技术领域 technical field

本发明涉及康复训练领域,尤其是步行器受载力的测量,具体讲涉及基于遗传蚁群融合模糊控制器的助行电刺激精密控制方法。The invention relates to the field of rehabilitation training, in particular to the measurement of the load-carrying force of a walker, and in particular to a precise control method for electric stimulation of walking aids based on a genetic ant colony fusion fuzzy controller.

背景技术 Background technique

功能性电刺激(Functional Electrical Stimulation,FES)是通过电流脉冲序列来刺激肢体运动肌群及其外周神经,有效地恢复或重建截瘫患者的部分运动功能的技术。目前,由于脊髓再生能力微弱,针对脊髓损伤瘫痪患者,尚未有可直接修复损伤的有效医治方法,实施功能康复训练是一有效的措施。据统计,脊髓损伤瘫痪患者人数逐年增多,功能康复训练是亟待需求的技术。20世纪60年代,Liberson首次成功地利用电刺激腓神经矫正了偏瘫患者足下垂的步态,开创了功能性电刺激用于运动和感觉功能康复治疗的新途径。目前,FES已经成为了恢复或重建截瘫患者的部分运动功能,是重要的康复治疗手段。然而,如何精密控制FES的触发时序和脉冲电流强度以保证电刺激作用效果能准确完成预定的功能动作仍是FES的技术关键。据统计,目前FES的触发控制的方式研究尚少,而且根据作用效果与预定动作偏差,用闭环控制来自动调整FES刺激强度和时序参数,从而大大提高了FES系统的实时性、准确性和稳定性,但是现在有效的控制方法仍然在探索之中。Functional Electrical Stimulation (FES) is a technology that stimulates limb motor muscles and peripheral nerves through current pulse sequences to effectively restore or reconstruct part of the motor function of paraplegic patients. At present, due to the weak regeneration ability of the spinal cord, there is no effective treatment method that can directly repair the injury for paralyzed patients with spinal cord injury. The implementation of functional rehabilitation training is an effective measure. According to statistics, the number of paralyzed patients with spinal cord injury is increasing year by year, and functional rehabilitation training is an urgently needed technology. In the 1960s, Liberson successfully used electrical stimulation of the peroneal nerve for the first time to correct the gait of hemiplegic patients with foot drop, and created a new way of functional electrical stimulation for motor and sensory function rehabilitation. At present, FES has become an important rehabilitation treatment method for restoring or reconstructing part of the motor function of paraplegic patients. However, how to precisely control the trigger timing and pulse current intensity of FES to ensure that the effect of electrical stimulation can accurately complete the predetermined functional action is still the key to the technology of FES. According to statistics, there is still little research on the trigger control of FES at present, and according to the deviation between the effect and the predetermined action, the closed-loop control is used to automatically adjust the FES stimulation intensity and timing parameters, thereby greatly improving the real-time performance, accuracy and stability of the FES system. However, effective control methods are still being explored.

模糊控制器是一种通过模糊逻辑和近似推理的方法,把人的经验形式化、模型化,变成计算机可以接受的控制模型,让计算机代替人来进行实时地控制被控对象的高级策略和新颖的技术方法,可有效地提高控制算法的可控性、适应性和合理性,尤其是针对复杂而用数学方程难于建模且有丰富手控经验的课题具有奇特的优势,而人体肌肉的复杂性和时变性操作环境使其建立其数学模型,致使传统的控制方法很难适应FES领域的严格要求,模糊控制器为FES的精密控制提供了新方案。模糊控制器核心技术就是确定模糊控制器的结构、所采用的模糊规则、合成推理算法以及模糊决策的方法等因素,模糊控制要取得最优的控制效果的关键既是对模糊控制器量化因子、比例因子以及模糊控制规则等参数的整定。在FES领域,对系统稳定性要求极为严格,所以对模糊控制器参数选择亦尤为重要。本专利提出的基于遗传算法整定模糊控制器控制功能性电刺激精密控制的方法,在FES系统电流水平方面可取得良好的效果。Fuzzy controller is a method of formalizing and modeling human experience through fuzzy logic and approximate reasoning, and turns it into a control model acceptable to computers, allowing computers to replace people in real-time control of advanced strategies and control of the controlled object. The novel technical method can effectively improve the controllability, adaptability and rationality of the control algorithm, especially for the complex and difficult to model with mathematical equations and has a unique advantage in the subject of rich manual control experience, while the human muscle The complexity and time-varying operating environment make it possible to establish its mathematical model, which makes it difficult for traditional control methods to adapt to the strict requirements of the FES field. The fuzzy controller provides a new solution for the precise control of FES. The core technology of the fuzzy controller is to determine the structure of the fuzzy controller, the fuzzy rules used, the synthetic reasoning algorithm and the method of fuzzy decision-making. factors and fuzzy control rules and other parameter tuning. In the field of FES, the requirements for system stability are extremely strict, so the selection of fuzzy controller parameters is also particularly important. The method proposed in this patent based on the genetic algorithm to tune the fuzzy controller to control the precise control of functional electrical stimulation can achieve good results in the current level of the FES system.

遗传算法属于人工生物进化算法,是一种借鉴于生物界自然选择和自然遗传机制,主要特点是群体搜索策略和群体中个个体之间的信息交换,不依赖于梯度信息,特别适合对复杂的非线性问题寻优。但是对于系统中的反馈信息的利用却无能为力,致使求解到一定范围时往往做大量无力的冗余迭代,求精确解效率低。蚁群算法模拟生物世界中的蚂蚁在没有任何提示下寻找由蚁穴至食物源的最短路径的觅食行为提出基于种群的模拟进化算法,具有较强的适应性,分布式并行计算,易于其他算法集成的优点,但初期信息素匮乏,求解速度慢。遗传算法和蚁群算法都具有适用范围广、通用性强等等优点,广泛应用于离散最优化问题,遗传算法和蚁群算法具有互补性有机地融合在一起,可以克服各自缺点,发挥各自优点。The genetic algorithm belongs to the artificial biological evolutionary algorithm. It is a kind of natural selection and natural genetic mechanism for reference in the biological world. The main feature is the group search strategy and the information exchange between individuals in the group. Optimizing nonlinear problems. However, there is nothing that can be done about the utilization of feedback information in the system, resulting in a large number of powerless redundant iterations when the solution reaches a certain range, and the efficiency of obtaining an accurate solution is low. The ant colony algorithm simulates the foraging behavior of ants in the biological world looking for the shortest path from the ant nest to the food source without any prompts. A population-based simulated evolutionary algorithm is proposed, which has strong adaptability, distributed parallel computing, and is easy for others The advantages of algorithm integration, but the lack of pheromone in the initial stage, the solution speed is slow. Both genetic algorithm and ant colony algorithm have the advantages of wide application range and strong versatility, and are widely used in discrete optimization problems. Genetic algorithm and ant colony algorithm are complementary and organically integrated, which can overcome their respective shortcomings and give full play to their respective advantages .

发明内容 Contents of the invention

为克服现有技术的不足,本发明的目的在于,提出一种新的FES的精密控制方法,通过遗传算法和蚁群算法的融合,优势互补,优化模糊控制器的量化因子、比例因子以及模糊控制规则,继而准确稳定实时地控制FES系统的电流模式,并可有效地提高FES系统准确性和稳定性,并获得可观的社会效益和经济效益。为达到上述目的,本发明采用的技术方案是:基于遗传蚁群融合模糊控制器的助行电刺激精密控制方法,包括下列步骤:In order to overcome the deficiencies in the prior art, the object of the present invention is to propose a new precision control method for FES, through the integration of genetic algorithm and ant colony algorithm, the advantages are complementary, and the quantization factor, scale factor and fuzzy control factor of fuzzy controller are optimized. Control rules, and then accurately and stably control the current mode of the FES system in real time, and can effectively improve the accuracy and stability of the FES system, and obtain considerable social and economic benefits. In order to achieve the above-mentioned purpose, the technical solution adopted in the present invention is: a precise control method for electric stimulation of walking aid based on genetic ant colony fusion fuzzy controller, comprising the following steps:

首先将模糊控制的量化因子、比例因子以及隶属函数参量的12个决策变量kfuzz的选择转化为遗传与蚁群算法适用的组合优化问题,并对这12个kfuzz进行二进制编码,之后随机产生n个个体组成的初始种群P(0),其中kfuzz为n×12的向量;Firstly, the selection of 12 decision variables kfuzz of fuzzy control quantization factor, proportional factor and membership function parameter is transformed into a combinatorial optimization problem applicable to genetic and ant colony algorithm, and these 12 kfuzz are binary coded, and then n are randomly generated The initial population P(0) composed of individuals, where kfuzz is a vector of n×12;

其次建立合理的实际关节角度与肌肉模型输出关节角度的相应关系目标函数以及确定蚁群算法的参数设置,利用遗传算法产生蚁群算法中的初始信息素分布,利用蚂蚁随机搜索优化模糊控制器的隶属函数以及量化因子和比例因子,并调用已整定的模糊控制器,验证是否达到预设目标,若无重复以上操作,直到参数收敛或者达到预定的指标,输出模糊控制的决策变量和蚁群运行的次数;Secondly, establish a reasonable objective function of the corresponding relationship between the actual joint angle and the output joint angle of the muscle model and determine the parameter settings of the ant colony algorithm, use the genetic algorithm to generate the initial pheromone distribution in the ant colony algorithm, and use the ant random search to optimize the fuzzy controller Membership function, quantization factor and proportional factor, and call the fuzzy controller that has been tuned to verify whether the preset goal is reached. If not, repeat the above operations until the parameters converge or reach the predetermined index, and output the decision variables of the fuzzy control and the operation of the ant colony the number of times;

依据前述输出模糊控制的决策变量在模糊控制器下计算系统输出及其与肌肉模型的偏差后再进入下一步的自学习与自调整,反复此过程,最终实现模糊控制器参数的自适应在线整定,并用于FES系统。According to the above-mentioned output fuzzy control decision variables, calculate the system output and its deviation from the muscle model under the fuzzy controller, then enter the next step of self-learning and self-adjustment, repeat this process, and finally realize the adaptive online tuning of fuzzy controller parameters , and used in the FES system.

所述模糊控制器为二维模糊控制器,两个输入变量分别实际输出关节角度和期望关节度的误差e(k)以及误差的变化率ec(k),论域为FE=[-E,E],FEC=[-EC,EC],输出的刺激电流强度u(k),其论域为FU=[-U,U];Described fuzzy controller is a two-dimensional fuzzy controller, and two input variables actually output the error e (k) of joint angle and desired joint degree and the rate of change ec (k) of error respectively, and the domain of discussion is FE=[-E, E], FEC=[-EC, EC], the output stimulation current intensity u(k), its discourse domain is FU=[-U, U];

误差的量化论域为X={-n,-n+1,…0,…,n-1,n};(1)The domain of quantification of error is X={-n,-n+1,...0,...,n-1,n}; (1)

误差变化率的量化论域为X1={-m,-m+1,…0,…,m-1,m};(2)The domain of quantification of error change rate is X1={-m,-m+1,...0,...,m-1,m}; (2)

控制量的量化论域为Y={-k,-k+1,…0,…,k-1,k};(3)The domain of quantification of the control quantity is Y={-k,-k+1,...0,...,k-1,k}; (3)

量化因子分别为The quantization factors are

Ke=n/Xe;(4)K e = n/X e ; (4)

Kec=m/Xec;(5)K ec =m/X ec ; (5)

比例因子为The scale factor is

Ku=k/Yu;(6)K u = k/Y u ; (6)

误差的论论域:{-3 -2 -1 0 1 2 3};误差变化率的论域为{-3 -2 -1 0 1 2 3}输出值的论域{-3 -2 -1 0 1 2 3}。控制规则为:如果E1且EC1则U1,如果E2且EC2则U2,……Ep且ECp则Up;The domain of discourse of error: {-3 -2 -1 0 1 2 3}; the domain of discourse of error rate of change is {-3 -2 -1 0 1 2 3} the domain of discourse of output value {-3 -2 -1 0 1 2 3}. The control rules are: if E1 and EC1, then U1, if E2 and EC2, then U2, ... Ep and ECp, then Up;

其总模糊控制规则为Its total fuzzy control rule is

Figure GDA0000156290910000021
Figure GDA0000156290910000021

R=(Ei×CEi)T1οCi    (8)R=(E i ×CE i ) T1 οC i (8)

其中E1=(a1i…ani),EC1=(b1i…bmi),U1=(c1i…cti)(i=1,…p)where E 1 =(a 1i ...a ni ), EC 1 =(b 1i ...b mi ), U 1 =(c 1i ...c ti )(i=1, ...p)

采用的反模糊化法是加权平均法The defuzzification method used is the weighted average method

uu cc == (( ΣΣ ii == -- sthe s sthe s ii kk ii )) // (( ΣΣ ii == -- sthe s sthe s uu ii )) -- -- -- (( 99 ))

对于每一个具体的观察值偏差E*和其误差变化率EC*,再分别用各自的量化因子公式变成量化论域中的元素,再把其模糊化为E*和EC*For each specific observation value deviation E * and its error rate of change EC * , then use their respective quantification factor formulas to become elements in the quantitative domain, and then fuzzify them into E * and EC * ,

Figure GDA0000156290910000032
Figure GDA0000156290910000032

Figure GDA0000156290910000033
Figure GDA0000156290910000033

其中E*=(e1…en),EC*=(f1…fm)where E * = (e 1 ... e n ), EC * = (f 1 ... f m )

由公式(8)求输出的精确量。Calculate the exact amount of output by formula (8).

所述将模糊控制的量化因子、比例因子以及隶属函数参量的12个决策变量的选择转化为遗传与蚁群算法适用的组合优化问题,是按如下公式进行:The selection of the 12 decision variables of quantization factor, proportional factor and membership function parameter of the fuzzy control is transformed into a combinatorial optimization problem applicable to the genetic and ant colony algorithm, which is carried out according to the following formula:

Ke1=kfuzzi(1)*Ke    (18)K e1 =kfuzzi(1)*K e (18)

Kc1=kfuzzi(2)*Kc    (19)K c1 =kfuzzi(2)*K c (19)

Ku1=kfuzzi(3)*Ku    (20)K u1 = kfuzzi(3)*K u (20)

对误差的隶属函数的整定即对误差论域的论域整定为:The adjustment of the membership function of the error is the adjustment of the domain of the error discourse as follows:

{-3-kfuzzi(4),-2-kfuzzi(5),-1-kfuzzi(6),0,1+kfuzzi(6),2+kfuzzi(5),3+kfuzzi(4)}{-3-kfuzzi(4), -2-kfuzzi(5), -1-kfuzzi(6), 0, 1+kfuzzi(6), 2+kfuzzi(5), 3+kfuzzi(4)}

对误差变化率的隶属函数的整定即对误差变化率的论域整定为:The setting of the membership function of the rate of error change is the setting of the universe of the error rate of change as follows:

{-3-kfuzzi(7),-2-kfuzzi(8),-1-kfuzzi(9),0,1+kfuzzi(9),2+kfuzzi(8),3+kfuzzi(7)}{-3-kfuzzi(7), -2-kfuzzi(8), -1-kfuzzi(9), 0, 1+kfuzzi(9), 2+kfuzzi(8), 3+kfuzzi(7)}

输出电流的隶属函数的整定即对输出电流的隶属函数的论域整定为:The setting of the membership function of the output current is the setting of the domain of the membership function of the output current:

{-3-kfuzzi(10),-2-kfuzzi(11),-1-kfuzzi(12),0,1+kfuzzi(12),2+kfuzzi(11),3+kfuzzi(10)}{-3-kfuzzi(10), -2-kfuzzi(11), -1-kfuzzi(12), 0, 1+kfuzzi(12), 2+kfuzzi(11), 3+kfuzzi(10)}

所述利用遗传算法产生蚁群算法中的初始信息素分布,利用蚂蚁随机搜索优化模糊控制器的隶属函数以及量化因子和比例因子,前述kfuzzi既是遗传算法中染色体的编码,又是蚁群算法中城市的编码,二者编码的长度应该相等,依照The initial pheromone distribution in the ant colony algorithm is generated by using the genetic algorithm, and the membership function, the quantization factor and the scaling factor of the fuzzy controller are optimized by ant random search. The aforementioned kfuzzi is not only the coding of the chromosome in the genetic algorithm, but also the The code of the city, the length of the two codes should be equal, according to

ni<log2[(ximax-ximin)×10m]-1(21)n i <log 2 [(x imax -x imin )×10 m ]-1(21)

ni≥log2[(ximax-ximin)×10m+1](22)n i ≥ log 2 [(x imax -x imin )×10 m +1](22)

kfuzzi编码长度

Figure GDA0000156290910000034
kfuzzi encoding length
Figure GDA0000156290910000034

每个参数所对应的实数可以解码得到,则对应的解码公式为The real number corresponding to each parameter can be decoded, and the corresponding decoding formula is

kfuzzikfuzzi (( ii )) == xx ii minmin ++ (( &Sigma;&Sigma; jj == 00 ll ii bb jj &times;&times; 22 jj -- 11 )) &times;&times; xx ii maxmax -- xx ii minmin 22 ll -- 11 -- -- -- (( 23twenty three ))

其中kfuzzi(i)为整定的模糊控制器的变化量,li为此参数的编码的长度,b∈[0,1],ximax和ximin分别为决策量的最大值和最小值。Among them, kfuzzi(i) is the variation of the fuzzy controller, l i is the coded length of this parameter, b∈[0,1], x imax and x imin are the maximum and minimum values of the decision-making quantity respectively.

所述具体步骤细化为:The specific steps are detailed as follows:

首先是遗传算法的定义和设置:The first is the definition and setting of the genetic algorithm:

Step1:初始化遗传算法控制参数(种群规模,杂交概率,变异概率);Step1: Initialize the genetic algorithm control parameters (population size, hybridization probability, mutation probability);

Step2:设置遗传算法结束条件包括:最小遗传迭代次数,最大遗传迭代次数,最小进化率,连续迭代次数;Step2: Set the end conditions of the genetic algorithm including: the minimum number of genetic iterations, the maximum number of genetic iterations, the minimum evolution rate, and the number of consecutive iterations;

Step3:对待解决问题进行二进制编码,随机初始化种群X(0)=(x1,x2,...xn)。Step3: Perform binary coding on the problem to be solved, and randomly initialize the population X(0)=(x 1 , x 2 , . . . x n ).

Step4:对当前群体X(t)中每个个体xi,解码计算其适应度F(xi)。Step4: For each individual xi in the current group X(t), decode and calculate its fitness F(xi ) .

Step5:根据个体适应值以及赌轮选择策略确定每个个体的概率,将概率高的两个个体直接遗传到下一代,按照交叉、变异算法执行交叉、变异操作。Step5: Determine the probability of each individual according to the individual fitness value and the roulette selection strategy, and directly inherit the two individuals with high probability to the next generation, and perform crossover and mutation operations according to the crossover and mutation algorithm.

Step6:更新新一代个体的适应值。重复Step5。Step6: Update the fitness value of the new generation of individuals. Repeat Step5.

Step7:选择适应能力强的个体,放入集合中,作为最优解集合。对优化集中的每个个体,将遗传算法结果设置为蚁群算法初始信息素。Step7: Select individuals with strong adaptability and put them into the set as the optimal solution set. For each individual in the optimization set, the result of the genetic algorithm is set as the initial pheromone of the ant colony algorithm.

再次遗传蚁群融合算法中蚁群算法的改进,然后遗传算法相衔接,并用此融合算法整定模糊控制器参数:Again, the improvement of the ant colony algorithm in the genetic ant colony fusion algorithm, and then the genetic algorithm is connected, and this fusion algorithm is used to tune the parameters of the fuzzy controller:

Step8:信息素的初值设置:τS=τCG,其中,τC是一个常数,即MMAS算法中的最小信息素,τG是遗传算法求解结果转化的信息素值;Step8: Initial value setting of pheromone: τ SCG , where τ C is a constant, that is, the minimum pheromone in the MMAS algorithm, and τ G is the pheromone value converted from the solution result of the genetic algorithm;

Step9:参数初始化:令时间t=0和循环次数Nmax=0,设置最大循环次数Ncmax,将m个蚂蚁置于起始点。设置蚂蚁个数和循环次数;Step9: Parameter initialization: set time t=0 and number of cycles N max =0, set the maximum number of cycles N cmax , and place m ants at the starting point. Set the number of ants and the number of cycles;

Step10:蚂蚁随机搜索,在一次爬行结束后,决定哪些特征变量被选中作为实际输入变量,修改禁忌表指针,即选择好之后将蚂蚁移动到新的元素,并把该元素移动该蚂蚁个体的禁忌表中;Step10: Ants search randomly. After a crawl is over, decide which feature variables are selected as the actual input variables, and modify the taboo table pointer, that is, move the ant to a new element after selection, and move the element to the taboo of the ant individual table;

Step11:计算适应度函数和隶属函数,蚂蚁个体状态转移概率公式计算的概率选择元素;Step11: Calculate the fitness function and membership function, the probability selection elements calculated by the ant individual state transition probability formula;

Step12:利用训练样本提供的信息产生模糊规则的条件,检验模糊模型的正确率;Step12: Use the information provided by the training samples to generate the conditions of the fuzzy rules, and check the accuracy of the fuzzy model;

Step13:若蚂蚁元素未遍历完,转Step10,否则为Step12;Step13: If the ant element has not been traversed, go to Step10, otherwise go to Step12;

Step14:更新信息素浓度划分正确率高的特征变量的信息素浓度得到增强,下次搜索时会以更大的概率被选中;Step14: Update the pheromone concentration of the characteristic variable with high classification accuracy of pheromone concentration to be enhanced, and will be selected with a greater probability in the next search;

Step15:满足结束调节,整定结束。Step15: End adjustment when satisfied, and end of setting.

本发明其特点在于:首先以模糊控制根据膝关节角度的变化实时控制功能性电刺激的电流模式,有效地解决了由于人体肌肉的复杂性和时变性所带来的难以精确控制电刺激电流模式的问题,其次利用遗传蚁群算法的良好寻优特性,实时调整模糊控制器的量化因子、比例因子以及隶属函数参数,继而更精确的控制功能性电刺激的电流模式,既能完成理想的刺激效果,又能防止疲劳,可使功能性电刺激系统得到广泛推广,并获得可观的社会效益和经济效益。The present invention is characterized in that: first, the current mode of functional electrical stimulation is controlled in real time according to the change of knee joint angle by fuzzy control, which effectively solves the difficulty in precisely controlling the current mode of electrical stimulation due to the complexity and time-varying nature of human muscles Second, using the good optimization characteristics of the genetic ant colony algorithm to adjust the quantization factor, scaling factor and membership function parameters of the fuzzy controller in real time, and then more accurately control the current mode of functional electrical stimulation, which can complete the ideal stimulation effect, and can prevent fatigue, the functional electrical stimulation system can be widely promoted, and obtain considerable social and economic benefits.

附图说明Description of drawings

图1遗传蚁群算法收敛速度图。Fig. 1 Convergence speed graph of genetic ant colony algorithm.

图2遗传蚁群融合算法整定模糊控制器参数的结构框图Fig.2 Structure diagram of fuzzy controller parameters tuning by genetic ant colony fusion algorithm

图3实验场景图。Figure 3 Experimental scene diagram.

图4遗传蚁群算法自适应优化整定的模糊控制器追踪结果图。Fig. 4 The fuzzy controller tracking result diagram of adaptive optimization tuning of genetic ant colony algorithm.

图5遗传蚁群算法整定模糊控制器参数控制下预设输入关节角度与实际输出的相对误差。Fig. 5 The relative error between the preset input joint angle and the actual output under the control of fuzzy controller parameters by genetic ant colony algorithm tuning.

具体实施方式 Detailed ways

基于遗传蚁群融合模糊控制的助行功能性电刺激精密控制方法的应用的结构如图2所示。其工作流程为:首先将模糊控制的量化因子、比例因子以及隶属函数参量的12个决策变量的选择转化为遗传与蚁群算法适用的组合优化问题,并对其进行编码以及随机产生n个个体组成的染色体(初始种群),其次建立合理的实际关节角度与肌肉模型输出关节角度的相应关系函数以及确定蚁群算法的参数设置,充分利用遗传算法的快速性、随机性、全局收敛性,其结果是产生蚁群算法中的初始信息素分布,利用蚂蚁随机搜素使其变量优化模糊控制器的隶属函数以及量化因子和比例因子,并调用已整定的模糊控制器,验证是否达到预设目标,若无则重复以上操作,直到参数收敛或者达到预定的指标;最终输出即得模糊控制的决策变量和蚁群运行的次数。在新的模糊控制器下计算系统输出及其与肌肉模型的偏差后再进入下一步的自学习与自调整。反复此过程,最终实现模糊控制器参数的自适应在线整定,并用于FES系统。The structure of the application of the precise control method of walking aid functional electrical stimulation based on genetic ant colony fusion fuzzy control is shown in Figure 2. Its working process is as follows: firstly, the selection of 12 decision variables of quantization factor, proportional factor and membership function parameter of fuzzy control is transformed into a combinatorial optimization problem applicable to genetic and ant colony algorithm, and it is coded and n individuals are randomly generated The chromosomes (initial population) formed, and then establish a reasonable relationship between the actual joint angle and the muscle model output joint angle and determine the parameter settings of the ant colony algorithm, making full use of the rapidity, randomness, and global convergence of the genetic algorithm. The result is to generate the initial pheromone distribution in the ant colony algorithm, use ants to randomly search for variables to optimize the membership function, quantization factor and proportional factor of the fuzzy controller, and call the fuzzy controller that has been tuned to verify whether the preset goal is achieved , if not, repeat the above operations until the parameters converge or reach the predetermined target; the final output is the decision variable of the fuzzy control and the number of times the ant colony runs. After calculating the system output and its deviation with the muscle model under the new fuzzy controller, enter the next step of self-learning and self-adjustment. Repeat this process, and finally realize the adaptive online tuning of fuzzy controller parameters, and use it in FES system.

1 模糊控制设计1 Fuzzy control design

由于人的特殊性,FES领域对控制器稳定性,、鲁棒性、实时性要求严格,设计模糊控制器均衡稳定性和实时性选择了二维模糊控制器,即两个输入变量分别实际输出关节角度和期望关节度的误差e(k)以及误差的变化率ec(k),其论域为FE=[-E,E],FEC=[-EC,EC],输出的刺激电流强度u(k),其论域为FU=[-U,U]。Due to the particularity of human beings, the FES field has strict requirements on controller stability, robustness, and real-time performance. The two-dimensional fuzzy controller is selected for the balance stability and real-time performance of the fuzzy controller, that is, the two input variables are actually output respectively. The error e(k) of the joint angle and the expected joint degree and the rate of change ec(k) of the error, the domain of discussion is FE=[-E, E], FEC=[-EC, EC], the output stimulation current intensity u (k), its domain of discourse is FU=[-U, U].

误差的量化论域为The domain of quantification of error is

X={-n,-n+1,…0,…,n-1,n}(1)X={-n,-n+1,...0,...,n-1,n}(1)

误差变化率的量化论域为The domain of quantification of error rate of change is

X1={-m,-m+1,…0,…,m-1,m};(2)X 1 ={-m,-m+1,...0,...,m-1,m}; (2)

控制量的量化论域为The domain of quantification of the control quantity is

Y={-k,-k+1,…0,…,k-1,k}(3)Y={-k,-k+1,...0,...,k-1,k} (3)

量化因子分别为The quantization factors are

Ke=n/Xe    (4)K e =n/X e (4)

Kec=m/Xec  (5)K ec =m/X ec (5)

比例因子为The scale factor is

Ku=k/Yu(6)K u =k/Y u (6)

 本专利采用误差的论论域:{-3 -2 -1 0 1 2 3};误差变化率的论域为{-3 -2 -1 0 1 2 3}输出值的论域{-3 -2 -1 0 1 2 3}。控制规则为:如果E1且EC1则U1,如果E2且EC2则U2,……Ep且ECp则Up;This patent adopts the domain of discourse of error: {-3 -2 -1 0 1 2 3}; the domain of discourse of error change rate is {-3 -2 -1 0 1 2 3} the domain of discourse of output value {-3 - 2 -1 0 1 2 3}. The control rules are: if E1 and EC1, then U1, if E2 and EC2, then U2, ... Ep and ECp, then Up;

其总模糊控制规则为Its total fuzzy control rule is

Figure GDA0000156290910000061
Figure GDA0000156290910000061

R=(Ei×CEi)T1οCi    (8)R=(E i ×CE i ) T1 οC i (8)

其中E1=(a1i…ani),EC1=(b1i…bmi),U1=(c1i…cti)(i=1,…p)where E 1 =(a 1i ...a ni ), EC 1 =(b 1i ...b mi ), U 1 =(c 1i ...c ti )(i=1, ...p)

采用的反模糊化法是加权平均法The defuzzification method used is the weighted average method

Figure 33
(9)
Figure 33
(9)

对于每一个具体的观察值偏差E*和其误差变化率EC*,再分别用各自的量化因子公式变成量化论域中的元素,再把其模糊化为E*和EC*For each specific observation value deviation E * and its error rate of change EC * , then use their respective quantification factor formulas to become elements in the quantitative domain, and then fuzzify them into E * and EC * ,

Figure GDA0000156290910000063
Figure GDA0000156290910000063

其中E*=(e1…en),EC*=(f1…fm)where E * = (e 1 ... e n ), EC * = (f 1 ... f m )

有公式8可以求输出的精确量。There is Equation 8 to find the exact amount of output.

本专利角度误差及其误差变化率在[-90 90]上,论域为[-3 3],则可以用公式The angle error of this patent and its error rate of change are on [-90 90], and the domain of discussion is [-3 3], then the formula can be used

Xx == (( 22 nno bb -- aa (( xx &prime;&prime; -- aa ++ bb 22 )) )) -- -- -- (( 1111 ))

5.2遗传和蚁群融合算法整定模糊控制器参数5.2 Genetic and ant colony fusion algorithm tuning fuzzy controller parameters

蚁群算法是一种源于大自然生物世界的新型仿生算法,用蚁群算法求解最优化问题时,首先将最优化问题转化为了求解最短路径问题。每只蚂蚁从初始接点N00或N01出发,顺序走过N1,N2…,的其中一子结点,直到终结点Nk0、Nk1组成路径(N0t N1t…Nkt),t∈[0,1]。其路径可代表一个二进制的可行解。每次蚂蚁访问城市时有以下的特征:Ant colony algorithm is a new type of bionic algorithm derived from the biological world of nature. When using ant colony algorithm to solve optimization problems, the optimization problem is first transformed into the shortest path problem. Each ant starts from the initial node N 00 or N 01 , and walks sequentially through one of the child nodes of N 1 , N 2 ... until the end points N k0 and N k1 form a path (N 0t N 1t ... N kt ), t ∈ [0, 1]. Its path can represent a binary feasible solution. Each time an ant visits a city, it has the following characteristics:

状态转化规则:蚁群算法使用的状态转化规则为基于TSP问题提出的随机比例规则,它给出位于城市i的蚂蚁k选择移动到城市j的概率,State transition rule: The state transition rule used by the ant colony algorithm is a random proportional rule based on the TSP problem, which gives the probability that ant k located in city i chooses to move to city j,

Figure GDA0000156290910000066
Figure GDA0000156290910000066

其中τij(i,j)为(i,j)的适应度,ηij(i,j)为距离的倒数。α为残留信息的相对重要程度、β为期望值的相对重要程度。Among them, τ ij (i, j) is the fitness of (i, j), and η ij (i, j) is the reciprocal of the distance. α is the relative importance of residual information, and β is the relative importance of expected value.

在蚁群算法中,选择方式为In the ant colony algorithm, the selection method is

Figure GDA0000156290910000071
Figure GDA0000156290910000071

其中,q为均匀分布在[0,1]上的一个随机数,q0为[0,1]上的参变量。Among them, q is a random number uniformly distributed on [0, 1], and q 0 is a parameter variable on [0, 1].

全局更新规则:蚂蚁算法有不同的更新算法,蚁群系统采用的全局更新原则,只允许全局最优解的蚂蚁释放信息素,这样是为了使蚂蚁的搜索主要集中在当前循环为止所找出的最好路径的邻域。Global update rules: The ant algorithm has different update algorithms. The global update principle adopted by the ant colony system only allows the ants with the global optimal solution to release pheromone. neighborhood of the best path.

τij(i,j)←(1-ρ)□τij(i,j)+ρ·Δτij(i,j)(14)τ ij (i, j)←(1-ρ)□τ ij (i, j)+ρ·Δτ ij (i, j)(14)

Figure GDA0000156290910000072
Figure GDA0000156290910000072

其中ρ为信息数挥发系数,Lgb为目前为止找到的全局最优路径局部更新信息:每只蚂蚁建立一个解的过程中也有进行信息数素迹的更新Among them, ρ is the volatility coefficient of information number, and L gb is the local update information of the global optimal path found so far: each ant also updates the information number trace in the process of establishing a solution

τij(i,j)←(1-γ)τij(i,j)+γ·Δτij(i,j)(16)τ ij (i, j)←(1-γ)τ ij (i, j)+γ·Δτ ij (i, j)(16)

其中γ∈[0,1]。where γ ∈ [0, 1].

利用功能性电刺激刺激肌肉使其完成相应的动作时,电流不能过激或者应该快速使肌肉完成动作,电流过激超过人的阈值,则会感觉到疼痛,有时难以忍受,并易引起肌疲劳,所以快速整定模糊控制器的相关参数尤其重要。故利用遗传算法和蚁群算法优点相结合,提高优化的效率,快速整定模糊控制器的相关参数。利用遗传蚁群模糊控制器既是利用遗传蚁群融合算法整定模糊控制的量化因子、比例因子和模糊规则中隶属函数的分布。如下公式所示When using functional electrical stimulation to stimulate muscles to complete corresponding actions, the current should not be overexcited or the muscles should complete the action quickly. If the current exceeds the human threshold, you will feel pain, sometimes unbearable, and easily cause muscle fatigue, so It is especially important to quickly tune the relevant parameters of the fuzzy controller. Therefore, the advantages of genetic algorithm and ant colony algorithm are combined to improve the optimization efficiency and quickly adjust the relevant parameters of the fuzzy controller. The use of genetic ant colony fuzzy controller means the use of genetic ant colony fusion algorithm to adjust the distribution of quantization factor, proportional factor and membership function in fuzzy rules. as shown in the following formula

Ke1=kfuzzi(1)*Ke    (18)K e1 =kfuzzi(1)*K e (18)

Kc1=kfuzzi(2)*Kc    (19)K c1 =kfuzzi(2)*K c (19)

Ku1=kfuzzi(3)*Ku    (20)K u1 = kfuzzi(3)*K u (20)

对误差的隶属函数的整定即对误差论域的论域整定为The adjustment of the membership function of the error is the adjustment of the domain of the error discourse as

{-3-kfuzzi(4),-2-kfuzzi(5),-1-kfuzzi(6),0,1+kfuzzi(6),2+kfuzzi(5),3+kfuzzi(4)}{-3-kfuzzi(4), -2-kfuzzi(5), -1-kfuzzi(6), 0, 1+kfuzzi(6), 2+kfuzzi(5), 3+kfuzzi(4)}

对误差变化率的隶属函数的整定即对误差变化率的论域整定为The setting of the membership function of the rate of error change is the setting of the universe of the rate of error change as

{-3-kfuzzi(7),-2-kfuzzi(8),-1-kfuzzi(9),0,1+kfuzzi(9),2+kfuzzi(8),3+kfuzzi(7)}{-3-kfuzzi(7), -2-kfuzzi(8), -1-kfuzzi(9), 0, 1+kfuzzi(9), 2+kfuzzi(8), 3+kfuzzi(7)}

输出电流的隶属函数的整定即对输出电流的隶属函数的论域整定为The setting of the membership function of the output current is to set the domain of the membership function of the output current as

{-3-kfuzzi(10),-2-kfuzzi(11),-1-kfuzzi(12),0,1+kfuzzi(12),2+kfuzzi(11),3+kfuzzi(10)}{-3-kfuzzi(10), -2-kfuzzi(11), -1-kfuzzi(12), 0, 1+kfuzzi(12), 2+kfuzzi(11), 3+kfuzzi(10)}

其中kfuzzi既是遗传算法中染色体的编码,又是蚁群算法中城市的编码,为了使二者更好地融合都采用二进制编码,再融合算法中kfuzzi不变,所以二者编码的长度应该相等,应该依照Among them, kfuzzi is not only the code of the chromosome in the genetic algorithm, but also the code of the city in the ant colony algorithm. In order to make the two better integrated, the binary code is used, and the kfuzzi is unchanged in the fusion algorithm, so the length of the two codes should be equal. should follow

ni<log2[(ximax-ximin)×10m]-1(21)n i <log 2 [(x imax -x imin )×10 m ]-1(21)

ni≥log2[(ximax-ximin)×10m+1](22)n i ≥ log 2 [(x imax -x imin )×10 m +1](22)

kfuzzi编码长度 kfuzzi encoding length

每个参数所对应的实数可以解码得到,则对应的解码公式为The real number corresponding to each parameter can be decoded, and the corresponding decoding formula is

kfuzzikfuzzi (( ii )) == xx ii minmin ++ (( &Sigma;&Sigma; jj == 00 ll ii bb jj &times;&times; 22 jj -- 11 )) &times;&times; xx ii maxmax -- xx ii minmin 22 ll -- 11 -- -- -- (( 23twenty three ))

其中kfuzzi(i)为整定的模糊控制器的变化量,li为此参数的编码的长度,b∈[0,1],ximax和ximin分别为决策量的最大值和最小值。Among them, kfuzzi(i) is the variation of the fuzzy controller, l i is the coded length of this parameter, b∈[0,1], x imax and x imin are the maximum and minimum values of the decision-making quantity respectively.

首先是遗传算法的定义和设置:The first is the definition and setting of the genetic algorithm:

Step1:初始化遗传算法控制参数(种群规模,杂交概率,变异概率)。Step1: Initialize the genetic algorithm control parameters (population size, hybridization probability, mutation probability).

Step2:设置遗传算法结束条件(最小遗传迭代次数,最大遗传迭代次数,最小进化率,连续迭代次数)。Step2: Set the end conditions of the genetic algorithm (minimum number of genetic iterations, maximum number of genetic iterations, minimum evolution rate, number of consecutive iterations).

Step3:对待解决问题进行二进制编码,随机初始化种群X(0)=(x1,x2,...xn)。Step3: Perform binary coding on the problem to be solved, and randomly initialize the population X(0)=(x 1 , x 2 , . . . x n ).

Step4:对当前群体X(t)中每个个体xi,解码计算其适应度F(xi)。Step4: For each individual xi in the current group X(t), decode and calculate its fitness F(xi ) .

Step5:根据个体适应值以及赌轮选择策略确定每个个体的概率,将概率高的两个个体直接遗传到下一代,按照交叉、变异算法执行交叉、变异操作。Step5: Determine the probability of each individual according to the individual fitness value and the roulette selection strategy, and directly inherit the two individuals with high probability to the next generation, and perform crossover and mutation operations according to the crossover and mutation algorithm.

Step6:更新新一代个体的适应值。重复Step5。Step6: Update the fitness value of the new generation of individuals. Repeat Step5.

Step7:选择适应能力强的个体,放入集合中,作为最优解集合。对优化集中的每个个体,将遗传算法结果设置为蚁群算法初始信息素。Step7: Select individuals with strong adaptability and put them into the set as the optimal solution set. For each individual in the optimization set, the result of the genetic algorithm is set as the initial pheromone of the ant colony algorithm.

再次遗传蚁群融合算法中蚁群算法的改进,然后遗传算法相衔接,并用此融合算法整定模糊控制器参数:Again, the improvement of the ant colony algorithm in the genetic ant colony fusion algorithm, and then the genetic algorithm is connected, and this fusion algorithm is used to tune the parameters of the fuzzy controller:

Step8:信息素的初值设置:τS=τCG,其中,τC是一个常数,即蚁群MMAS算法中的最小信息素,τG是遗传算法求解结果转化的信息素值。Step8: Initial value setting of pheromone: τ SCG , where τ C is a constant, that is, the minimum pheromone in the ant colony MMAS algorithm, and τ G is the pheromone value converted from the genetic algorithm solution result.

Step9:参数初始化:令时间t=0和循环次数Nmax=0,设置最大循环次数Ncmax,将m个蚂蚁置于起始点。设置蚂蚁个数和循环次数。Step9: Parameter initialization: set time t=0 and number of cycles N max =0, set the maximum number of cycles N cmax , and place m ants at the starting point. Set the number of ants and the number of cycles.

Step10:蚂蚁随机搜索,在一次爬行结束后,决定哪些特征变量被选中作为实际输入变量,修改禁忌表指针,即选择好之后将蚂蚁移动到新的元素,并把该元素移动该蚂蚁个体的禁忌表中。Step10: Ants search randomly. After a crawl is over, decide which feature variables are selected as the actual input variables, modify the taboo table pointer, that is, move the ant to a new element after selection, and move the element to the taboo of the ant individual table.

Step11:计算适应度函数和隶属函数,蚂蚁个体状态转移概率公式计算的概率选择元素。Step11: Calculate the fitness function and membership function, the probability selection element calculated by the ant individual state transition probability formula.

Step12:利用训练样本提供的信息产生模糊规则的条件,检验模糊模型的正确率。Step12: Use the information provided by the training samples to generate the conditions of the fuzzy rules, and check the accuracy of the fuzzy model.

Step13:若蚂蚁元素未遍历完,转Step10,否则为Step12Step13: If the ant element has not been traversed, go to Step10, otherwise go to Step12

Step14:更新信息素浓度划分正确率高的特征变量的信息素浓度得到增强,下次搜索时会以更大的概率被选中。Step14: Update the pheromone concentration of the characteristic variable with a high accuracy rate of pheromone concentration is enhanced, and will be selected with a greater probability in the next search.

Step15:满足结束调节,整定结束。Step15: Finish the adjustment when it is satisfied, and the setting is over.

其中,遗传和蚁群共用适应度函数,肌肉特性特别复杂而且人承受能力有限,这要求衡量控制系统三个指标为稳定性、准确性和快速性,为了更好使控制偏差趋于零,有较快的响应速度和较小的超调量,因此适应度函数应把最优预测与期望值的反馈偏差e(t),偏差的变化率ec(t)和控制量u(t)的关系,作为参数选取的最优指标JAmong them, genetics and ant colony share the fitness function, and the muscle characteristics are particularly complex and human tolerance is limited. This requires the three indicators of the control system to be measured as stability, accuracy and rapidity. In order to make the control deviation tend to zero, there is Faster response speed and smaller overshoot, so the fitness function should take the relationship between the feedback deviation e(t) between the optimal prediction and the expected value, the rate of change of the deviation ec(t) and the control variable u(t), The optimal index J selected as a parameter

JJ == &Integral;&Integral; 00 tt ww 11 ee 22 (( tt )) ++ ww 22 uu 22 (( tt )) ++ ww 33 (( ecec (( tt )) )) 22 dtdt -- -- -- (( 1414 ))

其中,w1,w2和w3是权值,一般都取w1=100,w2=10,w3=1。Wherein, w 1 , w 2 and w 3 are weight values, and generally take w 1 =100, w 2 =10, and w 3 =1.

适度函数为The fitness function is

F=C/J    (15)F=C/J (15)

其中,C=10n(n为整数),当个体的是适应度相差较大时,n≤0;相差较小时,n≥0。Among them, C=10 n (n is an integer), when the individual fitness differs greatly, n≤0; when the difference is small, n≥0.

2 实验方案2 Experimental scheme

实验装置采用美国SIGMEDICS公司生产的Parastep功能性电刺激助行系统以及PASCO公司PS-2137量角器和Data Studio软件。Parastep系统包含微处理器和刺激脉冲发生电路,含六条刺激通道,电池供电。实验内容为:利用FES系统对下肢相关肌群进行刺激,利用PASCO公司PS-2137量角器采集膝关节角度和Data Studio软件记录所测量的膝关节角度。要求受试者身体健康,无下肢肌肉、骨骼疾患,无神经疾患及严重心肺疾患。实验时受试者安坐于测试台上,将刺激电极固定于股四头肌的两端位置,将量角器固定在大腿和小腿上,使关节活动点贴近膝关节活动点位置。未施加电刺激时小腿放松、保持垂直悬空状态,FES实验场景如图3所示。电刺激脉冲序列采用经典的Lilly波形,脉冲频率为25Hz、脉宽150μs,脉冲电流在0~120m范围内可调。实验中可通过改变脉冲电流大小来调整刺激强度以改变由刺激产生的膝关节角度。实验前,设定期望的膝关节角度运动轨迹,实验中利用角度测量计实时检测膝关节张角变化。实验数据采样率为128Hz,数据记录时长为60s。The experimental device used the Parastep functional electrical stimulation walking aid system produced by SIGMEDICS Company of the United States, the PS-2137 protractor and Data Studio software of PASCO Company. The Parastep system includes a microprocessor and a stimulation pulse generation circuit, including six stimulation channels, and is powered by a battery. The content of the experiment is: use the FES system to stimulate the relevant muscle groups of the lower limbs, use the PS-2137 protractor of PASCO Company to collect the knee joint angle and record the measured knee joint angle with Data Studio software. The subjects are required to be in good health, without lower extremity muscle and bone diseases, without neurological diseases and severe cardiopulmonary diseases. During the experiment, the subject sat on the test bench, fixed the stimulating electrodes at the two ends of the quadriceps, fixed the protractor on the thigh and calf, and made the joint movement point close to the knee joint movement point. When no electrical stimulation was applied, the calf was relaxed and kept in a vertical suspension state. The FES experimental scene is shown in Figure 3. The electrical stimulation pulse sequence adopts the classic Lilly waveform, the pulse frequency is 25Hz, the pulse width is 150μs, and the pulse current is adjustable within the range of 0-120m. In the experiment, the stimulation intensity can be adjusted by changing the magnitude of the pulse current to change the knee joint angle generated by the stimulation. Before the experiment, set the expected trajectory of the knee joint angle, and use the goniometer to detect the change of the knee joint opening angle in real time during the experiment. The sampling rate of the experimental data is 128Hz, and the data recording time is 60s.

有益效果Beneficial effect

遗传蚁群融合整定的模糊控制器参数新算法对FES脉冲电流幅值进行测算和调整,使FES作用所产生的膝关节角度运动贴近预期的运动轨迹。图4为遗传蚁群算法自适应优化整定的模糊控制器追踪结果。图中红线表示预期运动轨迹、蓝线为实际输出关节角度。X轴为时间,Y轴为膝关节运动角度。为更清楚地观察此算法整定模糊控制器的控制误差,如图5遗传蚁群融合算法整定模糊控制下预设输入膝关节角度与实际膝关节角度的相对误差所示,则可以看出误差均在3%之内,可以达到精确的控制。The new fuzzy controller parameter algorithm of genetic ant colony fusion is used to measure and adjust the amplitude of FES pulse current, so that the knee joint angular motion generated by FES is close to the expected motion track. Figure 4 shows the tracking results of the fuzzy controller for the adaptive optimization of the genetic ant colony algorithm. The red line in the figure represents the expected motion trajectory, and the blue line represents the actual output joint angle. The X-axis is time, and the Y-axis is the knee joint motion angle. In order to observe the control error of the fuzzy controller set by this algorithm more clearly, as shown in Figure 5, the relative error between the preset input knee joint angle and the actual knee joint angle under the fuzzy control set by the genetic ant colony fusion algorithm, it can be seen that the error average Within 3%, precise control can be achieved.

本发明的主旨是提出一种新的FES的精密控制方法,通过遗传蚁群融合算法整定模糊控制器参数,继而准确稳定实时地有效地控制FES系统的电流强度。该项发明可有效地提高FES系统实时性、准确性和稳定性,并获得可观的社会效益和经济效益。最佳实施方案拟采用专利转让、技术合作或产品开发。The gist of the present invention is to propose a new precise control method for FES, which uses the genetic ant colony fusion algorithm to set fuzzy controller parameters, and then accurately, stably, and effectively controls the current intensity of the FES system in real time. The invention can effectively improve the real-time performance, accuracy and stability of the FES system, and obtain considerable social and economic benefits. The best implementation plan is to use patent transfer, technical cooperation or product development.

Claims (3)

1. walk help electro photoluminescence precision control method that merges fuzzy controller based on genetic-ant colony; It is characterized in that; Comprise the following steps: that at first selection with 12 decision variable kfuzzi of quantizing factor, scale factor and the subordinate function parameter of fuzzy control is converted into the combinatorial optimization problem that heredity and ant group algorithm are suitable for; And these 12 kfuzzi are carried out binary coding, and produce the initial population P (0) that the n individuals is formed afterwards at random, wherein kfuzzi is the vector of n * 12; The selection of 12 decision variables of said quantizing factor with fuzzy control, scale factor and subordinate function parameter is converted into heredity and the combinatorial optimization problem that ant group algorithm is suitable for, and is to be undertaken by following formula:
K e1=kfuzzi(1)*K e (18)
K c1=kfuzzi(2)*K c (19)
K u1=kfuzzi(3)*K u (20)
To the subordinate function of error adjust promptly to the domain of error domain adjust into:
{-3-kfuzzi(4),-2-kfuzzi(5),-1-kfuzzi(6),0,1+kfuzzi(6),2+kfuzzi(5),3+kfuzzi(4)}
To the subordinate function of error rate adjust promptly to the domain of error rate adjust into:
{-3-kfuzzi(7),-2-kfuzzi(8),-1-kfuzzi(9),0,1+kfuzzi(9),2+kfuzzi(8),3+kfuzzi(7)}
The subordinate function of output current adjust promptly to the domain of the subordinate function of output current adjust into:
{-3-kfuzzi(10),-2-kfuzzi(11),-1-kfuzzi(12),0,1+kfuzzi(12),2+kfuzzi(11),3+kfuzzi(10)}
The said genetic algorithm of utilizing produces plain distribution of initial information in the ant group algorithm; Utilize the ant random search to optimize subordinate function and the quantizing factor and the scale factor of fuzzy controller; Aforementioned kfuzzi is a chromosomal coding in the genetic algorithm; Be again the coding in city in the ant group algorithm, the length of the two coding should equate, according to
n i<log 2[(x imax-x imin)×10 m]-1(21)
n i≥log 2[(x imax-x imin)×10 m+1](22)
Kfuzzi code length
Figure FDA0000156290900000011
The pairing real number of each parameter can be decoded and obtained, and then corresponding decoding formula does
kfuzzi ( i ) = x i min + ( &Sigma; j = 0 l i b j &times; 2 j - 1 ) &times; x i max - x i min 2 l - 1 - - - ( 23 )
Wherein kfuzzi (i) is the variable quantity of the fuzzy controller adjusted, l iThe length of the coding of parameter for this reason, b ∈ [0,1], x ImaxAnd x IminBe respectively the maximal value and the minimum value of decision content;
Next sets up rational actual joint angles and the corresponding relation objective function of muscle model output joint angles and the parameter setting of definite ant group algorithm; Utilize genetic algorithm to produce plain distribution of initial information in the ant group algorithm; Utilize the ant random search to optimize subordinate function and the quantizing factor and the scale factor of fuzzy controller; And call the fuzzy controller of having adjusted, whether checking reaches goal-selling, if the above operation of no repetition; Perhaps reach predetermined index up to parameter convergence, the number of times of the decision variable of output fuzzy control and ant crowd operation;
According to the decision variable of aforementioned output fuzzy control under fuzzy controller computing system output and with the deviation of muscle model after get into next step again self study and self-adjusting; This process repeatedly; The final self-adaptation on-line tuning of realizing Fuzzy Controller Parameters, and be used for the FES system.
2. a kind of walk help electro photoluminescence precision control method based on genetic-ant colony fusion fuzzy controller according to claim 1 is characterized in that said fuzzy controller is a two-dimensional fuzzy controller; Two input variables are respectively the error e (k) and the error change rate ec (k) of actual output joint angles and expectation joint degree, and domain is FE=[E, E]; FEC=[EC, EC], the stimulating current intensity u (k) of output; Its domain is FU=[U, U];
The quantification domain of error is X={-n ,-n+1 ... 0 ..., n-1, n}; (1)
The quantification domain of error rate is X 1=m ,-m+1 ... 0 ..., m-1, m}; (2)
The quantification domain of controlled quentity controlled variable is Y={-k ,-k+1 ... 0 ..., k-1, k}; (3)
Quantizing factor is respectively
K e=n/X e;(4)
K ec=m/X ec;(5)
Scale factor does
K u=k/Y u;(6)
The domain of error: { 3-2-1 012 3}; The domain of error rate be the domain of 3-2-1 012 3} output valves 3-2-1 012 3}, control law is: if E1 and EC1 then U1, if E2 and EC2 then U2 ... Ep and ECp be Up then;
Its total fuzzy control rule does
Figure FDA0000156290900000021
R=(E i×EC i) T1οC i(8)
E wherein 1=(a 1iA Ni), EC 1=(b 1iB Mi), U 1(c 1iC Ti) (i=1 ... P)
The reverse gelatinization method that adopts is a method of weighted mean
Figure 5566
For each concrete observed value deviation E *With its error rate EC *, use quantizing factor formula separately to become the element that quantizes in the domain more respectively, again its fuzzy E that turns to *And EC *,
Figure FDA0000156290900000023
Figure FDA0000156290900000024
E wherein *=(e 1E n), EC *=(f 1F m)
Ask the exact value of output by formula (8) and formula (9).
3. a kind of walk help electro photoluminescence precision control method based on genetic-ant colony fusion fuzzy controller according to claim 1 is characterized in that said step is refined as:
At first be the definition and the setting of genetic algorithm:
Step1: initialization genetic algorithm controlled variable: population scale, hybridization probability, variation probability;
Step2: the genetic algorithm termination condition is set comprises: minimum genetic iteration number of times, maximum genetic iteration number of times, minimum evolution rate, subsequent iteration number of times;
Step3: treating deals with problems carries out binary coding, random initializtion population X (0)=(x 1, x 2... x n);
Step4: to each individual x among the current X of colony (t) i, its fitness F (x is calculated in decoding i);
Step5: confirm the probability that each is individual according to individual fitness and gambling wheel selection strategy, the direct heredity of two individuals that probability is high is arrived of future generation, and algorithm is carried out intersection, mutation operation according to intersecting, making a variation;
Step6: upgrade the individual adaptive value of a new generation, repeat Step5;
Step7: select the strong individuality of adaptive faculty, put into set, as the optimum solution set, to optimizing each concentrated individuality, it is plain that genetic algorithm result is set to the ant group algorithm initial information;
The improvement of ant group algorithm in the genetic-ant colony blending algorithm once more, genetic algorithm is connected mutually then, and with this blending algorithm Fuzzy Controller Parameters of adjusting:
Step8: the initial value setting of pheromones: τ SC+ τ G, wherein, τ CBe a constant, promptly the minimal information in the MMAS algorithm is plain, τ GIt is the pheromones value that the genetic algorithm for solving result transforms;
Step9: parameter initialization: make time t=0 and cycle index N Max=0, maximum cycle N is set Cmax, m ant placed starting point, ant number and cycle index are set;
Step10: ant random search; After the end of once creeping, determine the actual input variable of the selected conduct of which characteristic variable, revise the taboo list index; After promptly choosing ant is moved to new element, and move to this element in the individual taboo table of ant;
Step11: calculate fitness function and subordinate function, the probability that ant individual state transition probability formula calculates is selected element;
Step12: utilize the condition of the information generating fuzzy rule that training sample provides, the accuracy of check fuzzy model;
Step13:, change Step10, otherwise be Step14 if the ant element has not traveled through;
Step14: the pheromone concentration that the plain concentration of lastest imformation is divided the high characteristic variable of accuracy is enhanced, and next time can be selected with bigger probability when searching for;
Step15: satisfy termination condition, the end of adjusting.
CN201010193427XA 2010-06-07 2010-06-07 Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller Active CN101837165B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010193427XA CN101837165B (en) 2010-06-07 2010-06-07 Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010193427XA CN101837165B (en) 2010-06-07 2010-06-07 Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller

Publications (2)

Publication Number Publication Date
CN101837165A CN101837165A (en) 2010-09-22
CN101837165B true CN101837165B (en) 2012-08-15

Family

ID=42740990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010193427XA Active CN101837165B (en) 2010-06-07 2010-06-07 Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller

Country Status (1)

Country Link
CN (1) CN101837165B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102488963B (en) * 2011-12-08 2013-10-09 天津大学 A functional electrical stimulation method for controlling knee joint angle
CN102488965B (en) * 2011-12-08 2013-10-09 天津大学 A kind of functional electrical stimulation control method
CN102521508B (en) * 2011-12-08 2014-12-24 天津大学 Adaptive neural fuzzy muscle modeling method under functional electrical stimulation
CN104808494B (en) * 2015-04-23 2019-02-05 西安航空学院 PID parameter tuning method based on adaptive ant colony genetic hybrid algorithm
CN108312870B (en) * 2018-02-02 2020-08-21 杭州电子科技大学 Energy management method for hydrogen consumption and load change of hybrid electric vehicle

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1803216A (en) * 2005-12-08 2006-07-19 清华大学 Method for directly controlling functionalized electronic simulator using brain wave
CN101596338A (en) * 2009-04-29 2009-12-09 天津大学 A Precise Control Method of Functional Electrical Stimulation Based on BP Neural Network Tuning PID

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7627386B2 (en) * 2004-10-07 2009-12-01 Zonaire Medical Systems, Inc. Ultrasound imaging system parameter optimization via fuzzy logic

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1803216A (en) * 2005-12-08 2006-07-19 清华大学 Method for directly controlling functionalized electronic simulator using brain wave
CN101596338A (en) * 2009-04-29 2009-12-09 天津大学 A Precise Control Method of Functional Electrical Stimulation Based on BP Neural Network Tuning PID

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宋申民等.基于蚁群算法的模糊控制规则的过滤简化.《计算机仿真》.2006,第23卷(第3期), *
张纪会等.自适应蚁群算法.《控制理论与应用》.2000,第17卷(第1期), *

Also Published As

Publication number Publication date
CN101837165A (en) 2010-09-22

Similar Documents

Publication Publication Date Title
CN101816822B (en) Setting method of functional electrical stimulation PID (Proportion Integration Differentiation) parameter double source characteristic fusion particle swarm
CN101596338A (en) A Precise Control Method of Functional Electrical Stimulation Based on BP Neural Network Tuning PID
CN101837165B (en) Walking aid electrostimulation fine control method based on genetic-ant colony fusion fuzzy controller
CN105727442B (en) The brain control functional electric stimulation system of closed loop
Farhoud et al. Fully automatic control of paraplegic FES pedaling using higher-order sliding mode and fuzzy logic control
CN101816821B (en) Walking aid functional electrical stimulation precision control method based on ant colony fuzzy controller
CN101794114B (en) Method for tuning control parameter in walk-aiding functional electric stimulation system by utilizing genetic algorithm
Wu et al. Robotic knee tracking control to mimic the intact human knee profile based on actor-critic reinforcement learning
CN102274581A (en) Precise control method for functional electric stimulation
Qiu et al. Intelligent algorithm tuning PID method of function electrical stimulation using knee joint angle
CN118203762B (en) Electrical stimulation self-adaptive control method for electrical stimulation rehabilitation instrument
CN101837164B (en) Double source feature fusion ant colony tuning method for PID (Proportion Integration Differention) parameter in functional electro-stimulation
CN101846977B (en) Genetic fuzzy control method of joint angles by functional electrical stimulation
Di Febbo et al. Does Reinforcement Learning outperform PID in the control of FES-induced elbow flex-extension?
CN111341412B (en) Lower limb rehabilitation type exoskeleton gait planning method based on RBF-DMP oscillator
Zheng et al. A computational model for ratbot locomotion based on cyborg intelligence
Cheng et al. Identification-based closed-loop NMES limb tracking with amplitude-modulated control input
CN102697496B (en) Filtering method for functional electrical stimulation surface electromyogram signal
Li et al. Adaptive sliding mode control of functional electrical stimulation (FES) for tracking knee joint movement
Barbosa et al. Control techniques for neuromuscular electrical stimulation: A brief survey
Kostov et al. Improved methods for control of FES for locomotion
Boudville et al. GA-tuned fuzzy logic control of knee-FES-ergometer for knee swinging exercise
Jailani et al. Development of dynamic muscle model with functional electrical stimulation
Ahmad et al. Closed-loop Functional Electrical Stimulation (FES)–cycling rehabilitation with phase control Fuzzy Logic for fatigue reduction control strategies for stroke patients
Yahaya et al. Optimization of FLC parameters for optimal control of FES-assisted elliptical stepping exercise using GA and PSO

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210303

Address after: Room 101, building C22, entrepreneurship headquarters base, North Fuyuan Road, Wuqing Development Zone, Wuqing District, Tianjin

Patentee after: DATIAN MEDICAL SCIENCE ENGINEERING (TIANJIN) Co.,Ltd.

Address before: 300072 Tianjin City, Nankai District Wei Jin Road No. 92

Patentee before: Tianjin University