Nguyễn Văn Khanh * Trần Trọng Hiếu

* Tác giả liên hệ (vankhanh@ctu.edu.vn)

Abstract

A low-cost, real-time methodology for embedded devices based on well-known open source kernel - freeRTOS is presented in this study. The real-time algorithm designed consists of three main steps.Firstly, algorithm is designed and evaluated by utilizing Matlab/Simulink toolboxes. Secondly, the generic embedded C code is generated by Matlab program. Finally, freeRTOS Tasks code is utilized based on the generated C code to build and run on an embedded target. This real-time algorithm is demonstrated on a two-wheeled self-balancing robot which is employed a fuzzy PID self-tuning controller. The designed controller is executed on famous ARM Cortex M4 core microcontroller STM32F407VTG. The experimental results show that algorithm designed operated well on embedded system. The tracking position and rotation angle response in maximum delay 1.5 seconds which is fast enough while stabilizing the two-wheeled at upright. The real-time system designed is a low cost methodology and suitable for fresh embedded system designers.
Keywords: Open source, RTOS, embedded system, ARM Cortex, fuzzy PID controller

Tóm tắt

Bài báo trình bày một phương pháp thực hiện thuật toán điều khiển nhúng với chi phí thấp sử dụng nhân hệ điều hành thời gian thực nhúng freeRTOS. Phương pháp đề nghị gồm ba bước chính. Bước thứ nhất, thuật toán sẽ được thiết kế và kiểm chứng sử dụng Matlab/Simulink toolboxes. Bước thứ hai, thuật toán này sẽ được phát sinh mã nguồn ngôn ngữ C cho hệ thống nhúng bằng công cụ Matlab Realtime Embedded Coder. Bước cuối cùng, các tác vụ freeRTOS được lập trình dựa trên mã lệnh sinh ra để biên dịch và thực thi thuật toán trên hệ thống nhúng. Thuật toán PID mờ tự động hiệu chỉnh thông số điều khiển một robot hai bánh tự cân bằng được chọn để minh chứng phương pháp được đề nghị.Thuật toán này được chạy trên vi điều khiển nhân ARM Cortex M4 nổi tiếng STM32F407VTG. Kết quả thực nghiệm cho thấy thuật toán điều khiển nhúng đã hoạt động chính xác, robot vừa cân bằng vừa cho đáp ứng bám góc và vị trí nhanh với độ trễ tối đa 1.5 giây. Giải pháp đề nghị giúp có thể phát triển thuật toán điều khiển nhúng phức tạp với chi phí thấp phù hợp cho hầu hết các nhà phát triển hệ thống nhúng.  
Từ khóa: Mã nguồn mở, hệ điều hành thời gian thực, hệ thống nhúng, ARM Cortex, bộ điều khiển PID mờ

Article Details

Tài liệu tham khảo

Hrushit Shah, Rahil Shah, Udit Shah and Sanjay Deshmukh, 2013. Performance Parameters of RTOSs; Comparison of Open Source RTOSs and Benchmarking Techniques. International Conference on Advances in Technology and Engineering 101:1-6.

Renaux, D.P.B., 2014. Comparative Performance Evaluation of CMSIS-RTOS. Brazilian Symposium on Computing Systems Engineering: 126-131.

Renaux, D.P.B., Pottker, F., 2014. Applicability of the CMSIS-RTOS Standard to the Internet of Things. International Symposium on Object/Component-Oriented Real-Time Distributed Computing: 284-291.

Jorge C.G., Angel R.M., 2014. A Real-Time Sailboat Controller Base don ChibiOS. Proceeding of the 7th International Robotic Sailing Conference: 77-84.

TI Corporation, 2015. MSP430 LaunchPad Value Line Development kit. Available: http://www.ti.com/tool/msp-exp430g2. Accessed 8 September 2015.

Wikipedia, 2015. FreeRTOS. Available: https://en.wikipedia.org/wiki/FreeRTOS. Accessed 8 September 2015.

freeRTOS Real Time Engineers ltd., 2015. Available: http://www.freertos.org/RTOS.html. Accessed 8 September 2015.

Thao Ng.G.M, Nghia D.H, Phuc Ng.H, 2010. A PID backstepping controller for two-wheeled self-balancing robot. Proceeding of International Forum on Stategic Technology: 95-100.