help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Control System Design methods using Octave.


From: shall689
Subject: Re: Control System Design methods using Octave.
Date: Wed, 6 Dec 2017 16:23:08 -0700 (MST)

Doug Stewart-4 wrote
> On Wed, Dec 6, 2017 at 4:57 PM, shall689 <

> sahallacy@

> > wrote:
> 
>> Ok, I removed SampleFrequency from the tf function, i.e. tf(b,a) instead
>> of
>> tf(b,a,SampleFrequency).
>>
>> The bode plot seem to match each other much better and the frequency
>> range
>> is a little better, with the only issue is that the max discrete
>> frequency
>> is 10 (>> pi).
>>
>> Is there some type of issue with the bode() function?
>>
>>
>> <http://octave.1599824.n4.nabble.com/file/t372348/BodePlot2.png>
>>
>>
>>
>> --
>> Sent from: http://octave.1599824.n4.nabble.com/Octave-General-
>> f1599825.html
>>
>>
> Hi Shall
> If you would post your exact code, for me to run, then I am sure that I
> can
> answer your questions.
> https://pastebin.com/   is one way to post it.
> 
> 
> 
> -- 
> DAS
> 
> <https://linuxcounter.net/user/206392.html>
> 
> _______________________________________________
> Help-octave mailing list

> Help-octave@

> https://lists.gnu.org/mailman/listinfo/help-octave


Here's my latest code.  It is the same as my original code except in the
original I used sys = tf(b,a,SampleFrequency) instead of sys = tf(b,a).

The original code and the data file (i.e. buckVfreqResp.csv) was attached to
my previous post.

Please tell me if you need anything else.

Oh.. I just noticed something, I am using the sampling frequency instead of
the sample time..

Stephen


pkg load control;
pkg load signal;
clear all
x = csvread('buckVfreqResp.csv');
SampleFrequency = 20000;
f = x(:,1);
r = x(:,2);
phase_rad = x(:,3).*(pi/180);
h = r.*cos(phase_rad) + r.*(sin(phase_rad)*i); 
w = f.*2*pi/SampleFrequency;
[b,a] = invfreqz(h,w,12,14)
sys = tf(b,a)
bode(sys)



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]