Its not your setup. There is a bug in the LQ Control system. I cut out the arduino and pin14 and put a sine wave into the pendulum and it still crashes under version 5. There appears to be a bug with the TimeTable used in the LQ regulator. That is unused in the default mode (referencetype =2). So I cut it out and replaced it with a constant of zero and the LQ regulator now runs properly.
It is resolved! Your advice is really helpful to me!
Thank you Neil!
The example runs on current version with Arduino and all graphs are drawn in real time.
But only the animation works a few seconds delayed.
I cannot understand the reason.
Thank you for the excellent answer Neil. I just wanted to explain what the underlying problem was. TimeTable needs to start at 0 in the time (first) column in order to be valid. SystemModeler previously was a bit more lax and allowed it to start anywhere, like in the InvertedPendulum model, even though this meant that the table values at the start of the simulation was undefined. As of SystemModeler 5.0 this is no longer allowed which caused the error above.
It seems like you’ve already solved the issue with Neil’s help, but the download has been updated to reflect your issue. Some other small changes were also updated to better target newer versions of SystemModeler, they could possibly fix your animation issues, though I cannot reproduce them.