User Tools

Site Tools


eeros_architecture:hal:scaling

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
Last revisionBoth sides next revision
eeros_architecture:hal:scaling [2017/05/11 12:11] – [Configuring an Analog Output] grafeeros_architecture:hal:scaling [2021/05/20 07:32] – [Scale and Range of Analog Signals] ursgraf
Line 1: Line 1:
 ====== Scale and Range of Analog Signals ====== ====== Scale and Range of Analog Signals ======
-Within eeros we work with signals having physically meaningful units. However, when such signals are read from real-world hardware we use analog-to-digital converters or encoder which are basically counters. When outputting such signals we use digital-to-analog converters. These counters or converters all deliver or need an integer value. Its maximum and minimum value depend on the resolution of the underlying hardware. The ''scale'' and ''range'' key allows to convert between the necessary integer value and the physically meaningsful signals.+Within EEROS we work with signals having physically meaningful units. However, when such signals are read from real-world hardware we use analog-to-digital converters or encoder which are basically counters. When outputting such signals we use digital-to-analog converters. These counters or converters all deliver or need an integer value. Its maximum and minimum value depend on the resolution of the underlying hardware. The ''scale'' and ''range'' key allows to convert between the necessary integer value and the physically meaningful signals. You might have several stages in your hardware, see [[eeros_architecture:hal:scaling_multi|]].
  
 ===== Configuring an Analog Output ===== ===== Configuring an Analog Output =====
Line 28: Line 28:
   }   }
 </code> </code>
 +If you know the scale and offset of your channel you could give these values directly as:
 +<code>
 +  "channel0": {
 +    "signalId": "dacOut0",
 +    "scale": [ { "id" : "dac",
 +                 "scale":  0.5,
 +                 "offset": 2.5 } ],
 +    "range": [ { "id" : "dac",
 +                 "minIn":       0, "maxIn":  65536,
 +                 "minOut":  -10.0, "maxOut":  10.0 } ],
 +    "unit": "V"
 +  }
 +</code>
 +
    
 ===== Configuring an Analog Input ===== ===== Configuring an Analog Input =====
Line 58: Line 72:
 To configure such a channel follow these steps: To configure such a channel follow these steps:
   - Read the datasheet of your hardware and note the resolution of your encoder for a full turn.   - Read the datasheet of your hardware and note the resolution of your encoder for a full turn.
-  - Enter this limits in the configuration file under ''range'' with ''minIn'' and ''maxIn''+  - Enter this limits in the configuration file under ''scale'' with ''maxOut'' while ''maxIn'' is a full turn in rad
-  - Get the upper and lower limits of the digital values of the converter from the datasheet. +  - The ''range'' with have ''noLimit'' because it might turn forward or backward without limitation.
-  - Enter this limits in the configuration file under ''range'' with ''minOut'' and ''maxOut''+
-  - Enter a small analog voltage value to the analog input and note it in the configuration file under ''scale'' as ''minIn'' +
-  - Record the resulting digital input value of the analog-to-digital converter in the configuration file under ''scale'' as ''minOut''. If your are using comedi for instance, you use a user interface to read the digital value.  +
-  - Repeat this with a large voltage close to the upper limit. For this you have to know the range of your analog-to-digital converter.  +
-  - Record this value it in the configuration file under ''scale'' as ''maxIn'' +
-  - Record the resulting digital value in the configuration file as ''scale'' ''maxOut''.+
  
-The resulting channel configuration for a 16bit ADC might look like:+The resulting channel configuration for an encoder might look like:
 <code> <code>
   "channel0": {   "channel0": {
eeros_architecture/hal/scaling.txt · Last modified: 2022/05/06 21:09 by jonasfrei