필터 지우기
필터 지우기

How to correct the error "Error in default port dimensions function of S-function 'X'. This function does not fully set the dimensions of output port x" under Simulink?

조회 수: 47 (최근 30일)
Hi
I'm a master's student and i'm studying electrical engineering - control systems.
I've been assigned (by my Supervisor professor) to simulate a feedback linearization control method so I chose a paper (attached below) and I made a simulink model for it. The problem is when I try to run the simulation, it gives the error:
Error in default port dimensions function of S-function 'FeedbackLinearization/Controller'. This function does not fully set the dimensions of output port 2
So i turned on the signal dimensions display to check for signal dimensions and check whether i've made an error or not. I see a problem for the 'e' signal. It should be a 3*1 vector that indicates error for tracking x-y-z. As you can see, output of the mux the dimension is 3 so everything is ok. the problem is when the signal reaches a block (MATLAB function or derivative) its dimension reduces down to one. I have attached my slx model so you please be kind and take a look.
I've checked both Controller Matlab func and Plant Matlab func and they are working fine.
Please help me. This is so vital for me! Thank you for your time, and consideration!
Capture.JPG
  댓글 수: 1
JAMES OKELLO
JAMES OKELLO 2020년 5월 5일
편집: JAMES OKELLO 2020년 5월 5일
Please debug the controller "fcn" separetly. Simulink could not compile the "fcn" and consequently could not determine with certainity the port widths. This should be able to solve your problem.

댓글을 달려면 로그인하십시오.

답변 (3개)

Mark McBroom
Mark McBroom 2019년 1월 5일
Hi Amin,
It looks like Simulink was having trouble inferring the size of the for e_dot, e_doubledot and e_tripledot signals that are input to the controller MATLAB Function Block. I was able to fix by explicitly setting the size of e_dot to 3 ( rather than -1) in the Ports and Data Manager dialog for the MATLAB Function block. After making this cahnge, your model updates. See attached. NOte that the model does not simulation. There is a singularity somewhere in your algorithm.
Thanks.
Mark.
  댓글 수: 2
Alireza Madani
Alireza Madani 2020년 8월 23일
Hello Mark,
I have also encountered the same problem as Amin's.
Just one question about your answer:
How did you explicitly set the size of the e_dot (i.e. input variable of a matlabFunctionBlock() generated fucnction) variable?
Please let me know,
Bests,
Sep.

댓글을 달려면 로그인하십시오.


SANKAR RS
SANKAR RS 2019년 1월 17일
Run your simulink in previous version, i got the same problem. The orginal model might have been done with older version.

yohan diaz
yohan diaz 2022년 3월 7일
Create a new Matlab Function, copy and paste its content! It works!

카테고리

Help CenterFile Exchange에서 Discontinuities에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by