A year ago, I completed my first project β automating a welding production process via offline robot programming in RoboDK.
At that moment, I realized: to become a truly comprehensive automation systems engineer, I need to master PLC programming. From the entire IEC 61131-3 standard, I chose Structured Text and the CODESYS development environment. As always, mastering something "new" requires a massive challenge. In this case β studying Object-Oriented Programming (OOP), modular development, architecture, data structuring, code execution optimization, building abstractions, and complex visualization.
I chose a real-world object β the largest intersection in my city (View on Google Maps). Having absolutely no official documentation, I performed a complete reverse engineering of the intersection's operational logic solely through visual observation.
The extended 4K video review below demonstrates the results of my work: https://youtu.be/HEWyx1gOcKs
The CODESYS file, source code, and accompanying technical documentation are available here:
For ease of review, the repository contains:
AdaptiveTrafficLightControl_DK22-DK25_CODESYS.projectarchive β for a quick download and seamless launch of the project in CODESYS.src folder β fully replicates the structure of the project's codebase. This allows you to easily view and analyze the code (POU, GVL, DUT) directly in your browser on GitHub, without needing to open the IDE.The project was created in CODESYS V3.5 SP21 Patch 1+ (64 bit). Since everything was written entirely from scratch (including the math, simulator, and adaptive logic) and designed to run in a standard free CODESYS environment, the project does not require the installation of any third-party libraries.
Everything is accompanied by detailed technical documentation:
The system is built on the principle of deep, multi-level modularity. Here are the key modules (top abstraction level):
1) Intersection Control Core
A logic controller that synchronizes the operation of all actuators and displays the current state. The operation of all physical inputs and outputs is visualized on the main screen (the intersection model). The visualization implements connections specifically to hardware variables, not just logical ones.
2) Settings Manager
An isolated security module acting as a protective gateway between the user interface (HMI) and the main controller.
3) Adaptive Traffic Control Logic
Analyzes intersection data in real-time (generated by the MOCK simulator). Adaptive logic decisions include:
4) MOCK Simulator
An independent multi-parameter module that generates a dynamic traffic simulation (imitating the operation of a CCTV system and inductive loops).
π Multilingual & Scalable
The visualization supports 4 languages (English, German, Polish, Ukrainian) via Text Lists and native CODESYS localization. The software core is highly flexible and capable of scaling from a simple T-junction to a complex X-junction with 12 entry lanes without rewriting the code.
Initially, this project was created as a testing ground for learning Structured Text, but a deep dive made this field truly fascinating. However, my focus is not limited solely to traffic control.
In the future, I am interested in solving complex architectural challenges in the following areas:
π€ Currently, I am open to new career opportunities in the field of industrial automation, robotics, and PLC programming.
If you are looking for an engineer who isn't afraid of unconventional challenges β let's talk!
I would appreciate a repost or a comment!