Using the Kalman Filter block with multiple inputs u.

30 Ansichten (letzte 30 Tage)
ZACH LOUIS DANIEL
ZACH LOUIS DANIEL am 20 Jul. 2022
Bearbeitet: Christine Li am 22 Jul. 2022
I have state space equations that depend on a B matrix that has 2 columns, corresponding to having 2 inputs to my system, which are in this case two voltage sources. I would like the Kalman filter block to take both of these inputs and produce the full state estimation of the system. I'm encountering issues with the dimensions of the signals though, as the error I'm receiving is that the input dimensions to my Kalman filter must be 2x1, and then a second error stating that the output of the u port is a one dimensional vector with one element.
Is it even possible to use 2 input signals for the Kalman filter block in simulink, or am I messing up the muxing somehow? Any help is appreciated and I've attatched a picture of the sim. Attatched is also my matlab code that runs the sim.
  3 Kommentare
ZACH LOUIS DANIEL
ZACH LOUIS DANIEL am 20 Jul. 2022
What is the advantage of a Luenberger Observer compared to a Kalman Filter? Also I'll attatch my code thanks for the response!
Sam Chak
Sam Chak am 21 Jul. 2022
Previously, I thought your system is deterministic. Since your system is stochastic, then use the Kalman Filter to estimate the states.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Christine Li
Christine Li am 22 Jul. 2022
Bearbeitet: Christine Li am 22 Jul. 2022
Hello,
Kalman filter block from Simulink or the function 'kalman' can handle both SISO and MIMO system.
From your code, it looks the C matrix is 1-by-6, which should be 1-by-5 to be consistent with A and B matrix dimention. More specifically, it looks you have 5 states, 2 inputs and 1 outputs. Since y = Cx + Du, so the C matrix should be in a dimention of [numY by numX] which turns out to be 1 by 5.
For Kalman Filter design with MATLAB and Simulink, here are some references:
You can use MATLAB script to create the state-space model and call 'kalman' to estimate the states. Here is an example: Design Kalman Filter for MIMO Plant
If you are working in Simulink with Kalman Filter block, you just need to make sure the A, B, C, D matrixes and Q,R are consistent in dimention. As for the example shown above, here is the simulink model screenshot you can refer to:
For your model, there are 2 inputs, you can use a mux to combine the inputs. Please notes that Simulink can automatically handle the signal dimentional. Therefore, if your input signal is already multil-dimentional, you can just feed it in the block, as long as the dimention is consistent with A,B,C,D matrix, the model will be good to run.
To debug the dimention issues in Simulink, you can go to toolstrip tab - Debug ->Information Overlays and turn on the "Signal Dimensions".
Regards,
Christine Li

Produkte


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by