Predictive Controller in the Racing Car – a Driver Should Be Replaced

I am introducing you our university team – STUBA Green Team – that consists of students who every year design and construct an electric racing formula. Then we compete with the best teams from the world at Formula Student events. Formula Student is more like engineering competition than (moto)sport. Beside real racing in dynamics disciplines there are static events, where judges inspect the vehicle and award points for design, cost and business presentation. Nothing for slackers.


Many automotive companies have started to work on autonomous cars, why not student formula? And there it is, the new category for the driverless cars was created. The goal is to build the single-seater vehicles capable to drive without a driver. Sure, there is no utility in empty car moving around cones, but everything has to start somewhere.

Once, in traffic, drivers became redundant and will be replaced by computers. Perhaps. Let the smarter win. I placed my bet, I believe it is not hard to outperform humans (it is, but people are not very clever and reliable either, just join the traffic and see).


So, to build an autonomous car is not an easy task. Driver's eyes must be replaced by sensors, driver's hands and legs by actuators and driver's brain by computer. The vehicle is no more just the vehicle, but a robot. The computer in the car is the one who thinks (calculates), decides and gives commands. The boss – the controller. It happened that I have to design this controller. Of course there is much more what computer in the car does. It must generate the path from the map and give this information to the controller, the map is estimated from what deep neural network recognized and so on.

We decided to design a model predictive controller. To do that, we need to predict states. To predict states, we need a mathematical model that describes vehicle dynamics. Vehicle dynamics should approximate the real behaviour. We chose simpler but still complex single-track model, which consists of three (never-ending) differential equations.


Scheme of the single-track model


Block diagram of the system, there are 4 inputs and 3 states

Here we can control three states (velocity, angular velocity and side-slip angle) with four inputs to the system (front and rear forces and steering angles). Feed controller with the model, bound the inputs, set few parameters and job is done! No.

There must always be problems, the problems are there to be solved. And still, it is not enough. At the autonomous racing workshop, I heard from the member from another team an obvious but “have to be reminded” sentence:

If it works in simulation, it might work in reality. If it doesn't work in simulation, it will not work in reality for sure.

Visualisation of the path following

Here we are, with a MATLAB code capable to represent a vehicle that is chasing dots along the trajectory. Next job to be done is to connect this controller to other subsystems in formula, both hardware and software. Then participate in the summer competitions. Before this step it would be nice to somehow test and validate our system. Thanks to the best driverless team – AMZ from Zürich – there exists a simulator designed for the Formula Student driverless competitions.

The simulator is based on the Robot Operating System (ROS), same as software in our formula. Implement controller into this might be another problem, but not impossibility. How will everything turn out we'll see when we meet with the other teams on the race circuit. Our universal team mission, learn and improve everything what could be improved in the next season. Repeat.