You are on page 1of 5

OCTOBER 14, 2020

Statistical Signal Processing and


Estimation Theory
Lab 1 Report

Kalman Filter

Presented by:

 Ezgi Koçak
 Abdelrahman Genidy
Contents

Objective..........................................................................................................................................................2
System Modelling............................................................................................................................................2
Kalman Filter....................................................................................................................................................4
Simulations......................................................................................................................................................4
Appendix..........................................................................................................................................................4

1
Objective

This lab 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. 

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

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

 zero-mean square wave.


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

2
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 )

System Response

3
Input Voltage

Kalman Filter

Simulations

Appendix

1. Inputvoltage

o function U = inputvoltage(D,A,Delta,Ts)

t = 0:Ts:D;
u = A/2*square(t*2*pi/Delta);
U = u.';
End

2. Simulate

o function [Y,X] = simulate(U,G,T,Ts,L,x1)

A = [0 1;0 -1/T];
B = [0 ;G/T];
C = [1 0];

[Ad, Bd, Cd, ~]= c2dm(A,B,C,0,Ts,'zoh');

X(1,:) = x1;

for i = 1:(size(U,1)-1)
X_new = Ad *(X(i,:).') + Bd * U(i,1);
X(i+1,:) = X_new.';
end

Y = X(:,1);
Y = round(Y*L/2/pi)*2*pi/L;

end

You might also like