I am a student doing a homework assignment and encountered this bug. Is this a known bug? Couldn't find anything when I searched for it.
I'm trying to implement a PID control loop. However, I noticed that the PID block's transfer function has an extra parameter (N) that I wasn't taught. I looked it up online and I understand why it's there, but nevertheless, I noticed that the "derivative" block doesn't require the same parameter (it requires a "c" parameter which defaults to inf, whereas N can't be set to inf) so I decided to implement PID "manually" using the derivative block, and compare the results with the built-in PID block using the default N and c values.
I created this system:
With the PID block and scope deleted or commented out, the "hand-crafted" PID system works as expected:
However, when I enable the PID and scope blocks, even though they should not affect any other part of the system, I get massively different results:
I assume that somehow the existence of the PID block triggered some (bad) optimization for the derivative block, creating this unexpected result. This is just conjecture of course.
I've attached the .slx file to this post so you can inspect this behavior yourself (not all values and parameters are visible in the screenshot).
This is a pretty crazy bug. Luckily it doesn't actually mess up my usage, but if I were to encounter it in any real-world usage it would be horrifying. How would I work around this?