Joints stiffness

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Joints stiffness

Postby Julio Jerez » Fri Aug 28, 2015 4:58 pm

ok cool,

to see the jitter, take the 20 link snake, and lay horizontally, it should just rest on the ground with one break around the center the center.
however what happens is that it does find a break but not the optimal, so next time find anther break that is near by not the same, so the previous break try to get straight and this continue until it does settled, but after few jerky movement.

like I said this is a extreme case, if I was not a Mechanical engineer I will not know that the behavior is incorrect. I believe that if it does a few lcp passes, two or three, it will find the correct break each time. I will add that but it is not really a priority now. Let us see what else we find first.
Let us not make the perfect the enemy of the Good.

Now I will turn to put this into real practice by re writing the high performance vehicle model using this solver. This will a the real stress test because the parts have high mass ratios and move a high speed constantly, consider a differential with satellite gears spinning at high speed.

Hey Joe, you have mastered the art of making Joints now better than I. :mrgreen:
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby JoeJ » Fri Aug 28, 2015 5:36 pm

Ah, i see now. The snake is really a hard test case - i agree it should not become a big problem in practice.

Julio Jerez wrote:Hey Joe, you have mastered the art of making Joints now better than I. :mrgreen:

Whooo, Thanks :mrgreen:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Joints stiffness

Postby Julio Jerez » Sun Apr 17, 2016 3:38 pm

I finally managed to implement the real differential for the robot tank.

I now found why I has so much trouble using the same joint for the high performance vehicle.

and it turn out that, there is a Gyroscopic torque that is generated by the satellite gear the modern you apply two in depend torque along two axis.

this was what was cause a strange force in the vehicle that I could not explain,
you can see in the tank demo by much forward and turning at the same time, you can see how the tank over a lithe, the only way to cancel that is by doing what real Differential do which is use the satellite gears in symmetric pairs.
In the demo is ok because the Tank is very heavy, the differential spin a relatively low RPM, and the differentail in low mass.

for a high performance car all those fore condition are extreme. The car is lightweight, the engine spin a very high RPM and the mass if the gear should be very small.
A real time reduce coordinate system iterative solve can no deal with any of those condition let alone with all three at the same time.
Now I am glad I derive the Langragian model for the drive train for the vehicle system.

In the tan demo the vehicle only have one engine, late I will reenable the rest of eth demo.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Sweenie » Mon Apr 18, 2016 12:19 pm

The basic car and super car acts very weird now though. It's like there is no lateral tire friction.
Could the changes you made for the tank be the cause?
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Joints stiffness

Postby Julio Jerez » Mon Apr 18, 2016 1:15 pm

Yes I just found that out this morning.
I removed a couple od variable for the Bilateral joint that I though were legacy,
But it seems they where used for different purpose by the Contact joint.
I labeled the commit, I will compared to the corrupt head of the archive to see what is wrong.

Thank you for the warning.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Mon Apr 18, 2016 2:32 pm

wow, I see what the bug is now.
This could be either good of really bad.

basically I made a mistake when I was starting to add the skeleton, I though I should use the Skelton as a IK solver, but after a while I realize that it is too much problem, because it makes code pathway to complicated. So I comment out the code by I left something uncomment.
I made this huge mistake, I declared a flag to determine when the solver was in IK or on dynamics mode, but I made the flag a union with the Motor flag instead of a struct.
Code: Select all
   class dgFlags
   {
      public:
      union {
         dgInt8 m_flags;
         struct {
            dgInt32 m_isMotor         : 1;
            dgInt32 m_applyCorrection   : 1;
         };
      };
   };

but is should have been declared as
Code: Select all
   class dgFlags
   {
      public:
      union {
         dgInt8 m_flags;
         struct {
            dgInt32 m_isMotor         : 1;
            dgInt32 m_applyCorrection   : 1;
         };
      };
   };


what this does is that I map isMotor rown and kinematic row to the same variable
since when a each time a morter was set the code the function also rest applyCorrection
whi meat that moter are turn of each time function like

Code: Select all
void dgBilateralConstraint::SetMotorAcceleration (dgInt32 index, dgFloat32 acceleration, dgContraintDescritor& desc)
{
   m_rowIsMotor[index] = -1;
   m_motorAcceleration[index] = acceleration;
   desc.m_flags[index].m_isMotor = -1;
// huge mistake here, .m_applyCorrectionis sterring motro mode to zero again
   desc.m_flags[index].m_applyCorrection = 0;
   desc.m_jointAccel[index] = acceleration;
}


This is in fact good new in disguised.
for some feature I am using motors more and more, but I notice that some how motor are not as strong as I expect then to be, so I have to increase power more and more.
this si the good new, the reason is that the is a bug in the code.

The bad new is that I have to revisit all the place where I am using Motors.

what you are seen, in the vehicle is actually a very good thing. basically the tire are getting all 550 (I believe HP to the tire) and that is enough spin the tire lie crazy
this if the tire spins the Brush tire model (because of cycle of fruition) reduce the lateral fruition to the minimum.

I am no reverting the code so that it as is was by tonight I will fixed so that it work as it should for everything.
I really like the fact that we found that Bug because I hate when thing works because of the side effect of a bug.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Mon Apr 18, 2016 3:02 pm

I committed now. Thank for the warning.
I was going to add a function name lateral dynamics to the vehicle, but maybe I would not nee to do that if after I fix that bug.
and if I added it would be to make better driving model not to make of for a Bug. :D
I like the power is back, because now I can make the engine to conform more with realistic values.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Tue Apr 19, 2016 11:36 am

Sweenie wrote:The basic car and super car acts very weird now though. It's like there is no lateral tire friction.
Could the changes you made for the tank be the cause?


Ok Sweenie, the code is back to normal. I will do that last check this weekend but for now, I apply the feature that use to design the differential for the tank to the vehicle.
The differential is no much more accurate and simple. IT doe no lose much torque that was lost on the attachment point. This goes to the goal of using more realistic values.

if you test it the thing you when you turn the vehicle does no lose speed and previse version because the power is automatically distribute appropriately to all wheels.
Wheels turn a different rate, you co for example step on one plan and make sure one tire get different normal force than the other and the tire with less normal force will spin faster.
this are the cool tuff that make off road drive fun.
Later I will add the ability for turn the differential on an off, so that people can do that trick at will, for now is just a regular differential.

this weekend I will add that last part, which the torsion bar, and the lateral stability for driving a very high speed (race and sport cars)
low speed car do not really need that because the vehicle physics a medium to low speed are almost 90% determined by the vehicle kinematic. once you go a high speed the some turn on the lateral dynamics equation start to lost significant and in the case the car is almost like a particle.
Is a very interesting feature of cars that is hard to grasp, but once you get it is make lot of sense.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Tue Apr 19, 2016 8:41 pm

Ok I tried to place the car on a rod track and I now see some bug that I need to fix.

The first is the wheel collision bump, when going over edges, no sure what is that, I believe the engine was handing that but the is a bug there.

second is when the vehicle goes airborne, is gains a tremendous about of angular kinetic engine, I nee to find out why is that. It may be that the vehicle is too stiff system that the first order integration can deal with it.

other than that when not blown up the car seem to drive pretty well and 75 miles per hour on the road and can take all of the turns and high speed. That's no bad considering that there not vehicle stability handling controller.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Sweenie » Wed Apr 20, 2016 6:22 am

Yep, I'm seeing those problems as well.
When driving the car on a treecollider and driving over edges the car can flip and start spinning like crazy in the air. Except for those bugs it behaves incredibly nice. :)
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Joints stiffness

Postby Julio Jerez » Wed Apr 20, 2016 8:45 am

I figure out the crazy spin when in the air.
Basically the can is not a single body.
when it is in the air, the tires are free to rotate as fast as the can.
when that happen the centripetal for make the to fly apart from the vehicle.
But the joint does not act along the suspension axis, so a long this axis there is a strong cortiles and centripetal acceleration that that move the tire beyond what the memorial integration can copy with.
what prevent then for flying apart is the joint bumper, but the keep vibrating front the lower to top bumper given the vehicle more an more angular momentum.

I believe I can fix it like this.
keep track when the vehicle is air born, and calculate the vehicle angular momentum.

when the car is air born, set a flag and use this flag to project the tire to the lower bum suspension.
also when the vehicle is air born we know that the can behave as a single rigid body, which mean is present it angular mopementon form the last time was grounded.
apply an angular dynamics drag to the angular momentum, and let the rest go.

this will prevent the vehicle from spinning like crazy and it is still in the spirit of realism.

This si the fort bug and I am adding that now.

The I address the tri bumps on meshes.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Wed Apr 20, 2016 9:00 am

I now added that, the only thong that is not realistic is that I am applying a fake angular friction drag by scaling the air born angular momentum, this is just to see how it will work.

It work remarkably well.
Next I will applay a more correct
L = L - K * (omega * omega) * dt
this will let the vehicle spring with a quadratic angular attenuation, just like airplanes wings.

I will do that after I deal with the edge on mesh tire bumps.

to me I am very satisfy with the preliminary results, I am driving a rear wheel drive sport car supercar with stiff and short span suspension on wheel drive in an off road terrain at higher than a coasting highway, This is quite challenging my friend :mrgreen:

Please test it again. and let me know what you find.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Wed Apr 20, 2016 10:36 am

Ok I think I have a very good test case, in the image bellow if you look carefully you see that left frony tire going across the confluence of 6 faces in a terrain mesh, you can see there are tow contacts generate there.
spline.png
spline.png (455.71 KiB) Viewed 5782 times


I am sure if the bug is because multiple contact send joint reaction multiple time.
this could be possible since the tire model consider the tire load applied to as if they where contact independent of each other, instead of solving the complementary force for the tire free body and see what friction of the tire load apply to the contact. I am almost 95% this is the bug.

or if the bug is in fact in the collision system which seem very unlike because if that was the case then the rolling a ball of a cylinder would exhibit the same kind of discontinued jumps.

having multiple contacts is perfectly ok, for example the corner could be a concave, or the tire could be hitting more than one body, so limiting to one contact is no a solution.
I guess I will have to write a mini tire contact solve for to calculate the tire load per contacts, for example on that test case, if the load was 5000.0 NTs and there are tow contacts,
the load per contact would be more of less 2500.0nt.

however a naïve solution of dividend the load by the contact count will only works when contacts are very close, it will fail when they are far apart. So I am afraid it needs a proper solution.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Wed Apr 20, 2016 11:25 am

update:

I quickly tested my assumption, but forcing the collision to return only the closet contact.
the bug when away, by this doe not mean it not there because the vehicle followed slightly different path.
It is quiet hard to set up a test case when the tire generate the example jump. But I am sure this is the bug.
I could probably set to one contacts per tire, But I know that's calling for tire jitter when standing on complex surface, so I will fix the propel way.

That's all the time I have, now

edit:
I take that back, It turns out that this happens even with one contact per tire.
so some is going very wrong with the contact calculation in some situation.
I need to make the test case with one contact per tire and go from there.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Fri Apr 22, 2016 9:41 am

Ok Sweenie I fixed the collision bug.
I now put the car on a rough rolling terrain.

I drove a little and I did no see any discontinues behavior.
The terrain does not see rough for game play standard but for a super car, is in fact very rough.

I also lower the car suspension, and made the friction to conform more with real world.
before I was exaggerating the value to 1.2 but that cause roll over problem what driving a high speed. now but laws friction is 1, or less.

Now I will complex the coupling between engine ad driving tire so that tires do no continue skidding continually. and then finally I will add the lateral stability control so that the vehicle can do controlled drifting.

Please let me know what you thing, or any feedback that you might have.

remember this is a rear wheel high performance car, driving of a rough terrain, possible the worst of all world,
super car are no support to drive on rough terrain and most of then are four wheel drive.
when using four wheel drive the handling is much better, but to me that's cheating my goal is to get good handling using rear wheel drive vehicles.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron