Machines in OEE

oee machine

This page documents how machines participate in the OEE system. See Machine in the Glossary for the full data model and table schema.

Machine States

A machine’s operational state is derived from its current events, not stored as a separate field. The system evaluates the most recent event to determine the display state:

StateConditionColor
RUNNINGMachine has an active production/batch event (no end_ts)Green
DOWNMachine has an active downtime event (planned or unplanned)Red
IDLENo active batch and no active downtimeGray
SCHEDULEDA batch is scheduled with a future start_tsOrange

These states are derived, not stored. The derivation logic evaluates the event type, downtime reason type, and timestamps:

  • Production/batch event with no end_ts = RUNNING
  • Production event with end_ts = IDLE (completed, machine now idle)
  • Aborted batch = IDLE
  • Downtime event with planned reason type = DOWN
  • Downtime event with unplanned reason type = DOWN
  • Downtime event with idle reason type = IDLE
  • Incident event = IDLE (incidents do not change machine state)

Machine-Station Relationship

Machines relate to stations via a many-to-many join table:

  • A machine can belong to zero or more stations
  • A station can have zero or more machines
  • A machine can exist at a Site without being assigned to any station
  • A machine can operate across multiple stations

Two relationship modes exist:

Collaborative

Multiple machines (and people) contribute time to jobs at the same station. Each machine contributes its own hours to the job’s cumulative total. The station is the container where resources work together.

Dedicated (1:1)

A single machine is the sole contributor at its station. The station is a structural wrapper, and the machine and station are essentially one entity. When a job runs at the station, that machine is running. No other resources contribute time.

See Station Configuration for the machine_only and allow_concurrent_jobs settings.

How Machines Participate in OEE

Machines do not have OEE calculated directly on them. Instead, machines provide the raw time and event data that feeds into OEE calculations at the job, station, and product level.

Availability

Availability is derived from machine uptime vs. downtime. When a machine has an active downtime event, that time counts against availability. The downtime reason type determines how it affects the calculation:

Downtime TypeEffect on Availability
unplannedAlways reduces availability
plannedDepends on calculation mode: excluded in standard, included in strict and teep
idleDepends on calculation mode: excluded in standard and strict, included in teep

See Analytics for the three calculation modes (standard, strict, TEEP).

Performance

Performance compares actual production rate to the target rate. Machines define target rates via:

  • ideal_cycle_time_seconds — target time per part
  • target_rate / target_rate_unit — target production rate
  • expected_batch_duration_hours — expected run time per batch
  • expected_parts_per_batch — expected output per batch

Quality

Quality is the ratio of good parts to total parts produced. Part counts are recorded on batch/job completion events.

Time Contribution to Jobs

Machines contribute hours to jobs via production events in oee_machine_events. Machine time is cumulative — multiple machines can work on the same job simultaneously, and their hours are summed. See Job Time Tracking for the full model.

Machine Events

Three event types are recorded against machines via oee_machine_events:

Production/Batch Events

Track when a machine is actively producing. Each event has start_ts and end_ts (NULL if ongoing). Extended by oee_batch_details with part counts, status, and work order information.

Downtime Events

Track periods where a machine is not producing. Each downtime event has a downtime_reason_id linking to the Reason Taxonomy. The reason’s parent group determines the downtime type (planned, unplanned, or idle).

Downtime events support a troubleshooting workflow:

  • troubleshooting_started_at/by — when someone began investigating
  • troubleshooting_notes — investigation notes
  • resolved_at/by — when the issue was fixed
  • resolution_notes — description of the fix

Incident Events

Track non-downtime occurrences (quality issues, safety observations, maintenance notes). Incidents have an incident_reason_id linking to the Reason Taxonomy. Incidents do not affect OEE calculations or machine state — they are informational records.

Multi-Machine Events

A single downtime or incident event can affect multiple machines simultaneously via the oee_machine_event_machines junction table. For example, a power outage affecting three machines is recorded as one event linked to all three. See Events for details.

Machine Metrics on the Schematic

When machines appear on the process flow schematic, each node displays:

  • Current state (running/down/idle) as a color-coded badge
  • Active batch count
  • Queue count (batches waiting)
  • Rolling 7-day OEE percentage

Codebase Paths

  • Table: database/sql_scripts/tables/oee_machines.sql
  • Events table: database/sql_scripts/tables/oee_machine_events.sql
  • Event models: frontend/src/app/features/oee-dashboard/models/machine-event.model.ts
  • Frontend: frontend/src/app/features/oee-dashboard/

See Also