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

2 次查看(过去 30 天)
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 个评论
Omkar Sastry
Omkar Sastry 2022-3-17
编辑:Omkar Sastry 2022-3-17
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 2022-3-18
编辑:Adeel Jamal 2022-3-18
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 个评论
Omkar Sastry
Omkar Sastry 2022-3-21
编辑:Omkar Sastry 2022-3-21
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 HDL Code Generation 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by