
Dec 15, 2025
The Engineering Guide to Real-Time OEE: Moving Beyond the Spreadsheet
A 2000-word masterclass on implementing real-time OEE. Learn how to capture micro-stops, handle complex state machines at the edge, and kill the 'Excel Factory' using Proxus.
If you walk into a factory manager's office today and ask for their OEE (Overall Equipment Effectiveness), they will likely point to a whiteboard or open an Excel file. "Last week," they will say, "we ran at 72%."
This number is almost certainly wrong.
In the traditional manufacturing world, OEE is treated as a lagging indicator. It is calculated after the fact, usually by summing up operator logbooks where downtimes are rounded to the nearest 15 minutes, and short stops are ignored entirely. This "Analog OEE" is a participation trophy; it makes people feel good, but it doesn't solve problems.
True Digital Transformation requires Real-Time OEE. This is not just a dashboard; it is a high-resolution forensic tool that exposes the microscopic inefficiencies bleeding your profitability.
In this deep-dive guide, we will move beyond the basic formula. We will explore how to architect a real-time OEE engine using the Unified Namespace (UNS), how to handle complex machine states (like Starved vs. Blocked) at the edge, and how to use Proxus to capture the "invisible" losses that Excel can never see.
This article assumes you understand the basic Availability x Performance x Quality formula. We are here to discuss implementation architecture, edge logic, and data modeling.
1. The Anatomy of "Real" OEE
Before writing code, we must agree on the philosophy. Real-time OEE differs from reported OEE in three critical ways:
- Granularity: It captures events in milliseconds, not minutes.
- Context: It knows what product is running (SKU context) to determine the correct theoretical speed.
- Automaticity: It removes the human bias. Operators don't "decide" why the machine stopped; the PLC tells us.
The Six Big Losses: A Digital Mapping
To build a robust OEE engine, you must map the classic TPM "Six Big Losses" to digital signals in your Proxus Edge Gateway.
| Loss Category | TPM Definition | Digital Signal (Proxus) |
|---|---|---|
| Availability | Equipment Failure | PLC State = FAULT (Alarm Code > 0) |
| Availability | Setup & Adjustments | PLC State = SETUP or CHANGEOVER |
| Performance | Idling / Minor Stops | PLC State = IDLE or RUNNING but RPM < Threshold |
Reduced Speed | Actual_Cycle_Time> Ideal_Cycle_Time | | Quality | Process Defects | Quality Station NG_Count increment | | Quality | Startup Yield | Scrap_Count during State == RAMP_UP |
---
## 2. The Architecture: Edge-First Calculation
Many IIoT platforms make the mistake of sending raw sensor data to the cloud and calculating OEE there. This is a flaw.
OEE must be calculated at the Edge.
Why? 1. Latency: An operator needs to know now that they are falling behind, not 15 minutes later when the cloud processes the batch. 2. Data Volume: Sending every millisecond status change to the cloud is expensive. 3. Resolution: Capturing a 200ms micro-stop requires local processing power.
### The Logic Flow In the Proxus architecture, the OEE logic runs inside the Docker container on the factory floor (the Edge Gateway).
### Step 1: Ingest Raw State We read the raw heartbeat of the machine. This is usually a Status_Word integer from a Siemens S7 or an OpcUa_State string.
### Step 2: Normalize (The State Machine) We convert vendor-specific codes into a standard Enum: RUNNING, STOPPED, FAULT, IDLE, SETUP.
### Step 3: Enrich with Context We look up the currently running SKU (from the ERP production order) to find the Ideal Cycle Time. * Example: SKU "Bottle_500ml" runs at 0.5s/unit. SKU "Bottle_1L" runs at 0.8s/unit.
### Step 4: Compute & Buffer We calculate the OEE components every second and publish them to the Unified Namespace.
---
## 3. The Killer Feature: Micro-Stop Detection
This is where you earn your ROI. A "Micro-Stop" is a stoppage typically shorter than 2-5 minutes. Operators rarely log these. They clear the jam, hit reset, and keep going.
However, if a machine stops for 30 seconds, 40 times a shift, you have lost 20 minutes of production. That is 4% of your Availability, vanished into thin air.
### Implementing Micro-Stop Logic with C# Using the Proxus Scripting Engine, we can detect these automatically. Here is a simplified logic pattern:
```csharp // Proxus Edge Script: MicroStopDetector.cs
public class OEEEngine : IEdgeScript { private DateTime _lastStopStart; private bool _isStopped = false; // Threshold: Stops shorter than 120s are "Micro", longer are "Downtime" private const double MICRO_STOP_THRESHOLD = 120.0;
public void OnDataUpdate(string topic, object value) { // Assume topic is "Line1/PLC/State" var state = value.ToString();
if (state == "STOPPED" && !_isStopped) { // Machine just stopped _lastStopStart = DateTime.Now; _isStopped = true; } else if (state == "RUNNING" && _isStopped) { // Machine just started - calculate duration var duration = (DateTime.Now - _lastStopStart).TotalSeconds;
if (duration < MICRO_STOP_THRESHOLD) { // This is a Micro-Stop LogMicroStop(duration); Publish("Line1/OEE/Losses/MicroStop_Duration", duration); } else { // This is a major Downtime LogDowntime(duration); Publish("Line1/OEE/Losses/Downtime_Duration", duration); } _isStopped=false; } } } ``` By publishing MicroStop_Duration to the UNS, you can create a heatmap showing exactly when these stops happen. Often, they cluster around shift changes or raw material batches. --- ## 4. The "Starved" vs. "Blocked" Dilemma A machine isn't always "broken" when it's not running. In a continuous production line, context is everything. * Starved: The machine is ready to run, but the upstream machine hasn't given it any material. * Blocked: The machine is running, but the downstream machine is full/stopped, so the conveyor is backed up. If you penalize a machine's OEE for being Starved or Blocked, your operators will revolt. They will say, "It's not my fault the filler stopped!" And they are right. ### Handling Line Integration In your OEE logic, you must differentiate between Internal Downtime (Machine Fault) and External Downtime (Starved/Blocked).
- folder Line_Logic_Tree
- folder Input_Sensors
- draft Infeed_Photocell Detects incoming product
- draft Outfeed_Photocell Detects outgoing backup
- folder Derived_States
- draft State: RUNNING Motor On
- draft State: FAULT Alarm Active
- draft State: STARVED Motor On AND Infeed Empty
- draft State: BLOCKED Motor On AND Outfeed Full
Current_Job topic via the IT/OT Bridge. 2. Lookup Table: The edge gateway holds a local SQLite or JSON lookup table: { "SKU_001" : 0.5s, "SKU_002" : 0.8s }. 3. Real-Time Adjustment: When the job changes, the calculation formula automatically updates the denominator. This ensures that 100% Performance means "We are running as fast as physics allows for this product." --- ## 6. Visualization: The Andon Board Collecting data is useless if you don't visualize it effectively. An Andon Board is a large TV screen on the factory floor.Current State
A massive Green/Red indicator. Visible from 50 meters away.
Shift Target vs. Actual
A simple gauge: 'We should be at 5000 units. We are at 4200.'
Run, Stop, Count, and Scrap from the PLC? If not, do we need to install retro-fit sensors (e.g., a simple Photo-eye for counting)? ### 2. Namespace Design Create the MQTT topics. Factory/Line1/Machine/OEE/Availability Factory/Line1/Machine/OEE/Performance Factory/Line1/Machine/OEE/Quality ### 3. Edge Logic Deployment Write the C# script to handle the state machine, micro-stop detection, and dynamic cycle time lookup. Deploy this to the Edge Computing node via Docker. ### 4. Shift Schedule Configuration Configure the Rule Engine with shift times. * Rule: IF Time is 12:00 AND Time is 12:30 THEN Planned_Downtime=True. * OEE should stop calculating during planned breaks, or Availability will plummet incorrectly. ### 5. Validate & Iterate Run the system for one shift alongside the manual paper log. Compare the results. * Result: Proxus will likely show lower OEE than paper. * Action: Explain to management that the paper OEE was inflated. The Proxus number is the truth.