28.01.2013 Views

Adaptative high-gain extended Kalman filter and applications

Adaptative high-gain extended Kalman filter and applications

Adaptative high-gain extended Kalman filter and applications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tel-00559107, version 1 - 24 Jan 2011<br />

int DCmachine bloc ending ( s c i c o s b l o c k ∗ block , int f l a g )<br />

{return 0;}<br />

C.3 AEKF Computational Functions C Code<br />

C.3 AEKF Computational Functions C Code<br />

In the following code, we used the notation:<br />

− the array Ab[.] is composed of the elements of the matrix A(u)+b ∗ (x, u),<br />

− the variables of the form Pij are the elements of the matrix P ,<br />

− the tuning matrices of the EKF are set to r = 1 <strong>and</strong> Q = diag({q1,q2,q3}).<br />

Those two matrices are organized as follows:<br />

⎛<br />

Ab[0] Ab[3] 0<br />

⎞<br />

⎝ Ab[1] Ab[4] Ab[7] ⎠ <strong>and</strong><br />

Ab[2] Ab[5] Ab[8]<br />

⎛<br />

⎝<br />

P 11 P 21 P 31<br />

P 21 P 22 P 23<br />

P 31 P 23 P 33<br />

function name AEKF number of zero crossing<br />

surfaces<br />

0<br />

implicit n initial discrete state []<br />

input port size 3 real parameter vector []<br />

output port size 4 integer parameter vector<br />

[]<br />

input event port size [] initial firing vector []<br />

output event port size [] direct feed through y<br />

initial continuous state ⊛ time dependence y<br />

Table C.2: Arguments of the Main Function.<br />

⊛ =[I(0); ωr(0); Tl(0); P (0); θ(0)], initial state is a dim 10 vector.<br />

#include <br />

#include <br />

#include <br />

/∗ i n p u t = [V;Y; I ( t ) ] ∗/<br />

void AEKF( s c i c o s b l o c k ∗ xblock , int f l a g )<br />

{<br />

int n=3;<br />

int N=n ∗( n+1) / 2 ;<br />

if ( f l a g ==4)<br />

{/∗ INITIALISATION ∗/<br />

/∗ change o f v a r i a b l e s from o r i g i n a l c o o r d i n a t e s −> normal ..<br />

form c o o r d i n a t e s ∗/<br />

157<br />

⎞<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!