what is the sampling frequency limit in 'c2d' cmd for a stable discrete system?

9 vues (au cours des 30 derniers jours)
I'm converting a continuous transfer function into a discrete one, using 'c2d' cmd.
But realised that different sampling frequency / discretized step time would effect system stability.
The transfer function I'm working on is a 9th order system.
dt = 1/7993 can offer a stable discrete system while dt = 1/7993/226 would result in an unstable system.
Therefore, I'm wondering what the upbound limit for sampling frequency for c2d is.
And is there any other way that I can get a discrete system using dt = 1/7993/226 or even higher sampling rate?
Thanks!
  4 commentaires
Mathieu NOE
Mathieu NOE le 8 Oct 2020
ok
can you send me your code please ?
Yuan Zheng
Yuan Zheng le 8 Oct 2020
s = tf('s');
Numerator = [0.0600000000000000,4650.12456923186,469891112.822415,24707928430752.0,1.20652335179169e+18,4.20944975081939e+22,1.16295271062130e+27,2.60226400455778e+31,3.00789291336734e+35,5.42077247509226e+39];
Denomenator = [1,38641.8063676545,6310806321.25806,191569828362650,1.24352413192413e+19,2.80476725730876e+23,8.53294093617103e+27,1.19060993549040e+32,1.34735868395659e+36,2.69647295062221e+39];
sys = tf(Numerator,Denomenator);
% Approach 1
dt1 = 1/7993;
model1 = c2d(sys, dt1)
isstable(model1)
% Approach 2
dt2 = 1/7993/226;
model2 = c2d(sys, dt2)
isstable(model2)
The output on my side is as follows:
model1 =
0.06 z^9 + 0.1932 z^8 + 0.08054 z^7 - 0.1131 z^6 + 0.2028 z^5 - 0.06023 z^4 + 0.01388 z^3 - 0.01858 z^2 + 0.03273 z + 0.001653
--------------------------------------------------------------------------------------------------------
z^9 - 1.597 z^8 + 1.203 z^7 - 0.3637 z^6 - 0.09543 z^5 - 0.03584 z^4 + 0.1618 z^3 - 0.08772 z^2 + 0.01795 z - 0.007951
Sample time: 0.00012511 seconds
Discrete-time transfer function.
ans =
logical
1
model2 =
0.06 z^9 - 0.5373 z^8 + 2.139 z^7 - 4.966 z^6 + 7.413 z^5 - 7.378 z^4 + 4.895 z^3 - 2.088 z^2 + 0.5196 z - 0.05747
--------------------------------------------------------------------------------------------------------
z^9 - 8.977 z^8 + 35.82 z^7 - 83.37 z^6 + 124.7 z^5 - 124.5 z^4 + 82.77 z^3 - 35.39 z^2 + 8.829 z - 0.9788
Sample time: 5.5358e-07 seconds
Discrete-time transfer function.
ans =
logical
0
I do appreciate your interest in this!

Connectez-vous pour commenter.

Réponse acceptée

Paul
Paul le 8 Oct 2020
It appears to be a numerical issue when using c2d with you transfer function model. Try converting to state space first:
sys = tf(Numerator,Denomenator);
bode(c2d(ss(sys),dt1/226),c2d(ss(sys),dt1/226,'tustin'),c2d(ss(sys),dt1/226,'matched'),sys),grid
abs(pole(c2d(ss(sys),dt1/226,'tustin')))
ans =
9.9826e-01
9.9826e-01
9.9919e-01
9.9919e-01
9.9775e-01
9.9775e-01
9.9480e-01
9.9480e-01
9.9865e-01
A quick look under the hood showed that c2d converts the input tf to ss anyway and then converts back to tf. That conversion back is probably where the problem lies. Convert your model to ss and stay there. If you can, avoid the transfer function form altogether and build your model directly in ss form and stay in ss form.
You should add the bode plot of your discrete model using dt1 to those plots to see if you get what you need for that sample time.
  1 commentaire
Yuan Zheng
Yuan Zheng le 13 Oct 2020
Thank you so much Paul! The problem got solved =)
Appreciate your help!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by