Vehicle Dynamics
I am taking a class this semester on Vehicle Dynamics, which as it turns out, is mostly a class on simulating complicated things (cars) doing complicated things (driving). I kind of like that, and have for the whole semester so far been developing a single MATLAB object to handle all of the things we learn as we learn them. At first it wasn’t too interesting, just a class that would simulate cars rolling down hills or steady state turning.
At this point the class is getting fairly extensive. Most of the math is questionable, but it seems to be right-ish. For all of my simulations I am using a 2003 Infiniti G35, which is the car that we take to the track for labs. So far, I can simulate driving with the inputs being braking force, engine torque and steer angle. I would like to expand it to accept more inputs such as brake pedal pressure, steering wheel angle, and driver controls like that. For terrain I can use a generalized local gradient, which is mostly helpful in cases with no turning or on flat simulations, or the much more interesting terrain map. Here a N by M matrix of elevation values is inputted and interpreted as a surface on which the car can drive. This makes for some interesting possibilities and I would like to get some kind of mapping integrated so real terrains can be pulled in.
Here are some pictures:


Basically it is the G35, starting from a standstill on a hill, accelerating as fast as it can up and over, hitting the brakes really really hard, turning around, and going fast up the hill again. In the velocity plot you can see the acceleration and braking regimes pretty clearly. In the engine speed plot the up and down shifting points are pretty clear as well. On the acceleration plot the drops you see are from a 1/10th of a second shift delay. There are some unrealistic assumptions involved there (no tire slip, infinite tire grip, capable of applying max torque at all engine speeds, ect.), but it is a step in the right direction.
All of the code is updated with some kind of regularity here:
Stay in the loop
Get notified when I publish new posts. No spam, unsubscribe anytime.