Advertisement

Best way to simulate weight distribution between car wheels

Started by March 21, 2016 08:43 PM
23 comments, last by adriansnetlis 8 years, 9 months ago

I don't understand how can suspension force contain load.


When you compress a spring, it produces a force proportional to the compression distance. The more you compress a spring, more force will produce.
Force = springRate * compressionDistance
If you have a single spring and put an unknown mass over it, then the spring will get compressed some distance until reaching an equilibrium. In this point, the force produced by the spring counteracts exactly the force produced by the mass (unknown) under the influence of gravity (no matter it's earth's gravity or moon's) and any other possible acceleration the unknown mass might be suffering.

But as you know the spring rate and you can measure how much the spring has been compressed, you can get the actual force that is acting on the spring using the formula above. In a vehicle, the load on each wheel is calculated the same way, no matter the actual gravity value. In this case the suspension force is the same as load:
load = stiffness * compression + damper_rate * compression_speed
You don't need to account for the gravity, just the compression and compression speed for a suspension of known stiffness and damper rate. This article explains it in depth:

http://vehiclephysics.com/advanced/how-suspensions-work/


I don't understand how can suspension force contain load.

When you compress a spring, it produces a force proportional to the compression distance. The more you compress a spring, more force will produce.


Force = springRate * compressionDistance

If you have a single spring and put an unknown mass over it, then the spring will get compressed some distance until reaching an equilibrium. In this point, the force produced by the spring counteracts exactly the force produced by the mass (unknown) under the influence of gravity (no matter it's earth's gravity or moon's) and any other possible acceleration the unknown mass might be suffering.

But as you known the spring rate and you can measure how much the spring has been compressed, you can get the actual force that is acting on the spring using the formula above. In a vehicle, the load on each wheel is calculated the same way, no matter the actual gravity value. In this case the suspension force is the same as load:


load = stiffness * compression + damper_rate * compression_speed

You don't need to account for the gravity, just the compression and compression speed for a suspension of known stiffness and damper rate. This article explains it in depth:

http://vehiclephysics.com/advanced/how-suspensions-work/

Hm... But in my case the force, which compresses suspension and pushes it down, is the load. If I don't calculate it seperately, than the compression value will actually be wrong. It's almost 100% required to calculate it seperately.

When suspension is being compressed and decompressed, it's force actually differs from load. For example, when weight is being transfered to the right, suspension won't imediately reduce it's force on the left to the wheel's load, that's why the wheel will get pushed up until the `stiffness * compression` will be around the load of wheel.

Advertisement

In weight transfer, the best thing is that you don't need to calculate it at all, as Edy wrote :)

Simply just calculate the forces that act on the car:

- wheel, from your tire formula

- aero dynamics, from whatever formula :)

- gravity

- suspension (from previous iteration)

- etc

...and the wheel load will be "made" automaticaly.

As you apply the forces, the car's body will start pitching/turning. If you measure the distance from the suspension attachement point to the ground you get the compression/expansion amount of the springs, so you instantly know the force that pushes the wheels down and pushes the chasis up (don't forget to add this force to the car body)

However this is not the best method, but good for starting.

Later you'll want to calculate with the wheel's mass too and handle it as a separate rigid body, and use the tire's compression instead of the suspension's.

In weight transfer, the best thing is that you don't need to calculate it at all, as Edy wrote :)

Simply just calculate the forces that act on the car:

- wheel, from your tire formula

- aero dynamics, from whatever formula :)

- gravity

- suspension (from previous iteration)

- etc

...and the wheel load will be "made" automaticaly.

As you apply the forces, the car's body will start pitching/turning. If you measure the distance from the suspension attachement point to the ground you get the compression/expansion amount of the springs, so you instantly know the force that pushes the wheels down and pushes the chasis up (don't forget to add this force to the car body)

However this is not the best method, but good for starting.

Later you'll want to calculate with the wheel's mass too and handle it as a separate rigid body, and use the tire's compression instead of the suspension's.

Are you sure that bullet has the weight transfer?

Are you sure that bullet has the weight transfer?


sure, every physics lib that handles forces and torques has it :)

the weight transfer is a derived figure that you can calculate from the simulation, and not something that you have to do yourself. it's like the engine power (horsepowers)

Are you sure that bullet has the weight transfer?


sure, every physics lib that handles forces and torques has it :)

the weight transfer is a derived figure that you can calculate from the simulation, and not something that you have to do yourself. it's like the engine power (horsepowers)

Well yeah, the remaining thing is calculating load correctly. Calculating directly from suspension force is wrong when suspension is moving(meaning that either it's exceeding more force than load that way lifting up or that it's exceeding not as much force as load that way getting more compressed.

Advertisement

After a little test in older version of my vehicle physics, I faced with this problem:

[VIDEO]https:

[/VIDEO]

I have a question there in the end of video - why're the results so different?

What are you going to do once you've calculated the load on each wheel?

The posters above are saying that even if you never write a single line of code that calculates load-per-wheel or weight-transfer, a car simulation can still exhibit these behaviours.
Weight transfer is an emergent property of the simulation.

Let's say the car's centre of mass is towards the front, so at rest, the loaf will "shift to the front wheels" and the nose will angle down.
We don't have to write any code for these behaviours.
All we need is:
1) a rigid body system with adjustable centre-of-mass wnd total-mass properties.
2) a gravity force, which accelerates the body downwards.
3) the ability to ray-cast against the ground.
4) a spring model, which uses ray-casting to measure the distance to the ground, computes spring compression from that value, and applies a force to the body from that value.

To begin with, you spawn the car in the air, perfect flat, and gravity accelerates it downwards.
After some time, all 4 wheels touch, their springs compress, and 4 upward forces are applied.
If the wheels were all equidistant from the centre of mass, no torque would be generated as they'd be cancelled out -- however, the back wheels are further away from the centre of mass than the front ones, so when you call AddForceAtLocation/etc, the rigid body system generates four torque values which sum together to create a slight "pitch-forwards" torque value.
The result is that when the rigid body system applies all the forces/torques for this frame, the car rotates forwards as well as falling down, meaning the front wheels fall further than the back wheels.
In the short term, if you don't also have dampners, the front springs, being more compressed, will push harder than the back ones, causing the load to shift back again -- so the car will rock back and forth a few times... But in the long term, the springs will find equilibrium and come to rest such that the front of the car is lower than the back, due to this torque produced simply from the spring's locations relative to the centre of mass.

The same thing happens when cornering. Say the front wheel's contact patches are exerting a force that goes forward and slightly left (this force is in addition to the spring forces).
Because the contact patches are below the centre of mass, this slightly left force will automatically generate a torque that causes the car to roll clockwise/right (and a yaw-torque that spins the car left, as these left-forces are being generated in front of the centre of mass). Thus when making a hard left turn, weight will transfer to the right wheels.

So you don't have to code this. It magically arises out of rigid body physics by simply applying linear forces at the correct locations.

Well yeah, the remaining thing is calculating load correctly. Calculating directly from suspension force is wrong when suspension is moving(meaning that either it's exceeding more force than load that way lifting up or that it's exceeding not as much force as load that way getting more compressed.

No. You definitely need to reconsider your ideas. Calculating the load from the suspension force is entirely correct. In fact, they are exactly the same magnitude but opposite directions.

  • When the suspension is not moving then load = suspension force = stiffness * compression_distance.
  • When the suspension is moving and the suspension has no damper then the load = suspension force = stiffness * compression_distance.
  • When the suspension is moving and the suspension has damper then the load = suspension force = stiffness * compression_distance + damper * movement_speed.

The last point is the generic case: if suspension has no damper then damper = 0; if suspension is not moving then movement_speed = 0. In either case leaves load = suspension force = stiffness * compression_distance.

It's fair that you might not fully understand it, but please trust other people that actually do. Use this load calculation for now and move forward to the other aspects of the simulation. It will work correctly. Get back to this in the future if you think something is still wrong.

You might also check out these demos and videos. This simulation model calculates load as the suspension force:

http://vehiclephysics.com/about/demos/

The telemetry shows the instant load on each wheel. You can see how load is redistributed as for the weight transfer when he vehicles accelerate, brake or steer:

[attachment=31318:2016-03-31_133007_suspension_load.jpg] [attachment=31317:2016-01-26_195905_vpp_suspension_load.jpg]

In the first picture the car is accelerating, so there is more load (=weight) at the rear wheels. In the second picture the car is performing a strong turn to the right (1.7G), so most of the weight (=load) has been transferred to the left wheels.

I have a question there in the end of video - why're the results so different?

Why is that so different from the Marco Monster doc, you ask?

You shouldn't consider any document as a "bible" for vehicle physics. Each document typically analyses specific aspect from different points of view, considering different things and calculating different properties in different ways. Everything is correct when considered separately. But these won't likely give you a generic vehicle simulation model.

nVidia PhysX committed that same mistake. When designing the PhysX Vehicles SDK at PhysX 3 someone considered that the concept of "sprung mass" was the Holy Grail of vehicle simulation. They designed and built the simulation around that concept. The result is a terrible vehicle simulation causing lots of troubles unless you find a specific combination of settings. Part of my code consists exclusively on neutralizing that sprung mass implementation so the suspension can work in the physically correct way, as described in my previous post.

The best recommendation I can give is to adhere to essential physics concepts as much as possible (rigid bodies, forces, torques, etc). Use the documents for learning, but build the vehicle simulation out of correct physic principles.

This topic is closed to new replies.

Advertisement