VD background
usually to simualate vehicle dynamic(VD) system, either by physical model, e.g. pysical models of engine, gearbox, powertrain; or parameter model, which doesn’t take into the physical process of the dynamic system, but tracking the system’s input, output and fit their relationship with polynomail equation or functions with multi-pieces.
traction force
is derived from engine torque, which goes to gearbox(powertrain system) and then divided by radius of wheels, then distribute to wheels.
traction torque
air drag
air lift force
traction force
$$ F(traction) = F(air drag) + F(air lift force) + F(tire drag) + acc * mass $$
in a detail way, the equation above should split into lateral state equation and longitudional state equation, if consider driver control module, which will give laterl control equation
and longitudional control equation
.
brake torque and ABS system
ABS(anti-block system) works in the situation, when driver input brake torque
is larger than the max ground-tire torque
can attached between tire and ground.
once max ground-tire torque
is achieved, namely the max fore-aft force T
is achived, the traction direction traction slip angular
decceleration will leap, this is the dead-blocking situation, and when it happens, the driver input brake torque
is saturated.
to avoid block situation happens, usually track decelleration of traction slip angular
during brake torque
increase, if the value of decelleration of slip traction angular
is beyond a threshold value, ABS controller will trigger to decease brake torque
.
drive stability
the driving stability is mainly due to forces on tires, sepcially the lateral angular velocity derived from Lateral Force
lateral control
taking driver as one element, the driveing system is a close-loop control system. the system works on a road situation:
- the driver pre-expect a driving path(predefined path) and operate the steering wheel to some certain angular
- the vehicle take a move with a real driving path(real path)
- the real path is not exactly fitted to the predefined path, leading the driver take an additional conpensation control
longitudinal control
similar as lateral control
VD in Unity
any vehicle in Unity is a combination of: 4 wheels colliders and 1 car collider.
WheelConllider
1) AxleInfo
AxleInfo
represents the pair of wheels, so for 4-wheel vehicle, there are two AxleInfo objects.
|
|
2) core parameters
wheel damping rate
suspension distance
Force apply point distance (where ground force act on wheel)
suspension spring
forwardSlip(slip angle), tire slip in the rolling(tractional) direction, which is used in calculating torque
sidewaySlip, the lateral direction slip, which leads to stability issue.
3) visualization
the WheelCollider
GameObject is always fixed relative to the vehicle body, usually need to setup another visual GameObject to represent turn and roll.
|
|
4) WheelCollider.ConfigureVehicleSubsteps
|
|
Every time a fixed update happens, the vehicle simulation splits this fixed delta time into smaller sub-steps and calculates suspension and tire forces per each smaller delta. Then, it would sum up all resulting forces and torques, integrate them, and apply to the vehicle’s body.
5) WheelCollider.GetGroundHit
return the ground collision data for the wheel, namely WheelHit
wheel friction curve
for wheels’ forward(rolling) direction and sideways direction, first need to determine how much the tire is slipping, which is based on speed difference between the tire’s rubber and the road,
then this slip is used to find out the tire force exerted on the contact point
the wheel friction curve taks a measure of tire slip as an Input and give a force as output.
The property of real tires is that for low slip they can exert high forces, since the rubber compensates for the slip by stretching. Later when the slip gets really high, the forces are reduced as the tire starts to slide or spin
1) AnimationCurve
unity official
store a collection of Keyframes that can be evaluated over time
vehicleController() in lg-sim
1) the controllable parameters:
|
|
2) math interpolate function used
Mathf.Lerp(a, b, t)
a -> the start value
b -> the end value
t -> the interpolation value between start and end
3) fixedUpdate()
|
|
4) ApplyTorque()
|
|
5) TractionControl()
|
|
in lg-sim, the VD model is still simple, as there is only traction/logitudional control.