Dual-Core FreeRTOS Social Robotics
A dual-core FreeRTOS implementation of subsystems for social robotics healthcare application on a Raspberry Pi Pico MCU.
Grade: 8.6
Healthbot - Dual-Core FreeRTOS Social Robotics
This project represents my exploration into real-time operating systems (RTOS) for embedded devices, specifically focusing on FreeRTOS implementation. The Healthbot project is part of an ongoing initiative at the Health Concept Lab, aimed at conducting exploratory research in social robotics and examining how embedded technologies can enhance elderly care and support healthcare providers.
Content
The project demonstrates advanced FreeRTOS features through a practical healthcare robotics application, showcasing dual-core processing capabilities on the Raspberry Pi Pico platform.
System Abstract
This project aimed to create a sophisticated embedded system for social robotics applications in healthcare settings. The system utilizes dual-core FreeRTOS architecture with multiple sensors, actuators, and communication interfaces to demonstrate advanced real-time operating system concepts.
The high-level system design illustrates interconnections between various components and the microcontroller unit (MCU). The MCU serves as the central hub, interfacing with multiple peripherals through distinct communication protocols including SPI, UART, USB, and PDM interfaces.
Features
- mmWave Radar Sensing: 60GHz mmWave radar for presence detection and motion sensing via SPI interface
- Dual-Core Processing: Utilizes both cores of the Raspberry Pi Pico for efficient task distribution
- Interactive Interface: Switch array for user interactions and LED matrix for visual feedback
- Audio Feedback: PWM-controlled audio output for user interface feedback
- Robotic Eyes: Dual 1.28-inch round displays acting as controlled robotic eyes
- Motor Control: Precise stepper motor control with step, direction, and enable signals
- Asynchronous Communication: UART and USB interfaces for data transfer and system monitoring
- Real-Time Scheduling: Advanced FreeRTOS scheduling with 5-level priority system
Technologies Used
- RTOS: FreeRTOS with dual-core configuration
- Hardware: Raspberry Pi Pico (RP2040 dual-core ARM Cortex-M0+)
- Programming: C with Pico SDK and FreeRTOS
- Communication Protocols: SPI, UART, USB, PDM
- Sensors: 60GHz mmWave radar with external ADC
- Actuators: Stepper motor, LED matrix, audio speaker
- Development Tools: Logic analyzer for signal verification and debugging
Implementation Details
FreeRTOS Configuration
The system is configured with specific parameters optimized for healthcare robotics applications:
- Stack Size: 128 uint32_t for efficient memory usage
- Total Heap Size: 145KB (below 256KB RAM limit)
- Priority Levels: 5-level system with critical functions at levels 4-5
- Tick Rate: 125MHz system clock frequency
- Time-Slicing: Enabled for responsive task switching
- Dual-Core: Both cores utilized for parallel processing
Task Architecture
The system implements six specialized tasks with specific priorities and core assignments:
- mmWave Radar Reader (Priority 3, Core 0): Handles 60GHz sensor data sampling and presence detection
- UART Communication (Priority 3/1, Core 0): Asynchronous TX/RX communication tasks
- PWM Audio Control (Priority 1, Core 0): Manages audio feedback for user interface
- Display UI Controller (Priority 2, Core 1): Controls dual robotic eye displays
- Stepper Motor Controller (Priority 2, Core 0): Manages precise motor movements with timeout handling
- System Status (Priority 1, Core 1): Heartbeat LED and system administration
Inter-Communication Techniques
The project demonstrates advanced FreeRTOS features including:
- Semaphores: Used for UART transmission completion signaling
- Queues: Buffer incoming UART data for processing
- Event Groups: Handle GPIO interrupts and button state management
- Task Notifications: Trigger communication between radar detection and UART tasks
Verification & Validation
The system underwent practical verification using logic analyzer measurements and runtime statistics monitoring. Key validation results include:
- Motor Control Timing: Verified 35μs pulse duration with 250μs period for stepper motor control
- Audio Signal: Confirmed 8-bit PDM signal at 11kHz sampling rate
- Task Switching: Monitored serial output to verify proper task execution and timing
- System Performance: Runtime statistics confirmed efficient operation across all tasks
The logic analyzer measurements validated the precise timing requirements for motor control and audio output, ensuring reliable operation in healthcare environments.
Future Development
Currently, the project serves as a demonstration of advanced FreeRTOS concepts. Future enhancements could include:
- Implementation of daemon tasks for background operations
- Enhanced inter-task communication through message queues
- Integration of additional sensors for comprehensive health monitoring
- Development of machine learning algorithms for patient interaction
This project successfully demonstrates the practical application of dual-core FreeRTOS in healthcare robotics, providing a foundation for future social robotics research in elderly care applications.
This project was completed as part of the Microcontrollers 5 - Realtime Operating Systems (EMBSYS01-MIC5) course at HAN University of Applied Sciences, Embedded Systems Engineering program, S6 2023-2024.