eeros_architecture:hal:scaling
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:hal:scaling [2017/05/11 11:45] – [Configuring an Analog Output] graf | eeros_architecture:hal:scaling [2021/05/20 07:31] – [Scale and Range of Analog Signals] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Scale and Range of Analog Signals ====== | ====== Scale and Range of Analog Signals ====== | ||
- | Within | + | Within |
===== Configuring an Analog Output ===== | ===== Configuring an Analog Output ===== | ||
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 upper and lower limits of the analog output voltage. | - Read the datasheet of your hardware and note the upper and lower limits of the analog output voltage. | ||
- | - Enter this limits in the configuration file under '' | + | - Enter these limits in the configuration file under '' |
- Get the upper and lower limits of the digital values of the converter from the datasheet. | - Get the upper and lower limits of the digital values of the converter from the datasheet. | ||
- Enter this limits in the configuration file under '' | - Enter this limits in the configuration file under '' | ||
- 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. | - 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. | ||
- | - Record this value it in the configuration file under '' | + | - Record this digital |
- Measure the resulting voltage with a multimeter and record it in the configuration file under '' | - Measure the resulting voltage with a multimeter and record it in the configuration file under '' | ||
- 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. | - 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. | ||
- | - Record this value it in the configuration file under '' | + | - Record this digital |
- | - Measure the resulting voltage with a multimeter and record it in the configuration file as under '' | + | - Measure the resulting voltage with a multimeter and record it in the configuration file under '' |
The resulting channel configuration for a 16bit DAC might look like: | The resulting channel configuration for a 16bit DAC might look like: | ||
Line 28: | Line 28: | ||
} | } | ||
</ | </ | ||
+ | If you know the scale and offset of your channel you could give these values directly as: | ||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Configuring an Analog Input ===== | ||
+ | To configure such a channel follow these steps: | ||
+ | - Read the datasheet of your hardware and note the upper and lower limits of the analog input voltage. | ||
+ | - Enter these limits in the configuration file under '' | ||
+ | - Get the upper and lower limits of the digital values of the converter from the datasheet. | ||
+ | - Enter this limits in the configuration file under '' | ||
+ | - Enter a small analog voltage value to the analog input and note it in the configuration file under '' | ||
+ | - Record the resulting digital input value of the analog-to-digital converter in the configuration file under '' | ||
+ | - 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 '' | ||
+ | - Record the resulting digital value in the configuration file as '' | ||
+ | |||
+ | The resulting channel configuration for a 16bit ADC might look like: | ||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Configuring an Encoder Input ===== | ||
+ | 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. | ||
+ | - Enter this limits in the configuration file under '' | ||
+ | - The '' | ||
+ | |||
+ | The resulting channel configuration for an encoder might look like: | ||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ |
eeros_architecture/hal/scaling.txt · Last modified: 2022/05/06 21:09 by jonasfrei