[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mistake with "connect" command while making a global state-space sys
From: |
Beginner1 |
Subject: |
Re: Mistake with "connect" command while making a global state-space system |
Date: |
Tue, 29 May 2018 03:09:44 -0700 (MST) |
I previously used the "connect" command in a previous example and it worked
properly:
/*%Packages call
pkg load control
pkg load io
%Parámetros del sistema
%Outer Loop
kv=15;%Constante proporcional del PI de la componente d
Tv=0.05;%Constante de tiempo del PI de la componente d
kq=0.4;%Constante proporcional del PI de la componente q
Tq=0.05;%Constante de tiempo del PI de la componente q
kdroop_AC=0%-3.0023;%Pendiente droop Q/U_AC
droop_FSM=0.050000000000000000000001%0.0500366528;%Pendiente droop P/f
FSM_slope=droop_FSM/0.002;%Pendiente droop P/f en p.u.
%Inner Loop
w=314.159;% Frecuencia de corte(rad/s) del controlador proporcional
resonante
ki=5000;%1% Constante integral de los controladores proporcional
resonantes
kp=1.5% Constante proporcional de los controladores proporcional
resonantes
%2-level VSC&Normalization block
Vdref_perm=1.003;%1.003;
Vqref_perm=0.074;%0.077;
Vdc_diff_perm=0.491;%0.492;
kdiff=(0.7)*Vdc_diff_perm;%Según DIgilent debería ser multiplicada por 1.4
en vez de 0.7
K_0=sqrt(3)/(2*sqrt(2));%Factor de modulación sinusoidal del VSC
Ub_DC=640/2;%Tensión base en DC del VSC-Según DIgilent debería ser 640 en
vez de 640/2
Ub_AC=275;%Tensión base en AC del VSC
k0=(K_0)*Ub_DC/Ub_AC;
Vdc_perm=1.019;%1.017;
Pmd_perm=0.689;%0.702;%0.69;
Pmq_perm=0.051;%0.057;%0.053;
Kvsc=k0*Vdc_perm;
%Definición del tiempo de simulación
Tfinal = 3;
t = (0:0.0001:Tfinal)';
%Función enable: para marcar la activación de la rama FSM
enable=0;
%Definición de matrices A,B,C y D
%Outer loop:Vdc-Q
%A_ol=[0 0;0 0];
%B_ol=[-kv/Tv kv/Tv 0 0 0 0 -kv*FSM_slope*enable/Tv kv*enable/Tv
-kv*enable/Tv kv*enable/Tv;0 0 kq/Tq -kq/Tq -(kq/Tq)*kdroop_AC
(kq/Tq)*kdroop_AC 0 0 0 0];
%C_ol=[1 0;0 1];
%D_ol=[-kv kv 0 0 0 0 -kv*FSM_slope*enable kv*enable -kv*enable
kv*enable;0 0 kq -kq -kq*kdroop_AC kq*kdroop_AC 0 0 0 0];
A_ol=[0 0;0 0];
B_ol=[-kv/Tv kv/Tv 0 0 0 0 -kv*FSM_slope*enable/Tv kv*enable/Tv
-kv*enable/Tv kv*enable/Tv;0 0 kq/Tq -kq/Tq -(kq/Tq)*kdroop_AC
(kq/Tq)*kdroop_AC 0 0 0 0];
C_ol=[1 0;0 1];
D_ol=[-kv kv 0 0 0 0 -kv*FSM_slope*enable kv*enable -kv*enable kv*enable;0
0 kq -kq -kq*kdroop_AC kq*kdroop_AC 0 0 0 0];
%Inner loop:PR current controller
A_il=[0 1 0 0 0 0; 0 0 1 0 0 0; 0 -4*(w)^2 0 0 0 0;0 0 0 0 1 0;0 0 0 0 0
1;0 0 0 0 -4*(w)^2 0];
B_il=[0 0 0 0 0 0; 0 0 0 0 0 0;0 0 -1 0 1 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0
-1 0 1];
C_il=[2*((w)^2)*ki 0 ki 0 ki*w 0;0 -ki*w 0 2*(w^2)*ki 0 ki];
D_il=[1 0 -kp 0 kp 0;0 1 0 -kp 0 kp];
%A_il=[0 1 0 0 0 0; 0 0 1 0 0 0; 0 -4*w^2 0 0 0 0;0 0 0 0 1 0;0 0 0 0 0
1;0 0 0 0 -4*w^2 0];
%B_il=[0 0 0 0 0 0; 0 0 0 0 0 0;0 0 -1 0 1 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0
-1 0 1];
%C_il=[2*(w^2)*ki 0 ki 0 ki*w 0;0 -ki*w 0 2*(w^2)*ki 0 ki];
%D_il=[1 0 -kp 0 kp 0;0 1 0 -kp 0 kp];
%Normalization block
D_nb=[kdiff 0 (0.7)*Vdref_perm;0 kdiff (0.7)*Vqref_perm];%Según DIgilent
debería ser multiplicada por 1.4 en vez de 0.7
%D_nb=[0.7 0;0 0.7];
%2-level VSC:controlled voltage source-average model
D_vsc=[k0*Vdc_perm 0 k0*Pmd_perm;0 k0*Vdc_perm k0*Pmq_perm];
%Definición de las ecuaciones de estado x.=Ax+Bu; y=Cx+Du
%Outer loop
stname_ol = {'xv','xq'};
inname_ol={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos'};
outname_ol={'idref','iqref'};
sys_ol = ss
(A_ol,B_ol,C_ol,D_ol,'stname',stname_ol,'inname',inname_ol,'outname',outname_ol);
%Inner loop
stname_il = {'xd1','xd2','xd3','xq1','xq2','xq3'};
inname_il={'Vd','Vq','Id','Iq','idref','iqref'};
outname_il={'Vdref','Vqref'};
sys_il = ss
(A_il,B_il,C_il,D_il,'stname',stname_il,'inname',inname_il,'outname',outname_il);
%Normalization block
inname_nb={'Vdref','Vqref','Vdcdiff'};
%inname_nb={'Vdref','Vqref'};
outname_nb={'Pmd','Pmq'};
sys_nb = ss (D_nb,'inname',inname_nb,'outname',outname_nb);
%2-level VSC
inname_vsc={'Pmd','Pmq','vdc'};
outname_vsc={'Vd_AC','Vq_AC'};
sys_vsc = ss (D_vsc,'inname',inname_vsc,'outname',outname_vsc);
%Assembled system1
inname_group={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos','Vd','Vq','Id','Iq','Vdcdiff'};
%inname_group={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos','Vd','Vq','Id','Iq'};
outname_group={'idref','iqref','Vd_AC','Vq_AC'};
sys=connect(sys_ol,sys_il,sys_nb,sys_vsc,inname_group,outname_group);*/
It worked properly with this system as it included all the state space
variables from all subsystems, as matrix A proved:
<http://octave.1599824.n4.nabble.com/file/t372684/Captura2.jpg>
So I don't understand why it does not work with an assembled system of 10
state-space variables but it does work for an assembled system of 8.
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
- Mistake with "connect" command while making a global state-space system, Beginner1, 2018/05/28
- Re: Mistake with "connect" command while making a global state-space system, Marco Atzeri, 2018/05/28
- Re: Mistake with "connect" command while making a global state-space system, Beginner1, 2018/05/29
- Re: Mistake with "connect" command while making a global state-space system, Beginner1, 2018/05/29
- Re: Mistake with "connect" command while making a global state-space system, Marco Atzeri, 2018/05/29
- Re: Mistake with "connect" command while making a global state-space system,
Beginner1 <=
- Re: Mistake with "connect" command while making a global state-space system, Beginner1, 2018/05/29
- Re: Mistake with "connect" command while making a global state-space system, Doug Stewart, 2018/05/29
- Re: Mistake with "connect" command while making a global state-space system, Beginner1, 2018/05/29
- Re: Mistake with "connect" command while making a global state-space system, Beginner1, 2018/05/30