Guys anything new with the vehicle is good but this could be really good.
After being sick and tire of adding code to component for numerical error solving the vehicle, I decided to develop by has a Generalized Coordinated Langragian formulation for all of the vehicle drivetrain.
I used the D'Alembert's form of the Langragian because that version let you get the constraint forces, while using Lagrange getting the Constraint force take more work.
This is quite tedious and it took me two weeks to get all the e correct to get the correct Jacobians
but it turned out that after to get what is going on, there is a lot of symmetry in the system
Here is a picture of what the vehicle solver solves.
The first image is the single axel differential with motor, clutch and gear box, 6 degrees of freedoms
The second is the two axel differential for two wheel cars. 18 degree of freddom.
Everything is simulated realistically and now I can add use data from vehicle data sheet without having to hack the values to god around the solver limitation.
The engine rotor mass and inertia can be very small, whiel it can generate the torque from the engine torque data, the transmission gear and differential gear are even a lot smaller, while the tire can have proper size and mass. And the solver has no problem find the solution
I just check in the code with the vehicle suspended in the air, so that you can see the four wheel drive differential in action.
Notice that when to spin one wheel the other spin in the opposite direction just like real car do.
if you apply the hand brake, the rear tire stop, the engine loses rpm, but the front tire still get power, just like rear four wheel drive car.
The engine always distribute power to the tire in the proper ration, in fact the tire can be all of different sized and the power get distributed correctly. so not longer we have to worry that the contact are on the tire surface.
Real car can still drive straight, even the tire radios are different sized, with the solve our car will be able to do that too.
please check it out and let me know what you guys think