## Differential constraints in car dynamics. How the ESP car system works?

Todays’ cars are stuffed with electronics. There are many people wishing themselves a car with more mechanics and less electronics. But in my opinion that’s not the way to innovation. Implementing electronic systems is a wide and proven way to sustain our civilisation’s products growth not only in automotive industry. I dare say that we don’t know any better technology than this one to do progressive work and achieve further goals in steering and measurements. Non programmable electronics is cul-de-sack and mechanics without programmable electronics is a 20th century wreck.

ESP stands for electronic stability control and origins from Mitsubishi, 1990 and shortly later  (1992) Mercedes and Bosch. Click here to get more information. After deploying the system achieved a market warm welcome and there have been published many innovations in this kind of systems so far.

This post is going to explain how mathematical differential constraints can be used in programming an ESP system that is widely used in cars. You can watch all the movies below to get acquainted with car dynamics while ESP is running and what it does with a vehicle.

The analysis of videos shows that the car has two devices: the gyroscope and the accelerometer. The gyroscope measures the angle and accelerometer  – acceleration. When you pause the car motion in the situations from above,  you could clearly see that the car is moving partially tangentially to a circle and partially in straight line. This is very important remark that allow us to go on further. The gyroscope allows to find a  system a car’s vector which will be helpful in describing the motion along circle. Using accelerometer you can almost find yourself on your way. This means that you can partially find the way you’re going on. Note that the car without GPS system isn’t observable system and doesn’t know its position. Those two devices provides data that are indispensable for further considerations: the car’s vector while it’s moving along circle (perpendicular speed), and the velocity while it’s moving along a line (tangential speed after some processing).

## Car dynamics

Let the car move along a straight line. The perpendicular speed, that is a result of curved circle-like motion is equal to 0. The tangential speed is equal to the value the accelerometer shows you and what you see inside a car while driving.

Let the car move along a curve, for instance while turning. You could recognize that curve as it would be part a of a the circle. So in fact, in a given time t, the car’s motion would have two speeds: the tangential and the perpendicular that is the result of rotary circle-based motion. See the photo below to get more understanding.

Motion of car in presence of obstacle

In the picture above the car begins turning to pass round the obstacle on his way. Firstly it moves tangentially to circle with R radius and secondly tangentially to circle with $R_{2}$ radius. I hope this image helped you to understand what circles I’m writing about. If not, write me an comment below the post or just email and I’ll try to explain.

## What actually happens geometrically if your car gets into slide?

Suppose you’re moving a little bit to fast and performed a rapid turn. Now your car changes the trajectory to a different curve and as a result you’re traveling tangentially to different circle. If the turn’s force was sufficiently big, the trajectory is changing all over the time. The car is moving on different circle at two subsequent time frames.  This results that at a given time t, the car is moving tangentially to circle t, but the force changes the circle’s tangent vector and therefore the car is going on a new one circle (note, that the circle can only have one tangent vector, at specified (x,y) position). So if you want to travel without slides you have to provide appropriate circle tangent vector. That’s what gyroscope is used for: to get information on which circle the car is moving and what’s the change of perpendicular velocity and the tangential velocity vector.

In an ideal environment (without physics) the tangent vectors should solve the problem. But there is centrifugal force $F=\frac{mv^2}{r}$, tangential speed and the real-world problem gets complicated. The physics impose constraints either on radius or tangential speed. So in case of slide the ESP system has three options:

1. to lessen the circle’s radius and maintain current speed
2. slow down car and maintain radius
3. somehow combine those two above two options

From the accelerometer you get information about current vehicle’s speed. The car on the move has a nonzero velocity, so changing the velocity is possible, but limited. The radius is a driver adjustable variable. Driver by rotating steering wheel changes the radius of circle the vehicle moves on. The systems should adjust to radius and provide smooth vehicle motion without slide. The gyroscope gives you information about the circle tangential vector. So all in one you get all of the information you need to start implementing your own ESP system: you got the car dynamics, the car’s motion equation (curves are part of circles), you get full understanding of basic car’s motion physics. In order to get it working on real-life car you have to provide the wheel blocking system so that you can manipulate with car’s position and tangential velocity vector. This is clearly shown at the videos above.

## How to combine tangential speed, tangential speed vector and the move along circle?

It’s easy. Suppose you know the circle’s tangential vector at given time t and give it the name of $p_{t}$. Now the set of $p_{t}$ points is the way your car should go on. So lets see that the $v(t) = \frac{\mathrm{d} x}{\mathrm{d}t}$ While the car is moving you get only the velocity (accelerometer), and tangential velocity vector(gyroscope). That’s what you’re using it for: to modify velocity vector so that the differential constrained can be fulfilled. How they should look like you already know because you got the information about car’s position and car’s velocities and computed the right vectors.  The last task that was left is imposing a differential constraint on a speed vector (wheel arrangement). The car’s instability problem while moving along circles has been solved. That’s clever and relatively easy, isn’t it?