Why discrete time integrator in HDL coder simulink library behaves completely differently with different input sampling time?

2 vues (au cours des 30 derniers jours)
I use two constant blocks one with sampling freq of 2e-7(5 Mhz) and another with 4e-7 (2.5 Mhz) followed by two same discrete time integrators (Sample time:inherited). The first one outputs zero and the second one outputs a ramp (which is the correct result)... What am I missing here?
Why 2e-7 or 5 Mhz is not working with discrete time integrator???
  3 commentaires
Omkar Sastry
Omkar Sastry le 17 Mar 2022
Modifié(e) : Omkar Sastry le 17 Mar 2022
Hi Adeel,
Could you please attach the other artifacts required to simulate the model (like definition for Controller.InternalSignals.DataType.PLL)? Thanks!
Adeel Jamal
Adeel Jamal le 18 Mar 2022
Please run the following in the matlab workspace;
Controller.InternalSignals.DataType.PLL = fixdt(1,23,4);

Connectez-vous pour commenter.

Réponse acceptée

Adeel Jamal
Adeel Jamal le 18 Mar 2022
Modifié(e) : Adeel Jamal le 18 Mar 2022
In my opinion, due to the low resolution of the fractional bit length, it rounds to zero in internal calculations of discrete time integrator.
  1 commentaire
Omkar Sastry
Omkar Sastry le 21 Mar 2022
Modifié(e) : Omkar Sastry le 21 Mar 2022
Hi Adeel, yes this is exactly what is happening. The 'floor' rounding mode coupled with the type used drags the value to 0 for the K*T*u(n) calculation in the first block.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur HDL Code Generation dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by