Engee documentation

First steps in finite automata

This example demonstrates finite automaton logic and is not exhaustive. For a deeper understanding of finite automata, please refer to other articles in State Machines.

Consider working with a finite automaton (CA) using a model of an automatic fire suppression system as an example. The final model will include the basic elements of the KA library stateflow button library:

For ease of understanding. Memory node stateflow history junction will not be used.

Let’s assume that the model can be in the following states:

  • Rest - the smoke concentration limit is not exceeded;

  • Alarm - the system activates the sprinkler;

  • Fault - self-diagnostics has shown a system malfunction and further operation is not possible.

im1

The system has one input - smoke concentration in the air and two outputs - "sprinklers" and "fault lamp". Depending on the value of the input signal, the system switches to one of the possible states, and the values of the output signals are set accordingly:

  • Rest - sprinklers off, fault lamp off;

  • Alarm - sprinklers switched on, fault lamp switched on;

  • Fault - Sprinklers off, fault lamp on.

The system transitions from one state to another via transitions:

im2

Transitions between states occur when certain conditions ([]) specified in the model are met. A transition condition can be an event, a logical condition, or time. In our example, the transition condition from Quiet to Alarm is that the smoke concentration exceeds the maximum permissible concentration, and Fault occurs if the sensor shows a negative concentration value.

im3

To add more complex conditions to the model, you can use nodes:

im4

The top node blocks the transition from the Quiet state to the Alarm state if the concentration is too high, as this does not correspond to the real situation. Instead, the system also transitions to the Failure state.

The example model of an automatic fire extinguishing system illustrates the basic principles of a finite automaton: dividing logic into states, defining conditions for transitions, and using nodes to handle more complex scenarios. This approach allows the development of a robust and predictable system that responds correctly to changes in input signals, minimising errors when implemented in the real world.