For a quick run-down of the changes from the Summer 2017 rules to the current rules check out our blog post: Updates to the rules for the Winter 2017 series.

The Competition

The Formula Pi series is an autonomous robotics competition based around the Raspberry Pi. There are different classes which involve different programming skills and a wide range of ages. It aims to advance autonomous robotics and to give a fun and challenging competition that improves coding and STEM education.

The main class is named the Monster class, which uses our MonsterBorg robot equipped with a Raspberry Pi 3. During the Summer 2017 season, we will introduce a new class called the Raptor class. This will have prerequisites for entry, which will include successful completion of at least one season of Formula Pi.

Both competitions use club robots, which are robots that we own and maintain. You cannot use your own robot in the Monster class as we want to make sure each robot is evenly matched. The possibility of using of your own robot in the Raptor class is currently being investigated.

Competitors write code and submit code to be run on the club robots for the competition. Code may be sent from anywhere in the world via either our FTP site, or by sending an SD-card via traditional mail.

The testing and racing will be live streamed for all people to view. The live stream will also be viewable after the event on YouTube.

There are deadlines as to when we need to have received the code for it to be used in the racing. The summer season starts April for testing and ends July. Winter season starts November for testing, and finishes March. Please see the Formula Pi Winter series competition dates for more details on event dates.

Cost to enter either competition for one season is £37 + shipping which includes a YetiLid. Last entry for the summer season is 30th April. Last entry date is 31st October for the winter season.

With a paid entry, you will be supplied with a competitor number with a YetiLid. The YetiLid will include a number to stick on, this number should be clearly displayed on the number section of the lid so we can identify the robots as they cross the start/finish. The remainder of the YetiLid you may decorate as you like, however, offensive, political, religious or tasteless messages will not be used and we may replace your lid with a sponsors' lid.

Do not decorate or mark the number section except with your competitor number. You must supply both the code and the YetiLid to race. Entry fees must be paid to race.

If you have not supplied us with your decorated YetiLid, but we do have your code, we may:

  1. Not run your entry at all
  2. Run your entry with one of our standard lids
  3. Place a sponsors' lids on your designated robot

Race Classes

There are multiple classes in the Formula Pi competition each using different robots. At the moment there are two active classes: Monster and Raptor. The rules for each class are largely the same, but each season we are likely to make some slight changes to include new robot capabilities and to keep challenging everyone to improve on previous performances. The Formula Pi is based around a set of timed races judged by laps completed along with some technical challenges to test coding skills. In the future we may add additional classes.

Class Pi Model Battery Controller Motors Other
Grand Pi
10 minutes
Pi Zero 9V PP3 ZeroBorg 4x 180 rpm Has been superseded by Monster Class.
10 minutes
Pi 3 10x 1.2V AAs ThunderBorg 4x 300 rpm Uses house robots only. Winners code released each year Winners Trophy and prizes.
10 minutes
TBC - Pi3 TBA PiBorg Raptor Low impedance velocity controlled motor Uses PiBorg Raptor controller, Pozyx localised GPS/IMU, wide angle camera, wheel speed encoder

The top 10 competitors will be offered single digit red numbers instead of black if they compete in the next season's competition.

The track

The first track for the series will be the PiBorg circuit, which is approximately 22m (72ft) long. On the edges of the track are rubber skirting - approx. 100mm (4") high, and is approx. 150mm (6") high in places. The rubber is 10mm (~3/8") thick to absorb impacts. The width of the track is ~2.4m (8ft). The track is separated into 6 lanes of approximately 305mm (12") wide, in a particular colour sequence.

In clockwise driving orientation, the ordering is from left to right with respect to the camera view: Red, Blue, Red, Green, Blue, Green. Normal orientation will be clockwise for the series, although there may be specialty races in the opposite direction.

The start bays are placed on the transition between colours. At starting time, all robots are to be within these start bays, and facing directly forwards. It is not permitted to angle the robots at start.

The timing is via a Laser and a diode at the start finish line. There is also a camera at the start line to be used for control of jump starts.

The stop/go instruction is via 5x20mm Red and 5x20mm Green LEDs. These LED's are approximately 1.8m (6ft) forward of the start line and are pointed directly at the front of the start bays, to enable maximum exposure on the Pi Camera. The lighting sequence will be Green, held for at least 5 seconds, then Red, held for randomly between 2 seconds and 30 seconds, then Green again. At the second green event, the race is live and it is permitted for the robots to begin racing.

Live broadcast

The series will be covered with our video cameras, and the stream will be available to watch online both live and at a later date. There will be a live commentary, so information about you/your team/strategy should be sent with the registration document.

The Robots

We will supply the robots for both the Monster and Raptor competitions. The robots in each class have approximately equal speeds, torque, turning abilities and friction.

They will be calibrated by the following methods.

  • On a fresh battery, we will record the time taken from two points in the track across a laser timing rig. The ThunderBorgs we are using will have slightly altered PIC code, which allows us to set the maximum power level. This will be dropped down to the point where the top speed matches a pre-determined value. When the ThunderBorg is commanded to 100% over I2C, it will put the motors to this calibrated power level.
  • Drive on all 4 wheels will be set to 100%. The deviation from a straight line will be recorded over 10m. If the deviation is more than a pre-determined value, the robot will be mechanically altered to rectify.
  • The camera will take an image of a grid in front of it. If the image deviates by more than a pre-determined value, the camera position will be altered.
  • The batteries are kept as a matched set. They will be tested from time to time. If there is a deviation in batteries by more than a pre-determined value, it will be replaced with an equivalent performing battery.

The Raptor class robots will have a similar calibration procedure based on the hardware used.

Each MonsterBorg has a Raspberry Pi 3, a V2 Raspberry Pi Camera, a ThunderBorg with ThunderBorg Lid, 4x 300 rpm motors and four giant wheels, their house batteries will be 10x GP 2700 AAs.
For the MonsterBorg class the only data input allowed is that of the Raspberry Pi camera. However any data seen by the camera may be used in any way you see fit.

Each Raptor robot will have a PiBorg Raptor controller, Pozyx localised GPS/IMU, wide angle camera, wheel speed encoder and probably a Raspberry Pi 3. We will announce the exact specification of the robots closer to the start of the series.
For the Raptor class more sensor data is available to be used by competitors in any way they see fit:

  • Camera images from the wide angle camera
  • IMU feedback from the Pozyx board
  • Encoder feedback from the Raptor controller
  • Localised GPS from the Pozyx board

The robots will not have any WiFi / Bluetooth / internet connection. All code must come from the SD card.

Event formats


There will be a total of two testing rounds at the start of the season:
Each testing round will consist of:

  1. A single entry robot starting in the central lane
  2. Two minutes boot-up time before the lights
  3. Standard race lights sequence
  4. Lap timer as used in the elimination heats
  5. Two minutes of running time

You will be able to see how your designated robot reacts to the lights and how it runs around the track. You cannot submit code updates or values to tweak live. No results from the testing round are used in the competition. This is purely for your own testing and validation purposes. It is not required to participate in the testing rounds. To participate in a testing round you must submit new code before the rounds submission deadline on the Monday before.

Challenge heats

There will be a total of three head-to-head avoidance heats of 2x competitors. Allocated time: 3 minutes
The two competitors will be given random assignment to one of the lanes on either +1 (Blue | Red) or -1 (Green | Blue). 5 additional stationary MonsterBorgs will be placed around the track in strategic locations. These locations will be chosen by the stewards to cause the most mayhem forcing competitors to take advantage of well written avoidance code. After each heat these stationary robots will be placed back into the same positions for the next heat.

From the lights go, the two robots will try and achieve as many laps as they can in the time limit.
Points will be awarded as follows:

  • 2 points will be awarded for each full lap completed (forwards direction only).
  • 2 additional points will be awarded for the team that comes first (most laps).
  • At least one lap must be completed to score any points, only whole laps count.

For example if team 1 manages 6 laps and team 2 manages 4 laps then team 1 scores 14 points and team 2 scores 8 points. If both teams get the same number of laps the team who crossed the line first for the last lap comes first. There is no limit on the number of laps or points that may be awarded.

Race heats

There will be a total of three race Rounds. This will be head-to-head of 5x competitors. Each heat will run as a 10 minute race between five robots.
The five competitors will be given random assignment to one of the 5 lanes, on a transition between two colours e.g. (Red | Green)
If all five robots are deemed unable to move, the race is declared stopped. Positions are taken from the number of laps completed and the order in which they crossed the line.

The heats have a simplified point scoring system.
To be awarded points, 5 laps must have been completed within the allocated time. Points will be awarded as follows:
10 points for first place
8 points for second place
6 points for third place
4 points for fourth place
2 points for fifth place.

No points will be given to any robot which jumps the start.

Both the position and total laps completed will be recorded, and from this information, a leaderboard will be generated based on firstly the total amount of points, and then based on completed laps from all heats.

Here is an example of the leaderboard:

Leaderboard position Competitor number Points Laps
1 52 60 50
2 13 50 48
3 5 41 49
4 22 41 45
5 3 32 51
6 12 30 43
7 7 29 41
8 2 29 41
9 21 25 38
10 11 23 36
11 1 19 35
12 9 15 33
13 16 14 34
... ... ... ...

In the event of a mechanical failure in heats:

  1. The stewards may choose to ignore the mechanically failing competitors result and place the competitor into another heat (OR)
  2. The stewards may choose to award points based on the following criteria
    1. Higher points for better avoidance of crashes
    2. Higher points for better handling performance and recovery
    3. Points proportional to expected positions
    4. Points proportional to running position before the failure
    5. Performance in previous heats may be taken into consideration

Battery disconnects and other similar problems occurring after an impact with a wall or another robot will NOT be counted as mechanical failures.

Whether there was a mechanical failure or not is determined entirely by the stewards. Stewards' decisions are final.

To participate in a race round you must submit new code before the round's submission deadline on the Friday before. We will not run the previously submitted code from other rounds so make sure you submit your code before each race week!

Elimination rounds

There will not be an elimination round. Instead the top ten robots will race head to head in an A and B final to decide the final top 10 positions


There will be two finals, an A final to decide positions 1st to 5th and a B final to decide positions 6th to 10th. The top five competitors on the leaderboard will qualify for the A final and the next five will qualify for the B final. Any "house robot" scores will not count for this qualification.

The finals will both be a race of 10 minutes total. The competitor with the most laps completed without jumping the start will win their final. If two or more teams get the same number of laps they will be placed in the order in which they last crossed the line.

In the event of a mechanical failure in elimination rounds or finals, no compensation will be awarded.

The top three from the A final will receive a place on our wall of fame and some other prizes. It may be required to pay Taxes on prizes, please check with your tax authority.


Submitting code

Each competitor is required to submit new code by the code submission deadlines before every challenge / race. These deadlines can be found in the event dates page of the website.

Each competitor is given space on the FTP server which has a name which corresponds to their competitor number. It is required that code be on the FTP site, or a physical SD card be received by the code submission dates. If there is no uploaded code on the FTP by the submission deadline (prior Monday 09:00 GMT), you will forfeit that race.

The code you wish to be run should be uploaded as a standard .tar.gz file to formulapi.tar.gz at the top of your FTP access. Only this file will be downloaded and extracted to the robot. For custom SD cards this will be used to overwrite the previous /home/pi/formulapi directory, it may be an empty .tar.gz format file if no changes are required from the last run.

We have provided a convenience script ( which can perform both the compression and FTP uploading when provided with your competitor number and FTP password. For example if your team number is 99 and your assigned password is pass1234 you can upload your code using these commands:

cd ~/formulapi
./ 99 pass1234

Alternatively you can use these commands to create a suitable compressed file:

cd ~/formulapi
tar -czvf formulapi.tar.gz

This file should then be uploaded to our FTP server using the ftp command in binary mode or any FTP client which supports binary transfers. ASCII transfers are NOT suitable and will likely corrupt the file!

To run in a testing round you must submit new code to the FTP by the submission deadline the week before the round. This includes those running custom SD cards.

In all cases you new code submission may be identical to the previous submission, it just has to be submitted on the week before the relevant round by the submission deadline.

Code requirements

Before the race, the competitors zipped code from the /home/pi/formulapi directory will be copied from the FTP site on to a house SD card. (Alternatively, if you have supplied a physical SD card, it will be used). This will be entered into the Raspberry Pi.

The standard SD card image will start up and automatically run the /home/pi/formulapi/ script. This means that if you are using the FTP uploading option then a script named "" must be part of the included code. You may use other programming languages and use the script to run a non-python program if you prefer.

Formula Pi code must be well documented. Obscuring how the code works may be deemed not in the spirit of the competition, and may result in disqualification.

Please note if your software does not run on our standard SD card image, we must receive an SD card with your code by traditional mail before the code submission deadline. Updates to the /home/pi/formulapi directory must be submitted before each submission deadline as well, although the file may be empty (no changes).

Receiving log files

It is possible for us to place log files back in the FTP folder after a run. This might be useful if you want to check via diagnostics what your robot was trying to achieve. There are limits to the size of the log file.

If you are using your own logging code please ensure any log files are stored in /home/pi/formulapi/logs. Only files stored in this folder will be uploaded to the FTP site. The logs folder will be uploaded as a single zip file with the current date as the file name.

Power up sequence

The SD card with the competitor's code will be inserted into a random club robot. A randomly selected charged battery will be put into the robot. The Robot will be placed on to a random lane of the track which will not be known by the competitor until viewed during the race.

Switching on is done in the order the steward decides. Each robot is to boot and wait until it can see the transition from lights off to lights green. The stewards will wait approximately 2 minutes for the Pi to boot, before attempting to change light states.

MonsterBorgs are required to display their assigned colour using the on-board LEDs when they are ready for the lights to show which team is running. This will be saved as a RGB triple (such as 1, 1, 0) into /colour.txt. The standard code will do this by default.

The lights will go through this sequence to start the race: Off, Green, Red, Green. The race is declared GO on the second Green. If a robot does not go, the stewards may or may not toggle the lights in all configurations to try and get the robot moving.

The time duration between lights off to lights on, lights green to lights red, and lights red to lights green is random. If the robot moves past the start position before the final transition from Red to Green, the robot is declared to have jumped the start and will be awarded 0 points for that heat or final.

If the robot does not move based on the lights alone, it will not be aided and will become a blockage for other competitors. No points will be awarded if the robot does not complete at least one lap, even if other competitors also do not move.

Once the race is "GO", the lights are not of significance and may be in the Green, Red or Off state.


Why do I need to share my code for Formula Pi?

A main aim of the event is to better the understanding and design of autonomous vehicles. The winner's code is shared at the end of the race, so the competition improves each time it is run.

Can I send my own vehicle?

No. Each robot is calibrated and matched to other robots to make sure they compete equally. We might allow custom robots in future series.

Can I test my robot on the track?

No. We have a couple of testing rounds before the race rounds start which should provide a reasonable amount of test time for each team. Code can be tested prior to these using the simulator provided with the race code.

Why do the MonsterBorg entries need to show a colour?

We need this to see which entry is which when the robots run upside-down. The LEDs have the advantage of being visible from most camera angles, making identification of each entry clearer.

Anti Cheating rules

The series wants to promote ingenuity and alternative approaches to racing. However these must be in the spirit of competition. Any strategy deemed to be cheating from the view of the stewards may result in expulsion from the competition without any compensation or reward. Cheating could include inhibiting other vehicles driving through means other than normal racing and rubbing of the vehicle.

Examples of this type of cheating includes but is not limited to immediately trying to attack other vehicles and running around the track backwards intentionally. If in doubt, please email the stewards to check.

Some other examples:

  • Gently pushing an opponent into a wall is permitted.
  • Turning around and head on crashing into other vehicles is considered cheating
  • Intentionally stopping to restrict a vehicle behind is not viewed as the spirit of racing, and may result in disqualification. This will be up to the judgement of the stewards.
  • Using the ThunderBorg LEDs for something other than displaying the assigned colour for the race

The above rules are subject to change.