User Tools

Site Tools


eeros_architecture:control_system:subsystem

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:subsystem [2023/06/28 13:09] ursgrafeeros_architecture:control_system:subsystem [2023/06/28 13:18] (current) – [Using Subio Block] ursgraf
Line 7: Line 7:
  
 ==== Using Subio Block ==== ==== Using Subio Block ====
 +
 +Define the number of inputs and outputs of your sysbsystem together with the necessary inner blocks in your custom class. In the constructor you create the inner blocks and connect them among each other. The run-method must call all the run-methods of the inner blocks. Set the outputs of your subsystem to suitable outputs of your inner blocks.
 +<code cpp>
 +class Observer : public eeros::control::Subio<1,1,Vector2,Vector2> {
 + public: 
 +  Observer() : gain1({5.0, 2.2}) ... {
 +    sum1.getIn(1).connect(sum2.getOut());
 +    sum1.negateInput(1);
 +    setOut(sum1.getOut());
 +    ...
 +  }
 +
 +  virtual void run()  {
 +    sum2.run();
 +    sum1.run();
 +    ...
 +    gain1.run();
 +  }
 +  
 + private: 
 +  eeros::control::Gain<Vector2> gain1;
 +  eeros::control::Sum<2, Vector2> sum1, sum2;
 +  ...
 +};
 +</code>
 +
 +The whole subsystem is now a block for itself. It can be added to a control system (or an outer subsystem). Its run-method will be called automatically as soon as it is added to a time domain which itself must be started by the executor.
  
 For an example study the tutorial at [[getting_started:tutorials:subsystem|]] . For an example study the tutorial at [[getting_started:tutorials:subsystem|]] .
eeros_architecture/control_system/subsystem.1687950574.txt.gz · Last modified: 2023/06/28 13:09 by ursgraf