Pump & Valve Automation สำหรับ Smart Farm: สั่งงานอย่างไรให้มี Feedback และไม่ชนกัน.
ออกแบบ Pump/Valve Automation ระดับระบบ ตั้งแต่ command ownership, sequence, feedback, dry-run/no-flow, timeout, interlock, manual mode และ recovery โดยไม่แทน electrical protection

พื้นฐาน Pump/Motor อยู่ที่ Pump/Motor Control Basics และการเลือก Valve อยู่ที่ Solenoid vs Motorized Valve หน้านี้จึงโฟกัส coordination ระหว่างอุปกรณ์
Command Ownership ต้องมีเจ้าของชัด
ปัญหาที่เจอบ่อยคือหลายระบบสั่งอุปกรณ์เดียวกัน:
- schedule
- soil rule
- dashboard button
- Home Assistant/MQTT
- local switch
ต้องกำหนดว่าใครมีสิทธิ์สั่งในแต่ละ mode และ conflict แก้อย่างไร
ตัวอย่าง state:
AUTO
MANUAL
MAINTENANCE LOCKOUT
FAULT
ไม่ควรให้ทุก source publish ON/OFF ลง topic เดียวโดยไม่มี arbitration
Command ไม่เท่ากับ Feedback
Pump ON command ≠ Pump running confirmed
Valve OPEN command ≠ Water path confirmed
feedback อาจมาจาก:
- flow
- pressure
- auxiliary contact
- current/energy state
- actuator position feedback
เลือกให้เหมาะกับ consequence ของ failure
Sequence ต้อง explicit
ระบบ irrigation ควรมี state machine มากกว่า delay กระจัดกระจาย
ตัวอย่างเชิงแนวคิด:
IDLE
→ PRECHECK
→ PREPARE WATER PATH
→ START PUMP / OPEN VALVE ตาม hydraulic design
→ VERIFY
→ RUN
→ STOP SEQUENCE
→ VERIFY STOP
→ IDLE
ลำดับจริงขึ้นกับ hydraulic/equipment design จึงไม่ควร copy เป็น wiring/control recipe ตายตัว
Timeout ทุกขั้นที่รอ Feedback
ถ้ารอ flow หรือ valve state โดยไม่มี timeout ระบบอาจค้างตลอดไป
ทุก transition สำคัญควรมี:
- expected feedback
- timeout
- action on timeout
- alarm/event
No-flow หลัง Start
ถ้าระบบสั่ง run แล้วไม่มี flow อาจเป็น:
- tank/source unavailable
- pump fault
- valve/path issue
- blocked pipe
- flow sensor fault
อย่า retry ไม่จำกัด ควร bounded retry หรือ require operator ตาม risk
Unexpected Flow ตอนควรหยุด
flow ยังอยู่เมื่อ command ปิดแล้วอาจบอก:
- valve stuck/open
- bypass/other source
- sensor error
- hydraulic drain-down
ต้องใช้ timing/context เพื่อแยก normal transient จาก fault
Dry-run และ Overload
Automation software อาจใช้ level/flow เป็น additional evidence แต่ไม่ควรถูกอธิบายว่าแทน equipment-native dry-run, overload หรือ electrical protection ที่ระบบต้องการ
Software control ≠ electrical/mechanical protection
Manual Mode ที่ดี
Manual Mode ควร:
- แสดงชัดว่าระบบอยู่ Manual
- จำกัด authority ตาม design
- log operator action
- ยังเคารพ critical protection/interlock ที่ต้องมี
- ไม่ทำให้ Auto เข้ามาแย่ง command ระหว่าง maintenance
Recovery หลัง Controller Reboot
คำถามสำคัญ:
- output boot state คืออะไร
- ถ้า reboot กลาง irrigation จะ resume หรือ stop
- last command ยัง valid หรือไม่
- physical state ถูก re-read ก่อน command ใหม่หรือไม่
โดยทั่วไปอย่า assume ว่า retained software state เท่ากับ physical state ปัจจุบัน
Valve Zone หลายตัว
ถ้ามีหลาย zone ควรกำหนด:
- allowed simultaneous zones
- total flow/pressure capacity
- priority
- minimum off/on time
- conflict policy
เปิดหลาย valve โดยไม่สน hydraulic capacity อาจทำให้ทุก zone ได้ flow ไม่พอ
Telemetry ที่ควรบันทึก
- requested state
- actual/confirmed state
- command owner
- mode
- start/stop timestamps
- flow/pressure
- runtime
- fault code/reason
ช่วย debug ได้มากกว่าบันทึกเฉพาะ pump=on
อ่าน Pressure & Flow Monitoring สำหรับ feedback layer และ Offline, Manual & Fail-safe สำหรับ degraded operation
Pump & Valve Automation ที่ดีจึงเป็น stateful control system ที่รู้ว่าใครสั่ง อุปกรณ์ตอบสนองหรือไม่ และเมื่อผิดปกติจะหยุด/ถอยอย่างไร ไม่ใช่ relay ON/OFF ผ่าน Internet

