Oee Calculation Example

OEE Calculation Example: Boost Your Manufacturing Efficiency :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } header { background-color: var(–primary-color); color: white; padding: 20px 0; text-align: center; margin-bottom: 20px; border-radius: 8px 8px 0 0; } header h1 { margin: 0; font-size: 2.5em; } h2, h3 { color: var(–primary-color); margin-top: 1.5em; margin-bottom: 0.5em; } .loan-calc-container { background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } .input-group { margin-bottom: 20px; padding: 15px; border: 1px solid var(–border-color); border-radius: 5px; background-color: #fdfdfd; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; margin-bottom: 5px; } .input-group .helper-text { font-size: 0.85em; color: #666; display: block; margin-top: 5px; } .error-message { color: red; font-size: 0.8em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; flex: 1; } .btn-calculate { background-color: var(–primary-color); color: white; } .btn-calculate:hover { background-color: #003366; } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; } .btn-copy { background-color: var(–success-color); color: white; } .btn-copy:hover { background-color: #218838; } #results-container { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); box-shadow: var(–shadow); } #results-container h3 { margin-top: 0; color: var(–primary-color); } .result-item { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed var(–border-color); } .result-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; } .result-label { font-weight: bold; color: var(–primary-color); display: block; margin-bottom: 5px; } .result-value { font-size: 1.2em; font-weight: bold; color: var(–text-color); } .primary-result { background-color: var(–success-color); color: white; padding: 15px 20px; border-radius: 5px; text-align: center; margin-bottom: 20px; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); } .primary-result .result-label { color: white; font-size: 1.1em; } .primary-result .result-value { font-size: 2.2em; color: white; } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 15px; padding: 10px; background-color: #eef; border-left: 4px solid var(–primary-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 20px; box-shadow: var(–shadow); overflow-x: auto; /* Make table scrollable */ display: block; /* Needed for overflow-x */ white-space: nowrap; /* Prevent wrapping within cells */ } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } canvas { max-width: 100%; height: auto; display: block; margin: 20px auto; border: 1px solid var(–border-color); border-radius: 5px; background-color: var(–card-background); } .chart-container { text-align: center; margin-top: 20px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } .chart-caption { font-size: 1em; color: #555; margin-bottom: 15px; } .article-section { margin-top: 40px; padding: 30px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } .article-section h2 { text-align: center; margin-bottom: 30px; } .article-section h3 { margin-top: 25px; color: #0056b3; } .article-section p { margin-bottom: 15px; } .faq-item { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dotted var(–border-color); } .faq-item:last-child { border-bottom: none; } .faq-question { font-weight: bold; color: var(–primary-color); cursor: pointer; display: block; margin-bottom: 5px; } .faq-answer { font-size: 0.95em; color: #555; margin-left: 15px; } .internal-links { margin-top: 30px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } .internal-links h3 { margin-top: 0; color: var(–primary-color); } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links p { font-size: 0.9em; color: #666; margin-top: 5px; } /* Responsive adjustments */ @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } header h1 { font-size: 1.8em; } .loan-calc-container, #results-container, .chart-container, .article-section, .internal-links { padding: 20px; } .button-group { flex-direction: column; } button { width: 100%; margin-bottom: 10px; } .primary-result .result-value { font-size: 1.8em; } table { font-size: 0.9em; } th, td { padding: 10px 12px; } }

OEE Calculation Example & Calculator

Master Your Manufacturing Efficiency

OEE Calculator

Calculate your Overall Equipment Effectiveness (OEE) to identify areas for improvement in your manufacturing processes.

Total minutes the equipment was scheduled to run.
Actual minutes the equipment was running.
The theoretical fastest time to produce one unit.
The total number of units produced during the run time.
The number of units that met quality standards.

OEE Calculation Results

Overall Equipment Effectiveness (OEE)
Availability
Performance
Quality
Total Units Produced
Good Units Produced
Total Operating Time (minutes)
Theoretical Maximum Production (units)
OEE Formula: OEE = Availability × Performance × Quality
Availability: (Run Time / Total Scheduled Time)
Performance: (Total Units Produced / Theoretical Maximum Production) / (Run Time / Ideal Cycle Time)
Quality: (Good Units Produced / Total Units Produced)
OEE Components Over Time (Simulated based on inputs)
OEE Calculation Breakdown
Metric Formula Value Unit
Total Scheduled Time N/A minutes
Run Time N/A minutes
Availability (Run Time / Total Scheduled Time) %
Ideal Cycle Time N/A seconds
Total Units Produced N/A units
Theoretical Maximum Production (Run Time * 60) / Ideal Cycle Time units
Performance (Total Units Produced / Theoretical Maximum Production) %
Good Units Produced N/A units
Quality (Good Units Produced / Total Units Produced) %
Overall Equipment Effectiveness (OEE) Availability × Performance × Quality %

What is OEE (Overall Equipment Effectiveness)?

Overall Equipment Effectiveness, commonly known as OEE, is a key performance indicator (KPI) used in manufacturing to measure how effectively a piece of equipment or a production line is utilized. It's a critical metric for understanding and improving manufacturing productivity by identifying losses in the production process. OEE is considered the best practice metric for measuring manufacturing productivity because it reveals the percentage of planned production time that is truly productive.

Who should use OEE? Any manufacturing facility aiming to optimize its operations, reduce waste, increase throughput, and improve profitability should use OEE. This includes companies in industries such as automotive, electronics, pharmaceuticals, food and beverage, and many others. Plant managers, production supervisors, process engineers, and continuous improvement teams are the primary users of OEE data.

Common Misconceptions about OEE:

  • OEE is just a number: OEE is not just a score; it's a diagnostic tool. The real value lies in understanding the underlying causes of low OEE and taking action.
  • OEE is only for complex machinery: OEE can be applied to any asset or process, from a single machine to an entire production line or even a manual assembly process.
  • Achieving 100% OEE is realistic: While the goal is high OEE, achieving 100% is virtually impossible due to inherent minor stoppages, defects, and changeovers. A world-class OEE is often considered to be 85% or higher.
  • OEE replaces other metrics: OEE complements other metrics like throughput, cost per unit, and cycle time; it doesn't replace them.

OEE Formula and Mathematical Explanation

The OEE calculation is a composite metric derived from three fundamental factors: Availability, Performance, and Quality. Each factor represents a different type of loss that impacts overall equipment effectiveness. By multiplying these three factors, OEE provides a single, comprehensive score of manufacturing productivity.

The Core OEE Formula

The fundamental formula for OEE is:

OEE = Availability × Performance × Quality

Let's break down each component:

1. Availability

Availability measures losses due to equipment downtime. It accounts for planned and unplanned stops.

Availability = Run Time / Total Scheduled Time

  • Run Time: The total time the equipment was actually running and producing parts.
  • Total Scheduled Time: The total time the equipment was scheduled to be running. This includes planned breaks, maintenance, and shift changes if they are considered part of the scheduled operation.

2. Performance

Performance measures losses due to the equipment running slower than its theoretical maximum speed. This includes minor stoppages and reduced speed.

Performance = (Total Units Produced / Theoretical Maximum Production) / (Run Time / Ideal Cycle Time)

A simpler way to think about Performance is:

Performance = Actual Production Rate / Theoretical Maximum Production Rate

Where:

  • Theoretical Maximum Production: The maximum number of units that *could* have been produced during the Run Time if the equipment ran at its Ideal Cycle Time. Calculated as: (Run Time * 60) / Ideal Cycle Time (in seconds).
  • Ideal Cycle Time: The theoretical fastest time to produce one unit.

3. Quality

Quality measures losses due to producing defective parts. It accounts for scrap and rework.

Quality = Good Units Produced / Total Units Produced

  • Good Units Produced: The number of units that meet quality standards without needing rework.
  • Total Units Produced: The total number of units produced, including good units and defective units.

Variable Explanations and Units

Here's a table summarizing the key variables used in the OEE calculation:

OEE Variables Table
Variable Meaning Unit Typical Range
Total Scheduled Time Total time equipment was scheduled to operate. minutes Varies (e.g., 480, 540)
Run Time Actual time equipment was running and producing. minutes 0 to Total Scheduled Time
Availability Ratio of actual run time to scheduled time. % 0% to 100%
Ideal Cycle Time Theoretical minimum time to produce one unit. seconds Positive number (e.g., 5, 10, 20)
Total Units Produced Total output during run time. units Non-negative integer
Good Units Produced Units meeting quality standards. units 0 to Total Units Produced
Theoretical Maximum Production Max units possible in run time at ideal speed. units Non-negative
Performance Ratio of actual output to theoretical maximum output. % 0% to 100%
Quality Ratio of good units to total units. % 0% to 100%
Overall Equipment Effectiveness (OEE) Combined measure of Availability, Performance, and Quality. % 0% to 100%

Practical Examples (Real-World Use Cases) of OEE

Understanding OEE becomes clearer with practical examples. Let's look at two scenarios in a manufacturing setting.

Example 1: A Well-Performing Production Line

A company runs a packaging line for a beverage product. They operate for an 8-hour shift (480 minutes).

Inputs:

  • Total Scheduled Time: 480 minutes
  • Planned Breaks: 30 minutes (deducted from scheduled time to get operating time)
  • Unplanned Downtime (e.g., minor jams, material refill): 15 minutes
  • Run Time: 480 – 30 – 15 = 435 minutes
  • Ideal Cycle Time: 5 seconds per unit
  • Total Units Produced: 3000 units
  • Good Units Produced: 2950 units

Calculations:

  • Availability: (435 min / 480 min) = 0.90625 or 90.63%
  • Theoretical Maximum Production: (435 min * 60 sec/min) / 5 sec/unit = 5220 units
  • Performance: (3000 units / 5220 units) = 0.5747 or 57.47%
  • Quality: (2950 units / 3000 units) = 0.9833 or 98.33%
  • OEE: 90.63% × 57.47% × 98.33% = 0.5100 or 51.00%

Interpretation: This line has good availability but suffers significantly in performance. The company needs to investigate why the line is running much slower than its ideal cycle time. This could be due to operator skill, machine wear, or material inconsistencies. The quality is excellent.

Example 2: A Machine with Quality Issues

Consider a CNC machining center that operates 24/7, so its scheduled time is very high.

Inputs:

  • Total Scheduled Time: 1440 minutes (24 hours)
  • Planned Breaks/Maintenance: 120 minutes
  • Unplanned Downtime (e.g., tool changes, minor breakdowns): 60 minutes
  • Run Time: 1440 – 120 – 60 = 1260 minutes
  • Ideal Cycle Time: 30 seconds per unit
  • Total Units Produced: 1500 units
  • Good Units Produced: 1350 units

Calculations:

  • Availability: (1260 min / 1440 min) = 0.875 or 87.5%
  • Theoretical Maximum Production: (1260 min * 60 sec/min) / 30 sec/unit = 2520 units
  • Performance: (1500 units / 2520 units) = 0.5952 or 59.52%
  • Quality: (1350 units / 1500 units) = 0.90 or 90.0%
  • OEE: 87.5% × 59.52% × 90.0% = 0.4714 or 47.14%

Interpretation: This machine has decent availability, but its performance is low, and its quality is significantly poor. The primary focus should be on understanding why 10% of the produced units are defective. This might involve tooling issues, programming errors, or material defects. Improving quality will have a substantial impact on the overall OEE.

How to Use This OEE Calculator

Our OEE calculator is designed to be intuitive and provide quick insights into your manufacturing performance. Follow these simple steps to get started:

  1. Gather Your Data: Before using the calculator, collect accurate data for the period you want to analyze (e.g., a shift, a day, a week). You will need:
    • Total Scheduled Time (in minutes)
    • Actual Run Time (in minutes)
    • Ideal Cycle Time (in seconds)
    • Total Units Produced
    • Good Units Produced
  2. Input the Values: Enter the collected data into the corresponding fields in the calculator. Ensure you use the correct units (minutes for time, seconds for ideal cycle time, units for production).
  3. Calculate OEE: Click the "Calculate OEE" button. The calculator will instantly process your inputs.
  4. Review the Results:
    • Primary Result: The overall OEE percentage is displayed prominently in a green highlighted box. This is your main indicator of manufacturing efficiency.
    • Intermediate Values: Below the primary result, you'll find the calculated Availability, Performance, and Quality percentages, along with other key metrics like Total Operating Time and Theoretical Maximum Production. These help pinpoint where losses are occurring.
    • Formula Explanation: A brief explanation of the OEE formula and its components is provided for clarity.
    • Table Breakdown: A detailed table shows each metric, its formula, calculated value, and unit, offering a comprehensive view.
    • Chart Visualization: The dynamic chart visually represents the OEE components, making it easier to grasp the distribution of losses.
  5. Interpret and Act: Use the results to identify areas for improvement.
    • Low Availability: Investigate unplanned downtime, setup times, and minor stoppages.
    • Low Performance: Analyze reasons for running below ideal speed, such as operator efficiency, machine wear, or material issues.
    • Low Quality: Focus on defect reduction, root cause analysis of scrap, and process control.
  6. Reset or Copy:
    • Click "Reset" to clear the fields and enter new data.
    • Click "Copy Results" to copy the main OEE value, intermediate values, and key assumptions to your clipboard for reporting or analysis.

By regularly using this calculator and acting on the insights gained, you can drive continuous improvement in your manufacturing operations. For more in-depth analysis, consider exploring related tools and resources.

Key Factors That Affect OEE Results

Several factors can significantly influence your OEE calculations. Understanding these is crucial for accurate measurement and effective improvement strategies.

  1. Downtime (Planned & Unplanned): This is the most direct impact on Availability. Unplanned downtime (breakdowns, jams) is a major loss. Planned downtime (maintenance, setups, changeovers) also reduces Availability if not managed efficiently. The duration and frequency of these stops directly lower the Availability score.
  2. Cycle Time Variations: Performance is heavily affected by how consistently equipment runs at its ideal cycle time. Fluctuations due to operator skill, material variations, or machine wear can lead to slower-than-ideal production, reducing the Performance score. Even minor speed reductions accumulate over time.
  3. Defect Rates (Scrap & Rework): Quality is directly tied to the number of good units produced versus total units. High scrap rates or the need for rework significantly decrease the Quality score. This often points to issues in process control, material quality, or operator training.
  4. Operator Skill and Training: Operator performance directly impacts both Performance (running speed) and Quality (defect rates). Inexperienced or poorly trained operators may run equipment slower, cause more stoppages, or produce more defects. Consistent training and standardized work procedures are vital.
  5. Machine Maintenance and Condition: The physical state of the equipment is paramount. Poorly maintained machines are prone to breakdowns (affecting Availability) and may not be able to run at their optimal speed (affecting Performance). Regular preventative and predictive maintenance are key to maintaining high OEE.
  6. Material Quality and Consistency: Inconsistent or poor-quality raw materials can lead to increased downtime (jams, tool breakage), slower run speeds, and higher defect rates. Ensuring reliable material suppliers and implementing incoming material inspections can mitigate these issues and improve all three OEE factors.
  7. Setup and Changeover Times: While often considered planned downtime, excessively long setup and changeover times significantly reduce Availability. Streamlining these processes (e.g., using SMED – Single-Minute Exchange of Die techniques) can dramatically increase the time equipment is available for production.
  8. Measurement Accuracy and Data Collection: Inaccurate data input will lead to misleading OEE results. If run time, units produced, or defect counts are not measured precisely, the calculated OEE will not reflect reality, hindering effective decision-making. Robust data collection systems are essential.

Frequently Asked Questions (FAQ) about OEE

What is considered a "good" OEE score?
A "good" OEE score varies by industry and company maturity. However, general benchmarks are:
  • Poor: Below 65%
  • Average: 65% – 75%
  • Good: 75% – 85%
  • World Class: 85%+
Focus on continuous improvement rather than just hitting a number.
How often should OEE be calculated?
OEE can be calculated at various frequencies depending on your needs. Many companies track it daily, shift-by-shift, or even in real-time for critical equipment. Weekly or monthly calculations are useful for trend analysis and strategic planning.
What's the difference between OEE and TEEP?
TEEP (Total Effective Equipment Performance) is similar to OEE but measures against *all* available time (24/7/365), not just scheduled time. TEEP = OEE × (Scheduled Time / Total Available Time). TEEP provides a broader view of potential capacity utilization, while OEE focuses on efficiency within planned operations.
How do I handle planned downtime like breaks and shift changes?
Planned downtime (breaks, meals, shift changes, scheduled maintenance) should be subtracted from the Total Scheduled Time to arrive at the Run Time. This ensures that Availability accurately reflects the time the equipment was *available* and *running* for production, excluding scheduled non-operational periods.
Can OEE be used for non-manufacturing processes?
Yes, the principles of OEE can be adapted to other areas like service industries, logistics, or even software development, although the specific metrics (Availability, Performance, Quality) might need redefinition to fit the context. The core idea of measuring efficiency against ideal performance and identifying losses remains applicable.
What are the main types of losses measured by OEE?
OEE categorizes losses into three main types:
  • Availability Losses: Unplanned downtime, planned downtime (setups, adjustments), minor stoppages.
  • Performance Losses: Slow cycles, small stops.
  • Quality Losses: Defects, scrap, rework.
How does OEE relate to Lean Manufacturing?
OEE is a cornerstone metric in Lean Manufacturing. It directly helps identify and quantify the "7 Wastes" (Muda) of Lean, particularly overproduction, waiting, and defects. By systematically reducing OEE losses, manufacturers implement Lean principles to eliminate waste and improve flow.
What is the role of data accuracy in OEE calculations?
Data accuracy is paramount. Inaccurate inputs for run time, units produced, or defect counts will lead to a flawed OEE score. This can result in misdirected improvement efforts and a lack of trust in the metric. Implementing reliable data collection methods (manual logs, automated sensors, MES systems) is crucial.
© 2023 Your Manufacturing Insights. All rights reserved.
var totalTimeInput = document.getElementById("totalTime"); var runTimeInput = document.getElementById("runTime"); var idealCycleTimeInput = document.getElementById("idealCycleTime"); var totalUnitsProducedInput = document.getElementById("totalUnitsProduced"); var goodUnitsProducedInput = document.getElementById("goodUnitsProduced"); var overallOEEOutput = document.getElementById("overallOEE"); var availabilityOutput = document.getElementById("availability"); var performanceOutput = document.getElementById("performance"); var qualityOutput = document.getElementById("quality"); var resultTotalUnitsOutput = document.getElementById("resultTotalUnits"); var resultGoodUnitsOutput = document.getElementById("resultGoodUnits"); var resultOperatingTimeOutput = document.getElementById("resultOperatingTime"); var theoreticalMaxProductionOutput = document.getElementById("theoreticalMaxProduction"); var tableTotalScheduledTime = document.getElementById("tableTotalScheduledTime"); var tableRunTime = document.getElementById("tableRunTime"); var tableAvailability = document.getElementById("tableAvailability"); var tableIdealCycleTime = document.getElementById("tableIdealCycleTime"); var tableTotalUnitsProduced = document.getElementById("tableTotalUnitsProduced"); var tableTheoreticalMaxProduction = document.getElementById("tableTheoreticalMaxProduction"); var tablePerformance = document.getElementById("tablePerformance"); var tableGoodUnitsProduced = document.getElementById("tableGoodUnitsProduced"); var tableQuality = document.getElementById("tableQuality"); var tableOEE = document.getElementById("tableOEE"); var chart; var chartContext; var chartData = { labels: ['Availability', 'Performance', 'Quality', 'OEE'], datasets: [{ label: 'Component Value (%)', data: [0, 0, 0, 0], backgroundColor: [ 'rgba(0, 74, 153, 0.6)', // Availability 'rgba(40, 167, 69, 0.6)', // Performance 'rgba(255, 193, 7, 0.6)', // Quality 'rgba(0, 123, 255, 0.6)' // OEE ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(255, 193, 7, 1)', 'rgba(0, 123, 255, 1)' ], borderWidth: 1 }] }; function initializeChart() { chartContext = document.getElementById("oeeChart").getContext("2d"); chart = new Chart(chartContext, { type: 'bar', data: chartData, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, max: 100, title: { display: true, text: 'Percentage (%)' } } }, plugins: { legend: { display: false // Hide legend as labels are on the bars }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += context.parsed.y.toFixed(2) + '%'; } return label; } } } } } }); } function updateChart(avail, perf, qual, oee) { if (chart && chartContext) { chart.data.datasets[0].data = [avail, perf, qual, oee]; chart.update(); } } function validateInput(inputId, errorId, minValue, maxValue) { var input = document.getElementById(inputId); var errorSpan = document.getElementById(errorId); var value = parseFloat(input.value); errorSpan.style.display = 'none'; // Hide error initially if (isNaN(value)) { errorSpan.textContent = "Please enter a valid number."; errorSpan.style.display = 'block'; return false; } if (value < 0) { errorSpan.textContent = "Value cannot be negative."; errorSpan.style.display = 'block'; return false; } if (minValue !== undefined && value maxValue) { errorSpan.textContent = "Value cannot exceed " + maxValue + "."; errorSpan.style.display = 'block'; return false; } return true; } function calculateOEE() { // Clear previous errors document.getElementById("totalTimeError").style.display = 'none'; document.getElementById("runTimeError").style.display = 'none'; document.getElementById("idealCycleTimeError").style.display = 'none'; document.getElementById("totalUnitsProducedError").style.display = 'none'; document.getElementById("goodUnitsProducedError").style.display = 'none'; // Validate inputs var isValid = true; isValid &= validateInput("totalTime", "totalTimeError", 0); isValid &= validateInput("runTime", "runTimeError", 0); isValid &= validateInput("idealCycleTime", "idealCycleTimeError", 0.01); // Cycle time must be positive isValid &= validateInput("totalUnitsProduced", "totalUnitsProducedError", 0); isValid &= validateInput("goodUnitsProduced", "goodUnitsProducedError", 0); var totalTime = parseFloat(totalTimeInput.value); var runTime = parseFloat(runTimeInput.value); var idealCycleTime = parseFloat(idealCycleTimeInput.value); var totalUnitsProduced = parseFloat(totalUnitsProducedInput.value); var goodUnitsProduced = parseFloat(goodUnitsProducedInput.value); // Additional cross-validation if (runTime > totalTime) { document.getElementById("runTimeError").textContent = "Run time cannot exceed total scheduled time."; document.getElementById("runTimeError").style.display = 'block'; isValid = false; } if (goodUnitsProduced > totalUnitsProduced) { document.getElementById("goodUnitsProducedError").textContent = "Good units cannot exceed total units produced."; document.getElementById("goodUnitsProducedError").style.display = 'block'; isValid = false; } if (!isValid) { // Reset outputs if validation fails overallOEEOutput.textContent = "–"; availabilityOutput.textContent = "–"; performanceOutput.textContent = "–"; qualityOutput.textContent = "–"; resultTotalUnitsOutput.textContent = "–"; resultGoodUnitsOutput.textContent = "–"; resultOperatingTimeOutput.textContent = "–"; theoreticalMaxProductionOutput.textContent = "–"; updateTableValues("–", "–", "–", "–", "–", "–", "–", "–", "–", "–"); updateChart(0, 0, 0, 0); return; } // Calculations var availability = (runTime / totalTime) * 100; var theoreticalMaxProduction = (runTime * 60) / idealCycleTime; var performance = (totalUnitsProduced / theoreticalMaxProduction) * 100; var quality = (goodUnitsProduced / totalUnitsProduced) * 100; var overallOEE = (availability / 100) * (performance / 100) * (quality / 100) * 100; // Handle potential NaN or Infinity from division by zero or invalid inputs availability = isNaN(availability) || !isFinite(availability) ? 0 : availability; performance = isNaN(performance) || !isFinite(performance) ? 0 : performance; quality = isNaN(quality) || !isFinite(quality) ? 0 : quality; overallOEE = isNaN(overallOEE) || !isFinite(overallOEE) ? 0 : overallOEE; theoreticalMaxProduction = isNaN(theoreticalMaxProduction) || !isFinite(theoreticalMaxProduction) ? 0 : theoreticalMaxProduction; // Display Results overallOEEOutput.textContent = overallOEE.toFixed(2) + "%"; availabilityOutput.textContent = availability.toFixed(2) + "%"; performanceOutput.textContent = performance.toFixed(2) + "%"; qualityOutput.textContent = quality.toFixed(2) + "%"; resultTotalUnitsOutput.textContent = totalUnitsProduced.toFixed(0); resultGoodUnitsOutput.textContent = goodUnitsProduced.toFixed(0); resultOperatingTimeOutput.textContent = runTime.toFixed(2); theoreticalMaxProductionOutput.textContent = theoreticalMaxProduction.toFixed(0); // Update Table updateTableValues( totalTime.toFixed(2), runTime.toFixed(2), availability.toFixed(2), idealCycleTime.toFixed(2), totalUnitsProduced.toFixed(0), theoreticalMaxProduction.toFixed(0), performance.toFixed(2), goodUnitsProduced.toFixed(0), quality.toFixed(2), overallOEE.toFixed(2) ); // Update Chart updateChart(availability, performance, quality, overallOEE); } function updateTableValues(totalScheduled, run, avail, idealCycle, totalProduced, theoreticalMax, perf, goodProduced, qual, oee) { tableTotalScheduledTime.textContent = totalScheduled; tableRunTime.textContent = run; tableAvailability.textContent = avail; tableIdealCycleTime.textContent = idealCycle; tableTotalUnitsProduced.textContent = totalProduced; tableTheoreticalMaxProduction.textContent = theoreticalMax; tablePerformance.textContent = perf; tableGoodUnitsProduced.textContent = goodProduced; tableQuality.textContent = qual; tableOEE.textContent = oee; } function resetCalculator() { totalTimeInput.value = 480; runTimeInput.value = 400; idealCycleTimeInput.value = 10; totalUnitsProducedInput.value = 2000; goodUnitsProducedInput.value = 1900; // Clear errors document.getElementById("totalTimeError").style.display = 'none'; document.getElementById("runTimeError").style.display = 'none'; document.getElementById("idealCycleTimeError").style.display = 'none'; document.getElementById("totalUnitsProducedError").style.display = 'none'; document.getElementById("goodUnitsProducedError").style.display = 'none'; calculateOEE(); // Recalculate with default values } function copyResults() { var resultsText = "OEE Calculation Results:\n\n"; resultsText += "Overall Equipment Effectiveness (OEE): " + overallOEEOutput.textContent + "\n"; resultsText += "Availability: " + availabilityOutput.textContent + "\n"; resultsText += "Performance: " + performanceOutput.textContent + "\n"; resultsText += "Quality: " + qualityOutput.textContent + "\n"; resultsText += "\nKey Assumptions & Intermediate Values:\n"; resultsText += "Total Scheduled Time: " + totalTimeInput.value + " minutes\n"; resultsText += "Run Time: " + runTimeInput.value + " minutes\n"; resultsText += "Ideal Cycle Time: " + idealCycleTimeInput.value + " seconds\n"; resultsText += "Total Units Produced: " + totalUnitsProducedInput.value + " units\n"; resultsText += "Good Units Produced: " + goodUnitsProducedInput.value + " units\n"; resultsText += "Theoretical Maximum Production: " + theoreticalMaxProductionOutput.textContent + " units\n"; // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = resultsText; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copy failed!'; // Optionally show a temporary message to the user var copyButton = document.querySelector('.btn-copy'); var originalText = copyButton.textContent; copyButton.textContent = msg; setTimeout(function() { copyButton.textContent = originalText; }, 2000); } catch (err) { console.error('Unable to copy', err); var copyButton = document.querySelector('.btn-copy'); copyButton.textContent = 'Copy Failed!'; setTimeout(function() { copyButton.textContent = 'Copy Results'; }, 2000); } document.body.removeChild(textArea); } // Initialize chart on page load window.onload = function() { initializeChart(); calculateOEE(); // Calculate with initial default values }; // Add event listeners for real-time updates totalTimeInput.addEventListener('input', calculateOEE); runTimeInput.addEventListener('input', calculateOEE); idealCycleTimeInput.addEventListener('input', calculateOEE); totalUnitsProducedInput.addEventListener('input', calculateOEE); goodUnitsProducedInput.addEventListener('input', calculateOEE);

Leave a Comment