Let us Talk about Vehicles.

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Let us Talk about Vehicles.

Postby Julio Jerez » Fri Aug 28, 2015 2:16 pm

Newton 2.xx had two vehicles. a raycast and a multibody version.
I was never happy with neither one

3.11 and 13 have the newer version with the a Brush tire model which goo, but I am still no happing with.
The reason I am no happy is because it does no interact with embodiment very well for once.
Also the code is too complicated, it is fact implement a full rigid body system so tat I can by pass the limitation of the soft joints. This works but it a lot of extra work.
I am thinking refactoring the vehicle so that I use the core engine with normal joint

The goal now is that the vehicle have to simulate realistically vehicle part like e engine, the differential, transmission, axels, and maybe articulated suspension parts.
it should also be easy to work with.
and this time the vehicle should do realistic simulated drift.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Mon Aug 31, 2015 1:18 am

now I committed the fist step in the Mutibody vehicle.
It is not much really just the framework, a chassis mount in the for indecent suspension.
Next I am adding the Differential and the Engine.

because the vehicle us eth engine core to implement the joints, the progress is much faster, and is need a lot less code. The next challenge is to implement a realistic differential.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Mon Aug 31, 2015 1:51 pm

woohoo I got the differential going now. No checked in yet, I will do soon.

I placed a dummy collision shape to show how it work, by maybe I should make so the use can pass a visual mesh to show the coolness.
Too bad it will be an invisible part by I can make a demo with a tube car where all parts are visible so that so that it show it up.
Next is test a lithe so that is robust, and the plug the engine and trasmmition.

Again the engine will be a rigid body that will receive the Torque from the a torque curve, as seed by the current rpm.
this eliminate lot of hacking in the case when engine behavior is undefined, place lie idling and start. non of the vehicle book and paper talk about that, and it is quite tricky.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Mon Aug 31, 2015 2:47 pm

this is the same tire Model I am using for the car in 3.12, to 3.14
https://www.youtube.com/watch?v=AOEJaWaM-bs

it is called the brush model and I found on the University of Illinoi paper. but the is so much better explained.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Sweenie » Wed Sep 02, 2015 4:04 am

I know it isn't finished yet, but I couldn't resist to check out the latest work. :D
What is that rotating thing on the car roof?
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Wed Sep 02, 2015 9:30 am

That's, the rotation spider gear of a differential.
basically the wheel rotate in two direction, which mean it I universal joint.
the wheel are connect to a point on the surface of the wheel.
it is hard to explain graphical by mathematically is very easy to see how the equation of a differentia work. this is how.
a differential gear has two degree of freedoms, one os the rotation around the crown axis and the other around its own axis
in the lack space of the we can represent that as a vector

W = (Wx, Wy, 0)
now imagine two point on the surface of the gear. but with symmetry alone one axis only

let the point attached to left wheel be

pl (-xl, yl, 0)

and point attached to the right be

pl (xl, yl, 0)

now the linear velocity of each one of those points is give the cross product, of the distance to the cog.
Code: Select all
vl = cross (w, pl) = (0, 0, Wx * yl + Wy * xl)
vr = cross (w, pr) = (0, 0, Wx * yl - Wy * xl)


and if we make yl and xl = 1.0 and we link the unit veleocity to a point on a tire at a radio 1.0
and this is a trivial relation joint, we get the kinematic relation for the tire angle velocity
Code: Select all
left_tire_omega  = Wx + Wy
right_tire_omega = Wx - Wy


as you can see that instant velocity of that point is the equal to the angular velocity of one axis minos the angular velocity of the other axis. This is exactly the kinematics equation of a differential.

Now if we control Wx by plugin in to an engine (a engine body conceded by a joint acting as a transmission) while Wy is controlled by the two tires linked to the middle body.
differential behavior should emerge naturally as opposed to the nonsense of dividing the torque by half. Also notice that it is no limited to just two tires, we can plug four tires for a four wheel drive car.

It is not completed yet by I can see the emerging behavior already, I just hope the numerical errors are small enough that do not ruin the effect.
finally the object will be a null collision located and the center of the axel or the center of the vehicle, for now It an let it be there for calibration.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Wed Sep 02, 2015 12:09 pm

I committed a more elaborate version now.
there are still few things.
1-the version you saw did not plase the point of the surface of the ball, and rotate with the ball.

by the point should be on the a disk that rotate with one axis and is fixed on the other
so tow bodies connect by two hinges. by that add tow joint with is 12 dof to calculate(tow bodies and two joints, while using a universal only add 4 dof and we are doing this for performance.
one body with one joint that restrict only 4 dof.

The next step is to make sure that the ball integrate the angular velocity but no the angular orientation of the middle objects.
Newton doe sno have that functionality, I am now emulation by resting the matrix to the original orientation any frame, but the mess up with some internal stated of newton, so I will add a new function SetMatrixNotUpdate, this will only set the body matrix and inertia and nothing else.

one that is done, an we plug the engine to one axis, you will see the real cool effect of a differential, where you spin one wheel in one direction, and the other spin the opposite.

if you try hard now you cnma actually see the effect start to shows now

also notice that the car does not loses as much speed when turning, and that is a really big turn angle. and the is the main reason for this.

later when I plug the engine I will do sole cool effects that can only be done we a proper differential.
then I have to add the slip funtionalinity.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Thu Sep 03, 2015 4:19 pm

hey Sweenie it is now committed, if you want to see how it works, try to flip the car and spin the a rear tire, you will see the other spin the opposite direction.
only when the car is moving straight you will see the top object spinning along its local x axis, but when the car is turning the top object spin along it verily local axis but the turn rate.
It is in fact a true real differential.

after I plug the engine the real test will be to make one tire bigger that the other and the car should still move straight, because the differential soul figure out the correct torque distribution to math the different tire speed.

and another thing is that this vehicle is much mic faster that the vehicle in 3.13
we may no nee ray cast car vehicle at all.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Fri Sep 04, 2015 7:17 pm

this is what I hope to see emerging of the simulation without hacks.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Tue Sep 08, 2015 9:38 am

Ok I added he transmission, and I made a video.
First before you say anything, this is no completed, there is not tire model and there is a nasty unexpected behavior that produce a unwanted wobble the chassis.
I debug all day yesterday and is not cummings for the vehicle, it comes for the solver.
The vehicle is pretty much one of the the worse configuration you can have, the mass ration are very high, the body part has very skew inertia and the all move a relatively high speed.
The solve can copy with the chassis, the tire, the engine and the differential.
but the contention between the engine, the differential and the tire are using the soft joint solver and the leave residual torque and force that can be quiet significant.
I would probably have to connect that to the new solver, but at the moment it is no supported because I did no envision a body been part of more than one skeleton.
I would hate to have to write a solve for the vehicle again so I will see how I can accommodate this.

In any case you can see how the drift behavior come out natural and last for some time, even when the vehicle doe no have the proper brush tire model.
after I figured out the wobble bug and I add the proper tie modem I think the vehicle will be controllable and realistic and the same time.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Tue Sep 08, 2015 11:01 am

Ok I believe I figure out the reason for the wobble, basically I plug the engine the highway, but
connected the differential wrong. I though that the torque was going to be deleted to the chassis
at the engine attachment point, by in reality the torque is passed to the differential and part is delivered by the differential and part by the engine, the problem Is that the differential is connoted axially and the toque tilt the car sideway a lithe.
this compress one tire and decompress the other, so one tire start to spin fate than the other and the result is that the differential start to rotate. as the differential rotates the torque changes direction and that explain the wobble motion until the vehicle speed stabilizes.
car.png
car.png (10.54 KiB) Viewed 9063 times


basically I am accelerating the car with the brake on, and the effect is quiet clear. is actual and awesome effect, more realist that I would imagine would. and is exposes my bad design.
when I align the differential the, the effect will be even more impressive because the torque will till the car just like real car do. this explain why cars till the way the di regardless where the engine is located. I will do the fix and let is see what else need more tweaking.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Thu Sep 10, 2015 4:27 pm

Ok I no added the engine, gear box, and differential as a single unit.
This save lot of calculation, plus makes it more stable
the thong lest to do are. The vehicle model is almost complete. four thing left to do
1-Adding the friction clutch
2-adding the gear shift
3-contact tire model
4-tweaks

The vehicle is more or less drivable even without a realistic contact tire model, It is amazing how by using a Mutibody configuration many features comes out as emerging physics behavior.
I cannot wait to add the tire model this weekend. :D
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Sweenie » Fri Sep 11, 2015 2:14 am

Wow, it's starting to look really good now. Can't wait to test drive this on a track with some ramps and obstacles :lol: ( yup I prefer offroad driving :mrgreen: )
I just need to settle on which game engine to move on to since Terathon dropped the C4 Engine :cry:
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Fri Sep 11, 2015 3:01 am

sync again, I just added another engine tweak.
remember this does not have tire model at all and is already more realistic than any vehicle I made before. I think the trick of good handling is the differential. to test the differential, flip the car upside down and with the mouse spin on of the rear tire, you will see the other turning the other way. This car is rear wheel drive and it drivable already. Most physics engines doing raycast cars can't do that without cheating, and don do it at all.
To my knowledge there are not simulation out there with this level of sophistication that actually works. The other thing tat is a huge help is an engine that actually has a rotor with mass and inertia. everything comes out natural from the simulation even the concept of a friction clutch.
Believe or not with an realistic engine a friction clutch is necessary to prevent a jolt when changing gears. I will add that with the option of being automatic or manual.

On the game engine. I am confused I though Teragon was C4?
and why do you need to change I assume C4 is still an engine?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby Sweenie » Fri Sep 11, 2015 4:04 am

The car is getting more and more realistic. I don't understand how you can implement this so fast. :shock:

Oh, and I saw that you added an obstacle :wink:

About C4... Yes Terathon is the developer of the C4 Engine, but a while ago they decided to stop all development of the C4 Engine. At least for their users. They still develop it for their own game but the user won't get any more updates.
I can still use the current version but I don't want to use a game engine that has no future.

Instead thinking about moving on to Unreal or Unity. Unity most likely because Im not really that fond of Unreal. It looks nice but feels bloated. I already managed to get Newton running in Unity as well.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests