User Tools

Site Tools


eeros_architecture:hal:scaling

This is an old revision of the document!


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.

Configuring an Analog Output

To configure such a channel follow these steps:

  1. Read the datasheet of your hardware and note the upper and lower limits of the analog output voltage.
  2. Enter this limits in the configuration file under range with minOut and maxOut.
  3. Get the upper and lower limits of the digital values of the converter from the datasheet.
  4. Enter this limits in the configuration file under range with minIn and maxIn.
  5. Write a small digital value to the analog output directly (not through eeros). That is, if your are using comedi for instance, you use a user interface and write a value of 1000 to one of its analog outputs.
  6. Record this value it in the configuration file under scale as minIn
  7. Measure the resulting voltage with a multimeter and record it in the configuration file under scale as minOut.
  8. Repeat this with a large digital value close to the upper limit. For this you have to know the range of your digital-to-analog converter.
  9. Record this value it in the configuration file under scale as maxIn
  10. Measure the resulting voltage with a multimeter and record it in the configuration file as under scale maxOut.

The resulting channel configuration will look like:

  "channel0": {
    "signalId": "dacOut0",
    "scale": [ { "id" : "dac",
                 "minIn":    2000, "maxIn":  64000,
                 "minOut": -9.787, "maxOut": 9.923 } ],
    "range": [ { "id" : "dac",
                 "minIn":       0, "maxIn":  65536,
                 "minOut":  -10.0, "maxOut":  10.0 } ],
    "unit": "V"
  }
eeros_architecture/hal/scaling.1494495858.txt.gz · Last modified: 2017/05/11 11:44 by graf