AI Coding Of OEE of Lean Manufacturing
def calculate_oee(planned_minutes, downtime_minutes, ideal_cycle_seconds, total_units, good_units):
planned_seconds = planned_minutes * 60
downtime_seconds = downtime_minutes * 60
run_time = planned_seconds - downtime_seconds
if planned_seconds <= 0:
raise ValueError("Planned production time must be greater than zero.")
availability = run_time / planned_seconds if planned_seconds > 0 else 0.0
if run_time <= 0:
performance = 0.0
else:
performance = (ideal_cycle_seconds * total_units) / run_time
if total_units <= 0:
quality = 0.0
else:
quality = good_units / total_units
oee = availability * performance * quality
return {
"Availability": availability,
"Performance": performance,
"Quality": quality,
"OEE": oee
}
#Example
result = calculate_oee(
planned_minutes=480, # 8 hours
downtime_minutes=60, # 1 hour lost
ideal_cycle_seconds=10, # machine ideal time per unit
total_units=1800,
good_units=1700
)
print(result)
#Example Output
{
'Availability': 0.875,
'Performance': 0.7142857142857143,
'Quality': 0.9444444444444444,
'OEE': 0.589
}
Comments
Post a Comment