According to the MATLAB example "Control of Aircraft Lateral Axis Using mu-Synthesis" I want to create a weighting function, bandpass filter, to extract only certain frequency interval of my mechanical plant in state space representation , that I want to use for the hinfstruct(). Only the range from 40 to 60 Hz is point of interest for the optimization.
I chose a butterworth filter with for an interval from 40 to 60 Hz and of high order for a "clear cut". Next it is tranformed to a tranfer function with specifed I/O. The bodeplot shows me the real properties of the filter (normalized), where contrary to this fvtool shows the properties I want to achieve.
[b, a] = butter(10,[40 60]/200);
W_but = tf(b,a); W_but.u='p'; W_but.y='fp';
figure
bodemag(W_but)
figure
fvtool(b,a,'Fs',200)
The problem is now, that the resulting filter is normalized and the gain is altered. What should I do, to get the once again in the desired frequency resolution to connect the filter with the plant (genss), to which I added some tuneable parameters. This will be then the input for hinfstruct(). The bodemag of non-normalized W_but should look like the one from fvtool().
For testing reason one can use the plant of the plant from the example mentioned at the beginning, to solve my main problem, that I don't filter the desired frequency range. For example, when I now want to filter around 100 Hz instead of 1 Hz, like it does now.
load LateralAxisModel
LateralAxis.u = {'u1','u2'};
LateralAxis.y = {'p','y1','y2','y3'};
Sys_test = connect(LateralAxis,W_but,{'u1','u2'},{'fp','y1','y2','y3'});
bodemag(Sys_test(1,1),LateralAxis(1,1))
PS: I thought about connecting the plant and the weighting function before introducing the tuneable parameter. Therefore I had to transforme the plant from ss to frd, then normalize it and multiply with the weighting function. Afterwards a transformation back to ss could be performed. But this process is quite laborious in my opinion and I guess there is a better way to do so, but I can't get it.