The software of artificial organ is more and more complex, but it lacks real-time operating system to manage and schedule its resources. In this paper, we propose a lightweight real-time operating system (RTOS) Cyborgan OS based on the SmartOSEK OS. Cyborgan OS optimizes and improves it from the code size, context switch, low power consumption, and partial dynamic update, making it suitable for the artificial organ control system. Finally, we use the heart blood pump model to analyze the task allocation and execution sequence as well as the code size of the whole program. In this application, the maximum space occupied by the code is only 15 kB, which is suitable for most microcontrollers.