Extended Kalman Filter state transition parameters
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Eduardo
le 27 Jan 2023
Réponse apportée : Emmanouil Tzorakoleftherakis
le 27 Jan 2023
As a follow up to this question, I am wondering how to correctly input a vector of additional parameters to an EKF block.
The state transition function is a wrapper of the state function used for a NLMPC.
Similar to the following example: Swing-Up Control of a Pendulum. My state function works using additional parameters like the "Ts" used in the example. In my case, however, the additional parameters are some signals U from my plant plus 37 predefined parameters in the base workspace.
This parameters are given as a vector "p".
For now I have tried using a mux:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1276050/image.png)
The simulation fails during compilation with the following error:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1276055/image.png)
The function used as a wrapper looks as follows:
function xk1 = stateFcnEKF_mixBufRd_wrapper(xk, u)
% Wrapper function for the State function used by the Extended Kalman Filter block.
%
%
% u = [signal1 signal2 signal3 signal4 p]
%
% Outputs:
% xk1: Updated state values based on xk and uk
uk = [u(1) u(2) u(3) u(4)];
p = u(5); % <----- vector of 37 parameters defined in base workspace
xk1 = stateFcnDT0_mixBufRd(xk, uk, p); % <----- function used in NLMPC
Any ideas how the configuration of blocks should look like?
I have tried using IC and signal description blocks but I am not sure of the correct input definition.
0 commentaires
Réponse acceptée
Plus de réponses (1)
Emmanouil Tzorakoleftherakis
le 27 Jan 2023
Glad you figured it out. By the way, this example shows the general workflow of using NLMPC + EKF with additional parameters
0 commentaires
Voir également
Catégories
En savoir plus sur Model Predictive Control Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!