bloc sample time.. do I have to put it equal to the resonance ? how?

1 view (last 30 days)
I am studying the frequency stability of a pressure sensor mems for a ptoject.
before explaing all the details, I write my question (the other important question is at the very end of the post):
I believe it is appropriate to set the sample time of the blocks equal to approximately the inverse of the resonance frequency .. which is about 65kHz for now they are all set to -1 which means (if I am right) "inherited" and that simulink regulates itself the sampling time according to the block and the context.
if you read the rest I hope you can answer me that the .-1 sample time is ok and that I don't have to worry about my sample time for consistent results .. (Since they are simulations that last for hours ... because rapid acceleration mode doesn't work -. - '.. I would like to have results that can be trusted xd)
details: my prof has already written articles saying that with a certain feedback is possible to exploit the nonlinearity (because it acts as a Duffing oscillator .. where the resonant frequency varies with the amplitude of oscillation) for frequency stability we choose the voltage (pulse duration of a impulse less of the period of oscillation .. microseconds) and so to be in a "flat" where the frequency of oscillation does not vary too much with the amplitude.
We're looking for that optimal value of the voltage pulse that gives us maximum amplitude of oscillation, but minimizes the standard deviation .. because plotting the period of oscillation "apparently" there is first a transitory and then a permanent state where the oscillator appears to stabilize on a certain period of oscillation .. but if zooomming .. in its steady state there is much noise .. we seek that value of voltage that minimizes the standard deviation of the permanent regime of the output (oscillation as stable as possible)
thanks to theoretical calculations (thanks to scientific articles), we've found an optimal value of 0.46 volts (more or less)
  • > I choose a linspace vector Vp_vec of values like 0.44 and 0.48
  • >I do a cycle of simulations
  • > at each iteration (each Vp_vec(k)) calculating the standard deviation of the last 6,5 million samples of the Output
  • >get a vector of standard deviation values depending on the voltage at the end of cycle
plotting it I get this standard deviation as a function of the voltage values what I expect is a nice looking strong minimum of standard deviation at a certain voltage value (the optimal we're searching)
after having "only" about 800000 samples for a simulation and an output a bit too 'noisy I've also decided to extend the simulation time to get more samples (now about 8 million.. so why i chose the last 6,5 million.. they are enough , and are quite far from the transitional regime) And now i'm doubting about the sample time.
At each iteration (for each Vp_vec(k)) I get a variable number of samples (in the panel of configuration parametres as I put the ode solver 45 and variable steps) But in the cycle number to be analyzed is fixed (6,5 million for instance)
I copy just a small piece of code (Vp_vec linspace is a total of points of tension between 0.45 and 0.48)
for k = 1: length (Vp_vec)
Vp = Vp_vec (k)
sim ('test_sensors');
s_T_bruit(k)=std(Output.signals.values(length(Output.signals.values)-6500000:length(Output.signals.values)));
end
  • I set to analyze the last 6500000 samples, don't I?
only approximately one "step calculation" is a sample (one oscillation period.. yes?no?) .. and in order to have consistent results (I mean in order to have the right to compare the results coming from each iteration with a Vp_vec(k)) SHOULD I set the sample time more or less like 1/resonance frequency of the sensor oscillator?
i tried to to enable (parametres in config-> optimization) < inline parametres> .. I did not understand what i does actually, but I do not think it's the right one as the plot was an horrible thing
consistency between the results .. is obtained if at each iteration I have the same number of samples (regardless of the step calculation time for each sample??) ..
or in order to compare the standard deviation of each iteration output should I have at each iteration the same number of samples with the same simulink computing time ?
comparing the standard deviation of a fixed number of samples but calculated with different computing time.. has it no sense?
thank you
ask me further details if u need :-)
Valeria

Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!