Search Unity

Question Joint issue when creating car suspension

Discussion in 'Physics' started by sandeepharrar, Jan 17, 2022.

  1. sandeepharrar

    sandeepharrar

    Joined:
    Nov 9, 2021
    Posts:
    2
    I am attempting to recreate the suspension of a car in Untiy using a number of joints. I have tried using the standard joints and configurable joints and have run into some issues.

    I've noticed whenever I'm defining a pin joint, the point at which the rigid bodies are rotating about have some spring like movement in that the axis is not completely fixed in place. This happens at all the pin joints, which is a lot given its car suspension. I have also notices that when I define a pin joint and set all the damping to zero there is something which dampens the movement, even when I want to to oscillate forever (I have also set the drag coefficients all to zero too).

    All of this has lead to some bizarre behaviour. When the car is suspended in the air, the wheels move and settle as they should, however as soon as it makes contact with the ground, the entire system begins to oscillate quite violently and shake about.

    If anyone has had any similar issues of has successfully modelled suspension in a different way, it would be great to know how.

    upload_2022-1-17_15-32-57.png
     
  2. unity_44234FBC39E5661FBF5B

    unity_44234FBC39E5661FBF5B

    Joined:
    May 11, 2021
    Posts:
    29
    Can we see a gif of what it looks like when you hit play?
     
  3. sandeepharrar

    sandeepharrar

    Joined:
    Nov 9, 2021
    Posts:
    2
    Thanks for your reply, I'll attach the gif to this reply!

    Each of the suspension arms has its own joint, and way that the springs are done is that there are 2 springs connected from the centre of the spring to the point where it attaches on the body. In this I drop the car from a small height and as you can see when it hits the ground it just begins to shake all over the place even thought the stiffness and damping is super high. Super weird.
     

    Attached Files:

    Last edited: Jan 19, 2022
  4. unity_44234FBC39E5661FBF5B

    unity_44234FBC39E5661FBF5B

    Joined:
    May 11, 2021
    Posts:
    29
    Is enable collision on?
     
  5. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    467
    Regular joints are not well suited for this kind of problem. I’m not sure if you actually modeled the suspension with the beams holding it as rigidbodies, but this will only work with a huge amount of iterations.

    If you absolutely must, you can model the suspension using ArticulationBodies which are guaranteed to be stable, but the go-to solution I’d recommend is a wheel collider for each wheel and animate the suspension using kinematic equations.

    In case you also planned to use rigidbodies as wheels, I strongly advise against that. The friction model is not well suited for car dynamics in my opinion