mois23 Posted August 10, 2018 Share Posted August 10, 2018 (edited) 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 August 10, 2018 by mois23 I added an Hip file. Quote Link to comment Share on other sites More sharing options...
mois23 Posted August 12, 2018 Author Share Posted August 12, 2018 Anyone??? Really??? Quote Link to comment Share on other sites More sharing options...
mois23 Posted August 13, 2018 Author Share Posted August 13, 2018 (edited) 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 August 13, 2018 by mois23 added hip file Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted August 14, 2018 Share Posted August 14, 2018 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 1 1 Quote Link to comment Share on other sites More sharing options...
julian johnson Posted August 15, 2018 Share Posted August 15, 2018 (edited) @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: Inspired by this: https://www.youtube.com/watch?v=GW__Gzkk4G0 (4.53 is where this setup is described) suspension9.hipnc Edited August 15, 2018 by julian johnson 2 Quote Link to comment Share on other sites More sharing options...
julian johnson Posted August 15, 2018 Share Posted August 15, 2018 (edited) Realised I'd attached the springs to the upper wishbone instead of the main chassis!. Updated gif and hipnc attached@: suspension10.hipnc Edited August 15, 2018 by julian johnson modified damping to prevent wigging out 5 Quote Link to comment Share on other sites More sharing options...
mois23 Posted August 24, 2018 Author Share Posted August 24, 2018 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. Quote Link to comment Share on other sites More sharing options...
Atom Posted August 24, 2018 Share Posted August 24, 2018 Nice work, that is a good start. Now you just need torque on the back wheels and steering in the front. Quote Link to comment Share on other sites More sharing options...
julian johnson Posted August 25, 2018 Share Posted August 25, 2018 (edited) 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. Finally, as you do, I did attach a motor to all wheels for some torque! suspension13.hipnc. 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 August 25, 2018 by julian johnson 4 Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2018 Share Posted August 25, 2018 (edited) 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. 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? Or do the constraint locations also need to be adjusted? ap_car_suspension_13_082518.hiplc Edited August 25, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2018 Share Posted August 25, 2018 I guess the constraint points probably do need adjusted. This image shows turning ON/OFF chassis stretching compared to constraint point locations. Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2018 Share Posted August 25, 2018 (edited) 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. ap_car_suspension_14_082518.hiplc Edited August 25, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2018 Share Posted August 25, 2018 Ok, now we are having fun! 4 Quote Link to comment Share on other sites More sharing options...
julian johnson Posted August 26, 2018 Share Posted August 26, 2018 @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: 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 2 Quote Link to comment Share on other sites More sharing options...
mois23 Posted September 18, 2018 Author Share Posted September 18, 2018 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 Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted September 18, 2018 Share Posted September 18, 2018 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. Quote Link to comment Share on other sites More sharing options...
Popular Post julian johnson Posted September 17, 2019 Popular Post Share Posted September 17, 2019 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.... car_rig_bullet_julian.hip 5 5 Quote Link to comment Share on other sites More sharing options...
K'n'K Posted October 14, 2019 Share Posted October 14, 2019 Julian! You are a champ! This is absolutely amazing! Thank you so much for sharing the file. For a rookie like me it is absolutely a joy to learn this way Your setup is very straightforward and easy to customize for different car models. As I played around with it last night I came across a few ideas: - Ability to reverse (right now the wheels can only spin forward, even when the car is traveling backwards) - Override wheel rotations (It would be great to make the wheels over- or underrotate for wheelspins or aggressive (no ABS) braking) The first one I have no idea. The second one, I have no idea either but that doesn't stop me from digging into it... I guess it would be best to do the overrides directly inside the "distance_travelled" CHOP network. Maybe I should after the "vector1" (before it goes into the area calculation). I couldn't figure it out yet so any pointers would be massively appreciated. Quote Link to comment Share on other sites More sharing options...
julian johnson Posted October 15, 2019 Share Posted October 15, 2019 (edited) Hi K'n'K, glad you liked it. I'm in the middle of a job at the moment so I can only give you brief pointers. You are right, though, I think it can all be done in the distance travelled CHOP. For reverse you need to establish some concept of what constitutes forwards and what constitutes reverse. I think using the tangents of the path curve and bringing them into CHOPs would be the way to do that - then compare the slope vector with the tangent vector. A dot product between the two would give less than 0 for reverse and greater than zero for forwards. Then just multiply the result of the area chop (length) by -1 to negate if you want to reverse (using the dot product to tell you whether you need to). For wheelspin I think a simple animated add to the length chop would do (for a manual spin) or using the acceleration to procedurally increase the length if it goes over a certain threshold. CHOPs are fiddly so it might take a few tries to get it right! Edited October 15, 2019 by julian johnson 1 1 Quote Link to comment Share on other sites More sharing options...
K'n'K Posted October 19, 2019 Share Posted October 19, 2019 Oh nice. A simple math node with an animated "post add" works fine for wheelspins and braking. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.