User Tools

Site Tools


new

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
new [2021/05/19 15:28] – [Generic Block] ursgrafnew [2021/07/08 20:11] (current) – removed ursgraf
Line 1: Line 1:
-in https://wiki.eeros.org/eeros_architecture/control_system/available_blocks/int 
- 
-This, for instance, helps to stop integrating up a given input while handling an exception. Please note that an integrator is in the disabled state upon creation. Instead of enabling and disabling an integrator block manually, you can set an active safety level with  
-<code cpp> 
-setActiveLevel(safetySystem, safetyLevel) 
-</code> 
-If the active level is set, the integrator will be automatically be enabled if the current safety level is equal or greater than the active level.  
- 
- 
-https://wiki.eeros.org/eeros_architecture/control_system/available_blocks/switch 
- 
-By calling  
-<code cpp> 
-setActiveLevel(safetySystem, safetyLevel); 
-</code>  
-the switch will only switch if the current safety level is equal or greater than the safety level set by this method. 
- 
-====== Generic Block ====== 
-A generic block simply runs a predefined algorithm which can be passed to the constructor of the block. Such an algorithm could theoretically calculate any output from a given set of inputs. It can be especially valuable for cases like the following. A signal value must be applied with an offset and a scale. How to achieve this? 
-  - Use a constant block delivering the offset together with a sum block which adds the offset to the signal. Finally, a gain block applies the desired scale. All in all, you will use three blocks. 
-  - Use a generic block and define the necessary algorithm as follows <code cpp>GenericBlock<> gen([&]() { 
-  gen.getOut(0).getSignal().setValue(gen.getIn(0).getSignal().getValue() + 0.1) * 1.1); 
-  gen.getOut(0).getSignal().setTimestamp(gen.getIn(0).getSignal().getTimestamp()); 
-})</code> 
- 
-Such a generic block can save valuable execution time in reducing the number of necessary blocks. It can also be useful when a given algorithm cannot be stitched together from predefined blocks. 
- 
- 
-https://wiki.eeros.org/eeros_architecture/control_system/subsystem 
- 
-einfügen in https://wiki.eeros.org/tools/cplusplus 
- 
- 
-===== Using Input Signals ===== 
-Consider the following example 
- 
-This subsystem has an input which is used by several blocks within the subsystem. In order to be able to connect these blocks to the input, you have to define the input as being of type ''InputSub'' instead of simply ''Input'' 
-<code cpp> 
-InputSub<> in;   
-</code> 
-The getter function for this input will be  
-<code cpp> 
-virtual Input<>& getIn() {return in;}   
-</code> 
- 
-See Tutorial for a example of using a subsystem. 
- 
-Auch in Tutorial addieren. 
- 
  
new.1621430891.txt.gz · Last modified: 2021/05/19 15:28 by ursgraf