getting_started:practical_problems:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
getting_started:practical_problems:start [2017/09/24 16:25] – [Trigger Safety Event from Control System] graf | getting_started:practical_problems:start [2017/09/24 16:37] – [How to Stop a System with CTRL-C] graf | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Do's ===== | ===== Do's ===== | ||
+ | * [[.: | ||
+ | * [[.: | ||
+ | * [[.: | ||
===== Don'ts ===== | ===== Don'ts ===== | ||
+ | [[.: | ||
===== Stumbling Blocks ===== | ===== Stumbling Blocks ===== | ||
+ | * [[.: | ||
+ | * [[.: | ||
- | ====== Trigger Safety Event from Control System ====== | ||
- | It is not advisable to use the safety system to check signals of the control system. This causes unnecessary confusion and blows up the safety system. Rather insert a [[eeros_architecture: | ||
- | ===== Avoid Hidden States in the Safety System ===== | ||
- | It might be tempting to define elaborate actions in a certain safety level. However, in order to keep the safety system clean and simple avoid such practises. Do not define different states in a safety level. If you need to stay a certain amount of time in a safety level use the field '' | ||
- | ===== Handle Faults in the Control System ===== | ||
- | input not connected, forget to connect | ||
- | nan | ||
- | initial signals = nan, forget to addBlock | ||
- | remove block | ||
- | ===== Remove Blocks when no longer used ===== | ||
- | Blocks have to be added to a time domain and will then be run by this. If you have blocks which are used only for a certain task such as initialization, | ||
- | ===== Switch Block Switches Automatically ===== | ||
- | There are cases were a switch block has to switch to a certain input under given conditions. While it might be possible to use the safety system to check this condition it might be preferable if the switch block itself switches when a certain condition is met. To use the sequencer for this purpose is generally not advisable as realtime cannot be met there. \\ | ||
- | For further information refer to [[eeros_architecture: | ||
===== Block with Parameters ===== | ===== Block with Parameters ===== | ||
Situation: inner states of blocks can be changed only through signals or getter / setter methods. How to implement a slowly changing inertia matrix? You do not want to calculate this matrix out of regular signals with full speed. Solution: use slow time domain for this purpose and change ... | Situation: inner states of blocks can be changed only through signals or getter / setter methods. How to implement a slowly changing inertia matrix? You do not want to calculate this matrix out of regular signals with full speed. Solution: use slow time domain for this purpose and change ... | ||
- | ===== How to Stop a System | + | ====== Shutting down a System ====== |
+ | How does a robot control system properly shut down? In general it does never stop. Pressing an emergency button might switch to a emergency safety level. However, in a system under development it is often desirable to end an application. That usually means to switch to a specific safety level where the necessary steps for a well controlled stopping of the application takes place. Only after this happened the executor stops running and returns control to the main program, which then stops as well. \\ | ||
+ | The following example shows how this can be accomplished. The code can be found in [[getting_started: | ||
+ | <code cpp> | ||
+ | #include " | ||
+ | #include < | ||
+ | void signalHandler(int signum) { | ||
+ | SafetySystem:: | ||
+ | } | ||
+ | |||
+ | int main() { | ||
+ | signal(SIGHUP, | ||
+ | signal(SIGINT, | ||
+ | signal(SIGQUIT, | ||
+ | signal(SIGKILL, | ||
+ | signal(SIGTERM, | ||
+ | signal(SIGPWR, | ||
+ | |||
+ | ... | ||
+ | | ||
+ | // Create and initialize safety system | ||
+ | double period = 1; | ||
+ | MySafetyProperties ssProperties; | ||
+ | SafetySystem safetySys(ssProperties, | ||
+ | |||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | <code cpp> | ||
+ | exitFunction = [& | ||
+ | privateContext-> | ||
+ | }; | ||
+ | </ | ||
+ | In the example this function triggers a safety event '' | ||
+ | |||
+ | After pressing '' | ||
+ | The system will stay in the level as long as the shutting down will take. This could include a whole sequence of steps such as applying brakes or driving to a safe position. As soon as this point is reached another safety event, '' | ||
+ | <code cpp> | ||
+ | slOff.setLevelAction([& | ||
+ | </ | ||
+ | This will cause the executor to stop running and return control to the main programm which in turns will exit. | ||
===== How to interact between Sequencer and Control System ===== | ===== How to interact between Sequencer and Control System ===== | ||
Seq soll signale in CS setzen (const) oder lesen \\ | Seq soll signale in CS setzen (const) oder lesen \\ | ||
- | ===== Comparisons of Safety Level do not Work ===== | + | |
- | addLevel forgotten \\ | + |
getting_started/practical_problems/start.txt · Last modified: 2018/04/17 14:54 by graf