This function does not fully set the dimensions of output port 2
Hi, i am trying to write a design a fixed time disturbance observer for power estimation for a boost converter. But i keep getting this error: Error in default port dimensions function of S-function ‘boost_another_observer/MATLAB Function3’. This function does not fully set the dimensions of output port 2. Please help out 🙂
the code is as below:
function [sigma1_d,sigma2_d,sigma3_d,e1_est,d1_est,d1_d_est,d2_est,Pload_est] = observer(y2,e1,sigma1,sigma2,sigma3)
L1=8e3;
Ro=30;
Vcref=200;
C=1000e-6;
k1=0.5e3;
k2=0.5e3;
k3=3.5e4;
k4=3.5e4;
k5=50;
k6 = 50;
m1=0.8;
m2=0.6;
m3=0.4;
n1=1.2;
n2=1.4;
n3=1.6;
%% Observer design
sigma1_d=sigma2-k1*(abs(sigma1-e1)^m1)*sign(sigma1-e1)-k2*(abs(sigma1-e1)^n1)*sign(sigma1-e1)+y2;
sigma2_d=sigma3-k3*(abs(sigma1-e1)^m2)*sign(sigma1-e1)-k4*(abs(sigma1-e1)^n2)*sign(sigma1-e1);
sigma3_d=sigma3-k5*(abs(sigma1-e1)^m3)*sign(sigma1-e1)-k6*(abs(sigma1-e1)^n3)*sign(sigma1-e1);
%% Estimated values
e1_est=sigma1;
d1_est=sigma2;
d1_d_est=sigma3;
d2_est=-2*d1_est/(Ro*C);
Pload_est=-d1_est+Vcref^2/Ro-Vc^2/R+Vc^2/Ro;Hi, i am trying to write a design a fixed time disturbance observer for power estimation for a boost converter. But i keep getting this error: Error in default port dimensions function of S-function ‘boost_another_observer/MATLAB Function3’. This function does not fully set the dimensions of output port 2. Please help out 🙂
the code is as below:
function [sigma1_d,sigma2_d,sigma3_d,e1_est,d1_est,d1_d_est,d2_est,Pload_est] = observer(y2,e1,sigma1,sigma2,sigma3)
L1=8e3;
Ro=30;
Vcref=200;
C=1000e-6;
k1=0.5e3;
k2=0.5e3;
k3=3.5e4;
k4=3.5e4;
k5=50;
k6 = 50;
m1=0.8;
m2=0.6;
m3=0.4;
n1=1.2;
n2=1.4;
n3=1.6;
%% Observer design
sigma1_d=sigma2-k1*(abs(sigma1-e1)^m1)*sign(sigma1-e1)-k2*(abs(sigma1-e1)^n1)*sign(sigma1-e1)+y2;
sigma2_d=sigma3-k3*(abs(sigma1-e1)^m2)*sign(sigma1-e1)-k4*(abs(sigma1-e1)^n2)*sign(sigma1-e1);
sigma3_d=sigma3-k5*(abs(sigma1-e1)^m3)*sign(sigma1-e1)-k6*(abs(sigma1-e1)^n3)*sign(sigma1-e1);
%% Estimated values
e1_est=sigma1;
d1_est=sigma2;
d1_d_est=sigma3;
d2_est=-2*d1_est/(Ro*C);
Pload_est=-d1_est+Vcref^2/Ro-Vc^2/R+Vc^2/Ro; Hi, i am trying to write a design a fixed time disturbance observer for power estimation for a boost converter. But i keep getting this error: Error in default port dimensions function of S-function ‘boost_another_observer/MATLAB Function3’. This function does not fully set the dimensions of output port 2. Please help out 🙂
the code is as below:
function [sigma1_d,sigma2_d,sigma3_d,e1_est,d1_est,d1_d_est,d2_est,Pload_est] = observer(y2,e1,sigma1,sigma2,sigma3)
L1=8e3;
Ro=30;
Vcref=200;
C=1000e-6;
k1=0.5e3;
k2=0.5e3;
k3=3.5e4;
k4=3.5e4;
k5=50;
k6 = 50;
m1=0.8;
m2=0.6;
m3=0.4;
n1=1.2;
n2=1.4;
n3=1.6;
%% Observer design
sigma1_d=sigma2-k1*(abs(sigma1-e1)^m1)*sign(sigma1-e1)-k2*(abs(sigma1-e1)^n1)*sign(sigma1-e1)+y2;
sigma2_d=sigma3-k3*(abs(sigma1-e1)^m2)*sign(sigma1-e1)-k4*(abs(sigma1-e1)^n2)*sign(sigma1-e1);
sigma3_d=sigma3-k5*(abs(sigma1-e1)^m3)*sign(sigma1-e1)-k6*(abs(sigma1-e1)^n3)*sign(sigma1-e1);
%% Estimated values
e1_est=sigma1;
d1_est=sigma2;
d1_d_est=sigma3;
d2_est=-2*d1_est/(Ro*C);
Pload_est=-d1_est+Vcref^2/Ro-Vc^2/R+Vc^2/Ro; disturbance observer, simulink, matlab, sliding mode control, boost converter MATLAB Answers — New Questions
​