Matlab Simulink Discrete-Time Integrator Block with fixed point data type

556 Views Asked by At

I designed a controller in Simulink, which I want to compile in HDL and flash to an FPGA. Therefore I have to define the used data types in fixed point style rather than the standard double that Simulink chooses.
Every block I am using is working exactly the same as before after the datatype changes (apart from the precision in some cases of course) except for the discrete-time integrator block. With a fixed point data type (no matter which word or fraction length) the output value can only decrease and if it hits the bottom value limit of the datatype it jumps to the top one and decreases again.
I added a picture to clarify the difference. The integrator with double type was used and a second integrator exaclty the same except fpr the data type was logged at the same time.

Signal of integrator with double and with fixed point data types

What am I doing wrong? And how can I solve this problem? Thank you!

0

There are 0 best solutions below