Skip to content

Repository files navigation

Dynamic Gain for Delay-Resilient Control

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

Repository guide

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

Build

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_plant

These 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.

Configure the experiment

Before starting the programs, inspect the settings in the source:

  • Controller endpoint: IP_ADDR and SERVER_PORT in plant.c. The archived values are 192.168.1.2 and UDP port 4000; change the address to the controller host in your experiment.
  • Controller listener: controller.c binds UDP port 4000 on all local interfaces.
  • Sampling period: SAMPLING_PERIOD in matrix.h.
  • Disturbance configuration: plant.c also includes ATTACK_ADDR, ATTACK_PORT, and timing settings for the original disturbance experiment. Configure these for your experiment setup before execution.
  • Log directories: create log_controller/ and log_plant/ in the working directory of each relevant process.

Rebuild after changing source settings:

make -B controller.out plant.out

Run the controller and plant

In the configured experiment environment, start the controller first:

./controller.out

Then start the plant in a separate terminal or on the configured plant host:

./plant.out

Run 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.

Read the logs

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.

Cite the research

@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}
}

Research team and contact

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.

About

Research code for real-time controller reconfiguration in delay-resilient cyber-physical systems — IEEE Access, 2022.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages