Vehicle Wheel Speeds Unstable #96
-
Hi, When I run my PhysX vehicle simulation I get the following behaviour on the wheel speed reports when applying constant torque to all the wheels at low speeds: I'm using the following to retrieve wheel speeds for each wheel:
It looks like the wheel speeds jump between two distinct values randomly at lower speeds? The real speed of the wheels seem to be in the middle of these two values (Using derivative of wheel positions). It doesn't happen at higher speeds or when coasting to a stop (zero torque applied): Any help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is a consequence of a singularity in the tire longitudinal slip. If w is the wheel angular rotation speed, r is the wheel radius and vz is the rigid body velocity at the bottom of the wheel then we have:
A rough approximation of the longitudinal force is a linear function of longitudinal slip:
The problem is that at low forward speed (vz very near 0.0) we have a singularity in the longitudinal slip and force. For |vz| < 1.0 we have a large variability in long slip because small changes in vz lead to huge changes in longForce. When the vehicle slows down under damping and drag forces, we linearly interpolate between the simulated wheel speed and the rolling speed dictacted by the vehicle's forward speed at the wheel. This explains the smooth behaviour in the 3rd graph posted. We don't do this when drive torques are applied because we don't want to mask wheel slip that accumulates from aggressive throttling. This explains the noisy behaviour seen in graphs 1 and 2. There are 3 classes of solution available. TimestepsThe numerical error that accumulates will be roughly of order dt * dt so halving the timestep should reduce the numerical error by roughly one quarter. The first thing to try is to use smaller timesteps for the entire vehicle simulation step. The disadvantage of this approach is that the extra computation is only really needed at low speed so quite a lot of cycles are wasted. Try this first, though, to demonstrate that smaller timesteps do indeed have the desired effect. Assuming smaller timesteps have the desired effect, it is recommended to apply more substeps at low speeds. This avoids a lot of extra computation (eg scene queries) and targets the computational effort on the part of the simulation that needs the smaller dt. It is recommended to look at the snippets that ship wtih PhysX 5.x, paying special attention to the functions PxVehicleComponentSequence::beginSubstepGroup() and PxVehicleComponentSequence::endSubstepGroup(). Min Slip DenominatorThe basic idea here is to recast the long slip equation to avoid the singularity
The struct PxVehicleTireSlipParams has been introduced to allow the constant to be tuned in different scenarios. Increase the wheel moment of inertia (moi)Wheels that have low moi will be more prone to simulation noise. It is recommended to recheck the wheel moi just to make sure it is not unphysically small. |
Beta Was this translation helpful? Give feedback.
This is a consequence of a singularity in the tire longitudinal slip.
If w is the wheel angular rotation speed, r is the wheel radius and vz is the rigid body velocity at the bottom of the wheel then we have:
A rough approximation of the longitudinal force is a linear function of longitudinal slip:
The problem is that at low forward speed (vz very near 0.0) we have a singularity in the longitudinal slip and force. For |vz| < 1.0 we have a large variability in long slip because small changes in vz lead to huge changes in longForce.
When the vehicle slows down under damping and drag forces, we linearly interpolate between t…