Qualitative tire temperature model
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5454 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: b2321cf21004e782e12525f0492d518fe7a7892b Former-commit-id: c7c0d9717fbf9e7c93b8fecc4044d64de83489bb
This commit is contained in:
parent
6a189c7db8
commit
3d208eb809
3 changed files with 50 additions and 0 deletions
|
@ -57,6 +57,11 @@ SimCarConfig(tCar *car)
|
||||||
if (strcmp(enabling, VAL_YES) == 0) {
|
if (strcmp(enabling, VAL_YES) == 0) {
|
||||||
car->features = car->features | FEAT_REVLIMIT;
|
car->features = car->features | FEAT_REVLIMIT;
|
||||||
}
|
}
|
||||||
|
enabling = GfParmGetStr(hdle, SECT_FEATURES, PRM_TIRETEMPDEG, VAL_NO);
|
||||||
|
if (strcmp(enabling, VAL_YES) == 0) {
|
||||||
|
car->features = car->features | FEAT_TIRETEMPDEG;
|
||||||
|
}
|
||||||
|
|
||||||
/* continue with car parameters */
|
/* continue with car parameters */
|
||||||
car->dimension.x = GfParmGetNum(hdle, SECT_CAR, PRM_LEN, (char*)NULL, 4.7f);
|
car->dimension.x = GfParmGetNum(hdle, SECT_CAR, PRM_LEN, (char*)NULL, 4.7f);
|
||||||
car->dimension.y = GfParmGetNum(hdle, SECT_CAR, PRM_WIDTH, (char*)NULL, 1.9f);
|
car->dimension.y = GfParmGetNum(hdle, SECT_CAR, PRM_WIDTH, (char*)NULL, 1.9f);
|
||||||
|
|
|
@ -24,6 +24,9 @@ static const char *WheelSect[4] = {SECT_FRNTRGTWHEEL, SECT_FRNTLFTWHEEL, SECT_RE
|
||||||
static const char *SuspSect[4] = {SECT_FRNTRGTSUSP, SECT_FRNTLFTSUSP, SECT_REARRGTSUSP, SECT_REARLFTSUSP};
|
static const char *SuspSect[4] = {SECT_FRNTRGTSUSP, SECT_FRNTLFTSUSP, SECT_REARRGTSUSP, SECT_REARLFTSUSP};
|
||||||
static const char *BrkSect[4] = {SECT_FRNTRGTBRAKE, SECT_FRNTLFTBRAKE, SECT_REARRGTBRAKE, SECT_REARLFTBRAKE};
|
static const char *BrkSect[4] = {SECT_FRNTRGTBRAKE, SECT_FRNTLFTBRAKE, SECT_REARRGTBRAKE, SECT_REARLFTBRAKE};
|
||||||
|
|
||||||
|
tdble Tair = 273; //air temperature in K
|
||||||
|
tdble Ttrack = 283; //track temperature in K
|
||||||
|
|
||||||
void
|
void
|
||||||
SimWheelConfig(tCar *car, int index)
|
SimWheelConfig(tCar *car, int index)
|
||||||
{
|
{
|
||||||
|
@ -81,6 +84,16 @@ SimWheelConfig(tCar *car, int index)
|
||||||
wheel->relPos.ay = wheel->relPos.az = 0.0f;
|
wheel->relPos.ay = wheel->relPos.az = 0.0f;
|
||||||
wheel->steer = 0.0f;
|
wheel->steer = 0.0f;
|
||||||
|
|
||||||
|
/* temperature and degradation */
|
||||||
|
wheel->Ttire = Tair;
|
||||||
|
wheel->Topt = GfParmGetNum(hdle, WheelSect[index], PRM_OPTTEMP, (char*)NULL, 350.0f);
|
||||||
|
tdble coldmufactor = GfParmGetNum(hdle, WheelSect[index], PRM_COLDMUFACTOR, (char*)NULL, 1.0f);
|
||||||
|
coldmufactor = MIN(MAX(coldmufactor, 0.0f), 1.0f);
|
||||||
|
wheel->muTmult = (1 - coldmufactor) / ((wheel->Topt - Tair) * (wheel->Topt - Tair));
|
||||||
|
wheel->heatingm = GfParmGetNum(hdle, WheelSect[index], PRM_HEATINGMULT, (char*)NULL, 6e-5);
|
||||||
|
wheel->aircoolm = GfParmGetNum(hdle, WheelSect[index], PRM_AIRCOOLINGMULT, (char*)NULL, 12e-4);
|
||||||
|
wheel->speedcoolm = GfParmGetNum(hdle, WheelSect[index], PRM_SPEEDCOOLINGMULT, (char*)NULL, 0.25);
|
||||||
|
|
||||||
/* components */
|
/* components */
|
||||||
SimSuspConfig(hdle, SuspSect[index], &(wheel->susp), wheel->weight0, x0);
|
SimSuspConfig(hdle, SuspSect[index], &(wheel->susp), wheel->weight0, x0);
|
||||||
SimBrakeConfig(hdle, BrkSect[index], &(wheel->brake));
|
SimBrakeConfig(hdle, BrkSect[index], &(wheel->brake));
|
||||||
|
@ -158,6 +171,7 @@ void SimWheelUpdateForce(tCar *car, int index)
|
||||||
tdble s, sa, sx, sy; // slip vector
|
tdble s, sa, sx, sy; // slip vector
|
||||||
tdble stmp, F, Bx;
|
tdble stmp, F, Bx;
|
||||||
tdble mu;
|
tdble mu;
|
||||||
|
tdble tireCond = 1.0;
|
||||||
tdble reaction_force = 0.0f;
|
tdble reaction_force = 0.0f;
|
||||||
wheel->state = 0;
|
wheel->state = 0;
|
||||||
|
|
||||||
|
@ -246,6 +260,12 @@ void SimWheelUpdateForce(tCar *car, int index)
|
||||||
// load sensitivity
|
// load sensitivity
|
||||||
mu = wheel->mu * (wheel->lfMin + (wheel->lfMax - wheel->lfMin) * exp(wheel->lfK * wheel->forces.z / wheel->opLoad));
|
mu = wheel->mu * (wheel->lfMin + (wheel->lfMax - wheel->lfMin) * exp(wheel->lfK * wheel->forces.z / wheel->opLoad));
|
||||||
|
|
||||||
|
//temperature and degradation
|
||||||
|
if (car->features & FEAT_TIRETEMPDEG) {
|
||||||
|
tireCond = 1 - wheel->muTmult * (wheel->Ttire - wheel->Topt)*(wheel->Ttire - wheel->Topt);
|
||||||
|
mu *= tireCond;
|
||||||
|
}
|
||||||
|
|
||||||
F *= wheel->forces.z * mu * wheel->trkPos.seg->surface->kFriction; /* coeff */
|
F *= wheel->forces.z * mu * wheel->trkPos.seg->surface->kFriction; /* coeff */
|
||||||
|
|
||||||
// For debugging weather simultation on some tracks
|
// For debugging weather simultation on some tracks
|
||||||
|
@ -280,6 +300,24 @@ void SimWheelUpdateForce(tCar *car, int index)
|
||||||
car->carElt->_wheelSlipSide(index) = sy*v;
|
car->carElt->_wheelSlipSide(index) = sy*v;
|
||||||
car->carElt->_wheelSlipAccel(index) = sx*v;
|
car->carElt->_wheelSlipAccel(index) = sx*v;
|
||||||
car->carElt->_reaction[index] = reaction_force;
|
car->carElt->_reaction[index] = reaction_force;
|
||||||
|
car->carElt->_tyreEffMu(index) = mu;
|
||||||
|
|
||||||
|
tdble Work = 0.0;
|
||||||
|
/* update tire temperature and degradation */
|
||||||
|
if (car->features & FEAT_TIRETEMPDEG) {
|
||||||
|
//heat from the work of friction
|
||||||
|
Work = (wheel->forces.x * (wrl * CosA - wheel->bodyVel.x)
|
||||||
|
+ wheel->forces.y * (wrl * SinA - wheel->bodyVel.y)) * SimDeltaTime;
|
||||||
|
wheel->Ttire += Work * wheel->heatingm;
|
||||||
|
//air cooling
|
||||||
|
wheel->Ttire -= wheel->aircoolm * (1 + wheel->speedcoolm * v) * (wheel->Ttire - Tair) * SimDeltaTime;
|
||||||
|
//filling carElt
|
||||||
|
car->carElt->_tyreT_in(index) = wheel->Ttire;
|
||||||
|
car->carElt->_tyreT_mid(index) = wheel->Ttire;
|
||||||
|
car->carElt->_tyreT_out(index) = wheel->Ttire;
|
||||||
|
car->carElt->_tyreCondition(index) = tireCond;
|
||||||
|
}
|
||||||
|
printf("T=%g, W=%g\n",wheel->Ttire,Work);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,13 @@ typedef struct
|
||||||
tdble pressure; /* tire pressure */
|
tdble pressure; /* tire pressure */
|
||||||
tdble rel_vel; /* relative velocity - used for realstic suspension movement*/
|
tdble rel_vel; /* relative velocity - used for realstic suspension movement*/
|
||||||
|
|
||||||
|
tdble Ttire; /* tire temperature in K */
|
||||||
|
tdble Topt; /* optimal temperature in K, where mu maximal */
|
||||||
|
tdble muTmult; /* mu = mumax * (1 - muTmult*(T-Topt)^2) */
|
||||||
|
tdble heatingm; /* heating multiplier */
|
||||||
|
tdble aircoolm; /* air cooling multiplier */
|
||||||
|
tdble speedcoolm; /* how aircoolm increases with speed */
|
||||||
|
|
||||||
tDynAxis in;
|
tDynAxis in;
|
||||||
tDynAxis feedBack;
|
tDynAxis feedBack;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue