Summary of the invention
For overcoming the deficiencies in the prior art, the double source feature fusion ant colony setting method of pid parameter in a kind of functional electric stimulation is provided, can accurately stablize and control systematically current intensity of FES in real time, improve FES system accuracy and stability effectively, and obtain considerable social benefit and economic benefit.For achieving the above object, the technical solution used in the present invention is: the double source feature fusion ant colony setting method of pid parameter in the functional electric stimulation comprises the following steps:
At first, utilize the muscle model HRV forecasting knee joint angle of walk help process;
Secondly, utilize the ant group algorithm pid parameter of adjusting, real-time monitoring FES levels of current intensity, its flow process of adjusting is: head
Elder generation is according to three decision variable K of PID
p, K
iAnd K
dThe bound of span, determine to comprise the parameter of ant group population size, search volume dimension, and it is encoded, utilize then by actual joint angles and export the fitness value of the corresponding relation of joint angles as appropriate evaluation function calculating with muscle model HRV; Adopt ant group algorithm that pid parameter is controlled, promptly determine the parameter setting of ant group algorithm, utilize the Formica fusca random search to make its variable optimize the K of PID
p, K
iAnd K
dThree coefficients utilize fitness function to regulate at every turn explore path and judge whether to reach goal-selling of Formica fusca, as reach goal-selling, calculate the K that final best position promptly gets PID
p, K
iAnd K
dThree coefficients, as do not reach re-set target continuation optimizing, up to reaching goal-selling; Computing system output yout under the new PID coefficient and with the deviation of muscle model HRV after enter next step ant group algorithm again self study and weight coefficient self-adjusting;
Previous step finally realizes the self adaptation on-line tuning of pid control parameter repeatedly, and is used for the FES system.
The corresponding relation of described actual joint angles and muscle model HRV output joint angles is:
L=M×HRV
-1 (3)
M represents knee joint angle, and HRV represents that user is applied to the handle retroaction vector of power on the walker, and L represents the relation between HRV and the M, adopts the method for PLS to find the solution L:
Be provided with m HRV variable HRV1 ..., HRVm, p M variable, M1 ..., Mp, i (i=1 altogether,, the n) data set of individual observation, T, U are respectively the composition that extracts from HRV variable and M variable, concentrate the linear combination of extracting first couple of composition T1, U1 to be from original variable:
T
1=ω
11HRV
1+…+ω
1mHRV
m=ω
1′HRV (4)
U
1=v
11M
1+…+v
1pM
p=v
1′M (5)
ω wherein
1=(ω
11..., ω
1m) ' be model effect weight, v
1=v
11..., v
1p) ' be M variable weight is converted into the requirement of said extracted first composition and asks constrained extremal problem:
Wherein t1, u1 are the score vector of first pair of composition of being tried to achieve by sample, and HRV0, M0 are initializaing variable, utilize method of Lagrange multipliers, and the problems referred to above are converted into asks unit vector ω
1And v
1, make θ
1=ω
1' HRV
0' M
0v
1Maximum is promptly asked matrix H RV
0' M
0M
0' HRV
0Eigenvalue and characteristic vector, its eigenvalue of maximum is θ
1 2, corresponding unit character vector is exactly the ω that separates that is asked
1, and v
1By formula
Obtain;
Next sets up the equation of initializaing variable to T1
Wherein the t1 meaning is the same, α
1'=(α
11..., α
1m), β
1'=β
11..., β
1p) be the parameter vector when only a M measures t1, E1, F1 are respectively n * m and n * p residual error battle array, can try to achieve coefficient vector α according to common method of least square
1And β
1, α wherein
1Become model effect load capacity;
Can not reach the precision of regression model as first composition that extracts, utilization residual error battle array E1, F1 replace X0, Y0, repeat to extract composition, and the like, supposing finally to have extracted r composition, HRV0, M0 to the regression equation of r composition are:
The first step analyze extract in the gained HRV amount composition Tk (k=1 ..., r) regression equation that the M amount is set up r composition, i.e. t are brought in linear combination into
r=ω
K1HRV
1+ ... + ω
KmHRV
mSubstitution M
j=t
1β
1j+ ... + t
rβ
Rj(j=1 ..., p), promptly get the regression equation M of standardized variable
j=α
J1HRV
1+ ... + α
JmHRV
m
According to formula (3), can obtain L at last.
The described coding is that according to knee joint angle and current-mode, and three parameters of actual error situation setting PID are 5 position effective digitals, wherein K
pPreceding 2 of arithmetic point, behind the arithmetic point 3; K
iAnd K
dPreceding 1 of arithmetic point, behind the arithmetic point 4, specific coding such as following formula:
K
p=y
1,j×10
1+y
2,j×10
0+y
3,j×10
-1+y
4,j×10
-2+y
5,j×10
-3
K
i=y
6,j×10
0+y
7,j×10
-1+y
8,j×10
-2+y
9,j×10
-3+y
10,j×10
-4
K
d=y
6,j×10
0+y
7,j×10
-1+y
8,j×10
-2+y
9,j×10
-3+y
10,j×10
-4
And the concrete function of overshoot equal error design adaptation function according to output is:
fit=α1×σ+β1×t+c×error (9)
Wherein, σ is an overshoot, and t is the rise time, and error is the relative error of output joint angles and default joint angles, α 1=0.1, β 1=0.8, c=2;
The concrete workflow of ant group algorithm Tuning PID Controller device parameter is:
Step1: parameter initialization makes 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: 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 the probability that the Formica fusca individuality calculates according to the state transition probability formula, select element according to this probability;
Step5:, change Step3, otherwise be Step6 if the Formica fusca element has not traveled through;
Step6: 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;
Step7: satisfy and finish to regulate the end of adjusting.
Characteristics of the present invention are: utilize the HRV variation prediction knee joint angle of walking aid to change, pass through proportionality coefficient, differential coefficient and the integral coefficient of ant group group algorithm optimization PID then, then control the current impulse intensity of FES system, improved FES system accuracy and stability effectively.
The specific embodiment
Purport of the present invention is the precision control method that proposes a kind of new FES, utilize the error of knee joint angle and the joint angles of actual knee joint angle prediction of the HRV parameter prediction of walker, by proportionality coefficient, integral coefficient and the differential coefficient of ant group algorithm optimization PID, the accurately stable then systematically current intensity of FES of controlling in real time.This invention can improve FES system accuracy and stability effectively, and obtains considerable social benefit and economic benefit.
Based on the structure of the precision in the functional electric stimulation walk help of HRV control The application of new technique as shown in Figure 2, its workflow is: at first, utilize the HRV forecasting knee joint angle of walk help process, secondly, utilize the ant group algorithm pid parameter of adjusting, real-time monitoring FES levels of current intensity.It adjusts structural representation as shown in Figure 3, for: at first according to three decision variable K of PID
p, K
iAnd K
dThe bound of span, determine parameters such as ant group population size, search volume dimension, and it is encoded, utilize the fitness value that calculates as appropriate evaluation function by the corresponding relation of actual joint angles and muscle model output joint angles then, and the parameter setting of definite ant group algorithm, utilize Formica fusca to receive rope at random and make its variable optimize the K of PID
p, K
iAnd K
dThree coefficients utilize fitness function to regulate at every turn explore path and judge whether to reach goal-selling of Formica fusca.As reach goal-selling, calculate the K that final best position promptly gets PID
p, K
iAnd K
dThree coefficients, as do not reach re-set target continuation optimizing, up to reaching goal-selling.Computing system output yout under the new PID coefficient and with the deviation of muscle model after enter next step ant group algorithm again self study and weight coefficient self-adjusting.This process finally realizes the self adaptation on-line tuning of pid control parameter repeatedly, and is used for the FES system.
1HRV forecasting knee joint angle model
In the walk help process, when user under the functional electric stimulation effect, when lifting lower limb and taking a step, in order to support body steadiness, user applied force on walker is then different, because varying in size of joint can make the gravity center of human body be in diverse location, it is also different then to overcome the gravity applied force, the residing plan-position of human body also changes to some extent simultaneously, applied force also changes to some extent for the position is tumbled then in the plane, therefore, joint angles and user have certain relation to the walker applied force, as shown in Figure 4.
M=L·HRV+wPW (1)
Wherein, M represents knee joint angle, and HRV represents that user is applied to the handle retroaction vector of power on the walker, and L represents the relation between HRV and the M, and w represents coefficient, and W represents the center of gravity of upper arm, trunk and lower limb, and P represents the relation between three centers of gravity and the M.
In the reality, because the effect of walker, the gravity center of human body moves less, and knee joint angle then can be expressed as
M=L·HRV (2)
Wherein, M represents knee joint angle, and HRV represents that user is applied to the handle retroaction vector of power on the walker, and L represents the relation between HRV and the M.Shown in formula 2, determine that L just can utilize HRV to take out the knee joint angle in the corresponding moment.
L=M×HRV
-1 (3)
When the present invention finds the solution L, adopted the method for PLS.
Be provided with m HRV variable HRV1 ..., HRVm, p M variable, M1 ..., Mp, common i (i=1 ..., the n) data set of individual observation.T, U are respectively the composition that extracts from HRV variable and M variable, the composition of Ti Quing is commonly referred to the offset minimum binary factor here.
Concentrate the linear combination of extracting first couple of composition T1, U1 to be from original variable:
T
1=ω
11HRV
1+…+ω
1mHRV
m=ω
1′HRV (4)
U
1=v
11M
1+…+v
1pM
p=v
1′M (5)
ω wherein
1=(ω
11..., ω
1m) ' be model effect weight, v
1(v
11..., v
1p) ' be M variable weight.For guaranteeing that T1, U1 extract the variation information of place set of variables separately as much as possible, guarantee that simultaneously degree of correlation between the two reaches maximum, according to the character that the covariance of composition can be calculated by the inner product of the score vector of corresponding composition, the requirement of said extracted first composition is converted into asks constrained extremal problem.
Wherein t1, u1 are the score vector of first pair of composition of being tried to achieve by sample, and HRV0, M0 are initializaing variable.Utilize method of Lagrange multipliers, the problems referred to above are converted into asks unit vector ω
1And v
1, make θ
1=ω
1' HRV
0' M
0v
1Maximum is promptly asked matrix H RV
0' M
0M
0' HRV
0Eigenvalue and characteristic vector, its eigenvalue of maximum is θ
1 2, corresponding unit character vector is exactly the ω that separates that is asked
1, and v
1By formula
Obtain.
Next sets up the equation of initializaing variable to T1
Wherein the t1 meaning is the same, α
1'=(α
11..., α
1m), β
1'=β
11..., β
1p) be the parameter vector when only a M measures t1, E1, F1 are respectively n * m and n * p residual error battle array.Can try to achieve coefficient vector α according to common method of least square
1And β
1, α wherein
1Become model effect load capacity.
Can not reach the precision of regression model as first composition that extracts, utilization residual error battle array E1, F1 replace X0, Y0, repeat to extract composition, and the like.Suppose finally to have extracted r composition, HRV0, M0 to the regression equation of r composition are:
The first step analyze extract in the gained HRV amount composition Tk (k=1 ..., r) regression equation that the M amount is set up r composition, i.e. t are brought in linear combination into
r=ω
K1HRV
1+ ... + ω
KmHRV
mSubstitution M
j=t
1β
1j+ ... + t
rβ
Rj(j=1 ..., p), promptly get the regression equation M of standardized variable
j=α
J1HRV
1+ ... + α
JmHRV
m
According to formula 3, can obtain L at last.
Ant group algorithm is at first encoded to three parameters of PID to the control of pid parameter, and according to knee joint angle and current-mode, and three parameters that situation such as actual error is set PID are 5 position effective digitals, wherein K
pPreceding 2 of arithmetic point, behind the arithmetic point 3; K
iAnd K
dPreceding 1 of arithmetic point, behind the arithmetic point 4.Its specific coding sketch map as shown in Figure 5.
As following formula
K
p=y
1,j×10
1+y
2,j×10
0+y
3,j×10
-1+y
4,j×10
-2+y
5,j×10
-3
K
i=y
6,j×10
0+y
7,j×10
-1+y
8,j×10
-2+y
9,j×10
-3+y
10,j×10
-4
K
d=y
6,j×10
0+y
7,j×10
-1+y
8,j×10
-2+y
9,j×10
-3+y
10,j×10
-4
And the concrete function of overshoot equal error design adaptation function according to output is:
fit=α1×σ+β1×t+c×error (9)
Wherein, σ is an overshoot, and t is the rise time, and error is the relative error of output joint angles and default joint angles, α 1=0.1, β 1=0.8, c=2.
The concrete workflow of ant group algorithm Tuning PID Controller device parameter 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 the probability that the Formica fusca individuality calculates according to the state transition probability formula, select element according to this probability
Step5:, change Step3, otherwise be Step6 if the Formica fusca element has not traveled through
Step6: 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
Step7: satisfy and finish to regulate the end of adjusting.
The control that 2 ant group group algorithms are adjusted pid parameter
PID is made up of ratio unit P, integral unit I and differentiation element D three parts, according to the error of system, by the K that sets
p, K
iAnd K
dThree parameters are controlled system.
K wherein
pBe proportionality coefficient, K
iBe integral coefficient, K
dBe differential coefficient, error is the deviation of default output with actual output, and u (t) is the output of PID, is again the input of controlled system simultaneously.
Can obtain by PID output formula (1)
According to:
Δu(t)=u(t)-u(t-1)
=K
p(error(t)-error(t-1))+K
ierror(t)+K
d(error(t)-2error(t-1)+error(t-2))
……………………………………………………………(11)
Have:
u(t)=Δu(t)+u(t-1)=
u(t-1)+K
p(error(t)-error(t-1))+K
ierror(t)+K
d(error(t)-2error(t-1)+error(t-2))
………………(12)
The present invention adopts ant group algorithm to carry out the adaptive optimization of pid control parameter, as a combination, utilizes three parameters of PID the ant group algorithm optimizing to solve this combinatorial problem.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
00, N
01... N
0nSet out, N in proper order passes by
1, N
2..., a wherein child node, up to destination node N
K0, N
K1... N
KnForm path (N
0tN
1t... N
Kt), t ∈ [0,1,2 ... 9].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)=(10-|y (i)-y (i)
*|)/10, during y (i) ant group hunting in the value at i place, y (i)
*When searching for for last time in the value at i place.α 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.
Ant group algorithm is at first encoded to three parameters of PID to the control of pid parameter, and according to knee joint angle and current-mode, and three parameters that situation such as actual error is set PID are 5 position effective digitals, wherein K
pPreceding 2 of arithmetic point, behind the arithmetic point 3; K
iAnd K
dPreceding 1 of arithmetic point, behind the arithmetic point 4.Its specific coding sketch map as shown in Figure 5.
As following formula
K
p=y
1,j×10
1+y
2,j×10
0+y
3,j×10
-1+y
4,j×10
-2+y
5,j×10
-3
K
i=y
6,j×10
0+y
7,j×10
-1+y
8,j×10
-2+y
9,j×10
-3+y
10,j×10
-4
K
d=y
6,j?×10
0+y
7,j×10
-1+y
8,j?×10
-2+y
9,j?×10
-3+y
10,j×10
-4
The concrete workflow of ant group algorithm Tuning PID Controller device parameter 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 the probability that the Formica fusca individuality calculates according to the state transition probability formula, select element according to this probability
Step5:, change Step3, otherwise be Step6 if the Formica fusca element has not traveled through
Step6: 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
Step7: satisfy and finish to regulate the end of adjusting.
3 experimental programs
Experimental provision adopts the walker system of wireless transmission and the Parastep functional electric stimulation system that U.S. SIGMEDICS company produces, and this 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, make the experimenter according to predetermined actions, record is applied to HRV on the walker at first by being installed in voltage signal and the knee joint angle movement locus that foil gauge (BX350-6AA) network of electrical bridge changes into that lead of 12 on the walker simultaneously.Require the experimenter healthy, no lower limb muscles, skeleton illness, impassivity illness and severe cardiac pulmonary disease.Before the experimenter sits on walker during experiment,
Stimulating electrode is fixed in corresponding position, and when not applying electricity irritation, it is light that the experimenter keeps.The FES experiment scene as shown in Figure 5.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.In the experiment, write down in real time HRV with
And can adjust stimulus intensity to change the knee joint angle that produces by stimulating by changing the pulse current size.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.
Beneficial effect
The adjust new algorithm of pid parameter of ant group algorithm 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. 7 follows the trail of the result for the PID control that ant group algorithm 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 PID, shown in the relative error of default input knee joint angle and actual knee joint angle under the ant group algorithm Tuning PID Controller, then error can reach accurate control all within 5% as can be seen.
Purport of the present invention is the precision control method that proposes a kind of new FES, utilize the error of knee joint angle and the joint angles of actual knee joint angle prediction of the HRV parameter prediction of walker, by proportionality coefficient, integral coefficient and the differential coefficient of ant group algorithm optimization PID, the accurately stable then systematically current intensity of FES of controlling in real time.This invention can improve FES system accuracy and stability effectively, and obtains considerable social benefit and economic benefit.Optimum implementation intends adopting patent transfer, technological cooperation or product development.