Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Vehicle dynamics programming

  1. Jun 5, 2008 #1
    Centripetal force, enertia, friction, velocity, and mass; these are the forces I've collected that I need to manipulate to simulate vehicle dynamics. I'm playing around in Adobe Flash working on a vehicle rig for a simple game for self education's sake.

    Now I don't know anything about physics. I've got a good imagination and that's about it, so I'd love some help with this.

    Firstly, I understand that cetrifugal force does not exist (a fictional-force). A person turning sharply in a car may feel pulled to the outside of the curve, but it's an illusion. The car's mass/enertia is trying to go straight while the friction of the 'tangetal' tires are 'generating a cetripetal force' great enough to overcome the car's 'momentum'.
    Do I have that right? (?1)

    All that's easy and can be simulated without aby serious math: go, stop, turn. But when the centripetal force isn't enough to overcome the enertia, very complicated, interesting, and fun things begin to happen. Either the front, or rear axel-set (simplified from individual tires) looses large amounts of traction (friction) and the car spins and/or slides. The behavior of the spin/slide is dictated by the 'momentum', velocity, and varying amounts of 'friction' and vectors at the front and rear ends.

    I've started this project with simplicity in mind. Build a car out of 2 pieces, front and rear axel sets. Each part carries half of the vehicles mass. The rear aims for the front, while the front can be steered in a tangent from the rear's direction and travels independantly in that direction. Measure the centrifugal force pulling the front and rear to the outside of the turn. If the pulling force is greater than the pre-assigned traction value, the component begins travelling in biased majorly in a straight line(?). If the front is subject, then the rig under-steers (slides straight), if the rear is subect then the car over-steers (spins out). Simple enough...

    To measure the centrifugal force, I have two ideas. One is to apply a formula; F=mV2/r (mass*velocity squared/radius), but I don't quite udnerstand it. The other is to simulate two instances of the axel sets, one turning and one going straight. Measure the distance between the trurning axel and the continuing axel and use that as a measure for the amount of force pulling the axel out of the turn. When the distance is large enough, traction is lost and the axel travels in a straight line. (?2)

    So far I don't know what happens next. When the rear spins out, it should pull the front end, adding to the amount of force that the front-axel centripital force has to overcome, but it isn't adding to the enertia. I don't know what that force is? And if that isn't terribly important, the front will HAVE TO pull on the rear. When a car 'drifts' (big, fast donut) the rear is sliding but it isn't going in a straight line because it's teathered to the front axel which is still turning. I'm not sure yet how to teather it. (?3 and ?4)

    About F=mV2/r. I tried this formula where m=100,V=10, and r = 2 and the resulting F equaled 5000. 5000 what? What units are being used here? V in mph? r in feet? I don't even know what unit mass uses, pounds? And 'F' I assume is for Force, newtons?(?5) I also don't know how to find the radius of a fluctuating arc. How do you calculate the radius of any given section of any given curve in a country road?(?6)

    I'm beginning to think that simple just isn't going to cut it. Complicated means assigning a mass to the axel sets, calculating their momentum at every frame, calculating the friction of the tires (grip? What unit does friction use? Is it per square inch?), calculating the centripetal force generated and finally comparing it to the centrital force required. Possible, and maybe not so complex. What's your opinion?(?7)

    So that's a huge post, with too many questions, so a recap:
    1: Do I understand the concepts of fictional forces, friction, tangents, etc?
    2:Any opinions about comparing a 'veering' mass to a 'straight line' mass to find a rough centifugal value?
    3:How do the laws of physics explain how things are attached to eachother? Is it measured or calculated? It seems like a product of molecular friction to me. Does it change?
    4:What force pulls the rear wheels into an arc? It's teathered to the front axel, but how is that explained with math?
    5:What units are used in F=mV2/r? Is this the correct equation to use?
    6:How do you claculate a fluctuating arc's radius? Do arcs have radii?
    7:If your familiar with coding and programming efficiency, do you have a preference between simulating the physics or aproximating them with shortcuts?

    Any help with any questions will be welcome, thanks in advance.
  2. jcsd
  3. Jun 5, 2008 #2
    I can only offer some ideas for the easy bits of your post:smile:

    Yes. Centrifugal forces are an artifact of observers in non-inertial (accelerating) frames. Personally, I find it easier to work with centripetal (centre seeking) forces in inertial frames (I think there's less scope for confusion). If you think about watching the car from the ground outside (an inertial frame), you would see the passenger maintaining his straight line path until the door of the car meets him and provides the *centripetal* force required to take up the circular motion (unless of course the friction from the seat was sufficient to provide this force directly).

    The formula is correct. It gives the magnitude of the centripetal force. It's direction is towards the centre of the arc (of radius 'r') being traversed. But be clear as to what mass you are applying it to. For example, treating the whole car/passenger as a single particle, 'm' would be the total mass located at the centre of mass of the system and 'v' its linear speed.

    If you use SI units ('m' in kg, 'v' in m/s, 'r' in m) then F will be in Newtons.

    The rest of your questions are beyond my knowledge. Interesting project though. Good luck with it:smile:
  4. Jun 5, 2008 #3


    User Avatar
    Homework Helper

    Ignoring slip angle, the path of the car will be determined by the relative angle of the axis of the front and rear tires, and the distance between front and rear axles, until near the limits of traction. Side forces would be related to V2 / R plus any aerodynamic side forces from wind, and any side forces from gravity if on an angled road.

    Because the contact patch of the tires deform under horizontal loads, the actual turn radius is larger than the calculated radius based on axis angles and distance between axis. There is a slip angle at each tire, the tires points inwards of the direction it actually travels, and this angle increases with respect to the side load. If the steering angle is too much for the speed, the side force decreases even though the slip angle increases (driver induced understeer). If the rear tires lose traction more than the front tires, then the rear end steps out (oversteer).
    Last edited: Jun 5, 2008
  5. Jun 6, 2008 #4

    Thanks for all the comments. Will reply properly after I've had time to think about them.

    Immedidately though, how do you calculate/predict slip angle, or is it merely an observed byproduct? I'm guessing that slip angle is the difference between the angle of the object/vehicle/tire and the angle of travel (forgive my lack of correct terminology)? Is it accurate to describe a car sliding backwards as having a slip angle of 180 deg(assuming you want to be travelling forwards)?

    Thanks again, Tui.
  6. Jun 9, 2008 #5
    Real cars are awesome...

    When I lived in the States, I drove an AE86 Corolla. On the track it did all the physics for me...

    In the programming environment, I'm going to have to give up some aspects of sliding a car. Tire patch sizes and slip angles are out the window, there's just not enough gain for the amouont of proccessing required. I'm building an illusion, not a simulation, I'm realizing that.

    For the time being, I'm also thowing out understeer; it's just not fun, and it isn't needed for an arcade environment.

    Throttle induced oversteer is fun, and key, but it may also be over my head and will have to be tackled after I get over the basics of head-over-heels driving. For now, I will merely try to get the rear end of the car to swing out and around the front. My current project goal is to spin-out.

    I've implemented the duplicate axel technique; one 'imaginary' axel goes in a straight line, while the 'real' axel follows the path dictated by the steering front wheels. Measuring the distance between the two gives a reliable and quantifiable measure of centrifugal force, while an ArchTangent expression returns the direction/vector of the pull(basically, another object sits on the 'real' axel and points to the 'imaginary' one). It's not perfect, and it returns data in pixels rather than newtons, but it gives me some raw material to give the axel an aproximate 'slip-angle'.

    Here's what I've learned: Real cars are bolted together and mathematical ones aren't. While I think my rear-end sliding math is on the right track, I can't actually see it because I have to keep the car in one peice, and that math is getting in the way. My problem is not calculating the path the rear wheels want to slide in, it's keeping them attached to the front wheels and vice versa. If the rear wheels were allowed to slide in a straight line after loosing traction, they'd tear the car in half.

    An oversteering car is an immensly complicated proccess, I guess any body of mass travelling through space is... A coasting race car with super grippy front tires suddenly thrown into a corner will throw the rear out due to centrifugal force. But a muscle car burning out at a stop-light slips it's end to the side without any turning at all. The rear tires, while not grabbing the pavement and launching the car still have some give and try to push themselves toward the front axel. The front axel stays still (brakes on or enertia) and the rear axel is deflected, like a floating rubber-ducky. Chances are that due to imperfections in the road (even on a level surface), it won't be deflected directly backwards, but rather off to one side or the other. It's the real-world nuts and bolts of the frame that deflect the rear wheels, and I don't know how to duplicate that effect with math.

    Sliding cars are subject to both forces. When at any speed, the rear axel is going to want to continue in a straightline, centrifugal force, and will also be pulled/pushed on by the modest grip offered by the sliding tires. If the engine is pushing them toward the front axel, they deflect outward, if the brakes are pulling them away, they are deflected inward(although usually not enough to compensate for the cetrifugal forces).

    Doing a donut is a matter of frame deflection, while spinning out on the freeway is usually a matter of centrifugal force.

    Sometimes forums act as intelectual therapy. What principles are involved with frame deflection?

    Sorry for the wordy post,
    Thanks again.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Vehicle dynamics programming
  1. Accelerating vehicles (Replies: 8)

  2. Weight of a vehicle (Replies: 15)