How to use frequency analyzer(bode plotting) when I have PID controllers and PWM in my simulation Model?
7 次查看(过去 30 天)
显示 更早的评论
How to use frequency analyzer(bode plotting) when I have PID controllers and PWM in my simulation Model? When I was trying it is giving error "In "frestimate(modelname,op,io,in)", it is required for each of the linearization input I/O points that the sample time of the Simulink signal where it is located is one of the following: 1. It is either continuous or fixed in minor time step. 2. Its sample rate is equal to the sample rate of the input signal "in". The linearization I/O io(1) does not satisfy this requirement. Consider either changing the sample time of Simulink signal where io(1) is located to continuous sample time or changing the sample time of input signal "in"."
0 个评论
回答(1 个)
AMIT SURYAVANSHI
2024-1-15
移动:Sam Chak
2024-1-15
% Assuming 'modelname' is your Simulink model name
model = 'modelname';
% Specify the input/output points for linearization
op = operpoint(model);
io = linearizeio(model);
% Specify sample time explicitly (adjust the sample time accordingly)
in = frest.Sinestream('Frequency',logspace(-2,2,100),'Amplitude',0.1);
% Perform frequency analysis
sys = frestimate(model, op, io, in, 'FrequencyVector', in.Frequency);
The error you are getting while trying to do frequency analysis (Bode plot) indicates that there may be a problem with the sample time of your Simulink signals. The error notice informs the user that the signal's sample time at the designated linearization input/output point is insufficient for frequency analysis.
You may want to take the following actions to deal with this issue:
Maintain Regular Sample Times:
Verify the consistency of the sample times for the input, output, and intermediate signals—the signals used in the linearization.
To comply with the specifications listed in the error message, you might need to modify the sample times in your Simulink model.
In Simulink, set the sample time:
Launch your Simulink model and examine the signal sample times.
throughout the linearization.
Adjust the signals' sample times consistently in accordance with the specifications listed in the error message.
Employ a Constant Sample Duration:
You might want to think about using continuous sample time for the linearization points if your model includes discrete sample times.
Give the sample time in fractions:
When using the frestimate function, you can define sample times manually. Make sure your Simulink signal's sample time corresponds to the one given in the frestimate function.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!