Let us Talk about Vehicles.

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Let us Talk about Vehicles.

Postby e3dalive » Fri Sep 11, 2015 5:05 am

i agree the current svn version of the car is awesome. Is it possible for you to add overrides to your engine class like you did last time, so i integrate my own engine into your new car and test and upload new video of handling?
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Fri Sep 11, 2015 9:13 am

ne of the feature of this new vehicle is that the end user will be able to attach moving parts.
not more special vehicles for every thing.

there is that class VehocleBodyPart which is the base class for attaching moving part. the tire and the engine are build in moving part because they are special, by after the model is complete I will add the function SetEngine and you will be able to subclass the engine and override it.
the will be a sub class of the current engine and you can override the update functionality.
so the answer is yes.

on the adding moving part, the thongs that can be attached are stuff like doors rear view mirror, booms for heavy vehicles, wing and or propellers for airplane, etc.
the user can build parts either as generic closed loop body/joints using normal joints or as skeleton pieces that. so when I finish I will move the folklift and the tank demos to that class.

for the tank there the will also be especial, using the spline path, but his time the thread will be part of the vehicle so that the are easier to set up as opposed to 3.13 that is was all on the demo and everyone ignored it.

I think I will have a final workable version by the end of the weekend. now the more important step is adding a realistic tire model.
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 11, 2015 9:31 am

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

isn't that what a physics engine is suppose to be for? :) The way I see it, a physics engine is like Math. Math should always works, the difference Is that there are complex problems and simple problems. For simple problems we use basics college level math, for complex problem we use more advanced math, but we always use math. A physics engine should be the same way, it should solve simplex or complex problems, but we should solve them all using the same basics principles

That's not what the self appointed experts has made the public believe, they run around claiming physic are better because publishers force studios to use third party technologies because it is an accounting/budget issue for them. But in the internet world of experts that has become the metric for the quality of a physics library. but when you use that stuff you find the engine barely do collision and contact resolution, everything else is special case, Player controllers *, vehicle is ray cast and don't really work, particles are separate, the so called soft bodies and cloth is not physic based at all, and goes on and on.

I am not playing that game anymore. from newton 3.14 and on everything will be unified.
the next feature will be the player with an upright articulate skeleton, no more stupid lifeless rag dolls, the after that will be particles, real rigid body particles.

but for now the car is enough to close on 3.14
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 11, 2015 12:00 pm

BTW it is going to be broken until my next commit when I have a working tire model.
I committed the first part by mistake.
that is the reason why you see a scene object to test the materials.
after that I will place interesting scene object and more vehicle.

I am wondering what would be like to have a tow truck with a flat bed and have the car being towed, then drive the truck with the car on it. :shock:
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby d.l.i.w » Fri Sep 11, 2015 12:39 pm

Your car behaves really nicely, even in it's unfinished state. I also liked the heavy vehicles demo very much. That has to be said, just so you don't get the feeling no one follows your progress :mrgreen:

I regularly test the Linux build to make sure cmake still works - looking for changes closely...

One thing I noticed though, is the speed the vehicle moves. Related to it's size, it seems like there is a factor 10 missing somewhere. Is that right or is the grid fooling me?
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Fri Sep 11, 2015 1:30 pm

d.l.i.w wrote:One thing I noticed though, is the speed the vehicle moves. Related to it's size, it seems like there is a factor 10 missing somewhere. Is that right or is the grid fooling me?

yes you are right the grids are not fooling you, I just added the code to implement the tire friction model, and I changed the default material, so the tire are operating like a steel rings spinning on pavement.
The check in that looks good I temporally set lateral and longitudinal friction to the same value.
It will be broken until I get the tire model more elaborated, I could do the same trick because in the call back I have to add code to identify the tire. so it will be broken for the time being. :oops:
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby d.l.i.w » Fri Sep 11, 2015 2:08 pm

No problem, thanks for the explanation. :D
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Sat Sep 12, 2015 1:08 pm

Ok I now added the part that identify which nod is the tire and I quickly hack the friction
and the car is drivable again, the problem is ta all tire has the same friction value until I add a better tire model.
remarkable drive well enough that it is enjoyable to drive around. also
with the exception of the engine and differential (a very big exception) this car is the almost the original that was implemnetd in newton 1.xx, this Is because is uses the normal engine solver so it interact seamlessly with the scene. :mrgreen: no more touching a scene object and having the object flight off the map because of huge mass ratios or the car stops dead because all scene object are seem as static solid.

we now need few things to deem this completed.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby JoeJ » Sat Sep 12, 2015 1:18 pm

Tried the version a few hours ago and i really like it.
It's realistic but also as fun as an arcade.
(I hate realistic driving sims where you loose grip so soon while driving stills feels slow - i always think i could drive much better with my lame real car) :)
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Sat Sep 12, 2015 1:27 pm

just for fun I commit the "Bull in a china shop scene" :D

@ e3dalive
I know your main concern is the performance for you driven sim,
I also added 100 car for performance and with auto sleep off I am getting 3.8 ms per frame
if I set two threads then it is 2.5 ms
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Let us Talk about Vehicles.

Postby e3dalive » Sun Sep 13, 2015 3:59 am

I've tested it as well, new version is really fast comparing to old one. One thing i noticed when applying handbrake it seems that rear wheel is not stopped exactly when i press handbrake, it's stopped few seconds later. Did you implement some ABS breaks system or it's a effect from using joints and forcing the joint to stop not the wheel itself?
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Let us Talk about Vehicles.

Postby Julio Jerez » Sun Sep 13, 2015 9:53 am

ha that's the cool thing about the new model, in the old model the engine and transmission was fake, so the final torque was applied direct to the tire axis of rotation.

this implied that the high level vehicle code had to decide which torque dominate, the brake of the engine.

in the model the engine is it own independent body, the engine torque is applied to the engine, while the tire brake torque is applied to the tire axis of rotation, and it is the low level solver that determine the torque distribution.

so when you see Is that when you apply the engine toque, and the tire hand brake, the tire brake is
is a final value while the engine torque is multiplied by the first gear and reduce greatly the hand brake torque.

this is similar to what real car do, if you apply the accelerator to a car parked with hand brake, the car do start to move a little when the engine over take the brakes.
also this brake toque is a parameter, that can be increases at creation time.

this bring me to the second thong, I just added the Clutch controller. this is another feature in the car.
The make possible to do thin like tire burnouts, in previous versions the only way to do that was by hacking the engine toque curve at low rpm. Bu the is not how neither engine works of how tie burn is done.
the why tie burnout is done is that the drive engage the clutch, then apply the accelerator until the engine RMP is a the prion when the torque is maximal, then he let go of the clutch and that let a rush of power to be transmitted that overcome the tire friction the tire spins.

I just check that in, and now to test that you do this

-press enter to engage the clutch
-press w to apply power to the engine
-when the SRP is high, let go of the clutch (enter key)
-you get a beautiful burn out.

now I will complete the tire model, and when I get that I expect that doing the same operation as before, while turning the front tires left or right, then I expect to see a Doughnut burnout.
I am crossing my finger know on wood for that :mrgreen:
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 Sep 14, 2015 1:43 pm

I spend the weekend try to add the transmission and is was a complete failure

adding an object with the mass as engine, you can no longer apply the naïve method of gear,
basically when we have a fake engine, we look a the engine rpm and we get the engine torque.
this allows for the engine to change spn when a gear changes.
example say the
cant is in first gear G0, the when the car reach the top gear rpn is switches to gear G1 and the us say
g1 = 2 * g0

because the tire are spinning, the need to conserve momentum, so tire rpm before and after the gear change should be the same.
so what the method di that if apply the gear ration and get the rpm a the engine axel, and with et that is get the new engine torque, but the is totally wrong because the engine break the laws of conservation of momentum.

with the new method this is no longer possible, because the engine want to keep spin with the same angle velocity, no matt how much I tweak that all I got was vibration, too much power and the engine oscillate, too le the power and the vehicle simple stop dead.
the naive method of switching gears is very wrong. something is missing.
There have to be a way to switching the gears that conserved momentum, I have to investigate that.


another thong that does no help much is that the using the Viper with realistic values for the data sheet, is probably the worse or the worse selection to make the vehicle model.
The video is perhaps the worse high performance vehicle ever made by man.
I do not know why American car manufactories to get into their head that the secret of making a car stable is the aspect ratio. adding a few inches to the wheel base and the car can be very stable; by instead these idiots make the car longer and longer.
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 16, 2015 11:26 am

ok I think I figured out why I get these vobration when the car change gear
The image below show what is happening
github.png
github.png (27.22 KiB) Viewed 7320 times


basically at the angine GOG at any give time, conversation momentum must be obeyed, but the equation of power before and after a Gear shift say the that the move will be different, this is

P = torque_e * omega_e
on the other side for the transmission
P = G * torque_t * omega_e

at the moment of the gear shift, we expect that Omega change form W1 to W2
but conservation of momentum forbids that, this mean that W1 must still be equal to w2 and change gradually, this has nothing to do with clutch since is a real vehicle is possible to switch gear without engaging the clutch, in fact race car drive do just that. this mean it is the torque that must change.
this is what the curve is showing, the what fallow is the oscillation of the system natural response to and impulse. I sis quiet nice actually but is wrong because vehicle do not work like that.
That action will either brake the transmission of the engine.

So I wonder if this is no possible, the how do real car do it? Guess what the way real car do it is almost comical, is not different that what video games do physic for almost 30 years, with low pass filter x = x0 + (x1 - x0) * k.

Car engines happen to have what is called a Torque converter
https://en.wikipedia.org/wiki/Torque_converter

no body ever mention that to me, by basically this is nothing but a visual coupling between the engine axel and the transmission axel, so the toque is transmitted gradually over time.

I am hopping that ate I add that the gear shitting will be smooth because all the natural response will be absolve by the "Torque converter" I like to call it a low pass filter.

I could add that, but this is such a minor issue that I can simple rest the engine RPM to the rpm that is specified byte at the time of the Gear shift and the entire torque/rpm curve.
My guess is that real internal combustion engine do have the ability to change rpm almost instantaneously because the rotor is actually very small, so that is why the nee that toque converter device. The moment the rotor has non zero inertia, then it run into the problem of conservation of momentum, so the physics itself add the damping, he only problem is that is add the damping with and natural oscillating responses. So clipping the engine rpm can make the "ideal engine"
I is still better that the naïve engine torque curve, that everyone uses.
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 17, 2015 2:51 am

ok now the vehicle has an automatic transmission and the gear * is smooth and act just lie raer cars. her eis an image o fteh zewor to 60, to 150 km/h

github.png
github.png (45.63 KiB) Viewed 7302 times


first an last gear are irregular, but this because the first start from zero, and has the ramp form idle to peak torque, and the last is irregular because the vehicle fall of the map before change to the 6 gear. The cool thing is that the car travel up to 98 miles per hours goes straight as an arrow, as oppose to the on in 3.13 that veer to left or right.
Ok now we need to add the last but not least, thing the tire model. I am leaving that for last intentionally.
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 17 guests

cron