MBO-KISS: AI-supported code generation for IEC 61131-3 in industrial automation

Can large language models (LLMs) reliably and safely generate industrial control applications?

This is the question addressed by the MBO-KISS funding project. Led by Fraunhofer IKS, six partners from research and industry are developing methods to evaluate and optimize AI-generated control applications. The aim is to develop a methodological approach that enables the safe use of LLMs for industrial control applications.

The biggest challenges for AI-generated code in industry

IEC 61131-3 is the established standard for programming controllers in industrial production. However, specialists with knowledge of IEC 61131-3 languages are rare, and the same is true for current LLMs: Publicly available LLMs have been trained primarily on high-level languages such as Python, Java, or C/C++, but not on IEC 61131-3 languages such as Structured Text (ST) or Sequential Function Chart (SFC). These languages are mainly used internally within companies, meaning that there is hardly any freely accessible training data. Furthermore, real-time requirements, communication interfaces to actuators and sensors, and safety-critical aspects are rarely part of the training data.

In addition to the language barrier, the complexity of industrial control applications is also an obstacle to code generation via LLMs. Therefore, suitable decomposition, breaking down applications into less complex components, and a clean interface design are essential for successful code generation and subsequent orchestration. They ultimately enable the individual generated code components to be assembled into a functioning application.

MBO-KISS brings LLMs into industrial automation

The MBO-KISS project uses existing LLMs and develops methods to use them for generating control applications according to IEC 61131-3, despite the limitations described above. LLMs are used throughout the entire development process, from requirements specification to test case generation.

To improve the available LLM models, they are retrained with proprietary data sets. Techniques such as retrieval-augmented generation (RAG) are also used in prompt creation. RAG improves LLM results and helps avoid AI hallucinations by allowing the LLM to access external, trusted data sources.

The generated control applications then undergo a three-stage test workflow to validate the results:

 

  1. Code review: Static analysis of the generated control code
  2. Unit tests: Automated code analysis at the functional level
  3. 3D simulation: Execution of the code in a machine simulation

The results from these static and dynamic tests are incorporated into subsequent generation cycles. This means that the code is iteratively improved with each test run.

Safe and efficient AI code generation for industrial control applications

The project result is a comprehensively tested, methodical approach for the safe use of LLMs in industrial control applications. Initial interim results are already promising. The generated control applications showed few errors when compared with the code style guide. After several rounds of the testing workflow, we have already reduced the number of errors to one tenth.

Once the project is complete, manufacturing companies will be able to use the developed approach to safely and efficiently deploy AI-based solutions for code generation in industrial automation. This will reduce engineering costs, minimize the impact of the shortage of skilled workers, and enable an optimized development process that can be easily adapted to their own systems.

How companies benefit from the research results

As part of the MBO-KISS project, Fraunhofer IKS is also investigating which LLMs are best suited for code generation in Structured Text (ST). To this end, we are developing a comprehensive benchmarking system, which we will continue to expand after the project and provide companies with guidance on using LLMs in industry.

The methods and approaches developed by Fraunhofer IKS within the project are available for further use in future projects and for industrial customers. This provides a valuable foundation for innovations in industrial automation and AI in industry.

Would you like to benefit from our expertise? Contact us using the contact form:

Contact us now

Project details

  • Project name: MBO-KISS (Methods for evaluating and optimizing AI-generated control applications based on the physical simulation of machines and their target behavior)
  • Project lead: Fraunhofer IKS
  • Project period: January 2025 – December 2027

Project partners

A total of six partners are participating in the MBO-KISS project:

 

 

  • Fraunhofer IKS: Development of safe, efficient methods for generating control applications
  • ITQ GmbH: Development of methods for automated, static, and dynamic code analysis
  • Sepp.med GmbH: Test analysis, test design, test automation, and test coverage
  • Max Streicher GmbH & Co. KGaA: Provision of use cases and practical tests
  • Associated partners: Codesys Group and Bosch Rexroth AG are supporting the project as experts and consultants.

 

The project is funded by the Bavarian Ministry of Economic Affairs, Regional Development and Energy as part of the program BayVFP Förderlinie Digitalisierung.

More Information

Fraunhofer IKS conducts research into safe, intelligent cognitive systems for industrial automation. On the following pages, you will find further approaches and solutions that will make your production plant efficient and safe:

 

Automation Systems

Automation is crucial to ensure the quality and efficiency of production processes. Our vision for automation techniques is to complement human expertise, leveraging the strengths from both perspectives to achieve the best possible outcome.

 

Industrial Sensors

The automation of production requires reliable systems for the real-time monitoring and control of processes. We envision AI solutions that enable humans and machines to work together safely, ensuring precision and reliability.

 

LLM-based support for troubleshooting

Troubleshooting in modern manufacturing systems is often time-consuming and expensive, leading to downtime and requiring extensive expertise. Fraunhofer IKS supports companies with its LLM-based troubleshooting assistant to accelerate and simplify the troubleshooting process, ensuring flexible and resilient manufacturing.

Contact us now

Would you also like to collaborate with Fraunhofer IKS? Contact us without obligation using the contact form below. We look forward to receiving your message and will get back to you as soon as possible.

Thank you for your interest in the Fraunhofer IKS.

We have just sent you a confirmation e-mail. If you do not receive an e-mail in the next few minutes, please check your spam folder or send us an e-mail to business.development@iks.fraunhofer.de.

* Required

An error has occurred. Please try again or contact us by e-mail: business.development@iks.fraunhofer.de

Das Projekt wird gefördert durch das bayerische Staatsministerium für Wirtschaft, Landesentwicklung und Energie im Programm BayVFP Förderlinie Digitalisierung.