Research code for controller reconfiguration under communication delay.
Experimental materials for:
Real-Time Controller Reconfiguration for Delay-Resilient Cyber-Physical Systems
Sangjun Kim, Sanghoon Lee, and Kyung-Joon Park
IEEE Access, October 2022
Read the paper
The repository contains a UDP-connected plant simulation and controller, with supporting matrix, queue, timing, and logging code. The source preserves the original experiment settings.
Researcher: Sanghoon Lee · GitHub · Questions
| File | Purpose |
|---|---|
plant.c |
Plant simulation, sensing, and UDP communication |
controller.c |
Controller, delay tracking, and reconfiguration logic |
matrix.c, matrix.h |
Matrix and system-model utilities |
udp_protocol.c, udp_protocol.h |
Communication helpers |
queue.c, queue.h |
Queue utilities used by the controller |
log_manager.c, log_manager.h |
Timestamped experiment log files |
attacker.c |
Separate disturbance-experiment helper from the original setup |
Makefile |
Build targets |
Use a Linux environment with GCC and GNU Make. The plant uses POSIX timers and links against librt.
git clone https://github.com/Hun0130/Dynamic-gain-for-delay.git
cd Dynamic-gain-for-delay
make -B controller.out plant.out
mkdir -p log_controller log_plantThese two targets were compiled successfully on Ubuntu 24.04 during the documentation update. The -B option rebuilds the source even when the repository contains precompiled object files.
Before starting the programs, inspect the settings in the source:
- Controller endpoint:
IP_ADDRandSERVER_PORTinplant.c. The archived values are192.168.1.2and UDP port4000; change the address to the controller host in your experiment. - Controller listener:
controller.cbinds UDP port4000on all local interfaces. - Sampling period:
SAMPLING_PERIODinmatrix.h. - Disturbance configuration:
plant.calso includesATTACK_ADDR,ATTACK_PORT, and timing settings for the original disturbance experiment. Configure these for your experiment setup before execution. - Log directories: create
log_controller/andlog_plant/in the working directory of each relevant process.
Rebuild after changing source settings:
make -B controller.out plant.outIn the configured experiment environment, start the controller first:
./controller.outThen start the plant in a separate terminal or on the configured plant host:
./plant.outRun each command from its repository directory so that relative log paths resolve correctly. Stop the processes with Ctrl+C.
These commands start the controller and plant components. Reproducing the paper's delay scenarios additionally requires matching its network setup, disturbance conditions, and control parameters.
The current source writes timestamped, tab-separated files:
| Output | Columns, in order |
|---|---|
log_controller/controller_*.txt |
Simulation time, control input u, measured delay in seconds, delay_check flag |
log_plant/plant_*.txt |
Simulation time, ap_val, plant output y, control input u |
The controller's console prints delay in milliseconds; its log file stores delay in seconds. Use the code's log format when plotting results.
The original execution note is retained as a historical reference. The table above follows the current sprintf(log_message, ...) statements in the source.
@article{kim2022reconfiguration,
title = {Real-Time Controller Reconfiguration for Delay-Resilient Cyber-Physical Systems},
author = {Kim, Sangjun and Lee, Sanghoon and Park, Kyung-Joon},
journal = {IEEE Access},
year = {2022},
url = {https://ieeexplore.ieee.org/document/9896851}
}The paper was authored by Sangjun Kim, Sanghoon Lee, and Kyung-Joon Park.
For questions about these research materials, contact Sanghoon Lee at leesh2913@dgist.ac.kr. More research and tools.