I haven't tried that approach so can't say this will work for certain in your
sim, but since there was such a big change in performance when switching from
one slip angle calculation to the other, perhaps you might want to try
calculating slip ratio a different way.
For a top down, 2-D calculation, something like this might work better:
First, you could calculate the angle between the center of mass (CM) and each
wheel in the vehicle's coordinate system:
d[wheel] is the distance from a line drawn connecting the front and rear axle
(or axle lines) going through the center of mass. Basically 1/2 the track
width, but would change a little based on left/right load distribution if not
50/50.
dist_cm_to_front/rear_axle --is the distance from the center of mass to
whichever axle you're looking at. Again, this would be perpendicular to both
axles (not looking at the diagonals to the wheels yet).
Angle_To_Wheel[FrontRightWheel] = atn(d[FrontRightWheel]/dist_cm_to_front_axle
Angle_To_Wheel[RearRightWheel] = Pi -
atn(d[RearRightWheel]/dist_cm_to_rear_axle
Angle_To_Wheel[RearLeftWheel] = Pi + atn(d[RearLeftWheel]/dist_cm_to_rear_axle
Angle_To_Wheel[FrontLeftWheel] = 2 * Pi -
atn(d[FrontLeftWheel]/dist_cm_to_front_axle
That is just the interior angle from the center of mass to each respective
wheel with straight ahead being 0 degrees/radians, and increasing in the
clockwise (top down view) direction.
Then, you could calculate the circumference of the circle traced out by each
wheel as if the car was sitting still and was spun through a 360 degree
rotation. This would use the distance from the CM to each wheel respectively,
and is used below as Circum[wheel]. (Calc not shown here)
Next, the direction of the velocity vector due to rotation is simply
perpendicular to this Angle_To_Wheel. Just add 90 degrees (or .5 * pi) to it
and add the vehicle's yaw angle:
yaw_90=YAW + .5 * PI
Direction_Vel[wheel] = (Angle_To_Wheel[1] + yaw_90) MOD 2 * PI
(MOD is a modulus operation, not sure how to do that in C though, a simple IF
ELSE block will do it. This is simply keeping the angle between 0 and 2 * PI)
Now multiply the rotational velocity of the car to get the linear velocity at
each wheel due to rotational motion:
Instant_Linear_Velocity_From_Rotation = Circum[wheel] * yaw_rotational_vel / (2
* PI)
Now split that into the x/y (or whatever your ground plane coords are)
velocities:
term1 = Direction_vel[wheel]
x_component = sin(term1) * Instant_Linear_Velocity_From_Rotation
y_component = cos(term1) * Instant_Linear_Velocity_From_Rotation
What you have now is the x and y components of the velocity due solely to
vehicle rotation (the velocity vector on the 2-D ground plane, if I'm doing
this right ;-)) This is what indirectly causes the low speed yaw dampening
effect vehicle dynamicists (new term?) talk about.
Now, you can simply add the x and y component of the car velocity to these and
you should have the true velocity vector at each wheel.
This will flip around as different quadrants are hit, so:
Total_x_vel = x_component + car_x_vel
Total_y_vel = y_component + car_y_vel
IF Total_y_vel < 0 THEN Wheel_Travel_Direction[wheel] = (Pi + ATN(Total_x_vel /
Total_y_vel)) MOD 2 * Pi
IF Total_y_vel > 0 THEN Wheel_Travel_Direction[wheel] = (2 * Pi +
ATN(Total_x_vel / Total_y_vel)) MOD 2 * Pi
IF Total_y_vel = 0 THEN Wheel_Travel_Direction[wheel] = .25 * Pi * 2 *
SGN(Total_X_Vel) //Where SGN is the algebraic sign.
--
Slip_Angle = Car_Heading - Wheel_Travel_Direction[wheel] +
Steering_Angle[wheel] + ToeAngle[wheel] //Might as well get the toe angle in
there too while you're at it ;-)
----
----
If that's too ugly and messy looking, just draw a nice picture of the car from
the top down view. Draw a line from the center of mass to a wheel, then draw a
perpendicular line to that which would show what direction the wheel would be
moving if the car was rotating around its center of mass, but not moving
forwards/backwards/sideways at all. Then find the actual velocity at each
wheel from rotation, split it into the x/y components (which IS the velocity
vector, it's just two variables that store the x/y velocity) and add it to the
car's velocity vector. Then get the angle between that and the direction the
tire is pointing, and viola, there's the slip angle in 2-D :-D
Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com
My little car sim screenshots:
http://performancesimulations.com/scnshot4.htm