State-space feedback system using simulink
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
So, I wanted to make a Simulink model for a closed-loop system using Matlab Function block to describe the plant in a state-space form.

I have further simplified the controller (from PID to P) from the original design because the y(output) is failing to track the reference at all, as you can see below.

And here is the code for the Matlab Function that inputs x and u and outputs xdot and y. (simplest linear model for the time being)
function [xdot,y] = fcn(x,u)
%xdot = [0;0];
xdot = [0 1; -1 0]*x + [ 0; 1]* u;
y = x(1);
end
It is very unclear to me what I have done wrong. Why 'error' isn't exactly the difference between the ouput and the reference is hard to understand because there is nothing special about the sum block: it just adds, substracts, simple. I have defined the dimension of x in the integral block, which is set as [2 1].
Any insights or help would very much be appreciated! Thank you.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Time and Frequency Domain Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!