Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Matrix/vector mistake - wrong control input in NMPC Optimization
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm working on NMPC for moving object. The MPC parameters/initial conditions are set as follows:
mpciterations = 10; % Number of MPC iterations to be performed
N = 10; % Length of optimization horizon
T = 0.1; % Sampling interval
u0 = 320*ones(4,N); % Initial guess of open loop control
tmeasure = 0.0; % Time measurement of initial value
xmeasure =[0 0 0 0 0 0 0 0 0 0 50 0]';
where u0 is the 4*10 matrix (4 rotors of quadcopter).
The problem appearing during the simulation is that the calculated closed-loop control input is saved as a vector with one column, e.g. 40*1, not 10*4 and calculated control input is not adequate (e.g. ).
My assumption is that the wrong calculation of the control signal is over the wrong recording of u, not in four columns and some syntax should be added/changed and maybe the running costs representation should be then also modified for the correct matrix multiplication.
Code files are attatched. "script2" contains parameters of mnpc, constraints, mathematical model and calls the "nmpc" routine file.
Thank you for your answer!
0 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!