The disclosure refers to a method and an apparatus for computer-implemented generation of a state machine from a simulated technical component in a block-based simulation model. Furthermore, the disclosure refers to a corresponding computer program product and a corresponding computer program.
Block-based simulation models are known from the prior art. Those models enable simulations of a corresponding technical component being modelled by the simulation model. The technical component being simulated by the simulation model is described by a block within the simulation model where the block may be coupled to other blocks referring to other simulated technical components. In the following, the term technical component may refer to components of arbitrary size, wherein the component may also have sub-components. For example, a technical component may be a technical system including a plurality of sub-components.
H. Fu et al, “Hybrid automata of an integrated motor-transmission powertrain for automatic gear shift,” (2011 AMERICAN CONTROL CONFERENCE (ACC), 2011, pages 4604-4609, discloses a scheme of hybrid modelling of an integrated motor-transmission powertrain.
The behavior of technical components may also be described based on automatons, which are also referred as to state machines. Automatons for technical components represent the states of the technical components and transitions between those states. The description of a technical component by an automaton enables to apply specific analysis methods. Particularly, the behavior of a technical component described by an automaton may be formally verified. This is particularly useful in order to verify sequences of actions based on skills of the technical component described by the automaton.
Up to now, there do not exist any mechanisms enabling to convert a simulated technical component described by a simulation model into an automaton by the use of a computer.
Hence, it is an object of the disclosure to provide a computer-implemented method for generating a state machine (e.g., an automaton) from a simulated technical component in a block-based simulation model.
The scope of the present disclosure is defined solely by the appended claims and is not affected to any degree by the statements within this summary. The present embodiments may obviate one or more of the drawbacks or limitations in the related art.
The method enables a computer-implemented generation of a state machine from a simulated technical component in a block-based simulation model, where the simulated technical component is a block in the simulation model and includes a number of variables. Each variable has a value range with variable values which may be assigned to the respective variable when running a simulation of the technical component based on the simulation model. The variables may refer to continuous variables having a continuous variable range. Nevertheless, one or more of the variables may also refer to variables assuming discrete values. The simulated technical component may refer to any technical component, e.g., a component in an industrial automation system and/or an electric motor.
In the method, the following acts a) to e) are performed. In act a), one or more variables from the plurality of variables are selected. This may be performed automatically or semi-automatically as will be described later on.
In act b), a plurality of discrete states is generated for each selected variable, each state including a subset of values from the value range of the respective selected variable. In case that the selected variables have continuous value ranges, regions within the respective value ranges are defined which are associated with corresponding discrete states. In the same way, one or more discrete variable values may be associated with discrete states in case that the variable has discrete values. The discretization according to act b) is needed in order to generate automatons describing state changes as will be described in the following.
In act c), an automaton is generated for each selected variable, a respective automaton being represented by the states as generated in act b) of the respective selected variable and by one or more transitions from one state to another state of the respective variable. A respective transition is referenced by a label, and it is associated with a trigger condition defining the change of the respective selected variable resulting in the respective transition. In other words, the trigger condition defines that the respective transition is triggered when the value of the respective selected variable changes such that this change corresponds to a change between states as represented by the respective transition.
In act d), a first product automaton is generated from the automatons of all selected variables. This first product automaton includes a plurality of vector states representing all combination of states of all selected variables and a plurality of vector transitions for all transitions of single variables generated in act c). For example, each vector transition corresponds to a transition from one state to another state of a single variable as defined in act c) in a respective vector state where the states of the other variables in the respective vector state remain unchanged. In this first product automaton, the label and the trigger condition of the respective vector transition correspond to the label and trigger condition of the transition to which the respective vector transition corresponds.
In act e), superfluous vector transitions are removed from the first product automaton generated in act d). This removal is based on predefined rules applying to the simulation model. Particularly, those predefined rules describe the physics and/or the logic underlying the behavior of the simulated technical component. The removal of superfluous vector transitions results in a second product automaton which is the first product automaton not containing the removed superfluous vector transitions. This second product automaton is the state machine generated by the method. Due to the removal of superfluous vector transitions, the product automaton is reduced in size so that less computational recourses are needed when processing the product automaton.
The method enables a computer-implemented generation of an automaton based on a simulation model for a technical component. This is achieved by an adequate discretization of variables in the technical component and by creating a product automaton based on discrete states for the technical system. As a consequence, the simulated technical component may be subjected to methods which process automatons. For example, the automaton generated by the method may be used in implementations based on control theory.
In an embodiment, act a) is performed at least partly automatically based on a predefined selection of at least one variable. For example, the variables important for the behavior of the generated state machine are defined in advance. Alternatively, or additionally, act a) is performed at least partly semi-automatically in response to user inputs via a user interface, the user inputs specifying at least one variable which is to be selected.
In another embodiment, act b) is performed at least partly automatically based on predefined subsets of values from the value range of one or more selected variables. Alternatively, or additionally, act b) is performed at least partly semi-automatically in response to one or more user inputs via a user interface defining subsets of values from the value range of one or more selected variables.
Analogously to act a) and act b), act c) may also be performed at least partly automatically for at least one selected variable in order to generate an automaton for the at least one selected variable. For example, this automatic generation of an automaton may be performed in case that the respective variable has values with an order defining an adjacency relation. This is, e.g., the case when the variable refers to numbers. For variables having an order, transitions between adjacent regions of values corresponding to states may be defined up and down the ordering.
Additionally, or alternatively, act c) may also be performed at least partly semi-automatically in response to one or more user inputs via a user interface for at least one selected variable in order to generate an automaton for the at least one selected variable, the one or more user inputs specifying the transitions of the at least one selected variable. This semi-automatic generation of an automaton may be used for variables with non-ordered values.
In another embodiment, a validation act is automatically performed between act d) and act e), where the validation act tests whether the first product automaton generates outputs corresponding to outputs of the simulation model when running a simulation of the technical component based on the simulation model, where the method proceeds with act e) in case of a successful validation and where otherwise (e.g., in case of a failed validation) the method provides an input option on a user interface enabling one or more user inputs to modify the first product automaton, whereupon act d) is repeated based on the modified first product automaton.
Here and in the following, a successful validation refers to the scenario that the outputs of the simulation model correspond to the outputs of the product automaton whereas a failed validation refers to the scenario that at least one output of the simulation product does not correspond to the corresponding output of the product automaton. In the above validation act, the product automaton is the first product automaton. In the validation acts defined later on, the product automaton is a second product automaton or a third product automaton. The above validation act and also the validation acts described later on enable a test whether the product automaton corresponds to the simulated technical component in the simulation model. If not, means for modifying the automaton by a user are provided.
In another embodiment, a validation act is automatically performed after act e), where the validation act tests whether the second product automaton generates outputs corresponding to outputs of the simulation model when running a simulation of the technical component based on the simulation model, where the method either terminates or proceeds with another act without enabling a manual modification of the second product automaton in case of a successful validation. Otherwise, (e.g., in case of a failed validation), the method provides an input option on a user interface enabling one or more user inputs to modify the second product automaton, whereupon act e) is repeated based on the modified second product automaton.
In another embodiment, the second product automaton is further processed after act e) by act f) including one or more merging operations, where in a respective merging operation several vector states of the second product automaton differing in the value of a single variable are merged to a common vector state substituting the merged vector states, the vector transitions referring to the merged vector states being configured to vector transitions referring to the common vector state, thus resulting in a third product automaton. This act has the advantage that the size of the second product automaton is reduced.
Depending on the circumstances, at least one merging operation is performed automatically based on predefined rules and/or at least one merging operation is performed semi-automatically in response to one or more user inputs via user interface, the one or more user inputs specifying the vector states to be merged.
In an embodiment, the vector transitions of the merged vector states are configured to vector transitions referring to the common state as follows: i) in case that a vector transition refers to a vector transition from one merged vector state to another merged vector state, a self-loop transition is generated from the common vector state to the common vector state having a new label and the same trigger condition as the vector transition from the merged vector state to the other merged vector state; ii) in case that there are several vector transitions from a non-merged vector state to different merged vector states, a single vector transition having a new label is generated, the trigger condition being an OR concatenation of the trigger conditions of the several vector transitions; and iii) in case that there are several vector transitions from different merged vector states to different non-merged vector states being referenced by the same label and trigger condition, each vector transition of the several vector transitions receives a different label and a trigger condition discriminating between different merged vector states.
In another embodiment, a validation act is automatically performed after act f), where the validation act tests whether the third product automaton generates outputs corresponding to outputs of the simulation model when running a simulation of the technical component based on the simulation model, where the method terminates in case of a successful validation and where otherwise, (e.g., in case of a failed validation), the method provides an input option on a user interface enabling one or more user inputs to modify the third product automaton, whereupon act f) is repeated based on a modified second product automaton.
Besides the above method, the disclosure refers to an apparatus configured to perform the computer-implemented method or one or more embodiments of this method. In other words, the apparatus includes one or more processors configured to perform acts a) to e) and optionally perform acts of certain embodiments disclosed herein.
Furthermore, the disclosure refers to a computer program product with program code, which is stored on a non-transitory machine-readable carrier, for carrying out the method or one or more embodiments thereof when the program code is executed on a computer.
Moreover, the disclosure refers to a computer program with program code for carrying out the method or one or more embodiments thereof when the program code is executed on a computer.
In the following, embodiments of the disclosure are described in detail with respect to the accompanying drawings, wherein:
In the following, an embodiment of the disclosure is described with respect to the simulated technical component CO shown in
The operation of the motor in
As indicated in
In act S1 of
In the embodiment described herein, the three variables SP, TR, and VO are selected as the relevant variables. Each of the selected variables SP, TR, and VO is characterized by a continuous value range of values which may be assumed by the respective variable. However, in order to use those variables for state machines, discrete states of those variables need to be generated. This discretization is performed in act S2 of
In act S2, each variable is divided in two regions, namely a region, where the variable has the value 0, and the region, where the variable has a value greater than 0. Each region forms a respective state. For the variable speed SP, a speed equal to 0 is indicated as state S0 (SP=0) whereas a state of a speed greater than 0 is indicated as state S1 (SP>0). For the variable torque TR, a state of zero torque is indicated as state T0 (TR=0) whereas a state of torque greater than 0 is indicated as state T1 (TR>0). For the variable voltage VO, a state with zero voltage is indicated as state V0 (VO=0) whereas a state with a voltage greater than 0 is indicated as state V1 (VO>0). The above states are shown in
As a result of act S2, the above defined states S0, S1, V0, V1, T0, and T0 are provided for defining automatons in act S3, as will be described in the following. In act S3, an automaton A1 is generated for variable SP, an automation A2 for variable VO, and an automaton A3 for variable TR. Those automatons are shown in
As seen from
In the embodiment described herein, the automatons are generated automatically. This is because there are ordered sets of state variables based on adjacent value regions of variables. Therefore, transitions between adjacent regions may be defined as corresponding state transitions. However, in case that variables have non-ordered regions, act S3 may also be performed semi-automatically. In this case, a graphical representation of the regions is generated on a user interface UI. Based on this graphical representation, a user may define respective transitions between regions by user inputs IN, resulting in the generation of corresponding automatons.
Based on the automatons A1, A2, A3 generated in act S3, a first product automaton is created in act S4 incorporating the labels and trigger conditions as defined for the single automatons A1 to A3. This first product automaton PA is shown in
The respective vector transition VT receives the same label and trigger condition as the transition of the single variable within the respective automaton of
As shown in
After a successful validation act VS1, superfluous vector transitions in the first product automaton PA are removed in act S5 based on predefined rules RU applying to the simulation model SM. Those rules refer to the physical behavior of the motor CO in
If the voltage is in the state V0, then a transition of the variable TR from T0 to T1 is impossible (no voltage no torque).
If the voltage is in the state V0, then a transition of the variable SP from S0 to S1 is impossible (no voltage no speed).
If the voltage is in the state V1, then a transition of the variable TR from T1 to T0 is impossible (if voltage and torque occurs, then the torque stays).
As shown in
In case that the validation act VS2 succeeds (branch SU from act VS2), the method proceeds with act S6. Act S6 and the subsequent validation and modification acts VS3 and MO3 are optional, and the second product automaton generated in act S5 may be the result, (e.g., the generated state machine), produced by the disclosure. This automaton shows the same behavior as the simulation model SM for the motor CO and may be used in various applications and particularly in control theory.
In act S6 of
As a consequence, the transitions from merged state S0T0V0 to merged state S0T1V0 as well as from merged state S0T1V0 to merged state S0T0V0 need to be represented by new transitions in the form of self-loop transitions. Those self-loop transitions are indicated in
Due to the generation of the common vector state S0T*V0, there are now two vector transitions originating from this common state to different non-merged states, namely to S0T0V1 and to S0T1V1. To make this non-deterministic behavior deterministic, different labels and trigger conditions are used for those transitions. In other words, the transition from the common vector state S0T*V0 to vector state S0T1V1 receives the label L′ and the trigger condition CO′ defined by VO>0 and TR>0. This corresponds to the vector transition of the state S0T1V0 to S0T1V1 of
After having conducted the merging as shown in
The disclosure as described in the foregoing has several advantageous. Particularly, an automaton is generated which relates automaton states to the state space of a block-based simulation model, making it possible to verify the state changes between simulation and automatons and interpret simulation changes as state changes of the automaton. The transitions in the automaton refer to physically possible state changes of the variables of the corresponding technical component. Trigger conditions for transitions have a physical interpretation in the state space. The ports and interfaces of the block-based simulation model may be mapped to transitions and labels of the automaton, allowing composition of automatons consistent with composition of simulation models. Due to the coupling of a simulation model with an automaton, automaton theories may be used for validation. Furthermore, automatons help to interpret simulation traces in terms of state changes of relevant system states without understanding the underlying simulation model. The automatons generated by the disclosure may be used for an automatic analysis of erroneous behavior and error recovery in simulated technical components, like machines and plants.
It is to be understood that the elements and features recited in the appended claims may be combined in different ways to produce new claims that likewise fall within the scope of the present disclosure. Thus, whereas the dependent claims appended below depend from only a single independent or dependent claim, it is to be understood that these dependent claims may, alternatively, be made to depend in the alternative from any preceding or following claim, whether independent or dependent, and that such new combinations are to be understood as forming a part of the present specification.
While the present disclosure has been described above by reference to various embodiments, it may be understood that many changes and modifications may be made to the described embodiments. It is therefore intended that the foregoing description be regarded as illustrative rather than limiting, and that it be understood that all equivalents and/or combinations of embodiments are intended to be included in this description.
The present patent document is a § 371 nationalization of PCT Application Serial No. PCT/EP2019/074868, filed Sep. 17, 2019, designating the United States, which is hereby incorporated by reference.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/EP2019/074868 | 9/17/2019 | WO |