Kamsi Nwanekezie

Server-room cooling controller

Automation project, 2026

Summary

A server-room cooling controller designed to keep servers cool during continuous operation, with a target room temperature of 24–26 °C. Built in CODESYS, the project covers the process from defining the operating sequence to simulating and testing the controller.

  • Define the operating sequence in plain language.
  • Identify the input and output signals and the variables needed by the program.
  • Develop the ladder logic for normal operation.
  • Anticipate equipment faults and define how the controller and operator should respond.
  • Design an operator HMI for monitoring equipment status and controlling the unit.
  • Simulate the room and equipment, then test normal operation and fault responses.
Demo: start, fan confirmation, compressor start at 26 °C, live ladder logic, stop.

The task

A small server room contains equipment that produces heat continuously. One cooling unit, with a circulation fan and a compressor, serves the room.

Design a control system for this cooling unit with the following requirements:

  • The unit should maintain room temperature within a target range of 24–26 °C.
  • An operator should be able to manually turn the unit on and off and monitor the room temperature and equipment status.
  • The compressor should operate only when the fan is confirmed running.
  • The compressor should remain off for at least three minutes between runs to reduce wear and starting stress.

Understanding the system

The compressor moves heat from the indoor coil to the outdoor unit, and the indoor fan moves room air across that coil. Without airflow the coil can ice up and liquid refrigerant can reach the compressor, so the compressor may only run while the fan confirms it is running.

Sequence

Normal operation

  1. While the unit is stopped, the fan and compressor are off.
  2. Start enables the unit and switches on the fan. The fan runs whenever the unit is enabled.
  3. The compressor runs only when cooling is needed, fan feedback is present and the restart delay has finished. Losing fan feedback stops it immediately.
  4. Cooling is needed from 26 °C until the room falls to 24 °C. When the unit is enabled below 26 °C, it starts with no cooling request.
  5. The compressor stays off for at least three minutes between runs, including after controller startup. Stop and Start do not reset the delay.
  6. Stop switches off the fan and compressor. A held Start button cannot restart the unit.

Faults and warnings

  1. Fan switched on without running feedback for 10 s: fan fault, unit stops. Covers both failure to start and loss while running.
  2. While the fan fault is active, Start is blocked.
  3. Compressor switched on without running feedback for 5 s: compressor fault, compressor stops, fan keeps running.
  4. High-temperature warning at 30 °C, clearing below 29 °C. Cooling continues.
  5. Reset works only while the unit is stopped, and a new Start is needed afterwards.
ConditionCompressor responseFan and unit responseIndicationHow it clears
Fan commanded on without running feedback for 10 sCommand switches off immediately on feedback lossUnit is disabled and fan command switches off when the fault activatesFan fault, held until resetPress Reset while the unit is stopped
Compressor commanded on without running feedback for 5 sCommand switches off when the fault activatesUnit stays enabled; fan continues runningCompressor fault, held until resetPress Stop, then Reset
Room temperature reaches 30 °CTemperature control continuesNo change to operationHigh-temperature warningClears automatically below 29 °C

Signals and variables

InputWhy it exists
Room temperatureDecides when cooling starts and stops.
Fan runningPermits the compressor; detects a fan fault.
Compressor runningDetects a compressor fault.
OutputWhy it exists
Fan commandRuns the fan while the unit is enabled.
Compressor commandRuns the compressor when cooling is needed and its conditions are met.

I/O list

TagDescriptionI/O typeSignalAddressRangeFail-safe state
TT-101Room temperatureAI4–20 mA%IW00–50 °C–
FAN-101-FBFan running feedbackDI24 V DC%IX0.0–Off = not running
CMP-101-FBCompressor running feedbackDI24 V DC%IX0.1–Off = not running
FAN-101-CMDFan run commandDO24 V DC%QX0.0–Off
CMP-101-CMDCompressor run commandDO24 V DC%QX0.1–Off
Planned hardware I/O; not mapped in the simulation.

Variable list

VariableTypeComes fromTagPurpose
rRoomTempREAL (°C)Temperature sensorTT-101Room temperature used for cooling demand and the high-temperature warning.
xFanRunningBOOLEquipment feedbackFAN-101-FBTrue when fan-running feedback is present; permits compressor operation.
xCompRunningBOOLEquipment feedbackCMP-101-FBTrue when compressor-running feedback is present; used for fault detection.
xFanCmdBOOLControl logicFAN-101-CMDTrue while the controller commands the fan to run.
xCompressorCmdBOOLControl logicCMP-101-CMDTrue while the controller commands the compressor to run.
xStartBtnBOOLOperator screen–True while Start is pressed.
xStopBtnBOOLOperator screen–True while Stop is pressed.
xResetBtnBOOLOperator screen–True while Reset is pressed.
fbStartEdgeR_TRIGControl logic–Detects a new Start press, so holding Start cannot repeatedly start the unit.
xStartPulseBOOLControl logic–One-scan signal from fbStartEdge used to set the unit-enable latch.
xUnitEnabledBOOLControl logic–Remembers the enabled state after Start is released; clears on Stop or a fan fault.
xCoolingRequestBOOLControl logic–Requests cooling at ≥26 °C; clears at ≤24 °C or when disabled; holds its state between thresholds.
fbCompOffTimerTONControl logic–Times how long the compressor command has been off; resets when the command turns on.
xCompOffDoneBOOLControl logic–True when the minimum off-time has elapsed, allowing a compressor start.
fbFanTimerTONControl logic–Times missing fan-running feedback while the fan is commanded on.
xFanTimeoutBOOLControl logic–True after 10 seconds of fan command without running feedback.
xFanFaultBOOLControl logic–Stops the unit after a fan timeout; remains active until reset while stopped.
fbCompTimerTONControl logic–Times missing compressor-running feedback while the compressor is commanded on.
xCompTimeoutBOOLControl logic–True after 5 seconds of compressor command without running feedback.
xCompFaultBOOLControl logic–Blocks the compressor after a timeout; remains active until reset while stopped.
xHighTempWarnBOOLControl logic–High-temperature warning: activates at ≥30 °C and clears below 29 °C without stopping cooling.
rCoolOnTempREAL, 26.0Fixed setting–Room temperature at or above which cooling is requested.
rCoolOffTempREAL, 24.0Fixed setting–Room temperature at or below which the cooling request clears.
timMinOffTimeTIME, 3 minFixed setting–Minimum time the compressor command must stay off before another start, also applied after startup.
timFanFaultTimeTIME, 10 sFixed setting–Time allowed for missing running feedback while the fan is commanded on.
timCompFaultTimeTIME, 5 sFixed setting–Time allowed for missing running feedback while the compressor is commanded on.
rHighTempOnREAL, 30.0Fixed setting–Room temperature at or above which the high-temperature warning activates.
rHighTempOffREAL, 29.0Fixed setting–The high-temperature warning clears below this room temperature.
Equipment signals in GVL_IO; all others local to PRG_Control.

Control logic

Normal operation (without faults)

Six rungs cover normal operation: Start and Stop, the fan, the 24–26 °C cooling request, the restart delay and the compressor.

Ladder diagram of the six normal-operation rungs in CODESYS: start pulse, unit enable latch, fan command, cooling request, compressor off timer and compressor command
Rungs 1–6, normal operation.

With faults and a high-temperature warning

Five rungs add a feedback timer and fault latch for the fan and the compressor, plus the high-temperature warning. Two normal rungs change:

  • Rung 2: the fan fault breaks the unit-enable latch and blocks Start.
  • Rung 6: the compressor fault blocks the compressor; the fan keeps running.
Ladder diagram of all eleven rungs in CODESYS, with titled networks including the fan and compressor feedback timers, fault latches and high-temperature warning
All eleven rungs, faults and warning in rungs 7–11.

Simulating the process

With no physical equipment, a Structured Text program, PRG_Sim, stands in for the room and equipment. It heats the room at a constant rate, cools it while the compressor and fan run, returns running feedback shortly after each command, and has switches to fail the fan or compressor and to set the room temperature for tests.

PRG_Sim Structured Text program running online in CODESYS, with live values for room temperature, feedback delays and fail switches
PRG_Sim running online.

Operator screen

CODESYS operator screen during simulation: room at 29.9 °C, unit, fan and compressor running, cooling needed and the high-temperature warning active
Operator screen in simulation: compressor cooling, high-temperature warning active.

HMI design decisions

  • Read left to right: room, equipment, then faults.
  • Room temperature is the largest element, with the target band beside it.
  • Related items grouped in titled panels; each label sits next to its indicator.
  • Command and running feedback shown separately, so a mismatch is visible before the fault trips.
  • Grey for off, dark for on; colour reserved for faults and the warning.
  • Box text names the state it shows, so lit reads as yes.
  • Reset beside the faults it clears; Start and Stop apart at the bottom.
  • Momentary buttons; the logic handles a held Start.

Testing

Eleven of 22 recorded checks, run in CODESYS simulation. Boundary tests held the room temperature fixed. The three-minute delay was tested at full length; later checks used 20 s to save time.

TestCondition and actionExpected resultObserved resultResult
1Press Start with the room at 25 °CFan command turns on; running feedback follows after about 2 s; no cooling requestFan command on; feedback present at 2.8 s; cooling request offPass
2Press Start at 27 °C and read the outputs before fan feedback arrivesCompressor command stays off while fan feedback is absentCooling requested; fan feedback absent; compressor command offPass
3While cooling, set 24.1 °C, then 24.0 °C. After the off-time, set 25.9 °C, then 26.0 °CCompressor stays on at 24.1 °C, stops at 24.0 °C, stays off at 25.9 °C and starts at 26.0 °CAll four switching checks matched the expected result; fan kept runningPass
4Compressor stops, cooling needed again straight awayCompressor waits three minutes, then startsStill off at 2 min 54 s; started at 3 minPass
5Stop while cooling, Start again after 1 minuteCompressor waits the remaining 2 minutesStarted 3 min after the stopPass
6Start and Stop pressed togetherUnit stays stoppedUnit stayed stoppedPass
7Suppress fan feedback, press Start, then try Start while faulted. Reset and start again with feedback still suppressedFan fault after 10 s; both commands off; Start blocked while faulted; fault returns after a reset and restartUnit disabled and both commands off; Start was blocked; fault returned after 10 s on retryPass
8Suppress fan feedback while coolingCompressor command switches off immediately; fan fault disables the unit after 10 sCompressor stopped immediately; fan fault stopped the unit after 10 s; no compressor faultPass
9Suppress compressor feedback while running. Try Reset, then press Stop and ResetCompressor fault after 5 s; fan keeps running; Reset is ineffective until the unit is stoppedCompressor command off after the fault; fan kept running; fault cleared only after Stop and ResetPass
10Set room temperature to 29.9, 30.0, 29.0 and 28.9 °C in orderWarning activates at 30.0 °C, remains at 29.0 °C and clears at 28.9 °C; cooling continuesNo warning at 29.9 °C; warning active at 30.0 and 29.0 °C; cleared at 28.9 °C without stopping coolingPass
11Perform a controller warm reset while the unit is runningUnit returns stopped, with both commands off and no active faultsUnit returned stopped with no faults; minimum off-time setting was three minutesPass
Fan fault in simulation: the ladder logic online above the operator screen, with the fan fault active and the unit, fan and compressor stopped
Fan fault: rung 2 drops the unit, fan and compressor; the room warms and the high-temperature warning follows.

Limitations

  • This is a simulation. It is not a commissioned or safety-validated installation, and no standards compliance is claimed.
  • Temperatures, timings and signal types were selected for this project and have not been validated against a specific installation or manufacturer's data.
  • There is no standby cooling unit to take over if the unit fails.

Reflection and next steps

Breaking the task down into an operating sequence helped me understand what the program needed before writing the ladder logic. It separated the temperature decision from the conditions that allow the compressor to run, such as fan confirmation and the minimum off-time.

Considering faults alongside that sequence helped me identify what feedback the controller needed. A run command alone could not show whether the equipment had started, which is why the fault-handling stage needed running feedback from both the fan and the compressor.

Building and testing normal operation first made the later changes easier to follow. I could then check how each fault affected the existing sequence, including what stopped, what continued running and what the operator needed to do before restarting.

Next steps

  • Add temperature-sensor fault detection and define an appropriate cooling response for loss of the reading.
  • Add analogue-input scaling to convert a raw 4–20 mA reading into room temperature.
  • Add a standby cooling unit and changeover logic so cooling can continue if the active unit fails.