---
title: "Guide to RoboRave Line-Follow"
date: "2024-12-31"
categories: ["3D Printing Guides"]
tags: ["Guide", "Guides", "Line Follow"]
excerpt: "Welcome to the guide to starting RoboRave Line-Follow from scratchThe Challenge The goal of RoboRave Line-Follow (SPRINT) is to create a robot that can follow a black line and deliver a single ping-pong ball to a tower at the end of the track. The ga"
featuredImage: "/images/resources/guide-to-roborave-line-follow.jpg"
---

![](/images/content/fdc421-line-follow2.jpg)

Welcome to the guide to starting RoboRave Line-Follow from scratch

## The Challenge

![](/images/content/23a62d-tracks.gif)

The goal of RoboRave Line-Follow (SPRINT) is to create a robot that can follow a black line and deliver a single ping-pong ball to a tower at the end of the track. The game lasts 3 minutes, and after scoring the first ball, robots may continue scoring balls for the duration of the match. There are three fields for elementary, middle, and high school with increasing difficulty, respectively.

## The Rules

**Scoring:**

Scores are an accumulation of the following tasks:

- Following the track to the tower

- Delivering at least one ball

- Returning back home

- Delivering the highest number of bonus balls in the time remaining

**General Robot Rules:**

- The robot must be fully autonomous and cost $1500 USD or less

- The robot must fit within the size constraints of 25cm x 18cm with no height restrictions

- The weight limit for the robot is a maximum of 1kg

For the rest of the tournament rules and specific scoring matrices for each age division, visit the link below to the RoboRave website rules page.[Line-Follow Rules](https://roboraveaustralia.com/wp-content/uploads/2022/10/All-2023-Challenge-Rules-V1-PDF.pdf)

## Getting Started

**Physical Build:**

For the line-follow aspect of the challenge, the in-built colour sensors on the Micromelon rover can be used. Thus, the main focus of the physical build is to design and construct a system to carry and deposit the balls in the tower. The tower is an A4 mailing box, 20cm tall and 10cm wide, with a 10cm x 10cm wide hole at the top for the ping-pong balls.

Because of this, the recommended technique is to build a tower of sorts on top of the Rover with a container to store the balls. This container should also have a system (like a servo) to release the balls when it reaches the tower. Our 3D-printed RoboRAVE Line-follow attachment encompasses these considerations. For more details, click on button below to head to the build guide.[Build Guide: Roborave Line Follow](https://micromelon.com.au/resources/build-guide-roborave-line-follow)

![](/images/content/d08a3c-img_1131.jpg)

**Coding:**

For the coding aspect of the challenge, the recommended strategy is to use a basic line following technique with some modifications to suit the challenge. The link to the Micromelon Line Following activity has been added below.[Activity: Line Following](https://micromelon.com.au/resources/line-following?rq=follow)

After making the basic line following code, we need to add some conditions, so the robot is aware when it’s reached an intersection, reached the tower, or has returned home. Each situation is represented by a black line perpendicular to the current track. This can be seen in the line following mat examples in the RoboRave rules.

A simple way to detect these is to have an ‘if’ statement checking to see if all three colour sensors on the Rover see black. The ultrasonic sensor may also be used to detect the tower.

When these black areas are detected, the Rover must deduce the area type. This can be done by coding manually for the field. For example, for the MS field, the following coding structure can be used:

- Line follow until black area is detected (intersection reached)

- Turn at intersection

- Follow the line until black area is detected (tower has been reached)

- Deposit a ball and turn around

- Follow the line until black area is detected (intersection reached)

- Turn at intersection

- Follow the line until black area is detected (home reached)

## Tips and Tricks

#### Rover Expansion Headers:

One way to make the Rover follow the line faster is to use an external colour and light sensor instead of the three on the Rover. There are several sensors with differing capabilities. One such sensor is the QTR-8RC line sensor array which senses reflected light intensity from 8 infrared sensors. The expansion headers on the Rover can be connected to an external microcontroller which can be used to interface with these external sensors. For further detail about using the expansion header, head over to the guide to I2C and UART pages and the Rover and Arduino Line Follow showcase.

![](/images/content/17f0db-line-sensors.jpg)

![](/images/content/19bff0-img_1366.jpg)

[How to use I2C](how-to-use-i2c)

[How to Use UART](getting-started-the-micromelon-rover-uart)

[Showcase; Rover and Arduino Line Follow](showcase-rover-and-arduino-line-follow)


#### PID Line Follow:

When making your own line-follow code, most simple implementations will have the Rover following the line in a jerky motion. Implementing a PID (Proportional Integral Derivative) controller can smooth this motion and improve the Rover’s ability to follow the line quickly and more accurately. The basic idea is to use reflected light intensity from the line sensors. This value is usually very high on white and low on black, so the goal is to follow the middle point between the two, which we’ll call the grey area.

![](/images/content/f348f1-line-follow.png)

Our target will be 50% intensity. If the reading is less than that, the Rover will veer away from the line; if it’s greater than 50%, it will turn towards the line. The entire PID equation is excessive for the task, so a simple Proportional controller should suffice in most cases. Check out our guide for more information about making proportional controllers (link below).[Getting Started With Proportional Control On A Micromelon Rover](https://micromelon.com.au/resources/getting-started-with-proportional-controls)
