Jump to content
mois23

How create a constraint network for simulating Car Suspensions?

Recommended Posts

Hi Guys,

I'm trying to create a constraint network for simulating Car Suspensions, but with no results. I just need a simple "spring effect" between Body and Wheels (please find a video example attached). How I can do it?

Any suggestion will be really appreciated. Thank you! :)

I've attached a simple file test I'm working on.

Car Example.mp4

Cartest.hip

Edited by mois23
I added an Hip file.

Share this post


Link to post
Share on other sites

I tried with this solution (please find hip file attached) but spring constraint doesn't work. Can't figure out why. :(

Here the .abc file I'm using. Anyone can help?

 

Car Destruction v04.hip

Edited by mois23
added hip file

Share this post


Link to post
Share on other sites

Hello Mattia,

use combination of constraints. Pay attention to constraint attributes condir and condof. In attachment simple example. I hope it helps you.

Cartest_01.hipnc

  • Like 1

Share this post


Link to post
Share on other sites

@vicvvsh - very nice and elegant!

Here's a different approach using a simple double wishbone setup using cone twist constraints (primarily). No idea how accurate or robust it is but it seems to be a starting point for some fun:

rbd.gif.273d690b9421492757a3919e8b5fbcf3.gif

Inspired by this:

https://www.youtube.com/watch?v=GW__Gzkk4G0

(4.53 is where this setup is described)

 

suspension9.hipnc

Edited by julian johnson

Share this post


Link to post
Share on other sites

Realised I'd attached the springs to the upper wishbone instead of the main chassis!. Updated gif and hipnc attached@:

rbd2.gif.c61eb1f9351b97d87725778cd4cf853f.gif

 

suspension10.hipnc

Edited by julian johnson
modified damping to prevent wigging out
  • Like 2

Share this post


Link to post
Share on other sites

Thank you for your help guys. I'll come back home next week and I'll take a look.

I'll share my results if it works.

 

Really appreciated.

Share this post


Link to post
Share on other sites

Nice work, that is a good start. Now you just need torque on the back wheels and steering in the front.

Share this post


Link to post
Share on other sites

Well, I couldn't just leave it there so I did do a few further tests but started getting different results between 16.5.496 and 16.5.536 (the sim would explode in .496 but stay stable in .536) so these further tests are in 16.5.536. I noticed that with the conetwist setup in the original the 'freedom' to roll downhill was reduced as though there were some stiffness to the twist in the conetwist constraint so I remade those particular constraints with hard constraints set to position only.

Again, the stiffness of the rotation was quite strong. You can see that test in suspension11.hipnc.

I then converted those new hard constraints to position and rotation but used condof/condir to allow rotation around the wheel rotation axis (but unfortunately that also permits position changes (sliding) along that axis). However, that did allow the whole assembly to travel freely downhill but you can see the wheels sliding a little along their axes. I put the conetwist test in the same scene to see just how great the difference was: suspension12.hipnc. Had to give the conetwists a slight position CFM value to prevent craziness. You can see the conetwist chassis on the right is still very slow to roll.

hard_versus_cone.gif.gif.3e85ca4258c3ae217d0b7ee99f4a0450.gif

Finally, as you do, I did attach a motor to all wheels for some torque! suspension13.hipnc.

motor.gif.gif.fea43d35bd849e072589ca33d6a4a53c.gif

Don't have time at the moment to explore further. Not sure what combination of parameters is driving the stiffness or would loosen it: Position CFM, Position ERP, Bias, Relaxation or the physical properties like Friction, Bounce, Mass. Constraint iterations and solver iterations would also play a part. Very hard to work out the exact contributions of each of those parameters or how they affect the sim and the manual is very 'dry'.

 

suspension11.hipnc

suspension12.hipnc

suspension13.hipnc

Edited by julian johnson
  • Like 2

Share this post


Link to post
Share on other sites

Nice progress. Do you have a strategy for adjusting the wheel base to fit various body types? 

I can copy a body to piece6 after the simulation to apply a body style.

car_chassis.gif.d6a830e545fd900626d6f15865316cdf.gif

I tried scaling the chassis geometry before editing but that causes the tires to fall off during simulation. I did notice I am still on Houdini 16.5.496. Do you think that is why the wheels may be falling off when i stretch the chassis?

car_chassis.gif.a14f5e38ae62026f04aef5ebf439599d.gif

Or do the constraint locations also need to be adjusted?

 

 

ap_car_suspension_13_082518.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites

I guess the constraint points probably do need adjusted.

This image shows turning ON/OFF chassis stretching compared to constraint point locations.

car_chassis.gif

Share this post


Link to post
Share on other sites

Here is a ridiculous hard coded approach to stretching the rig along the Z-axis. I used a Delete node to remove all points except the one where the hard constraint line/bolt was supposed to be. These are hand picked hard-coded numbers that I have typed into the delete node. Then I fetched the point value using the centroid() function so the line uses the actual point geometry for it's location, not a hard coded constant. I did the same thing for tires and springs, only using the centroid of the primitive instead of the point. Finally I used that same primitive centroid offset for positioning the tire geometry in the correct location. With all that in place I was able to stretch the chassis, right after the FileCache node, slightly along the z-axis to match the wheel base of my chosen car body.

Currently there is no X-axis scaling supported so my advice is to scale the body so it fits the X-axis of the chassis then scale the chassis along the Z-axis to dial in the wheel base alignment. The copy the body to piece6.

car_chassis.gif

Untitled-1.jpg

ap_car_suspension_14_082518.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites

Ok, now we are having fun!

car_chassis.gif

  • Like 2

Share this post


Link to post
Share on other sites

@Atom - that looks great! Next thing I'd be looking at would be the spring strength, restlength multiplier and damping to control the body oscillations...just as you would tune a normal car suspension system.

You're right the constraints have to be positioned correctly. I did it all manually because it was a quick hack to demonstrate the principles. I've hacked the original hack (!) so that you can now scale the chassis without any manual intervention on the constraint positions:

rescale_chassis.gif.gif.65ce4e280ed47e13ba31e4cbec9b0280.gif

But I think that whole system needs to be built more elegantly from scratch in a more procedural way possibly using a name attribute on the chassis points to generate the appropriate constraints. At the moment it's a kludge.

suspension14.hipnc

  • Like 1

Share this post


Link to post
Share on other sites
On 14/8/2018 at 5:42 PM, vicvvsh said:

Hello Mattia,

use combination of constraints. Pay attention to constraint attributes condir and condof. In attachment simple example. I hope it helps you.

Cartest_01.hipnc

Hey vicvvsh, I tried your solution but with no result (I can't see Spring Constraints in DOP Network). Can't figure out why.

(here my car model)

Car Destruction v07.hip

Share this post


Link to post
Share on other sites

Hi,

because there are not pieces with point name attribute  "body_s" and "wheel_s_*" in DOP but constraints have. Houdini don't know which pieces must be constrained. All pieces in DOP have name like "unique*" so far.

Share this post


Link to post
Share on other sites

It's been a while (!) but here's an interim development of the original double wishbone chassis concept. Now you can fully adjust chassis to match car - it's all done via names - so you can transform the model in any way you like (just don't change the point numbering as constraint naming is based on point numbers). Effectively bullet is used to make the constraints easy and the only real simulation is on the wishbone springs. Wheels are pre-animated along a path and then adjusted for roll, ackerman steering angle (inner and outer wheels at different angles). Still quite tricky to adjust the sim because mass, spring strength/damping, load transfer and conetwist maximum angles are all interrelated - change one and you need to change all the others! This test Porsche is overly springy to illustrate the basic concepts at work especially the load transfer forward to back. Needs more work on rest to action transition period, too! To change the car simply bring the new car and wheels into the chassis node and swap out, make sure to transform chassis geo to fit. Change path, collision ground as you see fit....

soft2.gif

car_rig_bullet_julian.hip

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×