eeros_architecture:control_system:blocks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
eeros_architecture:control_system:blocks [2015/10/14 14:42] – [Signals] graf | eeros_architecture:control_system:blocks [2017/03/17 12:07] – [Signals] graf | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Inputs and Outputs ===== | ===== Inputs and Outputs ===== | ||
- | Every output carries a signal. An input simply refers to a connected output. | + | Every output carries a signal. An input can be connected to an output and simply refers to the signal of this connected output. |
- | {{ inoutputuml.png?500 | //Input und Output Type//}} | + | [{{ 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. | ||
=====Predefined Blocks===== | =====Predefined Blocks===== | ||
Build your control system by instantiating all the necessary blocks. For example: | Build your control system by instantiating all the necessary blocks. For example: | ||
- | < | + | < |
Step<> | Step<> | ||
step.setName(" | step.setName(" | ||
Line 20: | Line 20: | ||
Gain<> | Gain<> | ||
- | posController.getOut().getSignal().setName(" | + | posController.setName(" |
</ | </ | ||
Each block has inputs and/or outputs. Name the output in a meaningful way and assign a physical unit to each of the outputs. The signals which connect the different blocks will be created automatically. \\ | Each block has inputs and/or outputs. Name the output in a meaningful way and assign a physical unit to each of the outputs. The signals which connect the different blocks will be created automatically. \\ | ||
Line 28: | Line 28: | ||
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. | ||
- | =====Signals===== | ||
- | The signals used to connect the blocks can be of different types. Currently the following types are supported | ||
- | * Real signals | ||
- | * Logic signals | ||
- | All signals are vectors of dimension 1...n. 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 c> | ||
- | Sum sum(3); | ||
- | sum.getOut().setName(" | ||
- | sum.getOut().setUnit(" | ||
- | </ | ||
- | This is shown in the following diagram: | ||
- | {{ sumblock.png? | ||
- | |||
- | The functions //getIn()// and // | ||
- | In order to access the individual dimensions of a certain signal, use functions like | ||
- | <code c> | ||
- | sum.getOut().getValue(); | ||
- | sum.getOut().getValue(0); | ||
- | sum.getOut().getValue(2); | ||
- | sum.getIn(1).getValue(2); | ||
- | </ | ||
=====Making Connections===== | =====Making Connections===== | ||
When all necessary blocks have been created the blocks must be wired together. | When all necessary blocks have been created the blocks must be wired together. | ||
- | < | + | < |
- | sum.getIn(0).connect(step.getOut()); | + | sum.getIn(0).connect(step.getOut()); |
- | sum.getIn(1).connect(enc.getOut()); | + | sum.getIn(1).connect(gain.getOut()); |
- | posController.getIn().connect(sum.getOut()); | + | posController.getIn().connect(sum.getOut()); |
</ | </ | ||
+ | // | ||
+ | |||
+ |
eeros_architecture/control_system/blocks.txt · Last modified: 2022/04/19 12:36 by ursgraf