Feasibility Study for a Python-Based Embedded Real-Time Control System

Se Yeon Cho, Raimarius Delgado, Byoung Wook Choi

Research output: Contribution to journalArticlepeer-review

5 Scopus citations

Abstract

Because of its simplicity and the support of numerous useful libraries, Python has become one of the most popular programming languages for application development, even in embedded systems. However, in existing control systems where specific tasks must meet specific temporal deadlines and support schedulability with proper priority assignments, the Python interpreter may not satisfy real-time requirements, owing to features such as the global interpreter lock and garbage collector. This paper addresses these constraints with an approach that executes periodic real-time tasks under the fixed-priority preemptible scheduler of RT-Preempt. First, we implemented a Python real-time module that allows users to create and execute periodic tasks with fixed priorities based on Python. Then, we conducted experiments on an open embedded system, in this case, a Raspberry Pi 4. We evaluated the real-time performance, focusing on test metrics for control systems, such as task periodicity, responsiveness, and interrupt response. The results were then compared to those of conventional real-time tasks developed using the C language to validate the feasibility of the proposed method. Finally, we performed experimental validation by tracking the position of EtherCAT servo motors to demonstrate the feasibility of a Python-based real-time control system in a practical application.

Original languageEnglish
Article number1426
JournalElectronics (Switzerland)
Volume12
Issue number6
DOIs
StatePublished - Mar 2023

Keywords

  • EtherCAT
  • Python
  • RT-Preempt
  • embedded systems
  • real-time

Fingerprint

Dive into the research topics of 'Feasibility Study for a Python-Based Embedded Real-Time Control System'. Together they form a unique fingerprint.

Cite this