Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Discrete logic equations not producing expected results

Discrete logic equations not producing expected results

Hello,

I am working on testing some PLC logic that I have developed against simulated machine conditions. In order to do this I have recreated the controller logic in OMEdit and connected it to a simulation model of the machine. The problem I have is that it seems the solver is coming up with erroneous results. For example, I have a constant feeding into a not block, which you would expect to produce a constant output that is the inverse of the input, but is actually changing its output after the various events that are occurring in the simulation. A constant feeding into a not block is simple enough that I wonder if the solver has gone astray.

I am wondering if anyone has recommendations on things I can try or look at in order to try to debug what is going on here. The flattened equations look as they would expect. I have attached my package in case anyone else wants to try it on their system. If you run SafetyController.Simulations.Input.AllModeTraversal you should see that main.nSf25SafeModeControl_TestMode.not13.y switches values throughout the simulation even though the u input never changes. I have attached pictures of the two blocks in question and the plot of variables.

Does anyone have any suggestions on what may be happening here?

Thanks!
Ryan

Attachments:

https://openmodelica.org/images/agorapro/attachments/6248/mini_Model-State-Changes.png

https://openmodelica.org/images/agorapro/attachments/6248/mini_Not13-Simulation-Output.png

https://openmodelica.org/images/agorapro/attachments/6248/mini_Not13.png

Edited by: ryan.helminen - Jan-22-18 16:46:47
There are 0 guests and 0 other users also viewing this topic
You are here: