PhysX仿真车研究

来源:互联网 发布:双色球内部数据库 编辑:程序博客网 时间:2024/05/30 23:03

Solve the system of engine speed + wheel rotation speeds using an implicit integrator.
用隐式积分求解发动机转速+车轮转速的系统。


The following functions only compute the speed of wheels connected to the diff.
以下功能只计算连接到不同的车轮速度


Worth going to the length of the implicit integrator because after gear changes the difference in speed at the clutch can be hard to integrate.
值得去的隐式积分的长度,因为齿轮改变后,在离合器的速度的差异,可以很难整合。


Separate functions for 4W, NW and tank because the differential works in slightly different ways.
各自方法4W,NW和坦克因为差略有不同的方式工作。


  With driveNW we end up with (N+1)*(N+1) problem, with drive4W we end up with 5*5 and with tanks we end up with just 3*3.
与drivenw我们结束了(n + 1)*(n + 1)的问题,与drive4w我们结束了5×5和坦克我们最终只有3×3。


 Tanks use the method of least squares to apply the rule that all left/right wheels have the same speed.
坦克使用最小二乘法适用的规则,所有的左/右车轮有相同的速度。


 Remember that the following functions don't integrate wheels not connected to the diff so these need integrated separately.
记住以下功能不整合没有连接到不同的这些需要分别集成轮。



torque at clutch:  离合器的扭矩: tc = K*{G*[alpha0*w0 + alpha1*w1 + alpha2*w2 + ..... alpha(N-1)*w(N-1)] - wEng}

内容如下:

(i)   G is the gearing ratio, (ii)  alphai is the fractional contribution of the ith wheel to the average wheel speed at the clutch (alpha(i) is zero for undriven wheels).
(我)G是齿轮比率,              (ii)alphai是第i轮在离合器的平均车速的分数贡献                                                                           (alpha(i) 对无驱动轮值总是零)。

(iii) wi is the angular speed of the ith wheel.

     (iii)wi是第i轮的角速度。
        (iv)  K is the clutch strength .
(四)K是离合器的强度。
(v)   wEng is the angular speed of the engine。

      (V)wEng 是发动机的角速度。


torque applied to ith wheel is 应用于第i轮扭矩公式 :ti = G*gammai*tc + bt(i) + tt(i) 

gammai is the fractional proportion of the clutch torque that the differential delivers to the ith wheel.
        gammai是离合器的转矩,微分提供到第i轮分数比例。


bt(i) is the brake torque applied to the ith wheel.
        是应用于第i轮制动力矩。

tt(i) is the tire torque applied to the ith wheel.
               是轮胎和第i轮的扭矩。


acceleration applied to ith wheel is: 
ai = G*gammai*K*{G*[alpha0*w0 + alpha1*w1 alpha2*w2 + ..... alpha(N-1)*w(N-1)] - wEng}/Ii + (bt(i) + tt(i))/Ii
wheer Ii is the moi of the ith wheel


express ai as 
ai = [wi(t+dt) - wi(t)]/dt
and rearrange
wi(t+dt) - wi(t)] = dt*G*gammai*K*{G*[alpha0*w0(t+dt) + alpha1*w1(t+dt) + alpha2*w2(t+dt) + ..... alpha(N-1)*w(N-1)(t+dt)] - wEng(t+dt)}/Ii + dt*(bt(i) + tt(i))/Ii


Do the same for tEng (torque applied to engine)
tEng  = -tc + engineDriveTorque
where engineDriveTorque is the drive torque applied to the engine
Assuming the engine has unit mass then
wEng(t+dt) -wEng(t) = -dt*K*{G*[alpha0*w0(t+dt) + alpha1*w1(t+dt) + alpha2*w2(t+dt) + ..... alpha(N-1)*w(N-1(t+dt))] - wEng(t+dt)}/Ieng + dt*engineDriveTorque]/IEng


Introduce the vector w=(w0,w1,w2....w(N-1), wEng)
and re-express as a matrix after collecting all unknowns at (t+dt) and knowns at time t.
A*w(t+dt)=b(t);


通过 PX_FORCE_INLINE void setEngineRotationSpeed(const PxF32 speed)控制发动机的转速;

0 0