파이썬으로 가마 열 이상 탐지기 구축: 산업 가이드
발행: (2026년 5월 23일 PM 04:12 GMT+9)
4 분 소요
원문: Dev.to
Source: Dev.to
무거운 제조 데이터 시스템을 이어가면서, 행동이 말보다 크게 들립니다. 오늘은 파이썬 밸브를 열어봅니다.
아래는 100 미터 연속 가마 스캐너 데이터를 시뮬레이션하고, 이를 연소 구역, 전이 구역, 소성 구역으로 구분한 뒤, 안전 운영 한계가 초과될 경우 실시간으로 제어실 알람을 발생시키는 완전 작동 파이썬 프로토타입입니다.
이 스크립트를 그대로 복사해 Google Colab이나 로컬 Jupyter 환경에서 실행할 수 있습니다. numpy 로 데이터 시뮬레이션을, pandas 로 실시간 논리 임계값 판단을, seaborn·matplotlib 으로 물리적 열 지도를 생성합니다.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# 1. 가마 쉘 온도 데이터 시뮬레이션 (길이: 1~100미터)
np.random.seed(42)
kiln_length = np.arange(1, 101)
# 정상 운영 감쇠 곡선을 가진 기본 열 프로파일
base_temp = 350 - (kiln_length * 2.2) + np.random.normal(0, 15, 100)
base_temp[0:30] += 120 # 연소 구역 한계 상승
base_temp[30:60] += 50 # 전이 구역 한계 상승
# 미터 22에 CRITICAL HOTSPOT 삽입 (내화재 손상 시뮬레이션)
base_temp[21] = 435.0
# 텔레메트리 DataFrame 생성
kiln_data = pd.DataFrame({
'Meter': kiln_length,
'Shell_Temp_C': np.clip(base_temp, 120, 450)
})
# 2. 구역 구분 및 임계값 로직
def scan_kiln_zones(row):
meter = row['Meter']
temp = row['Shell_Temp_C']
if meter <= 30:
zone = 'Burning'
threshold = 400
elif meter <= 60:
zone = 'Transition'
threshold = 350
else:
zone = 'Calcining'
threshold = 300
status = 'CRITICAL HOTSPOT' if temp > threshold else 'NORMAL'
return pd.Series([zone, threshold, status])
kiln_data[['Zone', 'Threshold_Limit', 'Status']] = kiln_data.apply(scan_kiln_zones, axis=1)
# 3. 자동 제어실 알람 출력
hotspots = kiln_data[kiln_data['Status'] == 'CRITICAL HOTSPOT']
print("="*60)
print(" 산업 지휘관: 가마 열 스캐너 ")
print("="*60)
if not hotspots.empty:
for idx, row in hotspots.iterrows():
print(f"🚨 경고: {row['Status']} at Meter {row['Meter']} ({row['Zone']})!")
print(f" 현재 온도: {row['Shell_Temp_C']:.1f}°C | 한계: {row['Threshold_Limit']}°C\n")
else:
print("✅ 시스템 상태: 모든 구역이 안전 온도 한계 내에 있습니다.")
print("="*60)
# 4. 시각적 히트맵 및 추세 그래프 생성
plt.figure(figsize=(14, 5))
colors = ['red' if status == 'CRITICAL HOTSPOT' else 'blue' for status in kiln_data['Status']]
plt.plot(kiln_data['Meter'], kiln_data['Shell_Temp_C'], color='black', alpha=0.5, linestyle='--')
plt.scatter(kiln_data['Meter'], kiln_data['Shell_Temp_C'], c=colors, s=40, label='Kiln Telemetry')
plt.title("회전 가마 쉘 온도 프로파일 및 핫스팟 감지", fontsize=14, fontweight='bold')
plt.xlabel("가마 길이 (배출 지점부터 미터)", fontsize=11)
plt.ylabel("쉘 온도 (°C)", fontsize=11)
plt.axvline(x=30, color='gray', linestyle=':', label='구역 경계')
plt.axvline(x=60, color='gray', linestyle=':')
plt.grid(True, alpha=0.3)
plt.legend()
plt.show()
📢 연결 및 더 알아보기
- 📨 전체 뉴스레터 구독: 산업 자동화와 공정 제어에 대한 인사이트를 직접 메일함으로 받고 싶다면, 제 Industrial Commander Substack을 구독하세요.
https://industrialcommander.substack.com