• 沒有找到結果。

Chapter 2 Modeling and Parameters Measurement of A Permanent

2.2. L d and L q measurement

The d-axis and q-axis inductance, Ld and Lq,of a PMSM in which the magnets are buried in the rotor as shown in Fig. 2.3 can be measured with a single phase ac voltage source, see the connection below.

The applied voltage and current are recorded to calculate the inductance. The d-q axis inductance can be calculated as the equation shown below by varying the applied voltage from 0 to 100 volts approximately:

(2.19)

where is is the measured current and vs is the measured voltage.

variable ac voltage source

voltage meter

current meter

r

s

r

s

r

s

L

a

L

a

L

a

Fig. 2.5 Ld and Lq

measurement.

( )

2

2

3 1 2 60 2

or 1 s s

s q

d

v s r i

L i

L

⎟ −

⎜ ⎞

= ⎛

π

Chapter 3

Kalman Filter Estimator for A PMSM

y(k)

z-1

) ˆ k( z-1

y

+ +

+

v(k) w(k)

K

x(k)

PMSM

B(k) C(k)

A(k)

+ +

u(k)

C(K)

_

e(k)

+

+ +

+

A(k) B(k)

Fig. 3.1 Structure of EKF.

Fig. 3.1 shows the basic block diagram of the extended Kalman filter (EKF) [9]. It shows that the EKF is based on the state equations of a PMSM. The upper block shows the PMSM state equations which looks like the lower block except the Kalman gain K and noise vectors v(k) and w(k). The actual output y(k) and estimated output

y)

(k)would be the same with the same input u(k) neglecting v(k) and w(k) which results e(k) to zero. In fact, this would not happen in reality and e(k) is not zero due to v(k) and w(k) which represent system and measurement noises respectively. In the experiment, u(k) and y(k) are voltage commands and motor phase currents decoupled on stationary frame respectively, see Fig. 1.2. The states

vector x(k) is defined as [ ,

i

αs

i

sβ, θ , ω ] in which the unknown states, rotor position r θ r and speed ω , are to be estimated according to the known currents and . The Kalman gain K will try to minimize e(k) to estimate the speeds and positions with the covariance matrices P, Q, R of the system state vector, system noise vector, and measurement noise vector respectively.

α

i

s

i

sβ

3.1. Kalman filter on rotor reference frame for a PMSM

β q

ω

r

d

θ

r

α

Fig. 3.1 Rotor Reference Frame.

Rewrite (2.18) as below

. (3.1)

The equation above is derived from an arbitrary d-q reference frame. To apply EKF algorithm, (3.1) needs to be present in differential equations which the state variables should be defined first. Let the state variables be , where and are stator current projecting to arbitrary d-q frame,

t current referring to

i

t

i

y = [

α β

] i

α

i

β

αβ

reference frame. The input is , where and are stator input voltage referring to

t

There are two different coordinates, d-q and

αβ

frames. It’s also necessary to know the relation between these two frames:

. (3.2)

State equation forms:

Bu

Represent (3.1) in state equations:

⎥ ⎥

Rewriting the differential equations (3.5) and (3.6) in the form

Bu Ax dt x

d

= + ,

Cx y

= . and applying (3.2) in (3.7) yields

⎥⎥

The output equation is

. (3.9)

Now the complete state equations are

⎥⎥

3.2. Kalman filter on stator reference frame for a PMSM

Fig. 3.2 Stator Reference Frame.

In the arbitrary rotating frame, as shown in Fig. 2.1,

θ

is set to 90 electrical degrees to get a fixed coordinate

αβ

frame. Axis q and axis d are rotor quadrant and direct axes respectively. The (2.5) is presented below for quick reference ,

0

. (3.16)

Rewrite (3.14), we get

βα

In (3.20), the

ω

rterm comes from the differentiation of (3.19) Represent(3.20)as below,

, (3.21) Transfer (3.21) and (3.22) into state equation form:

s

s

Another differential equation form,

x f ( ) x Bu

dt

d = + ,

is introduced with state vector

,

input and output state variables , then the complete state equations are

t

These matrices will be discussed in detail in chapter 4.

3.3. Selection of the time-domain machine model

Comparing (3.10), (3.11), and (3.12) with (3.25), (3.26), and (3.27) we can observe some differences. It is possible to have EKF implementations using time-domain machine models expressed in the stationary or rotor reference frame. Obviously the selection of the reference frame has a great effect for the execution time in real time implementation using a DSP. In (3.26) and (3.27), the elements of these matrices are constants which can make coding easier and reduce calculation time needed, especially in view of the computational intensity of the EKF.

As discussed above, the EKF model would be based on (3.25), (3.26) and (3.27) derived from the stationary frame for the purpose of faster calculation.

Chapter 4

Simulations of EKF

The Matlab/simulink has been used throughout all the analysis, design and simulations.

It’s easier to simulate the EKF using Matlab language files (M files) instead of transfer functions in Matlab/simulink. Besides, the advantage of the M file is that it is easily converted into an assembly program. So the PMSM models of stator reference frame are adopted for the S-function and so are the EKF models.

As mentioned in section 3.2, the state vector, , have to be estimated.

The input is defined as and the output vector is . The state variables form of the equations will be obtained by assuming that the rotor inertia has an infinite value (thus the derivative of the rotor speed is negligible compared with the other system variables, and any mechanical load parameter, as well as the load torque,

t

ω =

. Although in practice the rotor inertia is not infinite, the required correction is performed by the Kalman filter algorithm. Thus the following state-variable equation is obtained:

( ) x Bu f

dt x

d = +

(4.1)

and the output vector is

Cx

Furthermore, the input matrix B is defined as

⎥ ⎥

and the output transformation matrix is

. (4.5)

As mentioned in section 3.3, in contrast to the transformation matrix of the model expressed in the rotor reference frame, see (3.10), the matrix as shown in (4.4) and (4.5) contains only constant elements, and it results in simplifications in the implementation of the EKF. The system described by (4.3) is a non-linear system. It is this non-linearity which ensures that the EKF has to be used, and not the conventional, linearized Kalman filter. It should be noted that the time-discrete model is now put into the following form where the noise vectors have also been added to obtain a system model required by the EKF:

)

The motor behavior with real position feedback and the EKF will be illustrated in simulation and experiments.

4.1. The steps of the discretized EKF algorithm on stator reference frame

The steps of the discretized EKF algorithm are as follows:

Step 1: Initialization of the state vector and covariance matrices

The initial values of the state vector x0=x(t0) and noise covariance matrices Q0 and R0

are set, together with the starting value of the state covariance matrix P0. It is important to note that in general, if incorrect initial values are used, the EKF algorithm will not converge to the correct values. For the initial position of the PMSM,

θ

r, which can be obtained using the method of aligning the rotor by applying stator current at “as” axis, then the rotor will be aligned at “as” (or

α

) axis. For a brushless DC motor, the rotor initial position can be obtained by examining the stator currents applied by a certain duty cycle of the output phase voltages, this method will be discussed in detail in chapter 4.

Step 2: Prediction of the state vector

Prediction of the state vector at sampling time (k+1) from the input u(k), the state vector at previous sampling time x(k), by using f and B, is obtained by performing

] [

] [

) ( ) 1 ( ) 1

(

k |k x k x k | k T f (k | k) Bu(k) x(k) T f (k) Bu(k)

x

+ = + = + x + = + x + . (4.11)

On the right side equation, the simplified notation has been used, and a simple rectangular integration technique is used by using the previous state estimate x(k|k), and also the mean voltage vector u(k) which is applied to the motor in the period

t

kto

t

k+1.

Step 3: Covariance estimation of prediction

The covariance matrix of prediction is estimated as

Q

where F is the gradient matrix:

x

Step 4: Kalman filter gain computation

. (4.15)

Step 5: State vector estimation

The state vector estimation at time (k+1) is performed through the feedback correction scheme, which makes use of the actual measured quantities (y):

x

ˆ(

k

+1

|k

)=

x

(

k

+1

|k

)+

k

(

k

+1)[

y

(

k

+1)

-Cx

(

k

+1

|k

)]. (4.16)

Step 6: Covariance matrix of estimation error

. (4.17)

It should be noted that this scheme requires the measurement of the stator voltages and currents. In a PWM voltage-source inverter, it is possible to reconstruct the stator voltage according to the DC bus voltage and switching states of the power switches. If so, we need a voltage sensor to detect the DC bus voltage and connect it to A/D interface of the DSP. As we know, PWM type inverter can be a noisy source which means you will pick up noises when you measure the motor phase voltages. To avoid the noises, using some filtering is necessary

but it will lead to another problem, phase lag, and this would cause some inaccuracies and convergence problem during the calculations of EKF algorithm. Another possible way is to use stator voltage references instead of the real phase voltages, thus we can get rid of the voltage sensor and simply the software and hardware.

4.2. Matlab/simulink simulation of the EKF

Fig. 4.1 PMSM with EKF simulink model.

4.2.1. Description of the function blocks

In Fig. 4.1, the descriptions of the blocks are as below:

dq2abc: Transform d-q current references to abc current references.

INPUT:

¾ iqref: q-axis current reference coming from PI speed regulator.

¾ idref: d-axis current reference, set to 0.

¾ ioref: Set to 0.

¾ thetae: Rotor position, it is needed for coordinates transformation.

OUTPUT:

¾ iabcr: Motor three phase current references.

PWM inv 2: Current regulator.

INPUT:

¾ iref: Three phase currents reference input.

¾ iabc: Three phase currents feedback coming from the motor.

OUTPUT:

¾ va,vb,vc: Motor three phase voltages.

Stator reference: Motor model in stator reference (alpha-beta),which is based on s functions.

INPUT:

¾ va,vb,vc: Motor three phase voltages input.

¾ Friction: Friction input coming from mechanical parts like bearings and loads.

OUTPUT:

¾ iabc: Motor three phase current outputs which can be used as monitor and feedback.

¾ w_e: Motor speed in electric degrees.

¾ theta_e: Rotor position in electric degrees.

¾ Te: Motor output torque.

EKM: Extended Kalman filter model.

INPUT :

¾ va,vb,vc: The inputs comes from the motor phase voltages.

¾ ia,ib,ic: The inputs comes from the motor phase currents.

OUTPUT:

¾ i_alpha_e: Estimated alpha axis current output from EKM.

¾ i_beta_e: Estimated beta axis current output from EKM.

¾ w_e: Estimated rotor speed in electric degrees from EKM.

¾ theta_e: Estimated rotor position in electric degrees from EKM.

¾ torque_es: Estimated torque from EKM.

4.2.2. Description of the motor simulink model in stator reference frame

Fig. 4.2 A PMSM Simulink model in stator reference frame.

Fig. 4.2 shows the block diagram of PMSM in stator reference frame. The inputs are the motor three phase voltages like the real motor. The outputs are three phase currents, motor speed and rotor position. It’s easy to simulate motor behavior using matrix Matlab/simulink S function. According to (3.23) and (3.24), the state equations for simulation in S function is shown below:

⎥ ⎥

where T means torque, is the system inertia. The output torque equation is presented as below:

J

)

The motor model is based in the stator reference frame, so we need to convert and to and . The transfer matrix:

Apply (4.20) to (4.19), it yields

)

The equation (4.21) will be used to calculate the output torque in the simulation. The output states variables:

⎥ ⎥

We will use (4.18) and (4.22) in the file pmstator.m

pmstator1.m file

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Motor model in stator reference frame

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [sys,x0,str,ts]=pmstator(t,x,u,flag);

Rs=5;

switch flag case 0,

sizes=simsizes;

sizes.NumDiscStates=0;

sizes.NumOutputs=4;

sizes.NumInputs=4;

sizes.DirFeedthrough=0;

sizes.NumSampleTimes=1;

str=[];

ts=[0 0];

x0=[0; 0; 0; 0];

sys =simsizes(sizes);

case 1,

U=[u(1);u(2);u(3)];

A=[-Rs/Ld 0 Fm/Ld*sin(x(4)) 0;

0 -Rs/Lq -Fm/Lq*cos(x(4)) 0;

0 0 0 0;

0 0 1 0];

B=[ 1/Ld 0 0;

0 1/Lq 0;

0 0 1/(J+u(4));

0 0 0 ];

sys=A*x+B*U;

case 3, sys=C*x;

case 4, sys=[];

case 9, sys=[];

end

4.2.3. Description of the EKF simulink model in stator reference frame

Fig. 4.3 The EKF model on stator reference frame.

Examining Fig. 4.3 finds the structure is quite similar to the model in Fig. 4.2, the input v_alpha, v_beta and the output i_aplha, i_beta, w_e, theta are the same with Fig. 4.2. The major differences are EKF needs currents feedback to calculate Kalman gain and there are white noises inputs injected to the voltages v_alpha, v_beta and currents i_alpha, i_beta.

The white noise is appeared as Fig. 4.4.

Fig. 4.4 White noises.

According to section 3.1, we can compose Matlab language as below:

EKM6a.m file

function [sys,x0,str,ts]=EKM6a(t,x,u,flag,P,Q,R);

%global Rs Ld Lq Fm v_alpha v_beta i_alpha i_beta;

%global P Q R fid;

%global out fit;

Rs=5;

Ld=10e-3;

Lq=10e-3;

Fm=0.175;

T=5e-4;

%i=0;

Bd=[1/Ld 0;

0 1/Lq;

0 0;

0 0];

H=[1 0 0 0;

0 1 0 0];

switch flag case 0, %ekmini;

sizes=simsizes;

sizes.NumContStates=0;

sizes.NumDiscStates=4;

sizes.NumOutputs=4;

sizes.NumInputs=4;

sizes.DirFeedthrough=0;

sizes.NumSampleTimes=1;

str=[];

ts=[0.0005 0];

x0=[0; 0; 0; 0];

sys = simsizes(sizes);

case 2,

% Step 1:Initialization of the state vector and covariance matrices

Uk=[u(1);u(2)];

Y=[u(3);u(4)];

% Step 2:Prediction of the state vector

fx=[-Rs/Ld*x(1)+Fm/Ld*x(3)*sin(x(4)) ;

-Rs/Lq*x(2)-Fm/Lq*x(3)*cos(x(4)) ;

0 ; x(3) ];

F=[-Rs/Ld 0 Fm/Ld*sin(x(4)) Fm/Ld*x(3)*cos(x(4));

0 -Rs/Lq -Fm/Lq*cos(x(4)) Fm/Lq*x(3)*sin(x(4));

0 0 0 0;

0 0 1 0];

x1=x+T*(fx+Bd*Uk);

% Step 3: Covariance estimation of prediction

P1=P+T*(F*P+P*F')+Q; % P1 is 4x4

% Step 4: Kalman filter gain computation

K1=P1*H'*inv(H*P1*H'+R);% K1 is 4x2

% Step 5: State vector estimation h=[x1(1);x1(2)];

sys=x1+K1*(Y-h);

% Step 6: Covariance matrix of estimation error

P=P1-K1*H*P1;

case 3, sys=x;

case 4,

sys=(round(t/T)+1)*T;

%sys=[];

case 9, sys=[];

end

4.3. Simulation results

Position error (deg)

Speed error (rad/s) Actual position

(deg)

Estimated position (deg)

Actual speed (rad/s)

Estimated speed (rad/s)

Fig. 4.5 Speed reference = 200 rad/s with EKF open.

Position error (deg)

Speed error (rad/s) Actual position

(deg)

Estimated position (deg)

Actual speed (rad/s)

Estimated speed (rad/s)

Fig. 4.6 Speed reference = 200 rad/s with EKF closed.

Actual speed (rad/s)

Estimated speed (rad/s)

Actual position (deg)

Estimated position (deg)

Position error (deg)

Speed error (rad/s)

Fig. 4.7 Speed reference = 100 rad/s with EKF open.

Actual speed (rad/s)

Estimated speed (rad/s)

Actual position (deg)

Estimated position (deg)

Position error (deg)

Speed error (rad/s)

Fig. 4.8 Speed reference = 100 rad/s with EKF closed.

Actual speed (rad/s)

Estimated speed (rad/s)

Actual position (deg)

Estimated position (deg)

Position error (rad)

Speed error (rad/s)

Fig. 4.9 Speed reference = 50 rad/s with EKF open.

Actual speed (rad/s)

Estimated speed (rad/s)

Actual position (deg)

Estimated position (deg)

Position error (rad)

Speed error (rad/s)

Fig. 4.10 Speed reference = 50 rad/s with EKF closed.

Fig. 4.5 to Fig. 4.10 show the results with EKF open and closed where the input commands come form 50 to 200 rad/s with a ramp of 200 rad/s at the beginning. The speeds and rotor positions can be easily estimated with EKF open for speed references from 50 to 200 rad/s. With EKF closed, which means the encoder feedbacks are replaced with the estimated speeds and positions by EKF, the EKF failed at a reference command of 200 rad/s.

Another speed reference is defined as below:

Rad/s

Sec Fig. 4.11 Speed reference.

Rad/s

Rad

Sec Fig. 4.12 Speed response and rotor position without load.

The speed reference ramps up at a slope of 200 rad/s, and it finally reaches to 50 rad/s. The motor behavior between field-oriented control (FOC) with and without sensor (EKF) are illustrated below. All the response comes out of the same PI controller which means the

proportional gain and integral gain are the same in order to see the differences if using the EKF instead. Fig. 4.12 is the speed and rotor position responses of FOC without load using

Rad/s

Rad

Sec Fig. 4.13 Speed response and rotor position with load 0.1N-m at t=1.5 seconds.

N-m

Sec Fig. 4.14 Torque response with load 0.1Nm at t=1.5 seconds.

position sensor. We can see the response is almost the same with the reference as shown in Fig 4.12. Next, a little bit loads is applied to the motor at 1.5 seconds which causes the speed response to change, as shown in Fig. 4.13. Actually the speed response can be better but the PI gain was adjusted only for the EKF instead of the FOC in the purpose of stability, so the PI gain is not suitable for the FOC here. As mentioned, the PI gains remain unchanged throughout the entire simulation. The torque response is shown in Fig. 4.14. We can see the applied torque is 0.1 Nm at 1.5 seconds. Fig. 4.15 is the current response.

A

Sec Fig. 4.15 Current response with load of 1.5 N-m at t = 1.5 seconds.

command

Rad/s

Rad

Sec Fig. 4.16 Speed response and rotor position using EKF.

Next is the motor behavior without position feedback which uses the EKF to calculate the rotor position. Fig. 4.16 is the speed response without any load using EKF. The speed response looks not so good compared to Fig. 4.12. Of course the response is poor in EKF, because the actual position sensor was not applied. The EKF will execute and output rotor position and speed every 500 us (2 KHz), because the TMS320LF2407 fixed-point DSP is adopted for the experiment, and a lot of matrices manipulation will be involved for EKF theory in real time. 2 KHz execution rate is acceptable for the DSP. The Kalman gain K will be adapted constantly, see below:

t= 0.000000 second,

K =

.

⎥⎥

⎥⎥

⎢⎢

⎢⎢

0.000000 0.000000

0.828697

-0.000000

0.487555 0.000000

0.000000 0.485420

t= 2.000000 seconds,

t= 3.000000 seconds,

K =

.

The initial covariant matrices for the simulations are :

⎥⎥

We can see Kalman gain changes all the time, especially the gain for rotor position and speed.

Fig. 4.17 and 4.18 are current and torque response of the EKF without loads.

A

Sec Fig. 4.17 Current response using EKF in no load condition.

N-m

Sec Fig. 4.18 Torque response without load using EKF.

Fig. 4.19 shows the speed and accumulated position errors compared with the actual speed and rotor position. The speed error will decade to zero and the rotor accumulated position error no longer increases after 1.5 seconds. The accumulated position error is about

2 π

or

6.24 radian. Fig. 4.20 shows that a light load at 1.5 seconds was applied which results the speed to oscillate a little bit compared with the Fig. 4.16. Fig. 4.21, 4.22 and 4.23 shows the same phenomenon due to a light load applied at 1.5 seconds.

Rad

Rad/s

Sec Fig. 4.19 Rotor position accumulated error and speed error without load.

command Rad/s

Rad

Sec Fig. 4.20 Speed response and rotor position using EKF with load 0.1 N-m at t=1.5 seconds..

N-m

Sec Fig. 4.21 Torque response using EKF with load 0.1 N-m at t=1.5 seconds.

A

Sec Fig. 4.22 Current response using EKF with load 0.1 N-m.

Rad

Rad/s

Sec Fig. 4.23 Rotor position accumulated error and speed error using EKF with load 0.1 N-m.

command

Rad/s

Rad

Sec Fig. 4.24 Speed and rotor position using EKF.

Rad

Rad/s

Sec Fig. 4.25 Rotor position and speed error using EKF.

The speed response is not good as shown in Fig. 4.16 due to the values of the covariance matrices P, Q and R. Another set of matrices which was derived by try and error is selected as below,

The speed response is much better compared with Fig. 4.16 in no load condition as shown in Fig. 4.24.

Chapter 5

Software Implementation of Kalman Filter Estimating Speed and Position

To implement the EKF algorithm in real time estimation by using a fixed-point DSP is not an easy task because there are a lot of numerical calculations involved such as signal conditioning, scaling, quantization noise, precision control, and all these computations must be completed within a very short specified time interval. First the motor parameters like inductances, constant of back EMF and resistances should be known. Next the numerical range of other parameter vectors that are phase currents and voltages, shaft speed and positions should be determined as well to decide the Q format. Then assembly language is adopted for this experiment for the purpose of reducing the calculation time.

5.1. Scaling for variables

Q format must be used to present a non-integer value for a fixed-point DSP using assembly language. For a 1024-pulse encoder with 1 KHz sampling frequency, there are 204 counts every millisecond at 3000 RPM. The minimum Q format that can represent the sampled data is Q8 and its resolution is 1/256 which is better than 1/204. The recommended resolution of the Q format for calculation should better be at least four times of the sampled data, that is, Q10. But ten times of the resolution of the sampled data is preferred for a better precision which is Q11.

A 10-bit A/D conversion is common in a 16-bit DSP or MCU which means the resolution of the A/D conversion is 1/512 for a signed value. From above, the minimum Q format would be Q11 (four times of the resolution).

Another consideration for choosing the Q format is the regulator performances which are the transient response and steady state error. To compromise all those factors discussed above, Q12 is mainly used in the assembly language.

5.1.1. Scaling for current, speed and position

Adjusted

A/D A/D

A

For the PMSM used in the experiment, the phase current is in a range of 5A which is needed to choose the proper Q format for a fixed-point DSP, as shown in Fig. 5.1. The DSP is supplied by 3.3V that means the A/D input voltage range is bounded form 0 to 3.3V and the current transducer has an output of 4V at 5A, so the output voltage from the transducer has to be scaled and shifted to fit the range. After the A/D is done, it has to be converted to Q format and a Q12 is chosen for the experiment. See below for the calculation and its error.

19.93dec=5102.08Q12.

Scaled current at 5 A= 411adjusted A/D= 8191Q12=4.999 A.

Error= 5 A- 4.999A= 0.0001A.

5 2.5

-2.5 -5

V

0 1.66

3

0.32 2.33

1

512 0

411

-413 P.U.

Q12

2

8192 923

1 4096

0 -1 -4096

-2

-8192 99

19.93

Fig. 5.1 Current scaling.

Pulses/1.68ms RPM

6.095dec=1561Q8.

Calculated speed at 3000 rpm: 672×1561/256=4097Q12=3000.7 rpm.

Error= Real speed – Calculated speed= 3000-3000.7=-0.7 rpm.

672

0

3000

-3000

P.U. Q12

1 4096

0

-1 -4096

-672

6.095

Fig. 5.3 Speed scaling for a 2000 PPR encoder.

Mechanical angular position of the rotor

Electrical angular

position of the rotor Pulses counted

From above, Q12 format is capable for the fixed-point calculation and most of the other variables use this format as well to simply the software especially in the EKF macro.

5.1.2. Scaling for EKF models

The chosen model is

( )

⎥⎥

⎥⎥

⎥⎥

⎢⎢

⎢⎢

⎢⎢

+

=

r

r r q s q s

r r d s d s

i L L

r i L L

r

x f

ω

θ λ ω

θ λ ω

β α

0

cos sin

. (5.1)

Fig. 5.4 Position scaling of a 4 pole motor for a 2000 PPR encoder.

45mechanical 90electrical

180mechanical 360electrical 2000

135mechanical 270electrical

90mechanical 180electrical 1000

0mechanical 0electrical 0

-45mechanical -90electrical -1000

Replacing the parameters with a real numerical value, Ld

= 12 mH, L

q

= 14 mH, r

s= 3.4 ohm

For the EKF, the integration period T is 0.5 ms, then

( )

Converting the constant values in (5.4) into Q12 format yields

0 12

In similar way,

0 12

. (5.7)

5.1.3. Scaling for covariance matrices and Kalman gain K

The covariance matrices and Kalman gain K are not well known as phase currents, shaft speed and rotor position which have a specific numerical range at beginning. To identify the ranges of those matrices and gain K, the proposed method is to check the simulation results.

According to the simulations results by the simulink, the matrices P, Q, R and gain K are almost less than one except the elements (3, 3) and (4, 4) in P and Q, respectively, which means a Q12 format could cover most of the variable ranges. Below is the matrices P(k) coming from the simulation of (4.12),

⎥⎥

Obviously element P (3, 3) is out of the range for Q12. Another covariance matrices Q and R is presented, respectively, as follows:

⎥⎥

Unlike matrix P (k) which changes with time, the elements of Q and R are constant and thus Q12 format can be applied except for the elements (3, 3) and (4, 4). In the EKF simulation, elements P (3, 3) could be chosen form 50 to 500 or larger and it comprises the addition of Q, as shown in (4.12), so the Q (3, 3) should be in the same format, that is Q5, as P (3, 3). Q (4, 4) uses Q8 format that has a positive range of 127 which can handle the possible values to choose according to the simulation. The Kalman gain K also changes with time, here below shows one of the matrices K which comes from the result of simulink simulation,

⎥⎥

⎥⎥

⎢⎢

⎢⎢

= −

0612 . 0 1729 . 0

7654 . 0 3719 . 0

4875 . 0 0

0 4854

. 0 ) (k

K

. (5.10)

According to the simulations, the elements of K (k) did not change substantially and Q12 can

According to the simulations, the elements of K (k) did not change substantially and Q12 can

相關文件