0

I have a XCOS scheme, where are presents:

  • My system G(Z)

  • A Pid controller

Xcos scheme

Now, I would like to know the closed loop transfer function.

How can i obtain it by scilab/Xcos ?

Thanks

Best

*** EDIT: ****

Following user1149326's suggestions :

loadXcosLibs(); loadScicos();
importXcosDiagram("/home/dursino/Desktop/nostro_sistema.xcos");
for i=1:length(scs_m.objs)
if typeof(scs_m.objs(i))=="Block" & scs_m.objs(i).gui=="SUPER_f" then
    scs_m = scs_m.objs(i).model.rpar;
    break;
end

end

-->sys = lincos(scs_m);

The last statement return this: lincos: Unable to find diagram inputs at line 118 of function lincos called by :
sys = lincos(scs_m);

Best regards

Jonas
  • 121,568
  • 97
  • 310
  • 388
Edge7
  • 681
  • 1
  • 15
  • 35

2 Answers2

0

You can use lincos to create a linear state-space model from a general dynamical system described by a xcos diagram.

After obtaining the state-space model you can use ss2tf to convert it to a transfer function.

spoorcc
  • 2,907
  • 2
  • 21
  • 29
  • Thanks for the answer, it was usefull.. I have a problem: lincos: Error during block parameters evaluation. Now I'm searching a solution.. If you have it please write! Best at line 85 of function lincos called by : sys = lincos(scs_m); – Edge7 May 27 '13 at 20:04
  • I don't quite follow your comment @Edge7, could provide your code and the complete error message? – spoorcc May 28 '13 at 09:02
  • You can edit you original question and add a update with what you've tried. – spoorcc May 28 '13 at 09:10
0

As mentioned by @spoorcc, you can use lincos to get the state-space representation of the system you made in Xcos. One important thing to remember is that you should use IN_f as the input and OUT_f as the output in Xcos. Only then you can get the state-space representation using lincos. I think you didn't use these in your Xcos model and that's why you got that error.

P.S. I know this answer probably won't help the OP (it's been 8 years now since it was asked) but I hope this might help someone like me who spent a lot on time searching for this method.

Chiranshu
  • 1
  • 2