กลับไปหน้ารวมไฟล์
autonomous-line-follower-with-seeed-shield-bot-12-and-arte-1ed934-en.md

Real-Time Robotics: Beyond the Standard Loop

Traditional Arduino programming relies on a single loop() function. When building a robot that must simultaneously read five sensors, drive two motors, and listen for Serial commands, this "One-at-a-time" approach can lead to jerky movements and missed path updates. This project utilizes the Shield Bot 1.2 and the ARTe (Arduino Real-Time eXtension) to implement a sophisticated Multithreaded Navigation system on the Arduino Due.

The ARTe Multi-Tasking Edge

Developed by ReTiS Lab, ARTe transforms the Arduino Due into a real-time operative environment.

  • Preemptive Scheduling: Unlike a standard loop where every task must wait for the previous one to finish, ARTe allows high-priority tasks (like path correction) to "Preempt" or interrupt lower-priority tasks (like serial data logging).
  • Concurrent Loops: This robot runs multiple loops at different rates. For instance, the IR Sensor Loop might run every 10ms to ensure the line is never lost, while the Telemetry Loop runs every 500ms to send battery status to the computer.
  • Synchronization: ARTe provides mechanisms to safely share data between these loops, ensuring that the Motor control task always has the latest sensor data without causing "Race Conditions."

Hardware: The Shield Bot 1.2 Rover

The Shield Bot 1.2 is a compact, integrated robotics platform designed for the Arduino ecosystem:

  1. 5 IR Reflectance Sensors: Line detection is achieved using a five-sensor array. This allows the robot not just to see "Line" or "No Line," but to calculate the Error Offset. If only the leftmost sensor sees the line, the robot knows it must perform a sharp left turn.
  2. Integrated Motor Drivers: The Shield Bot eliminates messy wiring by integrating the H-Bridge circuitry directly into the PCB, allowing the Arduino Due to control motor speed and direction via simple digital pins.
  3. Arduino Due Power: By using the Due (ARM Cortex-M3), this project gains significantly more processing power and memory compared to the Uno, which is essential for handling the overhead of a real-time OS like ARTe.

Manual and Autonomous Modes

The software implementation includes a dual-mode control switch:

  • Autonomous Path Following: The primary mode, where the ARTe scheduler manages the sensor-to-motor feedback loop to track the floor path with high precision.
  • Serial Command Mode: A manual override allows the user to send directional commands through the Serial Monitor. Thanks to multitasking, the robot can maintain its "Safety Sensors" even while being manually driven, preventing a collision if the user drives off code.

The aim of this project is to create a rover that is able to independently follow a certain line path traced on the floor. The identification of the path is done by the five sensors integrated on the Shield Bot 1.2 rover. Also, a manual mode has been implemented, to drive through user's command, received via Serial line.

The project has been developed exploiting the ARTe Arduino Real-Time extension from ReTiS Lab, Scuola Superiore Sant'Anna Pisa. ARTe is an extension to the Arduino framework that supports multitasking and real-time preemptive scheduling. Thanks to ARTe, the user can easily specify and run multiple concurrent loops at differents rates, in addition to the single execution cycle provided by the standard Arduino framework. ARTe has been developed to support concurrent real-time periodic activities, while maintaining the simplicity of the programming paradigm typical of the Arduino framework. More information about ARTe can be found at ARTe Website or in the Getting Started with ARTe project.

ข้อมูล Frontmatter ดั้งเดิม

title: "Autonomous Line Follower with Seeed Shield Bot 1.2 and ARTe"
description: "A simple rover for line following made exploiting the ARTe Arduino REal-Time eXtension."
author: "stefano_maugeri"
category: "Motors & Robotics"
tags:
  - "multithreading"
  - "rover"
  - "arte"
  - "robots"
  - "real-time"
  - "due"
views: 4177
likes: 0
price: 2450
difficulty: "Intermediate"
components:
  - "1x Seeed Studio Shield Bot 1.2"
  - "1x Arduino Due"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/750aca61-cff4-4395-b055-1d81ac07a43f.h"
documentationLinks: []
passwordHash: "283458fb601c63631796e0b7d83a36c5f7222820d4a73e2c67bd2c39a2c99b97"
encryptedPayload: "U2FsdGVkX1/LyvxS0uSjR3dLWrPML++tcvLc24JKM5TakPUH1keB0NUqRaG9uK7FTkcRchqTIcGpoO4MFGXhKdaXAOGwlGqF8rmglpv0vVs="
seoDescription: "Build an Autonomous Line Follower with Seeed Shield Bot 1.2 and ARTe Arduino REal-Time eXtension for multi-tasking and real-time robotics."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/autonomous-line-follower-with-seeed-shield-bot-12-and-arte-1ed934_cover.jpg"
lang: "en"