State-space feedback system using simulink

조회 수: 8 (최근 30일)
Sung-Wook Lee
Sung-Wook Lee 2020년 6월 29일
편집: Sung-Wook Lee 2020년 6월 29일
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개)

카테고리

Help CenterFile Exchange에서 Time and Frequency Domain Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by