Skip to main content

Sensor

A class to represent a Sensor in the manufacturing system.

Sensors are devices that monitor and collect data about Resources, Locations, or other manufacturing system components. They provide real-time or periodic measurements of various parameters like temperature, pressure, position, speed, etc.

Sensors are connected to various components in the manufacturing system:

  • Resources they monitor (machines, tools, conveyors)
  • Locations they observe
  • Products they inspect
  • Parts they measure

Best Practices:

  • Define clear measurement ranges and units
  • Set appropriate sampling frequencies
  • Maintain calibration schedules
  • Monitor sensor health
  • Handle measurement errors
  • Track data history
  • Set alert thresholds
  • Validate measurements

Attributes:

NameData TypeDescription
namestrHuman-readable name of the Sensor
sensor_typestrType of sensor (temperature, pressure, etc.)
measurement_unitstrUnit of measurement (°C, bar, mm, etc.)
range_minfloatMinimum measurable value
range_maxfloatMaximum measurable value
accuracyfloatMeasurement accuracy (± value)
sampling_ratefloatMeasurements per second
last_readingfloatMost recent measurement
last_reading_timedatetimeTimestamp of last measurement
alert_minfloatLower threshold for alerts
alert_maxfloatUpper threshold for alerts
statusstrCurrent sensor status (active, fault, etc.)
calibration_datedatetimeLast calibration timestamp
calibration_duedatetimeNext calibration due date
idstrUnique identifier
locationLocation or ResourcePhysical location of the sensor
creation_datedatetimeTimestamp when sensor was created
last_modifieddatetimeTimestamp of last modification

Example Configuration:

# Temperature sensor for a CNC machine
temp_sensor = Sensor(
name="CNC-1 Spindle Temperature",
sensor_type="temperature",
measurement_unit="°C",
range_min=0.0,
range_max=150.0,
accuracy=0.1,
sampling_rate=1.0, # Hz (readings per second)
alert_min=10.0, # alert if below 10°C
alert_max=120.0, # alert if above 120°C
resource=cnc_machine_1
)

# Vibration sensor for predictive maintenance
vib_sensor = Sensor(
name="Robot-2 Vibration Monitor",
sensor_type="vibration",
measurement_unit="mm/s",
range_min=0.0,
range_max=50.0,
accuracy=0.01,
sampling_rate=100.0, # 100 Hz sampling
alert_max=30.0, # alert if vibration too high
resource=robot_arm_2
)

# Position sensor for an AGV
pos_sensor = Sensor(
name="AGV-1 Position Tracker",
sensor_type="position",
measurement_unit="m",
range_min=0.0,
range_max=100.0,
accuracy=0.005,
sampling_rate=10.0, # 10 Hz position updates
resource=agv_1
)
note

Sensors are used for monitoring manufacturing processes.

Constructor

def __init__(self, /, *args, **kwargs):

Initialize self. See help(type(self)) for accurate signature.

Example Usage

# Create a new Sensor instance
Sensor(
args=<_empty>
kwargs=<_empty>
)