Main Content

对传输功能模型的频域识别进行故障排除

此示例显示了如何使用频率响应数据(FRD)执行和故障排除SISO系统的识别。此处解释的技术也可以应用于MIMO模型和频域输入输出数据。

when you use thetfestcommand to estimate a SISO transfer function model from the frequency-response data, the estimation algorithm minimizes the following least-squares loss (cost) function:

m 一世 n 一世 m 一世 z e G (( ω k = 1 n F | w (( ω k (( G (( ω k - F (( ω k | 2

这里w一世s a frequency-dependent weight that you specify,G一世s the transfer function that is to be estimated,F一世s the measured frequency-response data, and w 是频率。nF是数据可用的数字频率。 G (( w - F (( w 一世s the frequency-response error.

在此示例中,您首先估算模型,而无需预处理数据或使用估算选项来指定加权过滤器。然后,您将这些故障排除技术应用于改进模型估计。

Estimate the Model Without Preprocessing and Filtering

Load the measured continuous-time frequency response data.

loadtroubleshooting_example_dataGFrd;

GFrd一世s an一世dfrdobject that stores the data.

使用估计数据估算具有11个极点和10个零的初始传输函数模型。

gfit = tfest(gfrd,11,10);

Plot the frequency-response magnitude of the estimated model and the measured frequency-response data.

Bodemag(GFRD,GFIT);ylim([ -  100 0])传奇(“测量”,,,,'Estimated'

图包含一个轴对象。轴对象包含2个类型行的对象。These objects represent Measured, Estimated.

估计的模型包含虚假动态。估计算法在60 rad/s的山谷中错过了山谷,之后的谐振峰。因此,该模型对数据不合适。

The algorithm minimizes the squared error magnitude, | w (( w (( G (( w - F (( w | 2 ,,,,一世nthe loss function. Plot this quantity as a function of frequency. This error plot provides a view of which data points contribute the most to the loss function, and so are the likely limiting factors during estimation. The plot can help you identify why there are spurious or uncaptured dynamics.

因为您尚未指定频率的重量,所以 w (( w 一世s 1.

w=GFrd.Frequency; r1 = squeeze(freqresp(Gfit,w)); r2 = squeeze(freqresp(Gfrd,w)); fitError = r1-r2; semilogx(w,abs(fitError).^2) title('Weighted Estimation Error');Xlabel(“频率(rad/s)”);ylabel('Magnitude (abs)'

图包含一个轴对象。The axes object with title Weighted Estimation Error contains an object of type line.

从数据,模型和错误图中可以看到:

  • The largest fitting errors are below 10 rad/s.

  • 该算法的重点是拟合低于10 rad/s的嘈杂的高幅度数据点,这对优化损耗函数具有很大的贡献。结果,该算法将伪造杆和零分配给该数据区域。为了解决此问题,您可以预处理数据以提高该区域的信噪比。您还可以使用频率依赖的权重使该算法更少对该区域的关注。

  • Below approximately 40 rad/s, most variations in data are due to noise. There are no significant system modes (valleys or peaks) in the data. To address this issue, you can use a moving-average filter over the data to smooth the measured response.

  • 该算法忽略了60 rad/s左右的山谷,并忽略了三个轻度阻尼的谐振峰。这些功能对损耗函数无效,因为在这些频率下的拟合误差很小。为了解决此问题,您可以指定频率的权重以使算法更加注意这些频率。

预处理数据

为了提高估计的模型质量,请预处理数据。为此,您将低于1 rad/s的数据的低信号到噪声部分截断,而2e4 rad/s则不有趣。然后,您使用移动平均过滤器在低于40 rad/s以下的低频高磁性区域中平滑数据。在这些频率下,数据具有较低的信噪比,但是您对捕获感兴趣的动态。请勿以高于40 rad/s的频率应用滤波器,以避免在看到山谷和跟随它的三个峰的地方平滑数据。

制作原始的副本一世dfrd数据对象。

gfrdprocessed = gfrd;

Truncate the data below 1 rad/s and above 2e4 rad/s.

gfrdprocessed = fSelect(gfrdprocessed,1,2e4);

应用三点中心的移动平均过滤器,以平滑包含虚假动态的40 rad/s以下的频率响应数据。响应数据存储在反应室对象的属性。

w = gfrdprocessed.fquency;f = squeeze(gfrdprocessed.responsedata);idx = w <40;f(idx)= movmean(f(idx),3);

这里F((一世dx)一世s the frequency-response data at frequencies less than 40 rad/s.

Place the filtered data back into the original data object.

GFrdProcessed.ResponseData = f;

绘制原始和预处理的数据。

bodemag(Gfrd,GfrdProcessed); ylim([-100 0]); legend('Original data',,,,'Preprocessed data');

图包含一个轴对象。轴对象包含2个类型行的对象。这些对象表示原始数据,预处理数据。

The plot shows that all desired dynamics are intact after preprocessing.

指定加权过滤器

Use a low weight for the low frequency region under 10 rad/s where spurious dynamics exist. This low weight and the smoothing applied earlier to this data reduce the chance of spurious peaks in the estimated model response in this region.

重量=一个(尺寸(f));idx = w <10;重量(IDX)=重量(IDX)/10;

在频率范围40-6e3 rad/s的频率范围内使用高重量,您要捕获动力学,但响应数据幅度较低。

一世dx = w>40 & w<6e3; Weight(idx) = Weight(idx)*30;

指定权重重量一世ngFilteroption of the estimation option set.

tfestOpt = tfestOptions('WeightingFilter',,,,we一世ght);

note that重量一世s a custom weighting filter. You can also specify重量一世ngFilter作为'Inv'or'invsqrt'For frequency-response data. These options specify the weight as 1 / | F (( w | and 1 / | F (( w | , 分别。这些选项使您能够快速测试使用较高的重量数据级数据区域的效果。'invsqrt'通常是一个不错的初始选择。如果这些权重不能产生良好的估计结果,则可以提供自定义权重,如本示例所示。

Estimate Model Using Preprocessed and Filtered Data

估计11杆传递函数模型nd 10 zeros using the preprocessed data and specified weighting filter.

GF一世tNew = tfest(GfrdProcessed,11,10,tfestOpt);

Plot the original data, the initial model response, and the new model response.

Bodemag(GFRD,GFIT,GFITNEW);Ylim([ -  100 0]);传奇('Original Data',,,,'Original Model',,,,'新模式');

图包含一个轴对象。The axes object contains 3 objects of type line. These objects represent Original Data, Original Model, New Model.

Plot the estimation error. Compute the estimation error by including the weighting filter重量您用于估计GF一世tNew

w = gfrdprocessed.fquency;r1 = squeeze(freqresp(gfitnew,w));r2 = squeeze(freqresp(gfrdprocessed,w));fiterrornew =重量。*(r1-r2);Semilogx(W,ABS(Fiterrornew)。^2)标题('Weighted Estimation Error');Xlabel(“频率(rad/s)”);ylabel('Magnitude (abs)');

图包含一个轴对象。The axes object with title Weighted Estimation Error contains an object of type line.

新模型成功捕获了所有感兴趣的系统动态。

如果您最初的权重选择不会产生令人满意的结果,则可以使用加权错误图进行进一步故障排除。

也可以看看

|

Related Topics