Control system

To describe Afecs control systems COOL (Control Oriented Ontology Language) ontology language is used. Let us assume that we need to create a control system that implements CODA state machine. For simplicity we will create a control system with one user component. Any control system must have a supervisor agent that will orchestrate the control, i.e. implementing FSM. AFECS allows designing and implementing user FSMs, yet for this tutorial we will show how to create control system that implements CODA state machine. This is by far the simplest COOL control system design, since CODA FSM description is hidden from users. 

 

Control system COOL configuration file having only one user component is shown below.

1  <rdf:RDF
2  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3  xmlns:cool="http://AFECSHOMEDB/schema/cool#"
4  >
5  
6  <rdf:Description rdf:about="http://COOLHOME/Control/USER#USER">
7
8    <cool:include rdf:resource="http://COOLHOME/Component/USER/COMPONENTS.rdf"/>
9    <cool:hasComponent rdf:resource="http://COOLHOME/Component/USER/U0#U0"/>
10
11 </rdf:Description>
12
13 </rdf:RDF>

First 4 lines indicate that we are using RDF and COOL language definitions. Line 6 starts the definition of the control system named USER1. Lines 9 tells that this specific control system has a component named U0 and that the COOL description of that component is presented in the COMPONENTS.rdf file located in the $COOL_HOME/<expid>/Component/USER/ directory (see line 8).

A control system description having 2 components (U0 and U1) that are described in the same COMPONENTS.rdf file will look like this:

1  <rdf:RDF
2  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3  xmlns:cool="http://AFECSHOMEDB/schema/cool#"
4  >
5  
6  <rdf:Description rdf:about="http://COOLHOME/Control/USER#USER">
7
8    <cool:include rdf:resource="http://COOLHOME/Component/USER/COMPONENTS.rdf"/>
9    <cool:hasComponent rdf:resource="http://COOLHOME/Component/USER/U0#U0"/>
10   <cool:hasComponent rdf:resource="http://COOLHOME/Component/USER/U1#U1"/>
11
12 </rdf:Description>
13
14 </rdf:RDF>

In the case U1 component is described in $COOL_HOME/<expid>/Component/USER/OLDCOMPONENTS.rdf file than the previous configuration will look like:

1  <rdf:RDF
2  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3  xmlns:cool="http://AFECSHOMEDB/schema/cool#"
4  >
5  
6  <rdf:Description rdf:about="http://COOLHOME/Control/USER#USER">
7
8    <cool:include rdf:resource="http://COOLHOME/Component/USER/COMPONENTS.rdf"/>
9    <cool:hasComponent rdf:resource="http://COOLHOME/Component/USER/U0#U0"/>
10
11   <cool:include rdf:resource="http://COOLHOME/Component/USER/OLDCOMPONENTS.rdf"/>
12   <cool:hasComponent rdf:resource="http://COOLHOME/Component/USER/U1#U1"/>
13
14 </rdf:Description>
15
16 </rdf:RDF>
 

Control system COOL/rdf configuration files must be located in the $COOL_HOME/<expid>/Control directory. As we mentioned earlier every AFECS control system must have a supervisor agent, and must have its own description in the Component/<runtype> directory.  However if the configuration is missing supervisor agent description, control designer agent will provide default supervisor with CODA FSM knowledge. Attention: provided default supervisors are for CODA FSM only. If you design a new state machine you must provide complete supervisor component description in COOL.  

COOL/rdf description for the U0 and U1 user components (file COMPONENTS.rdf) looks like this:

1  <rdf:RDF

2  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

3  xmlns:cool="http://AFECSHOMEDB/schema/cool#"

4  >

5

6  <rdf:Description rdf:about="http://COOLHOME/Component/USER/U0#U0">

7     <cool:hasName>U0</cool:hasName>

8     <cool:hasType>USER</cool:hasType>

9     <cool:hasPriority>88</cool:hasPriority>

10    <cool:isCodaComponent>true</cool:isCodaComponent>

11 </rdf:Description>

12

13 <rdf:Description rdf:about="http://COOLHOME/Component/USER/U1#U1">

14    <cool:hasName>U1</cool:hasName>

15    <cool:hasType>USER</cool:hasType>

16    <cool:hasPriority>88</cool:hasPriority>

17    <cool:isCodaComponent>true</cool:isCodaComponent>

18 </rdf:Description>

19 </rdf:RDF>

 

As one can see we define a name, a type and a priority for a component at the lines 7, 8, 9 (14, 15, 16) respectively. Note the lines 10 and 17 informing that these components are CODA components. This tells control designer agent to provide default CODA FSM state descriptions for a component.