News

AI-supported programming assistant for the automation industry

news article

AI-supported programming assistant for the automation industry

Wie können Entwickler speicherprogrammierbare Steuerungen effizienter programmieren, ohne sensible Daten in die Cloud zu übertragen? Im Auftrag von Mitsubishi Electric hat das Team Machine Learning des Fraunhofer IOSB-INA einen spezialisierten KI-Assistenten entwickelt, der herstellerspezifischen Code generiert und validiert. Das Projekt zeigt exemplarisch, wie der Transferansatz des Leistungszentrums Engineering Automation industrielle Herausforderungen löst.

 

Challenge: Proprietary systems meet data protection

Programming programmable logic controllers (PLCs) is time-consuming and error-prone. Each manufacturer uses its own dialects and proprietary function blocks – what works with a Siemens controller cannot be easily transferred to a Mitsubishi Electric system. Modern AI models such as GPT-4 can write code in principle, but they do not know the specific syntax rules of individual manufacturers. This information is documented in extensive manuals and is not accessible to the models' training data. At the same time, cloud-based solutions are out of the question for many industrial companies for data protection reasons.

Solution: Intelligent knowledge database with compiler integration

The GeneriST project resulted in an AI assistant that is specifically tailored to Mitsubishi Electric's Structured Text implementation. The system uses Retrieval-Augmented Generation (RAG): a specialized knowledge database contains function modules, syntax rules, and code examples that are retrieved specifically for each query and provided to the language model as context.

Ein besonderes Merkmal ist die direkte Integration des GX Works3-Compilers. Generierter Code wird automatisch kompiliert und bei Fehlern iterativ korrigiert. So erhalten Nutzer validierten, sofort ausführbaren Code. 

In der Evaluation mit 100 Testaufgaben erreichte das RAG-gestützte System eine Kompilierungsrate von bis zu 87 Prozent. Ohne Wissensdatenbank lag sie bei 38 Prozent. Auch ein lokal lauffähiges Offline-Modell erreichte 86 Prozent und ermöglicht damit den Einsatz in sensiblen Industrieumgebungen ohne externe Cloud-Abhängigkeiten.

The architecture developed is not limited to Mitsubishi Electric. By exchanging the knowledge database and adapting the prompt templates, the system can be transferred to other PLC manufacturers. GeneriST thus offers a blueprint for companies that want to develop AI-supported programming assistants for proprietary systems.

Are you interested in this topic? Please contact Dr. Gesa Benndorf, head of the Machine Learning team at Fraunhofer IOSB-INA.