Walk-aiding functional electric stimulation precision control method based on ant group fuzzy controller
Technical field
The present invention relates to the rehabilitation appliances field, especially based on the walk-aiding functional electric stimulation precision control method of ant group fuzzy controller.
Background technology
(Functional Electrical Stimulation is to stimulate limb motion muscle group and peripheral nervous thereof by current pulse sequence FES) to functional electric stimulation, recovers or rebuild the technology of the componental movement function of paralytic patient effectively.At present, because the spinal cord regeneration ability is faint, at the spinal cord injury paralysed patient, Shang Weiyou can directly repair effective treatment method of damage, and implementing function rehabilitation training is effective measures.According to statistics, spinal cord injury paralysed patient number increases year by year, and function rehabilitation training is a technology of demanding demand urgently.The sixties in 20th century, Liberson successfully utilizes the electricity irritation peroneal nerve to correct the gait of hemiplegic patient's drop foot first, has started the new way that functional electric stimulation is used to move and Sensory rehabilitation is treated.At present, FES has become the componental movement function of recovering or rebuilding paralytic patient, is important rehabilitation means.Yet how accurate triggering sequential and the pulse current intensity of controlling FES can accurately be finished the key problem in technology that the intended function action is still FES with assurance electricity irritation action effect.According to statistics, the mode of the triggering of FES control is at present studied still few, and according to action effect and predetermined action deviation, automatically adjust FES stimulus intensity and time sequence parameter with closed loop control, thereby improved real-time, accuracy and the stability of FES system greatly, but now effective control method is still among exploring.
Fuzzy controller is a kind of method by fuzzy logic and approximate resoning, people's experience formalization, modelling, become computer acceptable controlling models, allow computer generation replace the people to control the high-level policy and the novel technical method of controlled device in real time, can improve the controllability of control algolithm effectively, adaptability and reasonability, especially at complicated and be difficult to modeling and have enrich manual empirical problem and have peculiar advantage with math equation, and human muscle's complexity and time variation operating environment make it set up its mathematical model, cause traditional control method to be difficult to adapt to the strict demand in FES field, fuzzy controller provides new departure for the precision control of FES.The fuzzy controller core technology is exactly to determine the factors such as method of structure, the fuzzy rule that is adopted, compositional rule of inference algorithm and the fuzzy decision of fuzzy controller, and the key that fuzzy control will obtain optimum control effect is to adjust to fuzzy controller quantizing factor, scale factor and fuzzy control rule are isoparametric.In the FES field, system stability is required very strictness, so select also particularly important to Fuzzy Controller Parameters.
Formica fusca in the ant group algorithm simulation biological world seeks under without any prompting by ant cave to the foraging behavior of the shortest path of food source and proposes simulated evolutionary algorithm based on population, has stronger adaptability, distributed parallel calculates, and is easy to the integrated advantage of other algorithms.At present, also not on top of, Heuristics relatively is short of whole mechanism of muscle.Utilize ant group algorithm adjusting of Fuzzy Controller Parameters to be helped the control of the precision of functional electric stimulation.
Summary of the invention
For overcoming the deficiencies in the prior art, purport of the present invention is the precision control method that proposes a kind of new FES, the accurately stable current-mode of controlling the FES system in real time.The present invention can improve FES system accuracy and stability effectively, and obtains considerable social benefit and economic benefit.For achieving the above object, the technical solution used in the present invention is: the walk-aiding functional electric stimulation precision control method based on ant group fuzzy controller comprises the following steps:
At first the selection with 12 decision variables of quantizing factor, scale factor and the membership function parameter of fuzzy controller is converted into the combinatorial optimization problem that ant group algorithm is suitable for, and to its initial group of cities of encoding and producing n individual composition at random;
Next sets up rational actual joint angles and the corresponding relation object function of muscle model output joint angles and the parameter setting of definite ant group algorithm;
Searching process: utilize the Formica fusca random search, optimize membership 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, do not repeat above operation repeatedly if having, parameter up to ant group algorithm restrains or reaches predetermined index, and final output promptly gets the decision variable of fuzzy controller and the number of times of ant group operation;
The decision variable of the fuzzy controller that the aforementioned final output of foundation promptly gets, calculate the deviation of output and this output and muscle model output by fuzzy controller, according to deviation ant group quantity of information is adjusted, and enter next searching process, this process repeatedly, the final self adaptation on-line tuning of realizing Fuzzy Controller Parameters, and be used for the FES system.
The described suitable combinatorial optimization problem of ant group algorithm that is converted into, be to be converted into to find the solution shortest route problem, concrete grammar is, the quantizing factor of ant group fuzzy controller and scale factor are that the basic quantization factor of fuzzy controller and basic scale factor be multiply by factor kfuzzi (the i) (i=1 that is optimized by ant group algorithm respectively, 2,3), the adjustment of ant group fuzzy controller membership function promptly is to the adjusting of basic fuzzy controller membership function domain, and adds or deduct factor kfuzzi (i) (i=4,5 that ant group algorithm is optimized on the basic domain basis of fuzzy controller, 6,7,8,9,10,11,12), and to optimization factor kfuzzi (the i) (i=1 of ant group algorithm, 2 ... 12) the initial group of cities of encoding and producing n individual composition at random, the described binary coding that is encoded to.
Described binary coding, corresponding decoding formula is
Wherein kfuzzi (i) is the variable quantity of the fuzzy controller adjusted, and l is the length of coding, b ∈ [0,1], x
ImaxAnd x
IminBe respectively the maximum and the minima of decision content.
Adopt following method to determine described fuzzy controller:
Input fuzzy controller initialization module variable is respectively the error e (k) and the error change rate ec (k) of actual output joint angles and expectation joint degree, and its 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 is
K
u=k/Y
u (6)
The opinion 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}, the control law of fuzzy control is: if E1 and EC1 then U1, if E2 and EC2 then U2 ... Ep and ECp be Up then;
Its total fuzzy control rule is:
R=(E
i×CE
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 gelatinizing method that adopts is a weighted mean method:
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
*,
E wherein
*=(e
1E
n), EC
*=(f
1F
m)
Can be by formula 8 in the hope of the accurate amount of output;
The method of described definite fuzzy controller adopts angular error and error rate thereof on [90 90], and domain is [3 3], then can use formula
Describedly utilize the Formica fusca random search to make its variable optimize the membership function of fuzzy controller and quantizing factor and scale factor to be,
Wherein kfuzzi (i) is the variable quantity of the fuzzy controller adjusted, and l is the length of coding, b ∈ [0,1], x
ImaxAnd x
IminBe respectively the maximum and the minima of decision content.
Ant group fuzzy controller is to utilize ant group algorithm to the optimization of adjusting of the relevant parameter of fuzzy controller, and concrete steps are as follows:
Ant group algorithm is to the control of Fuzzy Controller Parameters, as formula (18), (19), shown in (20):
K
e1=kfuzzi(1)*K
e (18)
K
c1=kfuzzi(2)*K
c (19)
k
u1=kfuzzi(3)*K
u (20)
The error domain of fuzzy controller is
{-3-kfuzzi(4),-2-kfuzzi(5),-1-kfuzzi(6),0,1+kfuzzi(6),2+kfuzzi(5),3+kfuzzi(4)}
The error rate domain of fuzzy controller is
{-3-kfuzzi(7),-2-kfuzzi(8),-1-kfuzzi(9),0,1+kfuzzi(9),2+kfuzzi(8),3+kfuzzi(7)}
The domain of the output valve of fuzzy controller
{-3-kfuzzi(10),-2-kfuzzi(11),-1-kfuzzi(12),0,1+kfuzzi(12),2+kfuzzi(11),3+kfuzzi(10)}。
Describedly utilize the Formica fusca random search to make its variable optimize the membership function of fuzzy controller and quantizing factor and scale factor work process to be:
Step1: parameter initialization.Make time t=0 and cycle-index N
Max=0, maximum cycle N is set
Cmax, m Formica fusca placed starting point.
Step2: Formica fusca number and cycle-index are set
Step3: the Formica fusca 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 Formica fusca is moved to new element, and this element is moved in the taboo table of this Formica fusca individuality
Step4: calculate membership function, the probability that Formica fusca individual state transition probability formula calculates is selected element
Step5: the information of utilizing training sample to provide produces the condition of fuzzy rule, the accuracy of check fuzzy model
Step6:, change Step3, otherwise be Step7 if the Formica fusca element has not traveled through
Step7: 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
Step8: satisfy and finish to regulate the end of adjusting.
Characteristics of the present invention are: utilize the ant group algorithm Fuzzy Controller Parameters of adjusting, and the accurately stable then current intensity of controlling the FES system in real time effectively, and can improve FES system real time, accuracy and stability effectively.
Description of drawings
Fig. 1 ant group algorithm structured flowchart of Fuzzy Controller Parameters of adjusting.
Fig. 2 ant group algorithm structural map.
Fig. 3 experiment scene figure.
The fuzzy controller that Fig. 4 ant group algorithm is adjusted is followed the trail of the result.
The adjust relative error of the default down input joint angles of Fuzzy Controller Parameters control and actual output of Fig. 5 ant group algorithm.
The specific embodiment
Proposed to adjust fuzzy controller (Fuzzy Controller) parameter with accurate control functional electric stimulation (Functional Electrical Stimulation, FES) new method of current-mode by ant group algorithm (Ant Algorithm) self adaptation.Its techniqueflow is: optimize membership function and the quantizing factor and the scale factor of fuzzy controller by the ant group algorithm self-adjusting, control the current-mode of FES system then.This method is a kind of brand-new functional electric stimulation accurate control technique.
Based on the structure of the application of the walk-aiding functional electric stimulation precision control method of ant group fuzzy controller as shown in Figure 1.Its workflow is: at first with the quantizing factor of fuzzy controller, the selection of 12 decision variables of scale factor and membership function parameter is converted into the combinatorial optimization problem that ant group algorithm is suitable for, and to its initial group of cities of encoding and producing n individual composition at random, next sets up rational actual joint angles and the corresponding relation object function of muscle model output joint angles and the parameter setting of definite ant group algorithm, utilize the Formica fusca random search to make its variable optimize membership 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, do not repeat above operation repeatedly if having, restrain or reach predetermined index up to parameter; Final output promptly gets the decision variable of fuzzy controller and the number of times of ant group operation.Computing system output under the new fuzzy controller and with the deviation of muscle model after to the adjustment of ant group quantity of information, make it enter next searching process.This process finally realizes the self adaptation on-line tuning of Fuzzy Controller Parameters repeatedly, and is used for the FES system.
1 design of fuzzy control
Because people's particularity, the FES field is strict to controller stability, robustness, real-time, design fuzzy controller equalization stable and real-time and selected two-dimensional fuzzy controller, promptly two input variable difference reality are exported joint angles and the error e (k) and the error change rate ec (k) that expect the joint degree, and its 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 is
K
u=k/Y
u (6)
The present invention adopts the opinion domain of error: { 3-2-1 012 3}; The domain of error rate is the { domain of 3-2-1 01 23} output valves { 3-2-1 012 3}.The control law table is: if E1 and EC1 then U1, if E2 and EC2 then U2 ... Ep and ECp be Up then;
Its total fuzzy control rule is
R=(E
i×CE
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 gelatinizing method that adopts is a weighted mean method:
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
*,
E wherein
*=(e
1E
n), EC
*=(f
1F
m)
Have formula 8 can in the hope of output accurate amount.
Angular error of the present invention and error rate thereof are on [90 90], and domain is [3 3], then can use formula
The 2 ant group algorithms Fuzzy Controller Parameters of adjusting
Ant group algorithm is a kind of novel bionic Algorithm that comes from the Nature biological world, when finding the solution optimization problem with ant group algorithm, at first optimization problem is transformed in order to find the solution shortest route problem.Every Formica fusca is from initial contact N
00Or N
01Set out, N in proper order passes by
1, N
2, a wherein child node, up to destination node N
K0, N
K1Form path (N
0tN
1tN
Kt), t ∈ [0,1].A binary feasible solution can be represented in its path.Following feature is arranged during each Formica fusca visit city:
The state transformation rule: the state transformation rule that ant group algorithm uses is the rule of ratio at random that proposes based on the TSP problem, and it provides the probability that the Formica fusca k that is positioned at city i selects to move to city j,
τ wherein
Ij(i j) is (i, fitness j), η
Ij(i j) is the inverse of distance.α is the relative significance level of residual risk, the relative significance level that β is expected value.
In ant group algorithm, selection mode is
Wherein, q is for being evenly distributed on a random number on [0,1], q
0Be the parameter on [0,1].
Overall situation update rule: ant algorithm has different update algorithm, the overall situation that ant group system adopts is upgraded principle, only allowing the Formica fusca release pheromone of globally optimal solution, is the neighborhood that mainly concentrates on the best path of being found out till the current circulation for the search that makes Formica fusca like this.
τ
ij(i,j)←(1-ρ)□τ
ij(i,j)+ρ·Δτ
ij(i,j) (14)
Wherein ρ is that information is counted volatility coefficient, L
GbBe the global optimum path of finding so far
Local updating information: every Formica fusca is set up the renewal that the plain mark of the information of carrying out number is also arranged in the process of separating
τ
ij(i,j)←(1-γ)□τ
ij(i,j)+γ·Δτ
ij(i,j) (16)
γ ∈ [0,1] wherein.
Basic fuzzy controller steady-state behaviour can not reach the requirement in FES field, it promptly is that relevant parameter with fuzzy controller utilizes binary coding to be converted into to find the solution shortest route problem that the present invention will adjust to quantizing factor and scale factor and fuzzy control rule, and the structure of ant group algorithm as shown in Figure 2.When basic domain and word set were constant, the quantizing factor variation can cause deviation and the pairing language value of rate of change thereof to change, and the controlled quentity controlled variable that the variation of scale factor can directly cause acting on controlled device changes.Be specially: K
eBig more, system's rise time is short more, otherwise long more; K
EcBig more, the reaction of system is sensitive more, otherwise blunt more, K
uBig more, system's rise time is short more, but causes vibration easily, and K
uThe too small dynamic process of system that easily makes is elongated.
What the present invention adopted is binary coding, and then Dui Ying decoding formula is
Wherein kfuzzi (i) is the variable quantity of the fuzzy controller adjusted, and l is the length of coding, b ∈ [0,1], x
ImaxAnd x
IminBe respectively the maximum and the minima of decision content.
Ant group algorithm is to the control such as the following formula of Fuzzy Controller Parameters:
K
e1=kfuzzi(1)*K
e (18)
K
c1=kfuzzi(2)*K
c (19)
K
u1=kfuzzi(3)*K
u (20)
The error domain is
{-3-kfuzzi(4),-2-kfuzzi(5),-1-kfuzzi(6),0,1+kfuzzi(6),2+kfuzzi(5),3+kfuzzi(4)}
The error rate domain is
{-3-kfuzzi(7),-2-kfuzzi(8),-1-kfuzzi(9),0,1+kfuzzi(9),2+kfuzzi(8),3+kfuzzi(7)}
The domain of output valve
{-3-kfuzzi(10),-2-kfuzzi(11),-1-kfuzzi(12),0,1+kfuzzi(12),2+kfuzzi(11),3+kfuzzi(10)}
The adjust concrete workflow of Fuzzy Controller Parameters of ant group algorithm is:
Step1: parameter initialization.Make time t=0 and cycle-index N
Max=0, maximum cycle N is set
Cmax, m Formica fusca placed starting point.
Step2: Formica fusca number and cycle-index are set
Step3: the Formica fusca 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 Formica fusca is moved to new element, and this element is moved in the taboo table of this Formica fusca individuality
Step4: calculate membership function, the probability that Formica fusca individual state transition probability formula calculates is selected element
Step5: the information of utilizing training sample to provide produces the condition of fuzzy rule, the accuracy of check fuzzy model
Step6:, change Step3, otherwise be Step7 if the Formica fusca element has not traveled through
Step7: 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
Step8: satisfy and finish to regulate the end of adjusting.
3 experimental programs
Parastep functional electric stimulation walk help system and the PS-2137 of PASCO company protractor and Data Studio software that experimental provision adopts U.S. SIGMEDICS company to produce.The Parastep system comprises microprocessor and boost pulse generation circuit, contains six stimulation channels, battery powered.Experiment content is: utilize the FES system that the relevant muscle group of lower limb is stimulated, utilize the PS-2137 of PASCO company protractor to gather knee joint angle and the measured knee joint angle of Data Studio software records.Require the experimenter healthy, no lower limb muscles, skeleton illness, impassivity illness and severe cardiac pulmonary disease.The experimenter sits on the testboard during experiment, and stimulating electrode is fixed in the end positions of quadriceps femoris, and protractor is fixed on thigh and the shank, makes the joint motion point press close to knee joint moving point position.Shank does not loosen, keeps vertical vacant state when applying electricity irritation, and the FES experiment scene as shown in Figure 3.The electric stimulation pulse sequence adopts classical Lilly waveform, and pulse frequency is 25Hz, pulsewidth 150 μ s, and pulse current is adjustable in 0~120m scope.Can adjust stimulus intensity to change the knee joint angle that produces by stimulating by changing the pulse current size in the experiment.Before the experiment, set the knee joint angle movement locus of expectation, utilize the angular surveying meter to detect the knee joint subtended angle in real time in the experiment and change.The experimental data sample rate is 128Hz, and the data record duration is 60s.
The Fuzzy Controller Parameters new algorithm that the ant group adjusts is calculated the FES pulse current amplitude and is adjusted, the knee joint angle that the FES effect is produced move the movement locus of expection.Fig. 4 follows the trail of the result for the fuzzy controller that the ant group algorithm adaptive optimization is adjusted.Red line represents that desired movement track, blue line are actual output joint angles among the figure.X-axis is the time, and Y-axis is the motion of knee joint angle.For more clearly observing the departure that ant group algorithm is adjusted fuzzy controller, shown in the relative error of default input knee joint angle and actual knee joint angle under Fig. 5 ant group algorithm Tuning PID Controller, then error can reach accurate control all within 3% as can be seen.
Purport of the present invention is the precision control method that proposes a kind of new FES, by the ant group algorithm self adaptation Fuzzy Controller Parameters of adjusting, the accurately stable then current intensity of controlling the FES system in real time effectively.This invention can improve FES system real time, accuracy and stability effectively, and obtains considerable social benefit and economic benefit.Optimum implementation intends adopting patent transfer, technological cooperation or product development.