Channel 1

This page documents the channel 1 configuration

Configuration file fields

This section is autogenerated from the Rule Schema file.

Channel 1 (1/2 primary) sensor.channel_1

Range sensor.channel_1.range

Type Default Options
integer 0

0-10V: 0 0-5V: 1 0-2.5V: 2 0-1.25V: 3 0-0.625V: 4

Digital low voltage level (%) sensor.channel_1.digital_low

Type Default
integer 50

Digital high voltage level (%) sensor.channel_1.digital_high

Type Default
integer 50

Pulse count sensor.channel_1.pulse_count

Type Default Options
integer 0

Reset: 0 Accumulate: 1


Configuration explained

This section contains additional information and examples.

Range

The input range can be configured for each channel pair (primary and secondary). The CANmod.input supports the following ranges:

Range [V]

Resolution [mV/bit]

0-10

9.8

0-5

4.9

0-2.5

2.4

0-1.25

1.2

0-0.625

0.6

Note

The digital resolution can be improved by selecting an input range matching the expected input waveform (see example below)

Example 1

Below illustrates a 0-1 V, 100 mHz sine sampled using 0-10 V and 0-1.25 V input Range respectively. As the waveform is always in range 0-1 V, the Range can be set to 0-1.25 V without risk of clipping. By reducing the input range, the quantization resolution is improved.

../../../_images/range_config.png

Compares a continuous signal with two quantified signals (using 0-10 V and 0-1.25 V input ranges). The right plot zooms in on the signal to illustrate how the quantization resolution is improved.

Example 2

A typical application is pulse counting generated by a passive inductive pick-up sensor. The input signal amplitude varies with frequency, making it difficult to set digital thresholds. By first amplifying (and potentially saturating) the signal (using the input Range setting), digitization becomes simpler.

Below illustrates a 0-2 V periodic signal sampled using each of the possible Range settings. As the input range is lowered, the signal is effectively amplified. Amplification (even with saturation and clipping) can in some cases be advantageous when a signal is to be digitized. Notice how the “0-0.625” almost becomes a perfect square signal.

../../../_images/range_config_saturation.png

An input signal is amplified using the Range setting.

Note

Using the internal gain amplifier to saturate an input signal does not damage the device.

Digital low voltage level

Sets the digital low voltage level as a percentage of the full Range. The input signal is considered low when below this threshold.

The threshold is used to generate the digital and pulse output results.

For a example of using the low voltage level, see below.

Digital high voltage level

Sets the digital high voltage level as a percentage of the full Range. The input signal is considered high when above or equal to this threshold.

The threshold is used to generate the digital and pulse output results.

Note

A dead-zone (hysteresis) can potentially improve results for some input waveforms.

Example

Below illustrates the use of the digital high/low voltage level thresholds. The input signal is a 0-10 V, 500 mHz sine. The digital high/low levels are set to 80% (8 V) and 20% (2 V) respectively. The resulting digital level interpretation is given on the right axis.

../../../_images/digital_level.png

Example of how an analog signal is digitized using the digital high/low voltage level thresholds.

Pulse count

The pulse count is incremented when the digital level changes from low to high (rising edge). The pulse counting uses the Digital voltage level thresholds to determine when the digital level changes.

The pulse count can be configured as either Reset or Accumulate (more on this below).

Example 1

In below example, the high/low digital thresholds are set to 70% (7 V) and 30% (3 V) respectively. These settings result in a pulse count of 5 (5 transitions from digital low to high).

../../../_images/pulse_count_threshold_1.png

Digital high threshold: 7 V, digital low threshold 3 V. Markers indicate when the pulse count is increased by one.

Example 2

In below example, the high/low digital thresholds are set to 60% (6 V) and 40% (4 V) respectively. These settings result in a pulse count of 10 (10 transitions from digital low to high).

../../../_images/pulse_count_threshold_2.png

Digital high threshold: 6 V, digital low threshold 4 V. Markers indicate when the pulse count is increased by one.

Example 3

In below example, the high/low digital thresholds are set asymmetrically to 60% (6 V) and 10% (1 V) respectively. These settings result in a pulse count of 6 (6 transitions from digital low to high).

Note that the counter is only increased when the digital level changes from low level to high level. Two consecutive high levels (separated by a NA / unknown digital state), do not increase the counter.

../../../_images/pulse_count_threshold_3.png

Digital high threshold: 6 V, digital low threshold 1 V. Markers indicate when the pulse count is increased by one.

Note

Set digital thresholds to obtain a specific pulse count interpretation of a known input waveform

Reset

When configured to Reset, the channel pulse count is reset each time a output result is produced. The count period is changed by changing the output message scaler (see pulse output configuration).

Example

Below illustrates pulse count with 1 s reset (the pulse count output message is set to 1 s period). The frequency of the input pulse signal is 10 Hz. With a 1 s reset, the pulse count directly becomes the input signal frequency in Hz.

../../../_images/pulse_count_reset.png

Example of pulse count with 1 s reset. The blue line is the analog waveform. The red line is the pulse count.

Accumulate

When configured to Accumulate, the channel pulse count is never reset. This allows the CANmod.input to be used as a digital counter with adjustable high/low levels. This can e.g. be used to count number of rotations from an inductive pickup sensor or events from a physical switch.

Note

The size of the internal counter is 32 bit (>4 billion)

Example

Below illustrates pulse count configured to accumulate. The frequency of the input pulse signal is 10 Hz. The output message period is 1 s.

../../../_images/pulse_count_accumulate.png

Example of pulse count accumulating. The blue line is the analog waveform. The red line is the pulse count.