You are on page 1of 11

STATES 2020 M1 EPICO GROUP

ÉCOLE CENTRALE DE NANTES


Statistical Signal Processing and Estimation Theory

Master1 EPICO Group


Lab Work - Kalman Filter

Report due 14/12/2020


Instructor:
Eric Le CHARPANTIER

Group Members:
Ezgi KOÇAK
Abdelrahman GENIDY

1
STATES 2020 M1 EPICO GROUP

Table of Contents

1 Objective:..........................................................................................................................................................3
2 System Modelling:............................................................................................................................................3
3.1 Kalman Filter Application........................................................................................................................5
3.1.1 Markov Model.....................................................................................................................................5
3.1.2 Modeling the quantization error as a uniform random variable....................................................5
3.1.3 Initialization of the prior information and a proposal for its variance ( X 1/0 and P 1/0 ¿.........5
3.1.4 Kalman Filter and Algorithm............................................................................................................6
3.2 Stationary Kalman Filter Application......................................................................................................7
3.3 Filters Comparison....................................................................................................................................7
4. Conclusion......................................................................................................................................................10

2
STATES 2020 M1 EPICO GROUP

1 Objective:

This laboratory aims to design a Kalman filter that provides estimates of some unknown variables - parameters
- of DC motor given the measurements observed over time. The Kalman filter considers the DC motor
mathematical model. The model will start from a continuous state space into a discrete state space form. Inputs of
the system are the armature voltage, and the output of the system is the estimated speed. Kalman filter is used to
estimate the speed without noise interference.

2 System Modelling:

A DC motor is considered as a case study. We created continuous time state space model. For this,
we have considered the state space model of dc motor which are given below.

 With the state vector x(t) = (Ω(t)


θ(t)
)
 θ ( t ) is the angular position of the rotor
 Ω(t ) is the angular velocity (Ω(t) = θ(t ˙ ))
 G = 50 rad.s −1 .V −1
 T = 20 ms

Afterwards, that continuous-time model is sampled using the zero-order-hold method (“zoh”).

The angular position of the rotor θ(t) is measured with an incremental encoder such that the
observation y n provided by the incremental encoder is a quantization of the actual angular positionθn .
y n = round (θn *L/2/pi) *2*pi/L

precision L = 512 angles per lap

3
STATES 2020 M1 EPICO GROUP

The DC motor is driven by the input voltage u(t). The input voltage u(t) is characterized with:

 zero-mean square wave


 period ∆ = 100 ms
 peak-to-peak amplitude A = 0.1 V
 sampled with sample time Ts = 1 ms

A MATLAB function (inputvoltage) is created to provide this sampled input for a duration D; the
output of this function - U - is a column vector which contains the sampled input voltage.

Another MATLAB function (simulate) is created to provide the evolution of the output y n, and the
evolution of the state vector x(t).

These two functions are simulated given x1 (the initial state vector) = (00).
The I/O signals are sampled with the given sampling time 1 ms. Also, the input signal is constant between the
two sampling times. The aim of this simulation was testing the discretized system referring the given data:
G=50 rad . s .V and T =20 ms .
−1 −1

The simulation figures are obtained as follows:

4
STATES 2020 M1 EPICO GROUP

Figure 1: System Response Figure 2: Input Voltage

3 Kalman Filter:

3.1 Kalman Filter Application

3.1.1 Markov Model

5
STATES 2020 M1 EPICO GROUP

In this part of the laboratory, the Markov model of the system is defined with the input un and the
output y n. The important point of this section was to consider the quantization noise of the incremental
encoder – which is defined as w nwith Var ( w n )=r and the modeling errors since the assumed actual
input is defined as un + v n. The term v nis used to define de white noise with Var ( v n ) =q . Hence, it is also
independent from the quantization noise. Therefore, the model is obtained as the following:

3.1.2 Modeling the quantization error as a uniform random variable

To propose a value for the variance of w n it is taken as a uniform random variable. As studied in the
course content, the variance of a uniform random variable is nothing but the ratio of the square of the
step size to 12.
In the laboratory model the quantization step size is related to the incremental encoders precision
which is given as:
L=512 angles per lap

Therefore, the step size s . s .=L/2 π


Hence the variance is proposed as:

( s . s . )2 2
Var ( w n )=r = =L /(3 ¿ π 2 )
12

3.1.3 Initialization of the prior information and a proposal for its variance ( ^
X 1 /0 and P1 /0 ¿

The prior information ^ X 1 /0 is also a 2x1 column vector whose upper minor denotes the prior
information of the angular position and the second minor is the prior information of its velocity.
Knowing that the motor is initially stopped, the prior information pf the velocity is zero, however,
there is no information about its angular position. To be able to get accurate plots, the ^
X 1 /0 ( 1,1 )is taken
as 0.01 which is close enough to zero again. Therefore,

^
[ ]
X 1 /0 = 0,01
0

Assuming a uniform distribution over the interval of the angular position of the motor arm [-π, π], the:

6
STATES 2020 M1 EPICO GROUP

[ ][ ]
2 2
(2 π ) / 12 0 (π ) /3 0
Var [ ^
X 1 /0 ] =P 1/ 0= =
0 0 0 0

3.1.4 Kalman Filter and Algorithm

In parts 3.1.2 and 3.1.3 the model is defined, and the initialization is completed. In this part, the loop
for n≥1 is computed on MATLAB using the discretized model and proposed parameters giving the
following result:

Loop for n≥1:

Figure 3 Kalman Filter Estimation

3.2 Stationary Kalman Filter Application

To implement the constant gain Kalman filter, the same initialization steps of the time-varying filter
are followed, however, the constant gain is obtained only once using the function dlqe. Moreover, the

7
STATES 2020 M1 EPICO GROUP

loop for n≥1 is computed on MATLAB using the same discretized model and proposed parameters for
the previous filter, giving the following result:

Loop for n≥1:

Figure 4: Stationary Kalman Filter Estimation

3.3 Filters Comparison

The estimation of the position and the velocity given by both filters is compared for different values of
q using the initialization ˆθ1 /0 = θ1 ± 0.05 in the following cases:

 the model of the system is perfect:

8
STATES 2020 M1 EPICO GROUP

Figures 5,6 and 7 : Plots obtained for q={1x10^-5, 0.1 ,1} for the system model is perfect

9
STATES 2020 M1 EPICO GROUP

 the model of the system is rough:

Figures 8,9 and 10: Plots obtained for q={1x10^-5, 0.1 ,1} for the system model is rough

10
STATES 2020 M1 EPICO GROUP

4. Conclusion

In this Laboratory work, given linear system of a DC motor it tested, discretized and observed with the
implementation of Kalman fiter and Stationary Kalman filter. Then both filters are compared under
different models: perfect and rough for different values of the variance of the white noise, which
introduces to the system as an addition of the input.
Comparing figures 5 with 8, 6 with 8 and 7 with10 it can be said that the plots of both filters are almost
identical for perfect and rough models in same q values, which illustrates that the performance of both
filters is independent on the model of the system. However, the filter’s performance is affected by the
variance q of v[n]. For both perfect and rough models, it is clear that with the increase of the variance
of the white noise the deviation from the model increases. Therefore, the closer the value of the q to
zero, the estimations of the both filters will have a better result.

11

You might also like