Search Unity

Question Car suspension coilover with physX

Discussion in 'Physics' started by ghiboz, Jul 17, 2020.

  1. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    Hi all!
    I'm trying to do a car suspension using the physx joint.. the hinge stuff is ok, but I got an issue on a 'coliover' creation:
    I'm trying to use a ConfigurableJoint, limit the movement only to slide and set Spring and Damper force...
    but is not working properly..
    what are the measure unit for these settings? should be Nm for the spring and Ns/m, but I'm not able to mantain a 1300kg car with 4 coilovers...

    any ideas? thankyou!
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,512
    Yes, units are Nm and N/m/s, but configurable joints loose their rigidity when attaching bodies whose masses are of different orders of magnitude. For example, a joint attaching 1000 Kg with 20 Kg will be "springy" no matter the values used.
     
  3. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    thank you Edy!
    and is there a way to avoid the loose the rigidity?
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,512
    You may increase the physics calculation rate by configuring a lower fixed timestep. This is in Project Settings > Time > Fixed Timestep. Default rate is 50 Hz (0.02). I'd try with 250 Hz (0.004).
     
  5. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    thanks!
    but doesn't work: is strange, 'cause in my test I use a mass of 1200kg, supposing to have the cog exactly in the middle of the wheels, I got a Force on each wheel about 2950N:
    I suppose with the car in idle mode to have a compression of 75mm, that should be a Spring force like 39000 Nm
    If I put this setting, to have the suspension compressed about 75mm, I need to lower the damper value, but the car goes bouncing...
     
  6. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,512
    Are you using the WheelCollider component?
     
  7. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    no Edy, I'm creating my own raycast wheel system and I tried to start from the suspension system trying to use the physX hinges
     
  8. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,512
    Ok, let me know if you come up with some good solution. I'll possibly need to implement some serious suspension system in the future.