Retrieval-grounded robot program generation and simulation-based correction via Model Context Protocol

Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh

arXiv:2608.21417 · 2026-08-25 공개 · arXiv · PDF

retrieval-augmented model-context-protocol code-validation robot-program-generation abb-robotstudio simulation-based-correction industrial-robotics natural-language-to-code

Abstract

Flexible manufacturing requires industrial robots to be reprogrammed rapidly as product variants change. This paper presents a language-model-based workflow that generates, validates, and iteratively corrects ABB RAPID robot programs from natural language task descriptions. A dual-stream retrieval-augmented generation (RAG) pipeline grounds code generation in verified technical documentation and production templates, reducing domain-specific errors produced by ungrounded language models. A custom Model Context Protocol (MCP) server connects the language-model client directly to ABB RobotStudio for automated code upload, simulation execution, and diagnostic feedback. The evaluation combines a 30-query retrieval benchmark, scoped code-generation checks, and RobotStudio case studies in a simulated pickand- place manufacturing cell. The simulation loop exposes execution failures that static and semantic checks alone cannot catch, including suction release-height errors, unreachable placement targets, and configuration-dependent recovery motions. The results show how RAG and MCP can connect grounded code generation with executable feedback from industrial robot simulation software, while reducing but not eliminating expert setup and final supervision.

한국어 요약

한 줄 요약

ABB RAPID 프로그램을 자연어에서 생성하고 RobotStudio 시뮬레이션을 통해 검증하는 RAG-MCP 통합 워크플로우를 제안한다.

핵심 기여도

핵심 아이디어

기존 언어 모델은 자연어를 코드로 변환할 수 있지만, 산업 로봇 프로그래밍에서는 도메인 특화 오류와 실행 가능성 문제를 해결해야 한다. 이를 위해 **RAG (Retrieval-Augmented Generation)**와 **MCP (Model Context Protocol)**를 결합한 워크플로우를 제안한다. RAG는 **기술 문서**와 **생산 템플릿**을 검색하여 생성된 코드의 정확도를 높이고, MCP는 **RobotStudio**의 시뮬레이션과 진단 정보를 언어 모델에 피드백하여 실행 오류를 감지한다. 이는 **정적 및 의미적 검사에서 포착되지 않는 실행 실패**를 해결하는 핵심 아이디어이다.

기술적 접근법

주요 결과

의의 및 한계

이 연구는 자연어에서 산업 로봇 프로그램을 생성하고, **RobotStudio 시뮬레이션을 통해 실행 가능성 검증**하는 체계적인 워크플로우를 제시한다. MCP를 통해 **RobotStudio의 진단 정보를 언어 모델에 직접 피드백**함으로써, 기존 RAG 기반 생성 방식의 한계를 보완한다. 그러나 **RobotStudio 스테이션, 도구, I/O 매핑, Smart Components**는 사전에 설정되어 있어, 완전 자율적 시스템은 아님. 또한, **안전 PLC 통합, 용접 제약, 다로봇 협업**은 검증되지 않았으며, **KUKA, FANUC, PLC 환경**으로 확장하려면 MCP 도구 구현이 필요하다.

실용적 활용

이 워크플로우는 **고객 맞춤형 제품 생산**이나 **제품 변형이 빈번한 제조 환경**에서 유용하게 활용될 수 있다. 특히, **ABB RAPID 기반 로봇 시스템**을 사용하는 공장에서 자연어 기반 재프로그래밍과 시뮬레이션 기반 디버깅을 통해 **재설정 시간을 단축**하고 **설치 전 오류를 사전에 감지**할 수 있다.