Kalman Filter for State Estimation

In summary, the conversation revolves around the development and implementation of a Kalman Filter for estimating the State of Discharge (SOD) of a battery during the discharging process. The filter is using a Linearized Discrete Time Kalman Filter and involves various codes, including a coefficient for relating measurements and a Kalman gain computation. There is a discussion about the need for tuning the parameters Q and R, which may not be constant due to the non-linear nature of the system. The conversation also includes a request for help and suggestions on how to improve the filter's performance, as it has shown some unexpected behavior in the simulation.
  • #1
tommyhakinen
36
0
Hi,

I am not sure if this is the right forum to post this. I am working on a Kalman Filter for battery state of discharge estimation during discharging process. I am using a Linearized Discrete Time Kalman Filter to estimate the State of Discharge/SOD (how much % of charge has been taken away) of a battery. Below are some of the codes.

Coefficient which relates the measurement (on most books it is a matrix, but since I am only having 1 state variable, it is a coefficient)
Hk=c1+2*c2*SOD+3*c3*pow(SOD,2)+4*c4*pow(SOD,3)+5*c5*pow(SOD,4)+6*c6*pow(SOD,5)+7*c7*pow(SOD,6)+8*c8*pow(SOD,7)+9*c9*pow(SOD,8)+10*c10*pow(SOD,9);

c1-c10 are the battery model coefficients to fit the experimental data well.

Kalman gain computation
Kk = (pkmin*Hk)/(Hk*pkmin*Hk+R);

Correction Updates
zk = uk - Hk*xkmin;
xkplus = xkmin + Kk*zk;


SOD = SOD + xkplus;
pkplus=(1-Kk*Hk)*pkmin*(1-Kk*Hk)+Kk*R*Kk;


Prediction Updates for the next iteration
Ak = 1; //it is the transition coefficient
xkmin = Ak*xkplus;
pkmin = Ak*pkplus*Ak + Q
;

The idea is to get measurement of the battery terminal voltage to estimates the state of discharge.
The state of the system xkmin is the change in SOD. uk is the change of battery terminal voltage from the actual measurement. R is measurement noise covariance (assumed to be 1). Q is process noise covariance (assumed to be 0.5).

My problem is in order to get the filter to work at its best, both Q and R must not be constant. This is due to the fact that the system is non-linear system which is linearized and both R and Q may be changing with each time step. I have read some research paper on how to do "tuning" of these two parameters, but always ended up with unsuitable approach. If anyone here have experience with Kalman Filter, your help and suggestions would be really appreciated. Thank you in advanced.
 
Physics news on Phys.org
  • #2
This is the MATLAB m-file of the Kalman Filter and the measurement data. I have a good smooth curve but at some point the curve swing out of quite far from the actual values. I am wondering what has cause such behavior. Anyone has experience on this, could you give me some suggestions or idea of what could have caused this. The filter is implemented in Labview but I thought it might not be common to have labview, so I converted it to MATLAB m-file. The picture is actually taken from the simulation in Labview. Thank you in advance.
 

Attachments

  • data.zip
    106 KB · Views: 193

1. What is a Kalman Filter and what does it do?

The Kalman Filter is a mathematical algorithm used for state estimation. It combines predictions from a mathematical model with real-world measurements to produce more accurate and reliable estimates of the system's state.

2. How does a Kalman Filter work?

The Kalman Filter works by using a prediction step and a correction step. In the prediction step, the filter uses the system's mathematical model to predict the current state. In the correction step, it combines this prediction with real-world measurements to produce a more accurate estimate.

3. What types of systems can be modeled and estimated using a Kalman Filter?

A Kalman Filter can be used to estimate the state of any system that can be described by a mathematical model, such as physical systems, financial models, and control systems.

4. How accurate is a Kalman Filter?

The accuracy of a Kalman Filter depends on the accuracy of the mathematical model and the quality of the measurements used. In ideal conditions, a Kalman Filter can produce highly accurate estimates of the system's state.

5. What are the advantages of using a Kalman Filter for state estimation?

One of the main advantages of using a Kalman Filter is its ability to incorporate both predictions and measurements, producing more accurate estimates than using either one alone. It is also a versatile and widely used algorithm that can be applied to various systems and applications.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
741
Replies
6
Views
2K
  • General Engineering
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Replies
3
Views
3K
Replies
24
Views
10K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
2K
  • Electrical Engineering
Replies
15
Views
3K
Back
Top