Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wrong calculation for brake lock/unlock?
02-02-2010, 12:05 PM,
#1
Wrong calculation for brake lock/unlock?
Hallo there,
first of all: thank you all for the great game !

I am not sure whether I got the following wrong or this is a bug.

I recognized, that unlocking the brakes seems to be harder than it should. The following brake lock calculation could explain that:

Quote:T GetTorque ( T rotational_speed )
{
T brake = brake_factor > handbrake_factor ? brake_factor : handbrake_factor;
//brake = pow(brake,2.0f);

T pressure = brake * bias * max_pressure;
T normal = pressure * area;
T torque = friction * normal * radius;
T velocity = radius * rotational_speed;
if ( velocity < 0.0 )
torque = -torque;

T absvel = std::abs(velocity);

// See if the brake is locked.
if ( absvel < threshold * normal )
//if ( absvel < ( threshold * brake ) )
{
torque = 0.0;
locked = true;
}
else
locked = false;

lasttorque = torque;

return torque;
}

In cardynamics the wheel speed is set to zero, when brakes are locked.
Hence,
Quote:if ( absvel < threshold * normal )
is always true, as absvel is proportional to the rotational wheel velocity.
Shouldn't the engine, tire-friction and all that influence the lock-state of the brakes? If these torques are higher than the static friction of the brake discs, the brakes should unlock.

Perhaps someone can help me understanding the physics calculations here.

Regards
Sebastian
Reply
02-02-2010, 02:32 PM,
#2
 
Looks like ApplyWheelForces() and CARBRAKE need some care. I'll look into it asap. Please feel free to help.Smile
Reply
02-02-2010, 06:21 PM,
#3
 
another thing about the brakes is that the handbrake locks up all wheels. it seems that it just uses the the normal brake, just harder.

because on a car with a break bias 60/40 front/back, the front brakes are more likely to lock up using the handbrake.
even though in the .car file the handbrake option is only on the rear wheels.
Reply
02-04-2010, 12:20 AM,
#4
 
portets Wrote:another thing about the brakes is that the handbrake locks up all wheels

Doh, you are correct. In carbrake.h we should always multiple handbrake_factor by handbrake. I fixed this in R2583.
Reply
02-04-2010, 01:31 AM,
#5
 
oh my! yes!

i think i mentioned this almost a year ago in the forum here and it went unnoticed.

this game feels so much more realistic now! haha.

but now that it only works on the rear wheels, it's a lot weaker. someone will need to go in and change the handbrake multiplier on the cars. i tested three cars now and the handbrake is very weak on them.

edit: changing them all to "2.0" feels about right. but maybe instead you can just code the handbrake to be twice as strong? it would make things easier if that's not too much of a burden. and an even "1.0" in the .car files looks nicer, :wink:
Reply
02-05-2010, 11:30 AM,
#6
 
Ah, I like the idea of just changing the .car files to handbrake=2.0 or whatever where needed instead of changing the code to automatically pump up the handbrake values. If you want to do that along with your other .car changes I'd be happy to commit them for you.
Reply
02-05-2010, 05:59 PM,
#7
 
okay, will do. but just in case you don't like my .car changes (you probably will, they mostly involve very minor things like moving wheels slightly forward) i'll do a set of unmodified cars with just the handbrakes changed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)