« Return to Thread: OCST: Gain Margin
From: lukas.reichlin@...
To: dastew@...; help-octave@...
Subject: Re: OCST: Gain Margin
Date: Fri, 3 Jul 2009 12:19:50 +0200
From: lukas.reichlin@...
To: help-octave@...
Subject: Re: OCST: Gain Margin
Date: Fri, 3 Jul 2009 09:48:16 +0200Dear Octave Community,
I wrote an objective function to optimize an Aström/Hägglund PID
Controller numerically by fminsearch. Versions for Octave and Matlab/
SImulink can be found here:
http://n.ethz.ch/student/lukasre/download/optiPID/
The Octave control package is quite limited. However, I managed to get
along quite easily except for one thing: the gain margin of a system.
In Matlab, there's [gamma, phi, w_gamma, w_phi] = margin(sys). I
couldn't think of a way to calculate the gain margin numerically. Is
there any control systems engineer out there who knows how to
implement an algorithm for the problem? Help would be very appreciated.
Regards,
Lukas
BTW: Despite I implemented the routine quite differently, the
conformity of the results between Matlab and Octave is simply
fantastic :-)
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
If you look at what I did you might get some ideas.
http://dougs.homeip.net/qtoctave/bode1w.m
Doug StewartThanks for your help! If I understood your code correctly, the following code should do the job:Regards,Lukas
I cleaned this up and added some comments. If it works the way you want, then
we should put it in the controls tool box.
Doug StewartThank you. I corrected some minor typos and added my family name :-) I think this hack needs some serious testing before it's added to anything ;-) Especially because the accuracy relies on how tightly spaced the frequency vector of bode(sys) is.Regards,Lukas
Thanks Lucas
If you think it is important to use a finer resolution for the frequencies then we could:
1) find the frequencies the way we are now.
2) call bode again with a frequency vector that is just in a narrow band around these frequencies;
3) recalculate the GM and PM
Do you think this is a good plan?
Doug
« Return to Thread: OCST: Gain Margin
| Free embeddable forum powered by Nabble | Forum Help |