Skip to content

User Analog


dev_encoder_absolute_a supports 2 external user analog channels with the following parameters:

Analog sampling rate 10kHz
Available channels an_0, an_1
op_state warning bit Bit 6 - Analog warning flag

Analog signal path

At the analog sampling rate the analog signal is scaled, then filtered, then checked for any limit excursions before being presented to the user as a JCS signal.

Scaling

To convert the raw ADC reading to a real engineering value, a gain and offset is applied such that:

\[y = gain \times adc - offset \]

where \(adc\) is a raw ADC value in the range \([0, 4095]\), \(gain\) is the gain configuration parameter an_X_gain and \(offset\) is the offset configuration parameter an_X_offset.

It is recommended to configure the user analog gain and offset so that real engineering units are returned.

Commands Type Required Description
an_X_gain float32 Optional Gain (V/count).
Default value: 1.0 / 4096.0
an_X_offset float32 Optional Offset (V).
Default value: 0V

Filter

A software based 1st order low pass filter then is applied to the scaled signal. If required the filter cutoff may be configured:

Commands Type Required Description
an_X_filter_fc_hz float32 Optional User analog filter cutoff frequency (Hz).
Default value: 1kHz

Note: A hardware antialiasing filter is also installed.


Limits and warnings

The filtered and scaled signal is then checked for limit violations. Where the signal exceeds the warning limits, the op_state warning bit is asserted to alert the user. Where the signal exceeds any of the error limits, the device will issue an e-stop and enter an error state.

Limits and warnings

Commands Type Required Description
an_X_limit_error_h float32 Optional User analog high error limit.
If the analog signal (after gain and offset transform), rises above this value an estop will be generated and the device will shutdown all outputs.
Default value: 1.0
an_X_limit_warning_h float32 Optional User analog high warning limit.
If the analog signal (after gain and offset transform), rises above this value the analog warning bit in op_state signal will be asserted.
Devices will ensure that an_X_limit_warning_h <= an_X_limit_error_h
Default value: 1.0
an_X_limit_warning_l float32 Optional User analog low warning limit.
If the analog signal (after gain and offset transform), falls below this value the analog warning bit in op_state signal will be asserted.
Devices will ensure that an_X_limit_warning_l >= an_X_limit_error_l
Default value: 0.0
an_X_limit_error_l float32 Optional User analog low error limit.
If analog signal (after gain and offset transform), falls below this value an estop will be generated and the device will shutdown all outputs.
Default value: 0.0

Note: Units are not given as they are dependent on the application and attached hardware.


Renaming the analog signal for jcs_host

The JCS user analog signal name an_X may be renamed so that it reflects the quantity being measured. Once the signal is renamed the new name becomes the new signal name for use in structure.yaml, dev_host.yaml and all other jcs_host operations.

Before defining parameters in the dev_name.yaml configuration file, redefine the analog signal with:

an_X_name:  new_name
an_X_units: new_units