-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clocking of synchronous state machines #3580
Comments
I would say that it corresponds to the There are several ways of handling that. We have the following Example: The second option is where everything is clocked, but without specifying a clock as in https://specification.modelica.org/maint/3.6/state-machines.html#example
|
I don't fully understand how this would produce a "synchronous" state machine. This means that for different transitions, differing clock tick rates can be set. Also I want to implement transitions based on specific signal events, and not a timed transition.
I cannot follow your example. None of the State Machine language constructs are used here. |
No, the transitions should all be on the clock of the state-machine. That is only possible if they all tick synchronously.
Having
It's in addition to the code in HierarchicalAndParallelStateMachine from the link (that contains those constructs) so:
|
This is also discussed quite extensively in #2287, unfortunately the discussion did not reach ignition temperature back then. I think this could be very interesting for the modelling of control automata in power system models, @adriguir, @marcochiaramello, @joyelfeghali, and @rosiereflo could comment on that. |
@HansOlsson thank you for your explanations! Still, I think we need to dissect the topic a bit more: Consider me reading the Modelica language spec, in which the terms "clock of the state machine" and "clock tick of the state machine" are used, but never clearly defined. Now let's consider the following example:
What is here "the clock of the state machine"? I assume Clock(1,1000)? And will therefore the Clock(1,100) be disregarded? Then let's look at a different case; a formulation with the when(...)-operator:
I would consider this to be an anti-pattern, or negative example, since So I guess an ideal, "expressive" solution for my problem would likely be (if correct, doesn't seem to work currently with OpenModelica):
Since it clearly introduces "the one and only" state machine clock, and uses the state machine Modelica language constructs as intended. |
...
No, the model is invalid. The synchronous sample goes from non-clocked to clocked, but |
I currently try to model a simple controller with the State Machine language constructs as described in the Modelica Specification (Chapter 17).
The specification mentions quite a few time the words "clock tick". Yet, the specification fails to describe how to establish a formal relation between a clock and a state machine (either semantically or syntactically). I'd request a clarification on this matter in the next version of the language spec.
For reference: I currently use OpenModelica, and tried to guess a solution by defining a clock in the state machine module, and also by exporting it to the sub-blocks with inner/outer definitions. Unfortunately, I was not able to change the state machine clock tick rate by this, and it stayed unchanged at one tick / second.
The text was updated successfully, but these errors were encountered: