Adaptive iterative extended Kalman filter algorithm AIEKF estimates SOC VS Extended Kalman estimates SOC

Adaptive iterative extended Kalman filter algorithm (AIEK)

Adaptive Iterative Extended Kalman Filtering Algorithm (AIEK) is a filtering algorithm whose purpose is to gradually adapt to different states and environments through an iterative process, thereby optimizing the filtering effect.

The basic idea of ​​the algorithm is to adaptively adjust the parameters of the filter according to the observed data and the state equation in each step of the iterative process, so as to better fit the distribution of the actual data. Specifically, the algorithm includes the following steps:

Initialization: First, set an initial value for the initial parameters of the filter, these parameters include state transition matrix, measurement matrix, process noise covariance and measurement noise covariance, etc.
Prediction: According to the current state equation and filter parameters, predict the next state and calculate the prediction error.
Correction: Based on the predicted results and the actual observed data, the prediction is corrected to better fit the distribution of the actual data.
Parameter update: According to the correction results, the filter parameters are adaptively adjusted to better fit the data in the next iteration.
The algorithm is self-adaptive and iterative, and can gradually adapt to different states and environments, thereby optimizing the filtering effect. In practical applications, different filter parameter adjustment methods and iteration strategies can be selected according to specific problems to obtain better filtering effects.

Load the working condition data to be identified

load FUDS.mat;       %导入数据
Ut = FUDS.Voltage;   %测量电压
I = FUDS.Current;    %测量电流
cs0=[   1.2761;
       -0.2899;
        0.0365;
       -0.0449;
        0.0095];

Calculation of SOC experimental data

soc_act = nan(1,N);
ocv = nan(1,N);
soc_act(1)=1;
ocv(1)=Ut(1);
for i=2:N
    soc_act(i)=soc_act(i-1)-I(i)/(Qn);
    nihe=[1.936,-7.108,9.204,-4.603,1.33,3.416];
    ocv(i)=polyval(nihe,soc_act(i)); 
end

FFRLS parameter online identification algorithm

[R0,R1,R2,C1,C2] = FFRLS(Ut,I,Qn,nihe,ff,cs0);


% 辨识参数图
t=1:N;

figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,R0,'r.-','LineWidth',1);
legend('R0(Ω)');

figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,R1,'g-.','LineWidth',1);
legend('R1(Ω)');

figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,C1,'b-','LineWidth',1);
legend('C1(F)');

figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,R2,'c--','LineWidth',1);
legend('R2(Ω)');

figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,C2,'m-','LineWidth',1);
legend('C2(F)');

EKF filter algorithm

SOCest_init=0.9;
P0=1e-3;     %状态误差协方差初值
Q=1e-8;      %过程噪声期望值
R=1;      %观测噪声期望值

[SOC_ekf,volt]=EKF(I,Ut,dt,Qn,SOCest_init,N,Q,R,nihe,P0,R0,R1,R2,C1,C2);
error_V_EKF= Ut'-volt;
error_SOC_EKF= soc_act-SOC_ekf;      %滤波处理后的误差


AIEKF filter algorithm

X_aiekf=zeros(3,N);  %定义状态向量x
X_aiekf(:,1)=[0;0;SOCest_init];%状态向量x初值设定
Q=1e-8;
R=1;
P0=0.01*eye(3);%定义协方差
f=0.1;
M=30;           %误差积累值窗口系数
[SOC_aiekf,Um]=AIEKF(I',Ut',X_aiekf,f,M,Q,R,N,P0,R0,R1,R2,C1,C2,Qn,nihe);

error_V_AIEKF= Ut'-Um;
error_SOC_AIEKF= soc_act-SOC_aiekf;      %滤波处理后的误差

Drawing

t=1:N;
figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,Ut,'r',t,volt,'b',t,Um,'g');
legend('端电压真实值','端电压EKF估计值','端电压AIEKF估计值'); 

figure;
set(gcf,'Units','centimeters','Position',[2 2 19.6 8]); 
plot(t,error_V_EKF,'b',t,error_V_AIEKF,'g');
legend('EKF端电压误差','AIEKF端电压误差'); 

% SOC估计结果图
figure
hold on;box on;
plot(SOC_aiekf,'b');%AIEKF
plot(SOC_ekf,'k');  %EKF
plot(soc_act,'r');
legend('AIEKF','EKF','参考值')
xlabel('时间(s)')
ylabel('SOC')
axis([0 12000 0 1])

figure
hold on;box on;
plot(100*error_SOC_EKF,'k');
plot(100*error_SOC_AIEKF,'b');
legend('EKF','AIEKF')
xlabel('时间(s)')
ylabel('SOC误差百分数(%)')
axis([0 12000 -10 15])

Simulation results

Reference SOC curve under FUDS operating conditions
Insert image description here

Reference SOC curve under DST operating conditions
Insert image description here

SOC estimation comparison chart under FUDS operating conditions (EKF and reference value)

Insert image description here
Insert image description here
Insert image description here

Insert image description here

Insert image description here
Insert image description here

Insert image description here

Absolute error curve of SOC estimation under FUDS operating conditions
Insert image description here

Insert image description here

SOC estimation comparison chart under DST conditions (EKF and reference value)

Insert image description here

Insert image description here

Insert image description here

Insert image description here
Insert image description here

Insert image description here

Insert image description here

Absolute error curve of SOC estimation under DST conditions
Insert image description here
Insert image description here

SOC estimation curve under FUDS working conditions (reference value EKF AIEKF)

Insert image description here

Insert image description here
Insert image description here

Insert image description here

Insert image description here

Insert image description here

Insert image description here

Absolute error curves of different algorithms for SOC estimation

Insert image description here
Insert image description here

SOC estimation curve under DST conditions (reference value EKF AIEKF)

Insert image description here

Insert image description here

Insert image description here

Insert image description here

Insert image description here

Insert image description here

Absolute error curves of different algorithms for SOC estimation

Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/m0_37702416/article/details/132793949