Ahmet Murat TUNÇ

OtomasyonAutomation··3 dk okuma4 min read

16 ünite tek bir sistem gibi: PLC haberleşme bloklarından öğrendiklerimSixteen units behaving as one: lessons from writing PLC teamwork blocks

Bir salonda on altı soğutma ünitesi varsa ve her biri yalnızca kendi sensörüne bakıyorsa, ortada odayı soğutan bir sistem yoktur. Birbirinin işini bozan on altı makine vardır. Haberleşme bloklarını bu yüzden kendim yazdım.Put sixteen cooling units in one hall, let each one listen only to its own sensor, and there is no system cooling the room. There are sixteen machines undoing each other's work. That's why I wrote the communication blocks myself.

PaylaşShare

Belirti hep aynı şekilde başlıyor. A ünitesi kendi dönüş sıcaklığını yüksek görüp kompresörünü açıyor. Yanındaki B ünitesi, A'nın bastığı soğuk havayı emiyor, salonu serin sanıp kendi kompresörünü kapatıyor. Yarım saat sonra roller değişiyor. Kompresörler durup kalkıyor, salonun bir ucu üşürken öbür ucu ısınıyor, enerji faturası tırmanıyor ve servis ekibi geldiğinde hiçbir ünite arızalı çıkmıyor.

Ünitelerin birbirinin ne yaptığını bilmesi gerekiyor. Sektörde buna teamwork deniyor ve kâğıt üzerinde kolay görünüyor. Zorluk, işler ters gittiğinde ne olacağında saklı.

Bir lider, on beş takipçi

Yapının merkezinde bir lider ünite var. Lider salonun genel durumunu, yani ortalama sıcaklığı ve en kötü noktayı değerlendirip kaç ünitenin hangi kapasitede çalışacağına karar veriyor. Takipçiler bu komutu uyguluyor, ama kendi güvenlik sınırlarını (yüksek basınç, donma koruması, filtre alarmı) asla liderin eline bırakmıyor. Lider "tam kapasite" dese bile basınç sınırını aşan kompresör durur.

Liderlik sabit değil. Her ünite periyodik olarak "buradayım" sinyali, yani heartbeat gönderiyor; liderin sinyali kesilirse sıradaki ünite birkaç saniye içinde görevi devralıyor. İlk sürümde bunu atlamıştım. Liderin beslemesi kesildiğinde on beş ünite son aldıkları komutta donup kalmıştı. O gün öğrendim.

Devralma kuralının bir de öbür yüzü var. Ağ ikiye bölünürse iki ünite aynı anda kendini lider ilan edebilir. Birbirini gören üniteler arasında belirsizliği kaldırmanın en sade yolu deterministik bir sıralama: canlı üniteler içinde adresi en küçük olan lider olur ve herkes aynı kuralı aynı veriyle uygular. Ağ gerçekten bölündüyse her parçanın kendi lideri olur, bu da kabul edilebilir. Asıl tehlike, iki liderin de kendini salonun tamamından sorumlu sanması. Haber alamadığı ünite sayısı arttıkça lider daha temkinli davranmalı; kapasiteyi kısmak yerine daha fazla üniteyi devreye almalı.

Çalışma saatleri eşit kalmalı

Kısmi yükte her üniteye ihtiyaç yok. Hangilerinin çalışacağına lider karar veriyor ve bunu çalışma saatine göre döndürüyor: en az çalışmış ünite önce devreye giriyor. Böylece beş yıl sonra üç ünitesi yıpranmış, on üçü sıfır gibi duran bir salonla karşılaşmıyorsunuz. Bakım planı da öngörülebilir hâle geliyor.

İki küçük ayrıntı büyük fark yaratıyor. Arızadan dönen ünitenin sayacı sıfırlanmamalı; yoksa salonun en "genç" ünitesi o olur ve sürekli o çalışır. Rotasyon da çalışan bir üniteyi sırf sırası geldi diye durdurmamalı. Değişimi doğal devreye alma anlarına ya da belirli aralıklara bağlamazsanız, çözmeye çalıştığınız durup kalkma sorununu bu kez kendi elinizle üretirsiniz.

Kablo çekilince ne oluyor

Ağ kablosu çekilir. Anahtar cihazı arızalanır. Biri yanlış IP verir. Bunların hepsi sahada oluyor. Kural basit: liderden belirli bir süre komut alamayan ünite yerel moda geçer ve kendi sensörlerine göre, temkinli bir set noktasıyla çalışmaya devam eder. Sistem en verimli hâlinde olmaz ama salon soğumaya devam eder. Bunun çalışması için her ünitenin baştan tek başına çalışabilecek şekilde tasarlanmış olması gerekiyor; teamwork bir katman, temel değil.

Devreye almadaki test listem kısa ve acımasız: liderin enerjisini kes, bir ağ kablosunu çek, bir ünitenin IP adresini başka bir üniteyle çakıştır, bir üniteyi arızaya sokup geri getir. Her adımda iki şeye bak: salonun sıcaklığına ve logda o an kimin lider göründüğüne. Bu testleri atlayan bir devreye alma, sorunu yalnızca ilk gerçek arızaya erteler.

Log konusunda da ısrarcıyım. Kim ne zaman lider oldu, hangi ünite neden devreye girdi, hangisi ne zaman yerel moda düştü; bir sayfalık kayıt, sahada iki gün sürecek bir tartışmayı bitirir. Kodun kendisi de aynı ölçüde okunabilir olmalı. Gece yarısı devreye alma sırasında bloğu açan teknisyen ne olduğunu çözemiyorsa, ne kadar zekice yazıldığının hiçbir önemi kalmaz.

On altı ünitelik bir salonda bu yapı oturduğunda fark kısa sürede görünüyor: kompresörler daha seyrek durup kalkıyor, sıcaklık dağılımı düzleşiyor. Asıl sınav ise ilk arızada geliyor. Müşteri arızayı alarm ekranından öğreniyor; salon sıcaklığı kimsenin dikkatini çekmeyecek kadar sakin kalıyor.

The symptom always starts the same way. Unit A sees a high return temperature and starts its compressor. Unit B, right next to it, draws in the cold air A is supplying, decides the hall is cool and shuts its own compressor off. Half an hour later the roles swap. Compressors cycle, one end of the hall gets chilly while the other warms up, the energy bill climbs, and when service arrives not a single unit turns out to be faulty.

The units need to know what the others are doing. The industry calls this teamwork, and on paper it looks easy. The hard part is what happens when things go wrong.

One leader, fifteen followers

At the centre of the structure sits a leader unit. The leader assesses the state of the hall, meaning the average temperature and the worst point, and decides how many units run and at what capacity. The followers carry out that command, but they never hand their own safety limits (high pressure, freeze protection, filter alarm) over to the leader. Even if the leader calls for full capacity, a compressor that hits its pressure limit stops.

Leadership isn't fixed. Every unit sends a periodic "I'm here" signal, a heartbeat, and if the leader's heartbeat disappears, the next unit in line takes over within seconds. I skipped this in the first version. When the leader lost power, fifteen units froze on the last command they had received. That was the day I learned.

The takeover rule has a flip side. If the network splits in two, two units can declare themselves leader at the same moment. Among units that can see each other, the simplest way to remove ambiguity is a deterministic order: the live unit with the lowest address leads, and everyone applies the same rule to the same data. If the network really has split, each part gets its own leader, and that is acceptable. The real danger is each leader believing it is responsible for the whole hall. The more units a leader can't hear from, the more cautious it should become, bringing extra units in rather than throttling capacity back.

Running hours should stay even

At part load not every unit is needed. The leader decides which ones run and rotates them by running hours, so the unit with the fewest hours starts first. Five years on, you don't end up with three worn-out units and thirteen that look brand new. Maintenance becomes predictable as well.

Two small details make a big difference. A unit returning from a fault must not have its counter reset, or it becomes the "youngest" unit in the hall and runs all the time. And rotation should never stop a running unit just because its turn is up. If you don't tie the swap to natural staging events or fixed intervals, you end up creating, with your own hands, the very cycling you set out to eliminate.

When the cable gets pulled

A network cable gets pulled. A switch fails. Someone assigns a duplicate IP. All of this happens on real sites. The rule is simple: a unit that hears nothing from the leader for a set time drops into local mode and keeps running on its own sensors with a conservative setpoint. The system is no longer at its most efficient, but the hall keeps cooling. That only works if every unit was designed from the start to run on its own; teamwork is a layer, not the foundation.

My commissioning test list is short and unforgiving: cut power to the leader, pull a network cable, give one unit the same IP address as another, force a unit into a fault and bring it back. At every step, watch two things: the hall temperature, and who the log says is leader at that moment. Commissioning that skips these tests simply postpones the problem to the first real failure.

I'm stubborn about the log, too. Who became leader when, which unit started and why, which one dropped into local mode and when: a one-page record ends an argument that would otherwise take two days on site. The code itself has to be just as readable. If the technician who opens the block at midnight during commissioning can't follow it, it doesn't matter how clever it is.

Once this structure settles in a sixteen-unit hall, the difference shows quickly: compressors cycle less often and the temperature distribution flattens out. The real test comes with the first failure. The client learns about it from the alarm screen, while the hall temperature stays calm enough that nobody notices anything.

Faydalı bulduysanız paylaşınFound it useful? Share it
Ahmet Murat TunçAr-Ge ve Mühendislik Müdürü, Systemair Türkiye. Klima santralleri, veri merkezi soğutma, otomasyon.R&D & Engineering Manager, Systemair Türkiye. Air handling units, data center cooling, automation.