Predicting PT1 output data with Kalman Filter without knowing K and T of the PT1
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I implemented Kalman Filter to predict some measurement data.
Measurement data was created by feeding a step function with various steps through a PT1. Then I put some random noise on the PT1 output data to simulate measurement noise.
The prediction was made based on the step input and the state space PT1 model. I provided initial values for T_k and K_k (index indicated that those are parameters used in the Kalman Filter) for the PT1 model in the Kalman Filter.
Whenever I change T and K of the original PT1 system and the initial T_k and K_k differ from those, the output of the Kalman Filter is not able to predict the model properly anymore and the model difference can only be "repaired" by adjusting T_k and K_k manually to the actual T and K, which will not be known in future usages.
The code below shows the Kalman Filter applied:
% u: step input vector
% t: time vector
% F: prediciton matrix
% B: control matrix
% P: Covariance of the states, here P = 1
% H: sensor matrix, here H = 1
% R: Sensor noise, here R = 1
% z: sensor mean, here z = 0
% x(1) is initialized with the first measurment point of the noisy PT1 data
for k = 1:length(u)-1
dt = t(k+1)-t(k); % t: time vector
F = (T_K/dt)/(1+T_K/dt);
B = K_K/(1+T_K/dt);
x(k+1) = F*x(k)+B*u(k+1); % State prediction, here: state space representation of PT1
P = F*P*F'; % Covariance prediction
Kal = P*H'*(H*P*H'+R)^(-1); % Kalman Gain
x(k+1) = x(k+1)+Kal*(z-H*x(k+1)); % State correction
P = P - Kal*H*P; % Covariance Correction
end
How can I alter my Kalman Filter to be able to make a proper prediciton of my PT1 without knowing the real T and K?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur State-Space Control Design and Estimation dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!