Autopilot for carrera slot car


Introduction

Yesterday I finished a very cool project with one of my fellow students (Roberto) at the HSR in Rapperswil. It was the module called ‘challenge project’ and was done by several groups.

What we did? We implemented an autopilot for a carrera slot car… The project was organized by Zühlke. (Many thanks to Wolfgang for the nice challenge!)

The project included a lot of topics which are in high demand these days. For example:

… just to name some of them ;-)

The challenge

What was the challenge? We wrote an autopilot for a carrera slot car. The data we had to accomplish that, was just one GYRO-Sensor on the car. And we only had the GYRO-Z-value to use. Yes… It was a challenge :-)

The pilot had to recognize the track automatically. (it had to work on any track) After he has a model of the track he must optimize the speed. In the end of the project we had a race with the other groups. Best algorithm wins…

The solution (simplification)

Simply explained, we splitted the algorithm in two phases. First we made the track recognition. With the GYRO-Sensor we recognized if we are driving LEFT, RIGHT or STRAIGHT. Based on that data, we generated patterns how the track possibly looks like. We try to prove these patterns and after a few rounds on the track, we know the correct pattern.

Second phase is the speedup phase… We just speeded up the STRAIGHT parts. (for the curves was no more time) We just give full power (255) in the beginning of a straight part, and then we brake down (nearly to zero power) at the end of the part. The target is to maximize the time until we have to brake down.

In the following object diagram you get an overview over the main actors (akka) we had in our system for a simple track:

actor-design

We also had to make a lot of data analytics. Here you can see an example how we visualized the GYRO-Data from the sensor and the round-times of the current race: actor-design

If you want to know more about the design of our project, everything we did is on our project site http://hsr-challp1-whitespace.github.io/.

Training video

In the following video you can see an example of one of our trainings, to get an idea:

As you can imagine, the project was a lot of fun ;-)

More to our project