Substation Automation System คืออะไร
Substation Automation System (SAS) คือระบบอัตโนมัติที่ใช้ควบคุม ป้องกัน ตรวจวัด และจัดการสถานีไฟฟ้าย่อย (Substation) ด้วยเทคโนโลยีดิจิทัลและเครือข่ายสื่อสาร แทนการใช้สายควบคุมแบบ Hardwired เดิม ทำให้ลดจำนวนสายไฟ ลดค่าก่อสร้าง เพิ่มความเร็วในการทำงาน และดูแลรักษาง่ายขึ้น
SAS ประกอบด้วยอุปกรณ์ Intelligent Electronic Device (IED) เช่น Protection Relay, Bay Controller, Merging Unit ที่สื่อสารกันผ่านเครือข่าย Ethernet ตามมาตรฐาน IEC 61850 ซึ่งเป็นมาตรฐานสากลสำหรับ Substation Communication
Level 1: Process Level
- Merging Unit (MU): แปลงสัญญาณ Analog จาก CT/VT เป็น Digital (Sampled Values)
- I/O Module: รับส่งสัญญาณ Digital จาก Circuit Breaker, Disconnector
- Process Bus: เครือข่าย Ethernet สำหรับ Sampled Values และ GOOSE ระดับ Process
Level 2: Bay Level
- Protection Relay (IED): ป้องกัน Overcurrent, Distance, Differential
- Bay Controller: ควบคุม Circuit Breaker, Disconnector ในแต่ละ Bay
- Station Bus: เครือข่าย Ethernet สำหรับ GOOSE และ MMS ระดับ Bay
Level 3: Station Level
- SCADA/HMI: หน้าจอแสดงผลและสั่งการสำหรับ Operator
- Station Computer: ประมวลผลข้อมูลจากทุก Bay
- Gateway: เชื่อมต่อกับ Control Center ผ่าน IEC 60870-5-104 หรือ DNP3
IEC 61850 Configuration (SCL)
<!-- IEC 61850 SCL Configuration File (Substation Configuration Language) -->
<!-- ไฟล์ SCD (Substation Configuration Description) -->
<?xml version="1.0" encoding="UTF-8"?>
<SCL xmlns="http://www.iec.ch/61850/2003/SCL">
<!-- Substation Description -->
<Substation name="SUB_001" desc="สถานีไฟฟ้า 115kV">
<VoltageLevel name="E1" desc="115kV">
<Bay name="Q01" desc="Incoming Line 1">
<ConductingEquipment name="QA1" type="CBR" desc="Circuit Breaker">
<Terminal name="T1" connectivityNode="E1/Q01/L1"/>
</ConductingEquipment>
<ConductingEquipment name="QB1" type="DIS" desc="Disconnector">
<Terminal name="T1" connectivityNode="E1/Q01/L1"/>
</ConductingEquipment>
</Bay>
<Bay name="Q02" desc="Transformer Bay">
<ConductingEquipment name="QA2" type="CBR" desc="Circuit Breaker"/>
</Bay>
</VoltageLevel>
</Substation>
<!-- Communication Network -->
<Communication>
<SubNetwork name="Station_Bus" type="8-MMS">
<ConnectedAP iedName="PROT_01" apName="S1">
<Address>
<P type="IP">192.168.1.10</P>
<P type="IP-SUBNET">255.255.255.0</P>
<P type="IP-GATEWAY">192.168.1.1</P>
</Address>
<!-- GOOSE Configuration -->
<GSE ldInst="LD0" cbName="GoCB01">
<Address>
<P type="MAC-Address">01-0C-CD-01-00-01</P>
<P type="APPID">0001</P>
<P type="VLAN-ID">100</P>
<P type="VLAN-PRIORITY">4</P>
</Address>
<MinTime unit="ms" multiplier="">4</MinTime>
<MaxTime unit="ms" multiplier="">1000</MaxTime>
</GSE>
</ConnectedAP>
</SubNetwork>
<SubNetwork name="Process_Bus" type="9-2">
<ConnectedAP iedName="MU_01" apName="P1">
<Address>
<P type="IP">192.168.2.10</P>
</Address>
<!-- Sampled Values -->
<SMV ldInst="MU01" cbName="MSVCB01">
<Address>
<P type="MAC-Address">01-0C-CD-04-00-01</P>
<P type="APPID">4001</P>
<P type="VLAN-ID">200</P>
</Address>
</SMV>
</ConnectedAP>
</SubNetwork>
</Communication>
<!-- IED Configuration -->
<IED name="PROT_01" desc="Distance Protection Relay" manufacturer="ABB">
<Services>
<GOOSE max="8"/>
<GSESettings cbName="Fix"/>
</Services>
<AccessPoint name="S1">
<Server>
<LDevice inst="LD0">
<LN0 lnClass="LLN0" inst="" lnType="LLN0_Type">
<!-- GOOSE Control Block -->
<GSEControl name="GoCB01" appID="PROT01_GOOSE"
confRev="1" datSet="DS_GOOSE01"/>
<DataSet name="DS_GOOSE01">
<FCDA ldInst="LD0" prefix="" lnClass="XCBR" lnInst="1"
doName="Pos" daName="stVal" fc="ST"/>
<FCDA ldInst="LD0" prefix="" lnClass="PTOC" lnInst="1"
doName="Op" daName="general" fc="ST"/>
</DataSet>
</LN0>
<!-- Protection Function -->
<LN lnClass="PDIS" inst="1" lnType="PDIS_Type"
desc="Distance Protection Zone 1"/>
<LN lnClass="PTOC" inst="1" lnType="PTOC_Type"
desc="Overcurrent Protection"/>
<!-- Circuit Breaker -->
<LN lnClass="XCBR" inst="1" lnType="XCBR_Type"
desc="Circuit Breaker"/>
</LDevice>
</Server>
</AccessPoint>
</IED>
</SCL>
Python Script วิเคราะห์ GOOSE Traffic
# Python Script วิเคราะห์ GOOSE Message จาก PCAP File
# ใช้ร่วมกับ Wireshark/tshark
import subprocess
import json
import re
from datetime import datetime
from collections import defaultdict
class GOOSEAnalyzer:
"""วิเคราะห์ GOOSE Traffic จาก PCAP"""
def __init__(self, pcap_file):
self.pcap_file = pcap_file
self.messages = []
def parse_pcap(self):
"""อ่าน GOOSE Messages จาก PCAP ด้วย tshark"""
cmd = [
"tshark", "-r", self.pcap_file,
"-Y", "goose",
"-T", "fields",
"-e", "frame.time_epoch",
"-e", "eth.src",
"-e", "eth.dst",
"-e", "goose.gocbRef",
"-e", "goose.stNum",
"-e", "goose.sqNum",
"-e", "goose.confRev",
"-e", "goose.ndsCom",
"-e", "goose.numDatSetEntries",
"-E", "separator=|",
]
result = subprocess.run(cmd, capture_output=True, text=True)
for line in result.stdout.strip().split("\n"):
if not line:
continue
parts = line.split("|")
if len(parts) >= 9:
self.messages.append({
"timestamp": float(parts[0]),
"src_mac": parts[1],
"dst_mac": parts[2],
"gocb_ref": parts[3],
"st_num": int(parts[4]) if parts[4] else 0,
"sq_num": int(parts[5]) if parts[5] else 0,
"conf_rev": parts[6],
"nds_com": parts[7],
"num_entries": int(parts[8]) if parts[8] else 0,
})
print(f"Parsed {len(self.messages)} GOOSE messages")
def analyze(self):
"""วิเคราะห์ GOOSE Traffic"""
if not self.messages:
print("No messages to analyze")
return
# Group by GOOSE Control Block
by_gocb = defaultdict(list)
for m in self.messages:
by_gocb[m["gocb_ref"]].append(m)
print(f"\n=== GOOSE Traffic Analysis ===")
print(f"Total Messages: {len(self.messages)}")
print(f"GOOSE Control Blocks: {len(by_gocb)}")
for gocb, msgs in by_gocb.items():
print(f"\n--- {gocb} ---")
print(f" Messages: {len(msgs)}")
print(f" Source MAC: {msgs[0]['src_mac']}")
# State changes (stNum changes)
state_changes = []
for i in range(1, len(msgs)):
if msgs[i]["st_num"] != msgs[i-1]["st_num"]:
state_changes.append(msgs[i])
print(f" State Changes: {len(state_changes)}")
# Timing analysis
intervals = []
for i in range(1, len(msgs)):
dt = (msgs[i]["timestamp"] - msgs[i-1]["timestamp"]) * 1000
intervals.append(dt)
if intervals:
avg_interval = sum(intervals) / len(intervals)
max_interval = max(intervals)
min_interval = min(intervals)
print(f" Avg Interval: {avg_interval:.1f} ms")
print(f" Max Interval: {max_interval:.1f} ms")
print(f" Min Interval: {min_interval:.1f} ms")
# ตรวจสอบ GOOSE Retransmission Pattern
if max_interval > 5000:
print(f" WARNING: Max interval > 5s (possible loss)")
# ตรวจสอบ Sequence Number gaps
gaps = 0
for i in range(1, len(msgs)):
expected_sq = msgs[i-1]["sq_num"] + 1
if msgs[i]["sq_num"] != expected_sq and \
msgs[i]["st_num"] == msgs[i-1]["st_num"]:
gaps += 1
if gaps > 0:
print(f" WARNING: {gaps} sequence number gaps detected")
# ใช้งาน
# analyzer = GOOSEAnalyzer("substation_capture.pcap")
# analyzer.parse_pcap()
# analyzer.analyze()
Network Configuration สำหรับ SAS
# === Cisco Switch Configuration สำหรับ IEC 61850 ===
! VLAN Configuration
vlan 100
name Station_Bus
vlan 200
name Process_Bus
vlan 300
name Management
! GOOSE VLAN — ต้อง Priority สูง
! PRP/HSR สำหรับ Redundancy
! Interface Configuration — Station Bus
interface GigabitEthernet1/0/1
description PROT_01_Protection_Relay
switchport mode trunk
switchport trunk allowed vlan 100,300
spanning-tree portfast trunk
spanning-tree bpduguard enable
storm-control multicast level 20
! QoS สำหรับ GOOSE Priority
mls qos trust dscp
interface GigabitEthernet1/0/2
description PROT_02_Protection_Relay
switchport mode trunk
switchport trunk allowed vlan 100,300
spanning-tree portfast trunk
spanning-tree bpduguard enable
! Process Bus Interfaces
interface GigabitEthernet1/0/10
description MU_01_Merging_Unit
switchport mode trunk
switchport trunk allowed vlan 200
spanning-tree portfast trunk
! IGMP Snooping สำหรับ Multicast (GOOSE/SV)
ip igmp snooping
ip igmp snooping vlan 100
ip igmp snooping vlan 200
! QoS — Priority สำหรับ GOOSE
mls qos
class-map match-all GOOSE_TRAFFIC
match vlan 100
match cos 4
policy-map GOOSE_PRIORITY
class GOOSE_TRAFFIC
set dscp ef
priority percent 30
! PTP (Precision Time Protocol) สำหรับ Time Sync
ptp mode boundary
ptp domain 0
interface GigabitEthernet1/0/24
description PTP_Grandmaster_Clock
ptp announce interval 1
ptp sync interval -1
! Redundancy — RSTP
spanning-tree mode rapid-pvst
spanning-tree vlan 100 priority 4096
spanning-tree vlan 200 priority 4096
! ตรวจสอบ
show vlan brief
show interfaces trunk
show spanning-tree vlan 100
show mls qos interface
Cybersecurity สำหรับ SAS
- IEC 62351: มาตรฐาน Security สำหรับ Power System Communication ครอบคลุม TLS, Authentication และ Authorization
- Network Segmentation: แยก Station Bus, Process Bus และ Management Network ด้วย VLAN และ Firewall
- Role-Based Access Control: กำหนดสิทธิ์ตามบทบาท Operator ดูได้อย่างเดียว Engineer แก้ไข Config ได้
- Intrusion Detection: ติดตั้ง IDS ตรวจจับ Traffic ผิดปกติบน Station Bus เช่น GOOSE ที่ไม่คาดคิด
- Patch Management: อัปเดต Firmware ของ IED อย่างสม่ำเสมอ ทดสอบใน Lab ก่อนติดตั้งจริง
- Audit Trail: บันทึกทุกการเข้าถึงและสั่งการ สำหรับ Forensics และ Compliance
- Physical Security: ล็อคตู้ Switch และ IED จำกัดการเข้าถึงทางกายภาพ
Substation Automation System คืออะไร
SAS คือระบบอัตโนมัติสำหรับควบคุม ป้องกัน ตรวจวัด และจัดการสถานีไฟฟ้าย่อยด้วยเทคโนโลยีดิจิทัล ใช้ IED สื่อสารผ่าน Ethernet ตามมาตรฐาน IEC 61850 แทนการใช้สาย Hardwired ลดต้นทุน เพิ่มความเร็ว และดูแลรักษาง่ายขึ้น
IEC 61850 คืออะไร
IEC 61850 เป็นมาตรฐานสากลสำหรับ Substation Communication กำหนด Data Model, Communication Protocol (GOOSE, MMS, Sampled Values), Configuration Language (SCL) และ Testing Methodology ทำให้อุปกรณ์จากต่างผู้ผลิตสื่อสารกันได้
GOOSE Message คืออะไร
GOOSE เป็น Protocol สำหรับส่งข้อมูลแบบ Multicast ระหว่าง IED เร็วมาก (ต่ำกว่า 4ms) ใช้สำหรับ Interlocking, Trip Signal, Status Information แทนสาย Hardwired ส่งผ่าน Ethernet โดยตรง (Layer 2) ไม่ผ่าน TCP/IP จึงเร็วมาก
SAS มีกี่ Level อะไรบ้าง
SAS มี 3 Level คือ Station Level (SCADA, HMI, Gateway) สำหรับ Monitor และสั่งการ, Bay Level (Protection Relay, Bay Controller) ควบคุมแต่ละ Bay และ Process Level (Merging Unit, I/O Module) เชื่อมต่อกับอุปกรณ์ Primary เช่น CT, VT, CB
สรุป
Substation Automation System ตามมาตรฐาน IEC 61850 เป็นเทคโนโลยีที่เปลี่ยนแปลงการจัดการสถานีไฟฟ้าย่อยจากระบบ Hardwired เป็นระบบดิจิทัล ใช้ GOOSE สำหรับ Fast Communication, MMS สำหรับ Client-Server, Sampled Values สำหรับข้อมูลวัด สิ่งสำคัญคือออกแบบ Network ให้มี Redundancy, QoS สำหรับ GOOSE Priority, Time Sync ด้วย PTP และ Cybersecurity ตาม IEC 62351
