The invention discloses a numerically-controlled machine tool permanent magnet synchronous motor drive control system, which is a divisional application with an original application number of 202010918630.2 and an application date of 09/04 in 2020.
Detailed Description
The present invention will be described in further detail below with reference to the accompanying drawings and examples.
Fig. 1 is a block diagram of an embodiment of a driving control system of a permanent magnet synchronous motor of a numerical control machine tool. In fig. 1, a Clarke conversion module inputs three-phase current i of a permanent magnet synchronous motor (i.e., PMSM) a 、i b And i c And outputs the current i under the two-phase static alpha-beta axis coordinate system α 、i β (ii) a A position sensor in the position and speed detection module detects the position theta of the rotor of the permanent magnet synchronous motor and converts the position theta into the angular speed omega of the rotor for output; park conversion module input current i α 、i β And rotor position theta, and outputs current i under a rotating d-q axis coordinate system d 、i q (ii) a PI speed controller inputs rotor given angular speed omega * And rotor angular velocity omega, output load torque set value T L * And torque current given component i' q (ii) a Input load torque set value T of load torque observer L * Rotor angular velocity ω and current i q The output torque current compensation component i ″) q (ii) a Torque current given component i' q And a torque current compensation component i ″) q After addition, as a given value i of q-axis torque current * q (ii) a q-axis current PI controller inputs q-axis torque current given value i * q And current i d And outputting a control voltage U under a q-axis coordinate system q (ii) a A q-axis torque current given value i is input by a d-axis current PI controller * d And current i d And outputting control voltage U under d-axis coordinate system d D-axis torque current setpoint i * d Equal to 0; the Park inverse transformation module inputs a control voltage U under a d-q axis coordinate system d 、U q And outputs the control voltage U under the alpha-beta axis coordinate system α 、U β (ii) a The SVPWM module (space vector pulse width modulation module) inputs a control voltage U α 、U β Outputting pulse signals to a three-phase inverter, which converts the DC voltage U dc Converting into three-phase AC power supply U a 、U b 、U c Thereby driving the permanent magnet synchronous motor to operate.
Neglecting the influence of core eddy current and hysteresis loss, etc., adopting i d The PMSM rotor magnetic field orientation control of 0, establishes a mathematical model of PMSM under a d-q axis rotating coordinate system, and the voltage equation is as follows:
for adopting i d The salient pole type PMSM vector control system adopts a control mode of 0, and an electromagnetic torque equation is as follows:
the PMSM equation of motion is:
in the formulae (1), (2) and (3), u d 、u q Voltages of d-q axes, respectively; i.e. i d 、i q Currents of d-q axes, respectively; l is d 、L q Inductances of the d-q axes, respectively; t is e Is an electromagnetic torque; t is L Is the load torque; r is the resistance of the stator; p is the number of pole pairs of the motor; omega e Is the rotor electrical angular velocity, i.e. angular frequency; ω is the rotor angular velocity, i.e. the mechanical angular velocity of the rotor of the electrical machine; psi f Is a permanent magnet flux linkage; j is the moment of inertia; b is the coefficient of friction; t is time.
As can be seen from the mathematical models of the permanent magnet synchronous motor formulas (1), (2) and (3) under d-q coordinates, i is adopted d The torque output of the motor can be controlled by the formula (2) as the control strategy of 0, and the operation of the motor is controlled by combining a speed and current double closed loop. Let the angular speed error e of the rotor of the motor be omega * - ω, ω is a given rotor angular speed of the electrical machine. The PI speed controller regulates and controls the rotor angular speed error e and outputs a given torque current component i' q And carrying out direct torque control on the permanent magnet synchronous motor. Equation (4) is the transfer function of the PI speed controller.
In the formula (4), K p Proportional coefficient, T, of PI speed controller i Is the integration time constant of the PI speed controller. Load torque set value T for direct torque control output of PI speed controller L * And torque current given component i' q Comprises the following steps:
wherein the given value of load torque T L * And (e) sending the error to a load torque observer, and (t) obtaining the instantaneous value of the rotor angular speed error.
The parameters of the speed loop controller can be manually adjusted according to a conventional PID parameter adjusting method; empirically, the proportionality coefficient K p The regulation range of (A) is more than 0 and less than 10I N ,I N Rated current of the permanent magnet synchronous motor; integral time constant T i The adjustment range of (a) is 0.001 to 0.5 s.
According to the PMSM electromagnetic torque and the motion equation, the constant value can be regarded as a constant value in a change period for constant step load, namely
The rotor angular speed and the load torque are used as state variables to form a PMSM state equation as follows:
based on equation (6), a load torque observer embodiment 1 is established with load torque and rotor angular velocity as objects to be observed:
in the formula (7), the reaction mixture is,
is an observed value of the load torque,
is an estimate of the angular velocity of the rotor, g is the feedback gain of the load torque observer,
k
g is the sliding mode gain of the load
torque observer embodiment 1, and the load
torque observer embodiment 1 is a sliding mode observer. Motor friction is smaller in specific weight than load torque, and if B is 0 and the influence of friction is ignored, load
torque observer embodiment 1 of equation (7) becomes:
from (6) and equation (8) when B is 0, the error equation of the load torque observer embodiment 1 is obtained as:
in the formula (9), the reaction mixture is,
for the estimation error of the angular velocity of the rotor,
for the observation error of the load torque, and defining the sliding mode surface of the observer as
According to the accessibility condition of the sliding mode, the system stability condition of the observer with the formula (8) is k
g ≤-|e
2 J |, and g < 0.
Based on equation (6), with the load torque and the motor rotor angular velocity as the observation targets, the load torque observer embodiment 2 can be established as follows:
motor friction is smaller in specific weight than load torque, and if B is 0 and the influence of friction is ignored, load torque observer embodiment 2 of equation (10) becomes:
in the formulae (10) and (11),
is an observed value of the load torque,
is an estimate of the angular velocity of the rotor, g is the feedback gain of the load torque observer,
k
W is the proportional gain of load
torque observer embodiment 2, load
torque observer embodiment 2 being a state observer. According to the formula (6) and the formula (11) when B is 0, the error equation of the load
torque observer embodiment 2 is obtained as follows:
in the formula (12), the reaction mixture is,
for the estimation error of the angular velocity of the rotor,
is the load torque observation error. The state observer of equation (11) is an autonomous linear system, at k
W < 0, and g < 0, the observer is asymptotically stable. Formula (7) of load
torque observer embodiment 1 and formula (10) of load
torque observer embodiment 2 both take friction factors of the motor into consideration, and the addition of small friction damping adversely affects the rapidity of system response, but canSo that the stability is increased on the basis of the formula (8) and the formula (11), respectively.
When load torque observer embodiment 1 of expressions (7) and (8) is selected, sliding mode gain k g Is set according to
Selection is performed. In the formula (13), alpha is more than or equal to 1; typically, the value of α is selected in the range of 1 to 5, for example, α is selected to be equal to 1.5. Load torque observer embodiment 1 in observing load torque, k g Is selected to be too small when | e 2 The observer cannot enter a sliding mode state when l is larger; k is a radical of g The absolute value of the observer is selected to be large enough to ensure that the observer enters a sliding mode state, but the steady-state observation fluctuation of the load torque is increased; k is a radical of g The value of (c) is changed along with the change of the load torque observation error, and the observer stability can be improved and the steady state observation fluctuation of the load torque can be reduced simultaneously.
When observer embodiment 2 of equations (10) and (11) is selected, proportional gain k W Is set according to
Selection is performed. In formula (14), T N Is the rated torque of the motor, beta is more than 0; the value of β is generally selected within the range of 1 to 20, and β is, for example, 10. When the selection of beta is increased, the steady state fluctuation observed by the load torque is increased, but the tracking overshoot of the torque observation is reduced; when the beta selection is decreased, the steady state fluctuation of the load torque observation becomes small, but the torque observation overshoot amount becomes large.
In the observers represented by equations (7) and (8) or equations (10) and (11), the magnitude of the feedback gain g greatly affects the load torque observation result. The larger the feedback gain g is, the smaller the fluctuation of the observed torque is, but the slower the identification speed of the observed torque is; the smaller the feedback gain g, the faster the observed torque speed, but the greater the observed torque ripple. In consideration of this problem, in the conventional load torque observer, the observation speed and the fluctuation of the load torque are considered together, and the feedback gain g is taken as a median, but this abandons the advantages of small fluctuation when the feedback gain is large and fast observation speed when the feedback gain is small.
When the motor is controlled by the PI controller, the influence of parameter change and external load disturbance on a system is mainly inhibited by increasing the proportionality coefficient in the controller, but the stability of the system is reduced due to the overlarge proportionality coefficient. In order to solve the contradiction between the response and anti-interference rapidity and stability of the PI speed controller, the observer is used for observing the load disturbance change in real time, and the load torque observed value is subjected to feedforward compensation to the current regulator, so that the anti-interference performance of the system is not reduced on the premise of reducing the proportional coefficient of the PI controller. In order to fully utilize the advantages of the feedback gain g in high and low values, according to the load torque observation values at two adjacent moments and the magnitude of the load torque set value variation, when the load torque set value variation is small and the load torque observation value variation is small, a larger value is given to the feedback gain g, so that the observation result has small fluctuation and stronger stability; when the change of the set value of the load torque is large or the change of the observed value of the load torque is large, a smaller value of the feedback gain g is given to accelerate the observation speed, and finally, the comprehensive result of high observation speed, small fluctuation and stronger stability is obtained by adjusting the feedback gain g.
Fig. 2 is a flowchart of an
embodiment 1 of a feedback gain automatic adjustment method, and when the
embodiment 1 of a load torque observer or the
embodiment 2 of the load torque observer is used in the embodiment of the driving control system of the permanent magnet synchronous motor in fig. 1, the feedback gain automatic adjustment is performed. In FIG. 2,. epsilon
1 Comparing thresholds, e, for a given torque variation
2 Comparing threshold values, Δ T, for observing torque changes
L * For the difference between the last 2 load torque setpoints,
the difference between the last 2 load torque observations. In the periodic control process of the primary permanent magnet synchronous motor drive control system, fig. 2(a) The adjustment of the feedback gain g is performed prior to the load torque observation and the output calculation of the PI speed controller, and includes:
Step 2, judgment
Whether or not it is larger than a given torque variation comparison threshold epsilon
1 (ii) a When in use
Greater than a given torque variation comparison threshold epsilon
1 Taking feedback gain g equal to g
min And entering
step 4; when in use
Less than or equal to a given torque variation comparison threshold epsilon
1 Then, entering
step 3;
step 3, judgment
Whether or not it is larger than comparison threshold epsilon for observing torque variation
2 (ii) a When in use
Greater than the comparison threshold epsilon for observed torque variation
2 Taking feedback gain g equal to g
min And entering
step 4; when in use
Less than or equal to the comparison threshold epsilon of the observed torque variation
2 Taking feedback gain g equal to g
max And entering
step 4;
step 4, the load torque observer carries out load torque T according to the feedback gain g value
L Observing to obtain the observed value of the load torque
PI speed controller for controlCalculating to obtain a given value of load torque
At this time
Is composed of
Is composed of
The next time when the feedback gain g is adjusted, that time
Become into
Become into
In the periodic control process of the primary motor speed, the adjustment of the feedback gain g shown in (b) of fig. 2 is later than the load torque observation and the output calculation of the PI speed controller, the feedback gain g adjustment method changes the
step 4 into the
step 1, the steps 1-3 into the steps 2-4, the entering
step 4 in each step is changed into exiting, and
when in use
Greater than epsilon
1 Indicating a given value of load torque T
L * Rotor angular velocity supply due to system model parameter variationThe constant value changes, the actual value of the angular speed of the rotor changes and is in a large change state, the observed value of the load torque has large fluctuation or will have large fluctuation, and the feedback gain g is selected to be equal to g
min Carrying out rapid identification and observation on the load torque; when | Δ T
L * | is less than or equal to epsilon
1 And is and
greater than epsilon
2 When the measured value of the load torque fluctuates greatly, the feedback gain g is selected to be equal to g
min Carrying out rapid identification and observation on the load torque; when in use
Is less than or equal to epsilon
1 And is and
is less than or equal to epsilon
2 When the feedback gain g is equal to g, the change of the given value of the load torque is small, the fluctuation of the observed value of the state load torque is small, and the feedback gain g is selected to be equal to g
max And carrying out torque identification and observation. In FIG. 2,. epsilon
1 >0,ε
2 >0,ε
1 、ε
2 Is related to the sampling control period (cycle time) of the PI speed controller, the permanent magnet synchronous motor and the load condition thereof, and epsilon
1 、ε
2 Are all taken within the range of more than 0 and generally less than 5 percent of rated torque, epsilon
1 、ε
2 May be of the same value or of different values, e.g. rated torque 22 Nm, may be ε
1 =ε
2 0.2 N.m, or ε
1 =0.2N·m,ε
2 0.25N · m. The value of the feedback gain g satisfies g
min <g
max < 0, in general, g
min ≥-5000。g
min When the value is suddenly changed, the torque observation tracking overshoot of the load torque observer output observation value is within the torque observation tracking overshoot limit value; g
max The value should be the variation of the last 2 times load torque observed values when the load torque is not changed and the load torque observer and the PI speed controller are both in a steady state
Less than epsilon
2 (ii) a For example, the feedback gain g is selected
max =-0.5,g
min -10. Selecting g
min 、g
max 、ε
1 、ε
2 The specific method of the value is that firstly, when the load torque is not changed and the load torque observer and the PI speed controller are both in a steady state, the feedback gain g is started from a larger value, for example, the feedback gain g is gradually reduced from-0.01, the steady state error observed by the load torque is gradually increased, and when the steady state error observed by the load torque reaches the steady state error limit value observed by the load torque, the feedback gain g at the moment is determined to be g
max Keeping the load torque constant and making the feedback gain g equal to g
max While continuously carrying out F
1 Next time
Measurement of the value, and
1 next time
Maximum F in measurement
2 An
The average value of the measured values is used as an observed torque variation comparison threshold epsilon
2 Given a torque variation comparison threshold ε
1 Comparison of threshold value epsilon in observed torque variation
2 The value is within 0.5-1.5 times; then, when the load torque observer and the PI speed controller are both in a steady state, the load torque is suddenly changed, and g is adjusted and determined according to the condition that the tracking and adjusting time of the output observed value of the load torque observer is as short as possible on the premise that the torque observation tracking overshoot of the output observed value of the load torque observer is within the torque observation tracking overshoot limit value
min The value is obtained.
Fig. 3 is a flowchart of an
embodiment 2 of a feedback gain automatic adjustment method, and when the
embodiment 1 of the load torque observer or the
embodiment 2 of the load torque observer is used in the embodiment of the driving control system of the permanent magnet synchronous motor in fig. 1, the feedback gain automatic adjustment is performed.In FIG. 3,. epsilon.is a torque change comparison threshold value,. DELTA.T
L * For the difference between the load torque set points for the last 2 times,
the difference between the last 2 load torque observations. In the periodic control process of the primary permanent magnet synchronous motor drive control system, the adjustment of the feedback gain g shown in (a) of fig. 3 is prior to the observation of the load torque and the output calculation of the PI speed controller, and includes:
Step II, judgment
Whether the torque variation is greater than a torque variation comparison threshold epsilon; when in use
When the torque variation is larger than the comparison threshold epsilon, the feedback gain g is equal to g
min (ii) a When in use
When the torque change comparison threshold value epsilon is less than or equal to the torque change comparison threshold value epsilon, taking the feedback gain g to be equal to g
max ;
Step III, the load torque observer carries out load torque T according to the feedback gain g value
L Observing to obtain the observed value of the load torque
The PI speed controller performs control operation to obtain
At this time
Is composed of
Is composed of
The next time when the feedback gain g is adjusted, that time
Become into
Become into
During the periodic control of the primary motor speed, the feedback gain g shown in fig. 3 (b) is adjusted later than the load torque observation and the output calculation of the PI speed controller, at this time:
step S1, the load torque observer carries out load torque T according to the feedback gain g value
L Observing to obtain the observed value of the load torque
The PI speed controller performs control operation to obtain
At this time
Is composed of
Is composed of
Until the next adjustment of the feedback gain g, that time
Become into
Become into
Step S3, judgment
Whether it is greater than a torque variation comparison threshold epsilon; when in use
When the torque variation is larger than the comparison threshold epsilon, the feedback gain g is equal to g
min (ii) a When the temperature is higher than the set temperature
When the torque change comparison threshold value epsilon is less than or equal to the torque change comparison threshold value epsilon, taking the feedback gain g to be equal to g
max 。
When the sum of the variation of the given value of the load torque and the variation of the observed value of the load torque is obtained for the last 2 times
When the feedback gain g is larger than epsilon, the fluctuation of the observed value of the load torque is large, or the change of the set value of the load torque is large and the observed value of the load torque has large fluctuation due to the change of system model parameters, the change of the set value of the angular speed of the rotor and the change of the actual value of the angular speed of the rotor, and the selection of the feedback gain g is equal to g
min Carrying out rapid identification and observation on the load torque; when in use
When the feedback gain g is less than or equal to epsilon, the change of the given value of the load torque is small, the fluctuation of the observed value of the state load torque is small, and the feedback gain g is selected to be equal to g
max And identifying and observing the load torque. In fig. 3, the torque variation comparison threshold e > 0, the specific value of e is related to the sampling control period (cycle time) of the PI speed controller, the permanent magnet synchronous motor and the load condition thereof, e is greater than 0 and generally less than the quotaThe constant torque is set to be within 5%, and for example, the rated torque is 22N · m, and ∈ may be 0.2N · m, or may be 0.3N · m. The value of the feedback gain g satisfies g
min <g
max < 0, in general, g
min ≥-5000。g
min When the value is suddenly changed, the torque observation tracking overshoot of the load torque observer output observation value is within the torque observation tracking overshoot limit value; g
max The value should be taken when the load torque is unchanged, and the load torque observer and the PI speed controller are both in a steady state, and the sum of the variation of the load torque given value and the variation of the load torque observed value for the latest 2 times
Less than epsilon; for example, the feedback gain g is selected
max =-0.5,g
min -10. Selecting g
min And g
max The specific method of the value is that firstly, when the load torque is not changed and the load torque observer and the PI speed controller are both in a steady state, the feedback gain g is started from a larger value, for example, the feedback gain g is gradually reduced from-0.01, the steady state error observed by the load torque is gradually increased, and when the steady state error observed by the load torque reaches the steady state error limit value observed by the load torque, the feedback gain g at the moment is determined to be g
max Keeping the load torque constant and making the feedback gain g equal to g
max While continuously carrying out F
1 Sub |. DELTA.T
L * The sum of | values
Measurement of the value, and
1 maximum F in the sub-measurement
2 An
The average value of the sums is used as a torque variation comparison threshold epsilon; then, when the load torque observer and the PI speed controller are both in a steady state, the load torque is suddenly changed, and on the premise of ensuring that the torque observation tracking overshoot of the output observation value of the load torque observer is within the torque observation tracking overshoot limit value, the tracking regulation of the output observation value of the load torque observer is usedAdjusting and determining g with as short a time as possible
min The value is obtained. g
max For high value of feedback gain, g
min Is a low value of the feedback gain.
When designing the PI speed controller and the load torque observer of the permanent magnet synchronous motor drive control system embodiment, the parameter setting can also be carried out by adopting optimization algorithms such as a particle swarm algorithm, a wolf pack algorithm, a genetic algorithm and the like. The specific method for setting the parameters of the PI speed controller and the load torque observer embodiment 1 or the load torque observer embodiment 2 by adopting the wolf colony algorithm is as follows:
when the parameters of the PI speed controller are set, a target function Q for comprehensively evaluating various performance indexes of the PI speed controller is established 1 Is composed of
In the formula (15), Q
11 The integral term in (1) is an IAE criterion (error integral criterion) of the angular speed step response of the motor rotor, t
m The time is the transition process time of the angular speed step response of the motor rotor, and t is 0 which is the starting time of the motor step response; q
11 Gamma in (5)
m1 (1-sgn(e(t)+ω
δ ) Term) is an angular velocity overshoot penalty function, where γ
m1 One is big enough
5 times and above the rational value), omega) of a positive number
δ The value is the rotor angular speed overshoot limit (namely the maximum value of the rotor angular speed overshoot allowed by the system); when the overshoot of the angular speed step response of the motor rotor does not exceed the rotor angular speed overshoot limit value omega
δ The term overshoot penalty function is equal to 0 when, and is equal to γ otherwise
m1 ;Q
12 For the steady state error penalty function, ω
Δ Is the rotor angular velocity steady state error limit; when the steady-state error of the angular speed step response of the motor rotor does not exceed the rotor angular speed steady-state error limit value omega
Δ The steady state error penalty function term is equal to 0 when, and is equal to γ otherwise
m1 ;Q
1 For value of objective function, i.e. wolf-pack algorithmCarrying out parameter optimization on the adaptive value of the PI speed controller; the smaller the adaptation value of the individual wolfe, the better the corresponding position. Gamma ray
m1 When taking value, firstly, the value is estimated
Reasonable value (upper limit); for example, if the rated rotational speed of the motor is 1500r/min (corresponding to the rated rotor angular speed of 157rad/s) and the starting time is about 0.2s, the motor is started
Has a reasonable value of not more than 40, gamma
m1 By 5 times or more of 40, for example, by γ
m1 =200。γ
m2 Typically greater than or equal to 2, the magnitude of which determines how long a measurement of the steady-state error of the angular speed of the rotor is made, e.g. gamma
m2 When the value is equal to 6, the time t of the transition process is 5 times
m The steady state error of the rotor angular velocity is measured. PI speed controller parameter optimization other objective functions than the one set up (15) may be established if needed to take into account other index factors, e.g., whether the transient time is short enough, whether the steady state error is small enough, etc.
When the parameters of the load torque observer are set, a target function Q for comprehensively evaluating various performance indexes of the load torque observer is established 2 Is composed of
In formula (16), Q
21 The integral term in (1) is an IAE criterion of the motor load torque observation step response,
for load torque observation error, e
2 (t) is an instantaneous value of the observed error of the load torque, t
p Tracking and adjusting time of motor load torque observation step response, wherein t is 0, and the load sudden change moment of the load torque observation step response is obtained; q
21 Gamma in (5)
p1 (1-sgne2T + T delta term is Torque viewA measure tracking overshoot penalty function, wherein γ p1 is a positive number large enough (5 times or more the reasonable value of Otpe2tdt + γ p2maxe 2T), T δ is the torque observation tracking overshoot limit, and when the torque observation tracking overshoot does not exceed the torque observation tracking overshoot limit T
δ The torque observation tracking overshoot penalty function term is equal to 0 when, and is equal to gamma otherwise
p1 。Q
22 Max (| e) in the first term
2 (t) |) is the absolute value of the steady-state error of the maximum torque observation, gamma
p2 Balancing the side weight coefficients for fitness, and gamma
p2 >0;Q
22 Gamma in (5)
p1 (1-sgn(e
2 (t)+T
Δ ) Term) is a penalty function for the steady state error of the torque observation, T
Δ Observing a steady state error limit for the load torque; when the observed steady state error of the torque does not exceed the observed steady state error limit T of the load torque
Δ The torque observed steady state error penalty function term is equal to 0 when, and is equal to γ otherwise
p1 。Q
2 The function value is an objective function value, namely an adaptive value for setting the parameters of the load torque observer by adopting a wolf pack algorithm; the smaller the adaptation value of the individual wolf, the better the corresponding position. Gamma ray
p1 When taking value, firstly, the value is estimated
Reasonable value (upper limit); for example, assuming that the rated torque of the motor is 22N m, the maximum predicted torque is observed to track the regulation time t
p When the time is about 0.1s, the numerical value of the integral term of the IAE criterion in the formula (16) does not exceed 2; fitness balance side weight coefficient gamma
p2 Has 2 functions, namely balancing an IAE criterion integral term and a maximum torque observation steady-state error absolute value term, for example, setting a load torque observation steady-state error limit value T
Δ Is 1 N.m, then gamma
p2 When 2 is taken, the IAE criterion integral term and the absolute value term of the maximum torque observation steady-state error are relatively balanced, or 2 objective function values Q
2 The functions are equivalent, in this case
Has a reasonable value of not more than 4, gamma
p1 A constant equal to or greater than 20 may be used. Reduction of gamma
p2 Value, then objective function value Q
2 Middle IAE criterionThe weight of the integral term is increased, and the method is more biased to the rapidity of torque observation; increase gamma
p2 Value, then objective function value Q
2 The weight of the steady-state error absolute value term of the medium and maximum torque observation becomes larger, and the steady-state performance of the torque observation is more biased. Gamma ray
p3 Typically greater than or equal to 2, the magnitude of which determines how long the measurement of the steady-state error of the load torque observation is made, e.g. gamma
p3 When the value is equal to 6, tracking and adjusting time (namely transition process time) t is 5 times
p The interval of (2) is measured for the load torque observation steady state error.
The method for optimizing the parameters of the PI speed controller or the parameters of the load torque observer by the wolf pack algorithm comprises the following specific steps:
in step 201, a wolf pack is initialized. Let the initial position of each wolf in the wolf group be
Wherein M is the number of wolf in wolf group, generally selected between 20-150, and the initial position is required to be randomly distributed. For different optimized objects, there are:
(1) for optimizing the PI speed controller parameters, the parameter vector to be optimized is θ ═ K p ,T i ]At this time, the search space dimension N of the wolf pack algorithm is equal to 2, and in the final result of the optimization, the position value of the wolf head is the optimal parameter of the PI speed controller.
(2) Aiming at the embodiment 1 of the load torque observer, when the feedback gain automatic adjustment method embodiment 1 is adopted to carry out the feedback gain automatic adjustment, the parameter vector to be optimized is theta 1 =[G max ,G min ,ε 1 ,ε 2 ,α]The search space dimension N of the wolf pack algorithm is now equal to 5.
(3) Aiming at the embodiment 1 of the load torque observer, when the feedback gain automatic adjustment method embodiment 2 is adopted to carry out the feedback gain automatic adjustment, the parameter vector to be optimized is theta 2 =[G max ,G min ,ε,α]The search space dimension N of the wolf pack algorithm is now equal to 4.
(4) For load torque observer embodiment2, when the feedback gain automatic adjustment method is adopted in the embodiment 1 of the feedback gain automatic adjustment method, the parameter vector to be optimized is theta 3 =[G max ,G min ,ε 1 ,ε 2 ,β]The search space dimension N of the wolf pack algorithm is now equal to 5.
(5) Aiming at the embodiment 2 of the load torque observer, when the feedback gain automatic adjustment method embodiment 2 is adopted to carry out the feedback gain automatic adjustment, the parameter vector to be optimized is theta 4 =[G max ,G min ,ε,β]The search space dimension N of the wolf pack algorithm is now equal to 4.
In the above parameter vector to be optimized, θ ═ K p ,T i ]Has a position value interval of [ m imin m imax ]The range interval can be given based on prior knowledge or experience, e.g., the parameter K p Value range of [ m ] 1min m 1max ]Is [ 010I N ]Parameter T i Value range of [ m ] 2min m 2max ]Is [ 0.0010.5 ]]。
In the parameter vectors of the load torque observer to be optimized, g is obtained after the final head wolf position (optimal position) is obtained through optimization
max 、g
min Are respectively in accordance with
Calculating to obtain; sliding mode gain k
g Calculating according to the parameter alpha and the formula (13); proportional gain k
W Calculated according to equation (14) based on the parameter β.
In the above load torque observer parameter vector to be optimized, the initial position of the ith wolf is expressed as
The position value interval is [ p ]
imin p
imax ]Corresponding to the parameters to be optimized. The range of the value interval of the parameter to be optimized can be given according to the prior knowledge or experience, for example, the parameter G
max Value area ofHas a spacing of [ -44 [)](ii) a Parameter G
min Has a value range of [ -44 [)](ii) a Parameter epsilon
1 And parameter ε
2 Or the value intervals of the parameter epsilon are all [ 00.05T
N ],T
N Is the rated torque of the motor; the value interval of the parameter alpha is [15 ]]Or the value interval of the parameter beta is [120 ]]。
In step 202, hunting competition. Calculating the adaptive value of each wolf in the wolf group, wherein the smaller the adaptive value is, the better the position of the wolf is; selecting 1 wolf with the best position as the wolf, and selecting R with the best position except for the wolf 1 The wolf is the competitive wolf. R 1 The hunting wolves are developed by the match-election wolves according to the formula (17), compete and replace the wolves, and the method specifically comprises the following steps:
step 2021, randomly selecting h for wolf contest 1 A direction, which is further advanced and then retreated according to formula (17) along each direction search parameter; calculating the adaptive value of the head wolf after the head wolf advances; selecting the minimum adaptive value in all directions, and replacing the home position of the competitive wolf with the position of the minimum adaptive value if the minimum adaptive value is smaller than the adaptive value of the home position of the competitive wolf; when the adaptive value of the head wolf is smaller than the adaptive value of the head wolf, the head wolf is used as the head wolf and the hunting competition is exited, otherwise, the step 2022 is entered;
step 2022, repeat h for each wolf race 2 The next step 2021;
step 2023, all R 1 After the wolve wolf finishes step 2022, the hunting competition is exited.
In the formula (17), i is 1, 2, …, R 1 (ii) a j ═ 1, 2, …, N; rand (-1, 1) is uniformly distributed in [ -11 ]]A random number within; 1, 2, …, h 1 (ii) a Stepa is the hunting step length, and the value range of the suggested Stepa is [ 0.10.9 ]];p i =[p i1 p i2 … p iN ]Is the location of the ith winning wolf. R 1 Suggested in the interval [0.1M 0.25M]Taking a fixed value or a random value; number of directions h 1 Suggesting in intervals[38]Value, repetition number h 2 Suggesting in the interval [ 310 ]]And (4) taking values.
In step 203, a flush is summoned. Summoning a raid; the head wolf and other wolfs except the competitive wolf develop the running search behavior according to the formula (18) and run towards the head wolf. Calculating an adaptive value of a new position of the ith wolf, and changing the position of the ith wolf when the new position searched by the ith wolf is superior to the current position of the ith wolf, or keeping the position unchanged; if the new position searched by the ith wolf is better than the wolf position, the ith wolf is converted into the wolf and the call is re-issued.
p′ ij =p ij +rand(-1,1)·stepb·(p bj -p ij ) (18)
In the formula (18), i is 1, 2, …, M-R 1 -1;j=1,2,…,N;p′ i =[p′ i1 p′ i2 … p′ iN ]Indicating the location of the ith wolf search update; p is a radical of formula i =[p i1 p i2 … p iN ]Represents the current position of the ith wolf; p is a radical of b =[p b1 p b2 … p bN ]Indicating the current wolf location; stepb is the running step length, and the suggested value range of Stepb is [ 1.32.5 ]]。
And step 204, the prey is attacked. Upon summoning of the wolf, other wolfs push (19) deploy a containment attack on the prey. Calculating an adaptive value of the new position of the ith wolf, changing the position of the ith wolf when the new position searched in the attacking process of the ith wolf is superior to the current position, and keeping the position unchanged if not; if the ith wolf is containment in the new position found to be better than the wolf position, then the ith wolf is converted to a wolf.
In formula (19), i is 1, 2, …, M-1; j ═ 1, 2, …, N;
representing the current position of the ith wolf (i.e. the position over n iterations),
searching a new position for the ith wolf; p is a radical of
b =[p
b1 p
b2 … p
bN ]Indicating the current wolf location; delta is a pre-established threshold value, and the value range of the suggested delta is [0.10.4 ]];p
jmax And p
jmin Respectively is the maximum value and the minimum value of the value interval of the jth dimension parameter. Stepc is the attack step size and is calculated according to equation (20).
In the formula (20), n is the current iteration number, and n max Is the set maximum iteration number; stepc max 、stepc min The maximum tapping step length and the minimum tapping step length are set respectively, and xi is a tapping step length attenuation factor. Suggested stepc min Is in the value range of [ 0.31.3],stepc max Taking the value as stepc min 5 to 100 times higher. n increases from 1 to n max When, stepc follows stepc exponentially max Decay to stepc min Adjusting the size of the attack step attenuation factor xi, and adjusting the relative attenuation speeds of the early stage and the later stage of the attack step; the bigger the xi value is, the faster the attenuation speed of the early stage of the stepc relative to the later stage is, and the longer time of the later stage is approximately equal to the step c min (ii) a The smaller the xi value is, the slower the attenuation speed of the stepc in the early stage relative to the later stage, and the attenuation state of the stepc in the later stage is still close to the stepc min (ii) a ξ is in the value range of [ 210 ]]. FIG. 4 is a diagram showing the effect of adjusting the relative attenuation speed of attack step stepc by attack step attenuation factor xi; in FIG. 4, the horizontal axis represents the number of iterations n, n max Equal to 1000; the longitudinal axis is the attack step size stepc max Equal to 10, stepc min Equal to 1; curve xi is the attenuation curve of stepc when xi is equal to 4, and curve xi is the attenuation curve of stepc when xi is equal to 8. E in the formula (20) is a natural exponent, i.e., a base of a natural logarithm.
When the xi is large, the proportion of the later small-step accurate search process is increased, which is more beneficial to finding out an accurate optimal solution; xi takes a small value, so that the diversity in the later searching stage is enhanced, and local optimality near the optimal solution is more favorably avoided; aiming at different optimized objects such as searching an accurate optimal solution and avoiding local optimal objects near the optimal solution, the maximum adaptation can be carried out by reasonably selecting the value of the attack step attenuation factor xi so as to achieve different optimization effects.
Step 205, terminating the condition judgment. If the loop iteration times reach or the head wolf adaptive value is smaller than a certain threshold value, the optimization process is terminated, and the head wolf position parameter is the optimal parameter of the optimized parameter vector. Otherwise, let n be n +1, go to step 206.
Step 206, race update. Randomly generating R according to the principle of high-priority and low-priority 2 Wolf replacing original R 2 The rejected wolf with the worst fitness value competes for updating wolf clusters, and the process goes to step 202. R 2 Suggested in the interval [0.05M 0.15M]Take a fixed value or a random value.
In the above steps, a new position of the individual wolf is randomly generated, or when the new position is generated by searching the individual wolf, each dimension variable of the new position of each wolf cannot exceed the value range corresponding to the variable. In the parameters of the load torque observer to be optimized, g max 、g min With a constraint g in between min <g max Corresponding to the constraint G min >G max . When randomly generating a new location of an individual wolf or searching for an individual wolf to generate a new location, first, the individual wolf p i Parameter p in (1) i1 (i.e. G) max ) According to the value interval [ p 1min p 1max ]Randomly generating a location or making a location update, then, the individual wolf p i Parameter p of i2 (i.e. G) min ) According to the value interval [ p i1 p 2max ]Randomly generating positions or updating positions to make individual wolfs p i Satisfies the constraint condition G min >G max I.e. satisfies the constraint g min <g max 。
In step 205, the termination condition is a maximum iteration step number limiting mode, and the maximum iteration number n max Suggested in the interval [ 20500]A fixed value is taken. For PI speed controlThe parameters of the device are optimized, and when the condition that the head wolf adaptive value is smaller than a certain threshold value is set, for example, the rated rotation speed of the motor is 1500r/min (corresponding to the rated rotor angular speed of 157rad/s), and the start time requirement is within 0.2s, the threshold value of the end condition can be set to 15. Optimizing parameters of a load torque observer, and setting a termination condition that the head wolf adaptive value is smaller than a certain threshold value, wherein the reference motor rated torque and the expected torque observation tracking regulation time t are required p Torque observation tracking overshoot limit T δ Load torque observation steady state jitter limit T Δ And the adaptability balance side weight coefficient gamma p2 Etc. to determine the threshold size; the rated torque of the motor is 22 N.m, T δ Is 2 N.m, T Δ Is 1 N.m.gamma p2 Equal to 1.5, the desired torque observation tracks the adjustment time t p Less than 0.04s, the threshold for the termination condition may be set at 1.8.
When the adaptive value of the wolf position is calculated in each step of the wolf group algorithm, the individual wolf position is required to be converted into the corresponding PI speed controller parameter to control the motor to start (or start in a simulation system) to obtain e (t) of the angular speed step response of the motor rotor required in a formula (15), and the transition process time t is determined according to e (t) m Calculating to obtain the adaptive value Q of the individual wolf 1 。
When optimizing the parameters of the load torque observer and calculating the adaptive value of the position of the wolf in each step of the wolf pack algorithm, the parameters of the PI speed controller are already set, and the PI speed controller is carried out under the condition of realizing load torque compensation control. The individual wolf position is required to be converted into corresponding load torque observer parameters in sequence, when the given speed of the motor is not changed and the PI speed controller is in a steady state, the load torque is suddenly changed, the motor is controlled to operate (or operate in a motor simulation system), and the motor load torque observation step response e required in the formula (16) is obtained 2 (t) according to e 2 (t) determining a transient time t p Calculating to obtain an adaptive value Q 2 。
Because the initial position of the individual wolf is required to obey random distribution, and the spatial search of wolf group algorithmThe mode is linear mode, therefore, the feedback gain is directly controlled to a high value g max And a low value g of feedback gain min In the interval [ -50000]In search optimization, the absolute value of the feedback gain, which has a large influence on the observer operating state, is in a low range, for example, in the range of [ -100 [)]Meanwhile, the probability of randomly generating the access or searching the access is small, and the feedback gain high value g is difficult to obtain through optimization max And a low value g of feedback gain min The optimal position of (a). The feedback gain is not directly adjusted to a high value g in the optimization process max And a low value g of feedback gain min Search optimization is performed, but optimization is performed in a gain-like manner, and the parameter interval [ -100 ]]The search interval is expanded, and a high value g of the feedback gain is easily obtained max And a low value g of feedback gain min The optimal position of (a); at this time, the feedback gain is high value g max And a low value g of feedback gain min The parameter intervals of (A) are [ -10000-0.0001 [ -10000 [ -0.0001 [ ]](ii) a High value g of feedback gain max Normally, it will not be in the range [ -0.00010 [)]Selecting within the range, otherwise, causing the observer to respond too slowly; in addition, the upper limit of the interval is-0.0001, and the high value g of the feedback gain is also avoided max The observer caused by taking a value of 0 does not work properly.
In the periodic control process of the speed of the permanent magnet synchronous motor in the drive control system, a load torque set value T calculated at the moment k (or the kth step) is used
L * Is marked as T
L * (k) Observed value of load torque
Is marked as
The moment k-1 is the previous periodic control process moment of the moment k, and the given value T of the load torque
L * Is marked as T
L * (k-1), load torque observed value
Is marked as
The moment k-2 is the previous periodic control process moment of the moment k-1, and the given value T of the load torque
L * Is marked as T
L * (k-2), load torque observed value
Is marked as
The method for controlling the speed of the permanent magnet synchronous motor in the drive control system of the permanent magnet synchronous motor of the numerical control machine comprises the following steps:
step one, detecting the rotor position theta, the rotor angular speed omega and the three-phase current i of the permanent magnet synchronous motor a 、i b And i c ;
Step two, according to three-phase current i a 、i b And i c Clark conversion is carried out on the permanent magnet synchronous motor to obtain current i under an alpha-beta axis coordinate system α Current i β According to the current i α Current i β Carrying out Park conversion on the rotor position theta to obtain a current i under a d-q axis coordinate system d Current i q ;
Step three, feedback gain g is given value T according to load torque
L * And load torque observed value
Is adjusted;
step four, the load torque observer is used for observing the rotor angular speed omega and the current i
q Observing the load torque to obtain a load torque observed value
And a torque current compensation component i ″)
q ;
Step five, the PI speed controller gives the angular speed omega according to the input rotor * And the angular speed omega of the rotor is controlled and calculated to obtain a given value T of the load torque L * And torque current given component i' q ;
Step six, giving component i 'according to torque current' q And a torque current compensation component i ″) q Calculating to obtain a given value i of q-axis torque current q * (ii) a d-axis current controller setting value i according to d-axis torque current d * With current i in d-axis coordinate system d The difference value between the two is subjected to PI control operation to obtain a control voltage U under a d-axis coordinate system d (ii) a The q-axis current controller sets a value i according to the q-axis torque current q * And the current i under a q-axis coordinate system q The difference value between the two is subjected to PI control operation to obtain a control voltage U under a q-axis coordinate system q (ii) a According to the control voltage U under a d-q axis coordinate system d 、U q Carrying out Park inverse transformation to obtain a control voltage U under an alpha-beta axis coordinate system α 、U β (ii) a d-axis torque current set value i d * Equal to 0;
step seven, controlling the voltage U under the alpha-beta axis coordinate system α 、U β As input of the SVPWM module, the SVPWM module controls a three-phase inverter to generate a three-phase alternating current power supply U a 、U b 、U c Thereby driving the permanent magnet synchronous motor to operate.
In the above steps, the sequence of the step three and the step four and the step five can be interchanged, that is, the step four and the step five can be performed first, and then the step three can be performed. In the steps of three, four and five, the feedback gain is automatically adjusted firstly, then the load torque observation and the speed control are carried out,
ΔT
L * =T
L * (k-1)-T
L * (k-2). Both (b) in fig. 2 and (b) in fig. 3 are subjected to load torque observation and speed control, and then to feedback gain automatic adjustment,
ΔT
L * =T
L * (k)-T
L * (k-1); in the above steps, the fourth step and the fifth step are performed first, and then the fourth step and the fifth step are performedAnd step three.
Observing to obtain a load torque observed value
Then, the observed value of the load torque is measured
Converted into a torque current compensation component i ″)
q Feed-forward compensating the input to a q-axis current PI controller, giving a component i 'to the torque current output from the PI speed controller'
q Compensation is performed. q-axis torque current given value i of q-axis current PI controller
* q Comprises the following steps:
in the formula (21), k q =1/(1.5pψ f ) The compensation factor is observed for torque. Comparing the formula (5) with the formula (21), when the load is disturbed or the system parameter is changed, the formula (5) does not add the load torque compensation, and needs to select a larger K p The value is used for providing enough large given current variation to counteract the disturbance of the load or the related influence of the variation of the system parameters so as to ensure that the rotating speed of the motor can be quickly constant; equation (21) feed-forward compensates the load torque observations into the current regulator without requiring a large K p Under the condition of the value, when the load is disturbed or the system parameter is changed, a given current change quantity which is large enough is provided to offset the relevant influence of the disturbance of the load or the change of the system parameter, and the output pressure of the PI speed controller is reduced.
When the feedback gain value is fixed, the smaller the feedback gain g is, the larger the oscillation amplitude observed by the load torque is, and the stronger the fluctuation is; the larger the feedback gain g is, the smaller the oscillation amplitude observed by the load torque is, and the higher the observation accuracy is. The automatic gain adjustment algorithm solves the problems that small feedback gains in a load torque observer cause large torque observation fluctuation and large feedback gains are long in convergence time, convergence time and fluctuation amplitude indexes are superior to those of a compromise gain algorithm, a load torque change value can be tracked quickly, observation errors caused by given changes or parameter changes can be reduced quickly, the oscillation amplitude is small, observation precision is high, and a good observation effect is achieved.
When a given rotation speed is changed at a rated load torque, although the actual load torque is not changed, as can be seen from the load torque observer constructed by equations (7), (8) or equations (10), (11), when the rotor angular velocity ω is changed, the observed torque observed value changes even if the load torque is not changed, resulting in an observation error. When the given rotating speed is changed under the rated load torque, the control and regulation process of the permanent magnet synchronous motor control system is that firstly, a PI speed controller changes according to the given speed to enable the output torque current given value i
* q Is changed (i.e. the given value of load torque T)
L * Change) of the permanent magnet synchronous motor, and thereby the electromagnetic torque T of the permanent magnet synchronous motor
e The change drives the motor to change the angular speed omega of the rotor; if the feedback gain g is only based on the variation of the observed value of the load torque
The automatic adjustment is carried out, and only when the angular speed omega of the rotor changes, the observed value of the load torque is enabled to be
After the change, the feedback gain g is adjusted; feedback gain g is simultaneously based on the variation delta T of the given value of the load torque
L * And amount of change in observed value of load torque
Automatically adjusting to a given value T of load torque when the given speed is changed
L * Change, load torque observed value
If no change has occurred, the feedback gain g is adjusted in advance, and when the load torque observed value is
When the observation error is really generated, the response speed of the observer can be accelerated, and the observed value of the load torque can be eliminated (reduced) as soon as possible
The observation error of the motor speed control is further improved, and the rapidity and the accuracy of the motor speed control are further improved. Similarly, when the system model parameter changes, the given value T of the load torque is caused to change
L * Anticipating load torque observations
When the feedback gain g changes, the feedback gain g changes according to the variable quantity delta T of the given value of the load torque
L * And amount of change in observed value of load torque
The feedback gain g can be adjusted in advance by automatic adjustment, the response speed of the observer is accelerated, and the observed value of the load torque is eliminated (reduced) as soon as possible
The speed control method and the device can further improve the rapidity and the accuracy of the speed control of the motor. Of course, the observed value is caused if the load is disturbed
When the change is made, the user can select the desired mode,
when a large change occurs, as can be seen from fig. 2 and 3, the feedback gain g can also be automatically adjusted to eliminate (reduce) the load torque observed value as soon as possible
To make the load torque observed value
Follow load rotation as soon as possibleMoment T
L A change in (c).
Further, in the embodiment of the driving control system of the permanent magnet synchronous motor, after the parameters of the PI speed controller and the parameters of the load torque observer are set manually or in an optimization manner, the parameters of the PI speed controller can be manually fine-tuned under the condition of realizing the load torque compensation control, or the parameters of the PI speed controller can be re-optimized by adopting the wolf pack algorithm according to the steps 201 and 206.
In each case g is selected from min 、g max In the specific method for comparing the value and the threshold value, the parameters in the PI speed controller are set and are realized under the condition of carrying out load torque compensation control; when the parameter value is determined manually, suggestion F is made 1 Is an integer of 20 or more, F 2 Is not less than 5 and not more than 0.5F 1 Is an integer of (1).
Parameters of the PI speed controller and the load torque observer can be optimized uniformly by adopting optimization algorithms such as a particle swarm algorithm, a wolf colony algorithm, a genetic algorithm and the like, and the particle swarm algorithm is adopted for unified optimization, so that the system motor gives the angular speed omega of the rotor at the moment
* The step signal is as shown in (a) of fig. 5, and the load torque T is changed according to (b) of fig. 5
L . Given the angular speed ω of the rotor
* The signal is a step signal and the angular speed of the rotor is set
Not more than the rated angular speed of the motor and not less than 80 percent of the rated angular speed of the motor. In fig. 5 (b), when the motor is started (the rotor angular velocity step signal T is given as 0), the load torque T is applied
L For high value T of load torque
Lmax (ii) a When the motor enters a stable rotor angular speed state (t > t)
z ) Rear, load torque T
L From a high value T
Lmax Reduction of the mutation to a low value of T
Lmmin (ii) a The load torque is maintained at a low value T
Lmmin Run time
Then, from a low value T
Lmin Mutation increases to a high valueT
Lmax (ii) a Wherein the load torque is high value T
Lmax Not greater than rated load torque T of motor
N Low value of load torque T
Lmin Not less than rated load torque T of
motor N 10% of (d), high value of load torque T
Lmax With low value T of load torque
Lmin The difference between the two is not less than the rated load torque T of the motor
N 50% of;
is 2 to 5t
z A random value in between. The step signal is used as the angular speed signal of the given rotor of the motor, the load torque sudden change is controlled when the angular speed of the rotor of the motor runs in a steady state, the parameters of a PI speed controller and a load torque observer are optimized simultaneously by constructing the comprehensive performance indexes of the starting stage and the steady state running stage of the motor, the influence of the good performance of the load torque observer is unified to the angular speed performance indexes of the rotor, the parameter optimization process is simplified, and meanwhile, the angular speed performance indexes of the rotor can be improved to the maximum extent.
Considering that the load torque observer mainly has the effect of improving the load interference resistance of the PI speed controller, and establishing a target function Q for comprehensively evaluating various performance indexes of the PI speed controller and the load torque observer 3 Is composed of
In the formula (22), Q
31 The integral term in (1) is the IAE criterion of the motor rotor angular speed step response starting stage, t
z The time is the transition process time of the angular speed step response of the motor rotor, and t is 0 which is the starting time of the motor step response; q
31 The second term γ in (1)
z1 (1-sgn(e(t)+ω
δ ) Is a rotor angular velocity overshoot penalty function, where γ
z1 One is big enough
5 times and above the rational value), omega) of a positive number
6 The value is the rotor angular speed overshoot limit (namely the maximum value of the rotor angular speed overshoot allowed by the system); when the overshoot of the angular speed step response of the motor rotor does not exceed the rotor angular speed overshoot limit value omega
δ The term overshoot penalty function is equal to 0 when, and is equal to γ otherwise
z1 ;Q
32 The integral term in the method is an IAE criterion of the motor rotor in the steady-state working stage of the angular speed, and the steady-state error and the problem anti-interference performance are comprehensively considered; q
32 The second term γ in (1)
z1 (1-sgnet + omega delta is a steady-state error penalty function, omega delta is a rotor angular speed steady-state error limit value, when the steady-state error of the rotor angular speed step response of the motor does not exceed the rotor angular speed steady-state error limit value omega
Δ The steady state error penalty function term is equal to 0 when, and is equal to γ otherwise
z1 ;Q
3 The value is a target function value, namely a fitness value for performing parameter optimization on a PI speed controller and a load torque observer by a particle swarm algorithm; the smaller the fitness value of the particle, the better the corresponding position. Gamma ray
z2 Typically 6 or more, the magnitude of which determines how long a steady-state error of the rotor angular velocity is measured, e.g. gamma
z2 When the value is equal to 10, the time t of the transition process is 9 times
z Measuring the steady-state error of the angular speed of the rotor in the interval; t is equal to gamma
z2 t
z Should be later than the load torque in fig. 5 from the low value T
Lmin Mutation increases to a high value of T
Lmax The time of day. Gamma ray
z The fitness balance adjustment coefficient is a constant larger than 0 and is used for balancing the starting performance and the steady-state performance (including steady-state error and anti-interference capability) of the motor; reduction of gamma
z Value, then objective function value Q
3 The weight of the middle starting performance item is increased, and the system performance is more biased to the rapidity of starting the motor; increase gamma
z Value, then objective function value Q
3 The weight of the middle steady-state performance item is increased, and the system performance is more biased to the steady-state performance and the anti-interference capability of the speed control. Gamma ray
z1 When taking value, firstly, the value is estimated
Reasonable value of(upper limit); for example, if the rated rotational speed of the motor is 1500r/min (corresponding to the rated rotor angular speed of 157rad/s) and the starting time is about 0.2s, the motor is started
The item number does not exceed 40; let gamma
z2 Value equal to 10, gamma
z Equal to 2 and rotor angular velocity steady state error limit ω
Δ Equal to 2rad/s, at this time
Reasonable value of not more than 60, gamma
z1 A constant equal to or greater than 300 may be used. PI speed controller parameter optimization other objective functions than the one set up (22) may be established if needed to take into account other index factors, such as whether the transient process time is short enough, whether the steady state error is small enough, and so on.
The method for optimizing the parameters of the PI speed controller and the load torque observer in the permanent magnet synchronous motor drive control system embodiment by adopting the particle swarm optimization comprises the following specific steps:
step 301, initialize a particle swarm. Setting the initial position of each particle in the particle group as
Wherein M is the number of individuals, generally selected from 20-150, and the initial position is required to be randomly distributed. For different optimized objects, there are:
(1) for the
embodiment 1 of the load torque observer in the embodiment of the permanent magnet synchronous motor drive control system, when the feedback gain automatic
adjustment method embodiment 1 is adopted to perform the feedback gain automatic adjustment, the parameter vector to be optimized is [
mu 1 ═ K [ [ K ]
p ,T
i ,G
max ,G
min ,ε
1 ,ε
2 ,α]At the moment, the search space dimension N of the particle swarm algorithm is equal to 7, and g is used for optimizing the optimal position of the particle
max 、g
min According to
Sliding mode gain k
g Calculated according to the parameter α in accordance with equation (13). The initial position of the ith particle is expressed as
Corresponding to the parameter vector mu to be optimized
1 (ii) a The position value interval is [ z ]
imin z
imax ]The range interval can be given based on prior knowledge or experience, e.g., the parameter K
p Value range of [ z ]
1min z
1max ]Is [ 010I
N ]Parameter T
i Value range of [ z ]
2min z
2max ]Is [ 0.0010.5 ]]Parameter G
max Value range of [ z ]
3min z
3max ]Is [ -44 ]](ii) a Parameter G
min Value range of [ z ]
4min z
4max ]Is [ -44 ]](ii) a Parameter epsilon
1 Value range of [ z ]
5min z
5max ]And parameter ε
2 Value range of [ z ]
6min z
6max ]Are all [ 00.05T
N ],T
N Rated torque of the motor; value range [ z ] of parameter alpha
7min z
7max ]Is [15 ]]。
(2) Aiming at the
embodiment 1 of the load torque observer in the embodiment of the permanent magnet synchronous motor drive control system, when the feedback gain automatic
adjustment method embodiment 2 is adopted to carry out the feedback gain automatic adjustment, the parameter vector to be optimized is [
mu 2 ═ K
p ,T
i ,G
max ,G
min ,ε,α]At the moment, the search space dimension N of the particle swarm algorithm is equal to 6, and g is carried out after the optimal position of the particle is obtained through optimization
max 、g
min According to
Sliding mode gain k
g And respectively obtaining by a computer according to the formula (13) according to the parameter alpha. The initial position of the ith particle is expressed as
Corresponding to the parameter vector mu to be optimized
2 (ii) a The position value interval is[z
imin z
imax ]The range interval may be given based on prior knowledge or experience, e.g. the vector μ
2 Middle and first 4 parameter value intervals and vector mu
1 The first 4 parameters are the same, and the value interval [ z ] of the parameter epsilon
5min z
5max ]Is [ 00.05T
N ],T
N Rated torque of the motor; value range [ z ] of parameter alpha
6min z
6max ]Is [15 ]]。
(3) Aiming at the
embodiment 2 of the load torque observer in the embodiment of the permanent magnet synchronous motor drive control system, when the feedback gain automatic
adjustment method embodiment 1 is adopted to carry out the feedback gain automatic adjustment, the parameter vector to be optimized is mu
3 =[K
p ,T
i ,G
max ,G
min ,ε
1 ,ε
2 ,β]At the moment, the search space dimension N of the particle swarm algorithm is equal to 7, and g is used for optimizing the optimal position of the particle
max 、g
min According to
Proportional gain k
W The parameters β are calculated according to equation (14). The initial position of the ith particle is expressed as
Corresponding to the parameter vector mu to be optimized
3 (ii) a The position value interval is [ z ]
imin z
imax ]The range interval may be given based on prior knowledge or experience, e.g. the vector μ
3 Middle and first 6 parameter value intervals and vector mu
1 The first 6 parameters are the same, and the value interval [ z ] of the parameter beta
7min z
7max ]Is [120 ]]。
(4) Aiming at the
embodiment 2 of the load torque observer in the embodiment of the permanent magnet synchronous motor drive control system, when the feedback gain automatic
adjustment method embodiment 2 is adopted to carry out the feedback gain automatic adjustment, the parameter vector to be optimized is mu
4 =[K
p ,T
i ,G
max ,G
min ,ε,β]At the moment, the search space dimension N of the particle swarm algorithm is equal to 6, and g is carried out after the optimal position of the particle is obtained through optimization
max 、g
min According to
Proportional gain k
W The parameters β are calculated according to equation (14). The initial position of the ith particle is expressed as
Corresponding to the parameter vector mu to be optimized
4 (ii) a The position value interval is [ z ]
imin z
imax ]The range interval may be given based on prior knowledge or experience, e.g. the vector μ
4 Middle and first 5 parameter value intervals and vector mu
2 The first 5 middle parameters are the same; value range [ z ] of parameter beta
6min z
6max ]Is [120 ]]。
Step 302, initial position z of each particle is determined
(0) As an initial optimum value z of each particle
b (0) A fitness function value (i.e., a particle fitness value) of each particle is calculated according to equation (22) and stored as an optimal particle fitness value for each particle; the fitness values of all the particles are compared to obtain the optimal solution z of the initial particle swarm
g (0) And storing the particle swarm optimal fitness value. Let the initial velocity of the particles be
Also following a random distribution, the initial velocity of the ith particle is expressed as
Extreme value of speed variation of parameter u
imin u
imax ]Generally setting the range of the parameter value interval to be 5-20 percent; for example, the parameter G
max Value range of [ z ]
3min z
3max ]Is [ -44 ]]And the interval range is 8, the 3 rd dimension variable (parameter G) of each particle
max ) Speed change extreme value of [ u ]
3min u
3max ]Is [ -0.40.4 ] in accordance with a value of 5%]The value is [ -1.61.6 ] according to 20%]。
Step 303, according to formula
Updating the speed and position of each particle; the speed change of each dimension variable cannot exceed the corresponding speed change extreme value of each dimension variable, and the updating position of each dimension variable cannot exceed the corresponding value interval of each dimension variable. In the formula (23), n is the current iteration number, u
n And z
n Is the velocity vector and position of the particle; c. C
0 The value range is 0-1.4 for the inertial weight, the search range and the search speed can be changed by adjusting the value of the inertial weight, and further, the adaptive reduction c is realized along with the increase of the iteration times
0 The value is favorable for achieving balance between searching capability and convergence speed; c. C
1 、c
2 Taking values between 1 and 2 as learning factors, and taking 2 as suggestions;
the random number is a random number with a value range of 0-1;
for the optimal solution (optimal position) found so far for the particle itself,
indicates the optimal solution (optimal position) of the particle group for the whole population up to now.
Step 304, a particle fitness value for each particle is calculated according to equation (22).
Step 305, for
And the corresponding optimal particle fitness value is updated to
And updating the corresponding particle swarm optimal fitness value.
Step 306, judging whether a cycle termination condition is met, if so, ending the particle swarm algorithm, and finally obtaining the optimal solution of the particle swarm as the optimal parameters of the optimized parameter vector, namely the optimal parameters of the PI speed controller and the load torque observer; otherwise, return to step 303.
The loop termination condition is generally that the maximum iteration step limit is reached or the optimal fitness value of the particle swarm is smaller than a certain threshold value. And (3) setting parameters of the PI speed controller and the load torque observer by adopting a particle swarm algorithm, and adopting a maximum iteration step limiting mode as a cycle termination condition, wherein the maximum iteration step is usually selected from 100-2000. And meanwhile, when a threshold termination condition of the optimal fitness value of the particle swarm is set, the threshold termination condition needs to comprehensively consider the starting performance and the anti-interference performance of the motor speed control. For example, if the rated rotational speed of the motor is 1500r/min (corresponding to a rated rotor angular speed of 157rad/s), the start-up time requirement is within 0.2s, and the anti-interference performance and the start-up performance are substantially balanced, the threshold of the end condition may be set to 30.
When the particle fitness value of each particle is calculated according to the formula (22), the position of each particle is required to be converted into a corresponding PI speed controller parameter and a corresponding load torque observer parameter in turn, the motor is controlled to operate (or operate in a simulation system), and the angular speed omega of the rotor of the motor in the system is given * As a step signal, load torque T L Under the condition that the rotor angular speed is subjected to sudden change in a steady state, the speed response e (t) of the motor is obtained, and the transition process time t is determined according to the e (t) z Meanwhile, calculating to obtain the fitness value Q of the particles according to e (t) 3 。
Among the parameters to be optimized, g max 、g min With a constraint g in between min <g max Corresponding to the constraint G min >G max . In the above steps, when the particle position is randomly generated or updated, first, the particle z i Parameter z in i3 (i.e. G) max ) According to the value range [ z 3min z 3max ]Randomly generating positions or performing position updates, then the particles z i Parameter z of i4 (i.e. G) min ) According to value zoneM [ z ] i3 z 4max ]Randomly generating positions or performing position updates to make particles z i Satisfies the constraint condition G min >G max I.e. satisfies the constraint g min <g max 。
In each of the above embodiments, the rotor angular speed steady-state error refers to a difference between an instantaneous value of the rotor angular speed of the motor and a steady-state value in a steady state, and the rotor angular speed steady-state error limit value is a maximum absolute value of the rotor angular speed steady-state error allowed by the system; the rotor angular velocity steady state error limit is generally the same as the maximum value of the rotor angular velocity steady state error allowed by the system. The torque observation tracking overshoot limit is typically 1% to 10% of the rated torque of the motor, and specifically, the torque observation tracking overshoot limit is 2% of the rated torque, or 5% of the rated torque, or 10% of the rated torque, or the like. The tracking adjustment time refers to that the load torque is suddenly changed from a fixed value to another fixed value, the moment when the sudden change starts to the moment when the load torque observer outputs the observation value and stably enters the load torque observation steady-state error limit range is a torque observation transition process, and the tracking adjustment time refers to the time of the transition process; the load torque observation steady-state error refers to an error between an observation torque instantaneous value and a load torque when the load torque is unchanged and a load torque observer is in a steady state, and the error comprises an observation error caused by buffeting of the sliding mode observer (or steady state fluctuation of the state observer) and an observation error caused by interference reasons except for load fluctuation; the load torque observation steady-state error limit value is the maximum absolute value of the load torque observation steady-state error allowed by the load torque observer; the load torque observed steady state error limit is generally the same as the maximum allowable load torque observed steady state error for the system; the observed load torque steady state error limit is typically 1% to 5% of the rated torque of the motor, specifically, the observed load torque steady state error limit is 1% of the rated torque, or 2% of the rated torque, or 5% of the rated torque, and so on. The torque observation tracking overshoot refers to that the load torque is suddenly changed from one constant value to another constant value, and the observed value output by the load torque observer exceeds the maximum deviation value of the suddenly changed load torque. When the observed steady state error of the load torque is within a range proximate to the observed steady state error limit of the load torque, for example, within a range of 95% to 105%, or within a range of 98% to 102%, the observed steady state error of the load torque is considered to increase to the observed steady state error limit of the load torque.
In the invention, the drive control system of the permanent magnet synchronous motor of the numerical control machine is a speed control system of the permanent magnet synchronous motor. The speed control system of the permanent magnet synchronous motor and the speed control method of the permanent magnet synchronous motor including the direct torque control method of the permanent magnet synchronous motor provided by the invention can be used for the drive control of the permanent magnet synchronous motor of a numerical control machine tool and can also be used for other application occasions of the permanent magnet synchronous motor.
In addition to the technical features described in the specification, other technical features related to the invention are the conventional technical skill which is mastered by a person skilled in the art. For example, the q-axis current controller and the d-axis current controller adopt PI controllers for control and selection of controller parameters, the PI speed controller for selection of control parameters, the position and speed detection module uses a rotary transformer or a photoelectric encoder for detection of the rotation angle and the rotation speed of the rotor of the permanent magnet synchronous motor, and the Clarke transformation module, the Park inverse transformation module, the SVPWM module, and the transformation method and the application method of the three-phase inverter, etc., all of which are conventional techniques grasped by those skilled in the art.