![]() |
|
Engine and wheel inertia - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4) +--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9) +--- Thread: Engine and wheel inertia (/showthread.php?tid=1146) Pages:
1
2
|
- stan.distortion - 07-22-2009 Think I may have got somewhere with it. Added a bit in at the end of CARDYNAMICS::ApplySuspensionForceToBody in cardynamics.cpp to store the current value for force and torque (think I only needed torque) and recall the previously stored value for the body orientation calculations (I put the save functions in cardynamics.h). It's working but I don't think its right as the suspension has to be set very soft for it to be noticeable. - joevenzon - 07-22-2009 Hmm, regarding your statement "I think its getting calculated but isn't getting applied to the body so the next frame assumes the body has already moved": the ApplySuspensionForceToBody function adds to the total_force and total_torque when it calls body.GetForceAtOffset, and then the total_force and total_torque get applied to the body back in ApplyForces. Could it be that suspension_force_application_point is set to the wheel, but should be set to someplace closer to the center of the car? Or should suspension_force be in a direction other than 0,0,1? As you can see I was experimenting with #defines to do other things but never figured out how it should work. By the way, if you end up touching up the car tuning, note that the engine inertia fix makes it so the clutch calculations are always running, and so some cars that have clutch friction set too low (CT for example) are pretty much unplayable now because the clutch is always slipping. - stan.distortion - 07-23-2009 Quote:Could it be that suspension_force_application_point is set to the wheel, but should be set to someplace closer to the center of the car? Or should suspension_force be in a direction other than 0,0,1? As you can see I was experimenting with #defines to do other things but never figured out how it should work.I was thinking the same at first but got my head around some of whats happening from using cout with GetDisplacement for each wheel, the springs are compressing properly with roll and acceleration forces and, as for as I can see, the inertia is getting taken into account but the body is just sitting level. Just been messing around with the rates on the C7 again, it's hard to get an idea of where to start with the settings (hence 3 days trying to get body roll ) but it seems right, its wallowing like a sick hippo. Here's the horrendous bodge I stuck on the end of ApplySuspensionForceToBody:Code: #endif![]() BTW, did you get a chance to look at the square root stuck on the damper force calc's ? It's ugly and relies on no integration to avoid launching the car on small bumps but it stops the car doing acrobatics when touching a curb on the ring or pau. I will look into adding a fast rise in the spring rate near the top of travel to simulate bump stops before too long, but first... Quote:By the way, if you end up touching up the car tuningNow I have some kind of body roll I'll get right onto it before poking at anything else, even if the roll changes from some proper coding the change should be fairly linear and just mean scaling the rates up or down. No idea what to do with the tires though, probably need a few more dead chickens to wave. Do you have any notes on the formulas used for the tire calculations? I want to do up a spreadsheet to visualize what does what and my head is already spinning from trying to follow object orientated things. Couple of other thoughts to finish of an already too long post: When you suggested the formula to get wheel inertia from wheel weight, does that look about right to you now? A value of about 2 is working well for me here, might not suit everyone though... Along with the damper and bump-stop I'd like to add damper fade to the suspension force code. It's simple to do but would need a .car file entry to be useful. Brake fade would be more or less the same code, and they both pave the way for tire temperature... Right, that's enough of that, I have .car files to look at ![]() cheers - stan.distortion - 07-23-2009 Sticking the .car file I'm using for the C7 here in case anyone has any suggestions. The power is way over the 170bhp it should have and the tires are fairly close to slicks but C7's have had every kind of power unit stuck in them, there were even a few 4x4 ones made. One here in Ireland had the running gear from a 320bhp sierra cosworth 4x4 . I'll be staying as close to standard as I can for the default cars.Code: drive = RWD- joevenzon - 07-27-2009 stan.distortion Wrote:I was thinking the same at first but got my head around some of whats happening from using cout with GetDisplacement for each wheel, the springs are compressing properly with roll and acceleration forces and, as for as I can see, the inertia is getting taken into account but the body is just sitting level. So you're basically just delaying the suspension force by one frame? I can't imagine that would have a huge difference. Did you try using your tuned C7 file with the original (current SVN) suspension code? Because when I tried your C7 file, voila, I got healthy body roll without having to touch the suspension code. Quote:BTW, did you get a chance to look at the square root stuck on the damper force calc's ? It's ugly and relies on no integration to avoid launching the car on small bumps but it stops the car doing acrobatics when touching a curb on the ring or pau. I will look into adding a fast rise in the spring rate near the top of travel to simulate bump stops before too long, but first... I plotted it and it does look a lot like the general shape of the shock dyno you posted. I tried it out in game and it seems to work fine. But I think the ideal solution is like you said, define points in the car file like how the torque curve is done -- the steepness of the sqrt function around zero kind of bothers me, but the cars drive great. Quote:Now I have some kind of body roll I'll get right onto it before poking at anything else, even if the roll changes from some proper coding the change should be fairly linear and just mean scaling the rates up or down. No idea what to do with the tires though, probably need a few more dead chickens to wave. Do you have any notes on the formulas used for the tire calculations? I want to do up a spreadsheet to visualize what does what and my head is already spinning from trying to follow object orientated things. There's a basic textual description of the different coefficients here: http://wiki.vdrift.net/Car_parameters#Tire But this is the best resource I've found for understanding what the different coefficients actually mean: http://members.xoom.virgilio.it/adiaforo/epcjk.htm Also, if you can find a pacejka editor so you can visualize how the curve changes with different values, that helps immensely as well. The coefficients for the 360 are a good starting place because it sets many of them to zero. Parts 21 and 22 here might help: http://phors.locost7.info/contents.htm Quote:Couple of other thoughts to finish of an already too long post: The wheel inertia formula is correct, although it assumes constant density over a cylinder. There's also a formula for a cut out cylinder that may give better values: http://en.wikipedia.org/wiki/List_of_moments_of_inertia Iz=0.5*m*(r1*r1+r2*r2) Also add a little more onto the value for the inertia of the axle. Quote:Along with the damper and bump-stop I'd like to add damper fade to the suspension force code. It's simple to do but would need a .car file entry to be useful. Brake fade would be more or less the same code, and they both pave the way for tire temperature... Oooh... :-) |