User Tools

Site Tools


eeros_architecture:control_system:signals

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:signals [2015/10/14 14:04] – grafeeros_architecture:control_system:signals [2021/03/03 08:29] (current) – [Reading from Unconnected Inputs] ursgraf
Line 3: Line 3:
 A signal represents a succession of varying physical quantities over time as used in signal processing and control. It has certain properties, such as a value and a timestamp, indicating the exact time corresponding to the value of the represented physical quantity. This is usually when the value was captured or generated.  A signal represents a succession of varying physical quantities over time as used in signal processing and control. It has certain properties, such as a value and a timestamp, indicating the exact time corresponding to the value of the represented physical quantity. This is usually when the value was captured or generated. 
  
-{{ signaluml.png?150 | Signal type with its properties}}+===== Properties ===== 
 +Each element of a signal is characterized by a value, a high precision timestamp, a name and additional properties, depending on the type of signal, which will provide semantic information. Some examples are dimension (e.g. length, mass, current, etc.), SI-unit (e.g. m, m/s, kg, Nm, A, etc.), reference coordinate system or activation state (enabled/disabled). Other properties could include information about the quality of the signal like noise or quantification which could be used for Kalman filtering. 
 + 
 +[{{ signaluml.png?150 | //Signal type with its properties//}}]
  
 It's important to note that a signal can carry a single value as well as a vector or matrix of values. For this purpose the field //value// is declared as of type T.  It's important to note that a signal can carry a single value as well as a vector or matrix of values. For this purpose the field //value// is declared as of type T. 
 +Signals are used to connect different blocks in the control system and share information between the control system, the sequencer and the safety system. 
  
-===== Using Signals ===== +Supported types for signals are 
-The example below shows a gain block being defined, where its input and output are set to a three dimensional vector. Its gain is therefore a 3x3-matrix. +  * Arithmetic (int, double ...)  
-<code c> +  * Logic (bool) 
- Gain<Vector3, Matrix<3,3>> g1({1,2,3,4}); +  * Vector (Vector2, Vector3, Vector4) 
- Gain<Vector3, Matrix<3,3>> g1({1,2,3,4}); +  * Matrix 
-</code>+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//}}]
  
-Each element of a signal is characterized by a value, a high precision timestamp, a name and additional properties, depending on the type of signal, which will provide semantic information. Some examples are dimension (e.g. length, mass, current, etc.), SI-unit (e.g. m, m/s, kg, Nm, A, etc.), reference coordinate system or activation state (enabled/disabled). Other properties could include information about the quality of the signal like noise or quantification which could be used for Kalman filtering.+The functions //getIn()// and //getOut()// return an input or output. To access the signals on those in- or outputs, use //getSignal()//.  
 + 
 +===== Timestamp ===== 
 +Every signal carries a timestamp. The timestamp of a signal is usually set in input blocks. Block which read from an external source and deliver this value on a output signal will set its timestamp to the time of the acquisition of the value. \\ 
 +Most blocks will not alter this timestamp. However, blocks which depend on the sampling time such as integrators or differentiators will change the timestamp according to their inner algorithm.   
 + 
 +===== Reading from Unconnected Inputs ===== 
 +If you try to read from an input, which is not connected to an output, a //NotConnectedFault// is thrown. Please make sure that such faults are handled correctly. For an example refer to [[getting_started:tutorials:controlsystem|]].
  
-Signals are used to connect different blocks in the control system and share information between the control system, the sequencer and the safety system.  
  
-In order to access the individual dimensions of a certain signal, use functions like 
-<code c> 
- sum.getOut().getValue();  // returns dimension 0 of output   
- sum.getOut().getValue(0);  // returns dimension 0 of output  
- sum.getOut().getValue(2);  // returns dimension 2 of output  
- sum.getIn(1).getValue(2);  // returns dimension 2 of input 1  
-</code>  
  
eeros_architecture/control_system/signals.1444824271.txt.gz · Last modified: (external edit)