User Analog
dev_sg supports one external user analog channel with the following parameters:
Analog sampling rate | 2kHz |
Available channels | an_0 |
op_state warning bit |
Bit 5 - 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:
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.
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
Use as a temperature compensation source
dev_sg user analog signal may be used as a temperature source in the ADC transform temperature correction.
Ensure the gain and scale values are configure correctly.
If the user analog is to be used as temperature source, then it is recommended to configure the an_0_limit_warning
and an_0_limit_error
parameters to ensure the system will monitor for any temperature excursions.