Simulink design LQR controller
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need control this model with LQR controller.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162867/image.jpeg)
I implemented the cost function with:
x=[Pm w] u=[a]
where, Pm is manifold pressure, w is the speed and a is the trhottle angle.
First step I have linearized the model with:
[a b c d]=linmod('Engine');
subsequently I use
K=lqr(a,b,q,r)
where I choose
q=[0.1 0 0 0;0 0.1 0 0;0 0 0.1 0;0 0 0 1] and r=500.
I have create the controller block in this mode:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162869/image.png)
I have an errors for this block : Error in port widths or dimensions. Output port 1 of 'eng1/Subsystem/Gain1' has 4 elements. This port does not accept the dimensions (or orientation) specified by the output signal.
Someone can you help me?
Thank you so much in advance.
1 commentaire
Drill Be
le 14 Août 2017
How did you define the system matrices (a,b, c,d), what are the dimensions? It seems you q and r matrices are not appropriate size with system matrices.
Réponses (0)
Voir également
Catégories
En savoir plus sur State-Space Control Design and Estimation 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!