SensorAnalog - nasa/gunns GitHub Wiki

SensorAnalog

default_img

Background

This is a generic analog sensor model that can be instantiated directly within a GUNNS network. It is not an actual GUNNS link, but it may be referred to by links or spotters in the network. In particular, some electrical links use these sensors in their trip logic, so these sensors are common in electrical networks.

The sensor model takes a 'truth' input and adds sensor-type effects to model a sensor output. These effects include scale & bias, noise, range limits, etc. A suite of malfunctions can also be used to fail the sensor in various ways.

How To Use in Gunnshow

This class is not a GUNNS link, but is rather referred to by other link classes. Because it isn't a link it doesn't have ports or associated port connection rules. It does not graphically connect to any other shapes. To add a sensor to the network, just drag this shape onto the drawing and configure it with the configuration and input data described below.

Port Connection Rules (These are limitations on the port connection to nodes that the link enforces in run-time):

  • N/A

Other Rules (These are extra rules you should always try to follow):

  • N/A

Configuration Data Parameters:

  • Enter the path to the link model: (default = common/sensors/SensorAnalog.hh): If you see this field, leave it alone and don't change it. This is an old format left over from previous versions of GunnShow.
  • minRange (default = 0.0, must be < maxRange): This is the minimum output range of the sensor in its output units.
  • maxRange (default = 0.0, must be > minRange): This is the maximum output range of the sensor in its output units.
  • offValue (default = 0.0, must be in the range of (minRange - maxRange): This is the output value of the sensor, in its output units, when the sensor is unpowered.
  • nominalBias (default = 0.0): This is the nominal bias that is always added to the truth input in the sensor's output value.
  • nominalScale (default = 1.0): This is the nominal scale factor that the truth input is always multiplied by in the sensor's output value. This multiplication happens before the bias is applied, so sensor_output = (truth_input * nominalScale) + nominalBias.
  • nominalNoiseScale (default = 0.0): This is the nominal constant amplitude of noise in the sensor output. This component of the noise is always the same amplitude and doesn't scale by the input.
  • nominalResolution (default = 0.0): This is the nominal resolution, or precision of the sensor in its output units. The sensed output will not change by less than this value. A zero value gives the sensor infinite precision (actually limited to single-precision floating point in the simulation). A negative value here will be treated as zero.
  • noiseFunction (default = 0, must = 0): This a function pointer to the noise function to be used by the sensor. This must be left 0 in the drawing, as GunnShow can't include the noise function class in the network clas to refer to here. If noise is needed, this can be set via the Trick Input File.

Input Data Parameters:

  • powerFlag (default = false): This sets the initial powered (true) or unpowered (false) state of the sensor.
  • truthInput (default = 0.0): This sets the initial truth input value in input units.

Common Problems

  • N/A

References

  • N/A
⚠️ **GitHub.com Fallback** ⚠️