User Tools

Site Tools


eeros_architecture:control_system:blocks

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
eeros_architecture:control_system:blocks [2017/03/17 09:16] – [Inputs and Outputs] grafeeros_architecture:control_system:blocks [2022/04/19 12:36] (current) – [Predefined Blocks] ursgraf
Line 3: Line 3:
  
 ===== Inputs and Outputs ===== ===== Inputs and Outputs =====
-Every output carries a signal. An input can be connected to an output and simply refers to the signal of this connected output. +Every output carries a [[eeros_architecture:control_system:signals|signal]]. An input can be connected to an output and simply refers to the signal of this connected output. 
-[{{ block.png?300 | //Two blocks connected together//}}]+[{{ block.png?200 | //Two blocks connected together//}}]
 This makes sure that each input is connected to a single output. On the other hand, an output can carry its signal to many inputs. This makes sure that each input is connected to a single output. On the other hand, an output can carry its signal to many inputs.
  
Line 12: Line 12:
   Step<> step(0.0, -3.14159265359, 5);   Step<> step(0.0, -3.14159265359, 5);
   step.setName("step 1");   step.setName("step 1");
-  step.getOut().getSignal().setName("phi_desired"); 
  
   Sum<3> sum;   Sum<3> sum;
   sum.setName("adds feedback");   sum.setName("adds feedback");
-  sum.getOut().getSignal().setName("control signal"); 
   sum.getIn(0).connect(step.getOut());   sum.getIn(0).connect(step.getOut());
   
-  Gain<> posController(174.5); // kp=174.5+  Gain<Vector2> posController(174.5); // kp=174.5
   posController.setName("gain block for position control");   posController.setName("gain block for position control");
 </code>  </code> 
Line 27: Line 25:
  
 Output signals are created together with the blocks. On the other side, there is no need to generate and name input signals.  Output signals are created together with the blocks. On the other side, there is no need to generate and name input signals. 
 +For most blocks you have to specify the signal types on its inputs or outputs with template parameters, see [[tools:cplusplus#templates|]]
  
-=====Signals===== 
-The signals used to connect the blocks can be of different types. They can be parametrized with the aid of template parameters. Supported types are 
-  * Arithmetic (int, double ...)  
-  * Logic (bool) 
-  * Vector (Vector2, Vector3, Vector4) 
-  * Matrix 
-Each signal can be assigned a name and a unit. All dimensions of a signal share the same name and unit.\\ 
- 
-As an example we look at a block which does summation. Two signals, each of dimension 3, will be added together.  
-<code cpp> 
-  Sum<2,Vector3> sum; 
-  sum.setName("adds feedback"); 
-  sum.getOut().getSignal().setName("control signal"); 
-</code>  
-This is shown in the following diagram: 
-{{ sumblock.png?300 | //Summation block with threedimensional signals//}} 
- 
-The functions //getIn()// and //getOut()// return an input or output signal, respectively. With the summation block, //getOut()// returns the single output signal.  
  
 =====Making Connections===== =====Making Connections=====
Line 56: Line 37:
 //getIn(0)// returns the first input signal. With //getIn(1)// you will get the second input signal. //getIn(0)// returns the first input signal. With //getIn(1)// you will get the second input signal.
  
 +===== Initial State of Outputs =====
 +All outputs of any block carry a value of NaN (not a number) after the block has been created. Only after the first execution of its run-method does the signal have a meaningful value.
  
eeros_architecture/control_system/blocks.1489738599.txt.gz · Last modified: 2017/03/17 09:16 (external edit)