• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
03-15-2012, 11:58 AM, ghiboz Junior Member  Posts: 44 Threads: 14 Joined: Jun 2008
hi all!
I have this question:
I made a car that the weight is almost 50% front and 50% rear:
the debug tell me that the Total mass: 1573 (kg?)

after debugging, the force in ApplyForces is almost 1573*9.81=15431 down (N?) and is right...
after I suppose that, when the car is stopped, in a steady state, the sum of the load for each wheel must give 15431 in the opposite direction of the force, but is only about 9800....

is right or not this??
thanks
03-16-2012, 04:24 AM, NaN Posting Freak     Posts: 2,024 Threads: 120 Joined: Jan 2010

Need more info. How did you figure out that you have 50% weight distribution? Entering specific values relative to the wheel positions median?

The most simple one is to look at the tire load obviously. You can also check if wheel position median is equal to center of mass offset.

Can you post you car setup?

Edit: median in xy-plane
03-16-2012, 06:29 AM, ghiboz Junior Member  Posts: 44 Threads: 14 Joined: Jun 2008

thanks, here is my config:
Code:
```[engine] position = 0.0, 1.42, -0.4 mass = 180.0 max-power = 248318 peak-engine-rpm = 6750.0 rpm-limit = 7000.0 inertia = 0.25 idle = 0.02 start-rpm = 1000 stall-rpm = 400 fuel-consumption = 1e-9 torque-friction = 0.0003 torque-curve-00 = 1000, 166.26 torque-curve-01 = 2000, 175.75 torque-curve-02 = 2250, 190.66 torque-curve-03 = 2500, 192.02 torque-curve-04 = 2750, 187.95 torque-curve-05 = 3000, 196.08 torque-curve-06 = 3250, 201.51 torque-curve-07 = 3500, 208.29 torque-curve-08 = 3750, 213.71 torque-curve-09 = 4000, 220.49 torque-curve-10 = 4250, 219.13 torque-curve-11 = 4500, 215.07 torque-curve-12 = 4750, 225.91 torque-curve-13 = 5000, 238.11 torque-curve-14 = 5250, 224.56 torque-curve-15 = 5500, 223.2 torque-curve-16 = 5750, 219.13 torque-curve-17 = 6000, 216.42 torque-curve-18 = 6250, 212.35 torque-curve-19 = 6500, 196.08 torque-curve-20 = 6750, 187.95 torque-curve-21 = 7000, 186.59 [clutch] sliding = 0.27 radius = 0.15 area = 0.75 max-pressure = 40000.0 [transmission] gears = 5 gear-ratio-r = -4.23 gear-ratio-1 = 3.72 gear-ratio-2 = 2.40 gear-ratio-3 = 1.77 gear-ratio-4 = 1.26 gear-ratio-5 = 1.00 shift-time = 0.07 [differential-rear] final-drive = 3.9 anti-slip = 600.0 [fuel-tank] position = 0.0, -0.26, -0.56 capacity = 70.0 volume = 70.0 fuel-density = 0.8 [camera] view-position = -0.35, -0.25, 0.42 hood-mounted-view-position = 0.0, 1.0, 0.45 [wing-front] position = 0.0, 0.0, 0.2 frontal-area = 2.0 drag-coefficient = 0.3 [wing-center] position = 0.0, 1.9, 0.60 frontal-area = 0.2 drag-coefficient = 0.0 surface-area = 0.3 lift-coefficient = -0.5 lift-efficiency = 0.95 [wing-rear] position = 0.0, -2.14, 0.37 frontal-area = 0.05 drag-coefficient = 0.0 surface-area = 0.5 lift-coefficient = -2 lift-efficiency = 0.95 [wheel.fl.coilover] spring-constant = 50000 bounce = 2500 rebound = 7600 travel = 0.15 anti-roll = 6000 [wheel.fr.coilover] spring-constant = 50000 bounce = 2500 rebound = 7600 travel = 0.15 anti-roll = 6000 [wheel.rl.coilover] spring-constant = 40000 bounce = 2250 rebound = 6800 travel = 0.15 anti-roll = 4000 [wheel.rr.coilover] spring-constant = 40000 bounce = 2250 rebound = 6800 travel = 0.15 anti-roll = 4000 [wheel.fl.brake] texture = rotor_worn.png friction = 0.83 max-pressure = 2.8e6 bias = 0.7 radius = 0.1135 area = 0.015 [wheel.fr.brake] texture = rotor_worn.png friction = 0.83 max-pressure = 2.8e6 bias = 0.7 radius = 0.1135 area = 0.015 [wheel.rl.brake] texture = rotor_worn.png friction = 0.83 max-pressure = 3.5e6 bias = 0.3 radius = 0.1135 area = 0.015 handbrake = 1.5 [wheel.rr.brake] texture = rotor_worn.png friction = 0.83 max-pressure = 3.5e6 bias = 0.3 radius = 0.1135 area = 0.015 handbrake = 1.5 [wheel.fl.tire] size = 195, 50, 15 type = &tire/touring [wheel.fr.tire] size = 195, 50, 15 type = &tire/touring [wheel.rl.tire] size = 195, 50, 15 type = &tire/touring [wheel.rr.tire] size = 195, 50, 15 type = &tire/touring [wheel.fl.hinge] wheel = -0.71, 1.34, -0.49 chassis = 0.66, 1.34, -0.16 [wheel.fr.hinge] wheel = 0.71, 1.34, -0.49 chassis = -0.66, 1.34, -0.16 [wheel.rl.hinge] wheel = -0.71, -1.21, -0.49 chassis = 0.66, -1.21, -0.16 [wheel.rr.hinge] wheel = 0.71, -1.21, -0.49 chassis = -0.66, -1.21, -0.16 [wheel.fl] position = -0.71, 1.34, -0.49 camber = -1.33 caster = 6.12 toe = 0.5 ackermann = 8.86    # 50% ackermann steering = 45 [wheel.fr] position = 0.71, 1.34, -0.49 camber = 1.33 caster = 6.12 toe = -0.5 ackermann = -8.86 steering = 45 [wheel.rl] position = -0.71, -1.21, -0.49 camber = -0.45 caster = 0.28 toe = 0.0 [wheel.rr] position = 0.71, -1.21, -0.49 camber = 0.45 caster = 0.28 toe = 0.0 [steering] position = -0.37, 0.44, 0.09 rotation = 87.5, 0.0, 0.0 max-angle = 320 [driver] position = 0.0, 0.023, 0.4 mass = 80.0 # these are used to calculate the weight distribution and balance [particle-00] mass = 160.0 position = 0.6, 1.34,-0.4 [particle-01] mass = 160.0 position = -0.6, 1.34, -0.4 [particle-02] mass = 250.0 position = 0.6, -1.2, -0.4 [particle-03] mass = 250.0 position = -0.6, -1.2, -0.4```

a question, after some navigation into code I noticed that the force of the spring depends by the displacement, but the displacement, how is calculed depending by the mass?
03-17-2012, 07:04 AM, NaN Posting Freak     Posts: 2,024 Threads: 120 Joined: Jan 2010

The config is not compatible with VDrift master. For what car is it? How did you determine that mass distribution is 50%, by hand?

I did the following test. Take XS.car. Set engine and driver mass to zero. Use 4 mass points at wheel positions 250kg each. I get 2620-2640 Newton load at each wheel, 50% mass distribution. It is also confirmed by mass center offset y of -0.06 = (1.14 - 1.26) / 2 equal to wheel median along y axis.

The suspension force arises from the car falling down at each simulation step. This compresses suspension, increases suspension force. The whole thing is stabilized by damping, else it would oscillate indefinitely.
03-19-2012, 04:19 AM, ghiboz Junior Member  Posts: 44 Threads: 14 Joined: Jun 2008

thanks!
i've solved the problem, or better, found the cause:
Code:
```//original VDrift code in game.cpp: ... timestep(1/90.0), ... //game.h float TickPeriod() const {return timestep;} // my code modified in game.cpp: ... timestep(1/160.0), ... //game.h float TickPeriod() const {return 1/90.0;}```

i've putted all to /160 and is ok... but why this thing? ok, is not a right thing change the 2 frequencies, but I don't know why only the load is change...

thanks again 03-19-2012, 11:42 AM, NaN Posting Freak     Posts: 2,024 Threads: 120 Joined: Jan 2010

This looks like a bug. But then considering the complexity of the GAME class...

We really need to refactor it into something more digestible, move functionality into separate modules, classes.
03-19-2012, 02:10 PM, NaN Posting Freak     Posts: 2,024 Threads: 120 Joined: Jan 2010

Duh, should have read your post more carefully. The problem you observed is most probably due to the fact that the GAME has a separate fixed time step logic. Whereas the physics engine has got its own. In your case the physics engine would be getting timesteps shorter than its fixed timestep, would drop simulation frames. It is interesting that it worked at all. Ideally one would feed the game logic as prestep, poststep callbacks to the physics sim, use one fixed step implementation.

Forum Jump:

Users browsing this thread: 1 Guest(s) 