User Tools

Site Tools


getting_started:tutorials:system1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:tutorials:system1 [2020/11/28 12:05] – [Explore Exceptions] ursgrafgetting_started:tutorials:system1 [2021/03/30 13:47] (current) ursgraf
Line 1: Line 1:
 ====== Simple System with Control and Safety System ====== ====== Simple System with Control and Safety System ======
-It is time to study a basic system consisting of a control system and a safety system. The control system encompasses a few blocks and one of their signals will be written to an output. As we do not have any real output we will use a simulator, see [[getting_started:install_wrapper#simulator|]]. Please build and install it. Further, you have to make sure that your example application is able to find the simulator library, see [[getting_started:deploy|]].\\ +It is time to study a basic system consisting of a control system and a safety system. The control system in this example encompasses a few blocks and one of their signals will be written to an output. As we do not have any real output we will use a simulator, see [[getting_started:install_wrapper#simulator|Simulator]]. Please build and install it. Further, you have to make sure that your example application is able to find the simulator library, see [[getting_started:deploy|]]. 
-In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run + 
 +In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/system/SystemTest1.cpp|SystemTest1.cpp]].  
 + 
 +Open a shell in the build directory of your EEROS library and run 
 <code> <code>
-$ ./examples/system/systemTest1 -c examples/system/SystemTest1Config.json+sudo LD_LIBRARY_PATH=/home/you/work/project/install-x86/lib/ ./examples/system/systemTest1 -c examples/system/SystemTest1Config.json
 </code> </code>
 +IMPORTANT You have to run a program using real time threads with root privileges and you have to set your library path so that the simulator library can be found, see [[getting_started:deploy:deploy_host|]]. 
 +
 This example encompasses a safety system and a control system. The control system has one time domain running several blocks This example encompasses a safety system and a control system. The control system has one time domain running several blocks
 [{{ :getting_started:tutorials:systemtest1.png?500 |//Control system of the example//}}] [{{ :getting_started:tutorials:systemtest1.png?500 |//Control system of the example//}}]
Line 10: Line 15:
  
 Upon switching the block also triggers a safety event. The safety system has four safety levels.  Upon switching the block also triggers a safety event. The safety system has four safety levels. 
-{{ :getting_started:tutorials:systemtest1ss.png?500 | }}+[{{ :getting_started:tutorials:systemtest1ss.png?300 |//Safety system of the example// }}]
 The system will start in level ''slInitializing''. The system will stay there for five seconds after which the time domain is started and a ''seStartRunning'' event is triggered. This will change the safety system into level ''slRunning''. Here, the integrator sums its input signal up to where the switch reaches its trigger level. The switch will automatically switch to its second input, which is simply a constant signal and the safety event ''seStopping'' causes the safety system to change into level ''slStopped''. It will stay there for three seconds after which it changes back into level ''slRunning'' and also switches its input back to its first input. After that the cycle restarts. The system will start in level ''slInitializing''. The system will stay there for five seconds after which the time domain is started and a ''seStartRunning'' event is triggered. This will change the safety system into level ''slRunning''. Here, the integrator sums its input signal up to where the switch reaches its trigger level. The switch will automatically switch to its second input, which is simply a constant signal and the safety event ''seStopping'' causes the safety system to change into level ''slStopped''. It will stay there for three seconds after which it changes back into level ''slRunning'' and also switches its input back to its first input. After that the cycle restarts.
  
Line 19: Line 24:
 We can demonstrate what happens ... We can demonstrate what happens ...
   - if you forget to connect an input to an output. To see what happens if you read from an unconnected input, comment line number 42 and recompile. This removes the connection between the constant block and the gain block. As soon as the time domain tries to run the gain block a ''NotConnectedFault'' is thrown. This causes the time domain to trigger a ''seEmergency'' event. In the safety level ''slEmergency'' the time domain is stopped to prevent further faults.   - if you forget to connect an input to an output. To see what happens if you read from an unconnected input, comment line number 42 and recompile. This removes the connection between the constant block and the gain block. As soon as the time domain tries to run the gain block a ''NotConnectedFault'' is thrown. This causes the time domain to trigger a ''seEmergency'' event. In the safety level ''slEmergency'' the time domain is stopped to prevent further faults.
-  - if you try to write a NaN value to a peripheral output. Please add line 42 and remove line 50, recompile and run the test. The integrator will add up and after some time the switch will change to the second input. The second constant block has no value assigned to it. This causes the time domain to calculate the peripheral output value to be NaN and a ''NaNOutputFault'' is thrown. This causes the time domain to trigger a ''seEmergency'' event. In the safety level ''slEmergency'' the time domain is stopped to prevent further faults.+  - if you try to write a NaN value to a peripheral output. Please add line 42 and remove line 50, recompile and run the test. The integrator will add up and after some time the switch will change to the second input. The second constant block has no value assigned to it. This causes the time domain to calculate the peripheral output value to be NaN and a ''NaNOutputFault'' is thrown. This causes the time domain to trigger a ''seEmergency'' event. In the safety level ''slEmergency'' the time domain is stopped to prevent further faults. The value on the peripheral output block switches to a safe level. This level is defined for cases when a NaN would be output. A safe level must ensure that an real actor such as a motor won't go wild.
  
  
  
  
getting_started/tutorials/system1.1606561517.txt.gz · Last modified: 2020/11/28 12:05 by ursgraf