Researchers program an autonomous vehicle to drift around obstacles using Nonlinear Model Predictive Control (NMPC)

author avatar

19 Jul, 2022

image: Toyota Research Institute

image: Toyota Research Institute

Advances in software allow a customized car to perform controlled, autonomous drifting to enhance active safety and to give drivers the skills of professional racers.

This article was discussed in our Next Byte podcast

The full article will continue below.

Toyota Research Institute (TRI) has successfully programmed a vehicle to autonomously drift around obstacles on a closed track. The video of the demonstration marks a new research milestone in autonomous vehicle technology.

A year ago, TRI and the Dynamic Design Lab at Stanford University set out to design a new level of active automotive safety to massively increase the safety of vehicles. Using Nonlinear Model Predictive Control (NMPC), the software can augment the skills of a regular driver enabling the car to autonomously respond to dangerous and extreme situations.

Drifting towards safer vehicles

Cornering while moving noticeably sideways is referred to as “drifting”. In this state, the rear tires are saturated and have a high longitudinal slip, causing the characteristic high amounts of tire smoke. In professional motorsport, controlled drifting is used to accelerate through corners. This is especially present in rally and dirt track races, where the friction coefficient between the tires is low or varies a lot, such as on snow or gravel surfaces. Professional drivers use drifting to maximize control when cornering.

Drifting can also occur under normal driving conditions when the friction between the tires and the ground is low or changes suddenly, such as in slippery conditions or if a driver over or understeers to avoid an obstacle or navigate a sharp turn. In these instances, as most drivers don’t have the skills to manage a controlled drift, the car will slide out of control and potentially crash.

According to the WHO, road traffic crashes represent the eighth leading cause of death globally. They claim more than 1.35 million lives each year and cause up to 50 million injuries. While most crashes occur in mundane situations, in some extreme situations, drivers may need to make maneuvers that take their vehicle close to and, at times, beyond normal limits of handling.

If a vehicle can control drifting, it will provide a greater range of possibilities to handle the car in emergencies. During a drift, the equilibrium sideslip angle in the drift is insensitive to the longitudinal velocity and friction variations. Thus, drifting around a corner can be a safer, easier, and more predictable way of cornering under unpredictable surface conditions[1]

With the support of automotive performance specialist GReddy and drift legend Ken Gushi, TRI was able to train a model that mimics the expertise of a professional driver and utilizes the advantages of drifting in extreme conditions to improve overall vehicle safety.

“At TRI, our goal is to use advanced technologies that augment and amplify humans, not replace them,” said Avinash Balachandran, Senior Manager of TRI’s Human Centric Driving Research. “Through this project, we are expanding the region in which a car is controllable, intending to give regular drivers the instinctual reflexes of a professional race car driver to be able to handle the most challenging emergencies and keep people safer on the road.”

Nonlinear Model Predictive Control (NMPC): The software behind the safety

Nonlinear Model Predictive Control is a powerful optimization strategy for feedback control. It is used to predict the future states of a system based on a predefined horizon. If the system has some output states with some desired output and a set of input variables, the model will repeat the three steps as follows:

  1. Consider the current output state. (Initialize the output state randomly in the beginning).
  2. Run forecasts on the possible input states for a certain period called the horizon. The input states are optimized and predicted over the horizon to make the current output closer to the desired output.
  3. The first calculated input is applied to the system.

This is essentially calculating the future path over every step and utilizing the next step of the optimized path to the model. This feedback mechanism after optimization at every step makes this model robust to modeling errors. 

Figure 1: The flowchart of a generalized NMPC system.

One of the most important features of NMPC is that constraints can be added on both input and output states. This prevents the system from asking for unrealistic inputs. For example, if a cruise controller commands the system to accelerate at 1000 miles per hour for a small fraction of a second and arrives at a sudden halt to prevent an accident, it can result in impossible scenarios and the system fails. With NMPC, the input and states can be bounded by constraints. These constraints are considered directly and the model will not allow any input and state combination to violate them. By considering the constraints directly, NMPC has a high potential for increased performance compared to other control methods.

Optimization is the heart of the NMPC. As the optimized inputs are calculated over a horizon at each step, the model can quickly adapt to the changes in the environment and is very flexible. However, due to this need to optimize the input over the horizon at each step which includes complex non-linear cost functions, the process is computationally intensive. Hence NMPC applications in the past have been mostly used in the Manufacturing and Chemical industries with comparatively slow sampling rates. With advancements in controller hardware and computational algorithms, NMPC has increasing applications in multiple industries such as automotive and aerospace.

TRI’s autonomous drifting experiment

TRI’s drifting demonstration uses Nonlinear Model Predictive Control (NMPC) as the base technology. Combining the vehicle dynamics and control design insights from drifting-specific approaches with the generalized framework of NMPC yields a control scheme that extends the vehicle’s operational domain beyond the point of tire saturation. This allows the vehicle to drive beyond the notions of traditional stability to where the vehicle is skidding but still controllable due to superior driving control. This model can smoothly transition from dynamic, non-equilibrium drifting to grip driving while accounting for multiple objectives, including road bounds. 

The TRI customized Supra demonstrating its autonomous drifting capabilities. Image: Toyota Research Institute

This approach was tested on a Toyota Supra that has been specially customized for autonomous driving research. It is equipped with computer-controlled steering, throttle, clutch displacement, sequential transmission, and individual wheel braking. Vehicle state information is obtained from a dual-antenna Oxford Technical Systems RT4003 RTK-GNSS-aided INS system at a rate of 250Hz, and the NMPC controller runs on an x86 computer.

With the help of advanced computing, The NMPC system optimizes every 20th of a second considering numerous objective functions such as yaw rate, lateral forces, steering angles, tire-slip angles, velocity,  and friction circle. The resulting model can drive through difficult and extreme roads automatically similar to a professional driver. 

TRI researchers on the track. Image: Toyota Research Institute

The path to autonomy

The successful project demonstration marks a significant milestone in increasing vehicle safety through augmenting driver skills with autonomous intervention. “When faced with wet or slippery roads, professional drivers may choose to ‘drift’ the car through a turn, but most of us are not professional drivers,” said Jonathan Goh, TRI Research Scientist. “That’s why TRI is programming vehicles that can identify obstacles and autonomously drift around obstacles on a closed track.”

TRI and other leading research groups will continue to develop more effective ways for emerging safety technologies to amplify human capabilities on the road. Each step significantly increases the safety of driver-controlled vehicles while improving the potential capability of autonomous vehicles. 

This article was significantly contributed to by Sreekiran A R.


  1. Kück, Corvin. “MPC Design For Autonomous Drifting CORVIN.” (2017).