1
0
Fork 0

"min throttle" tunable from Maik:

Background are problems modeling the rotax 912 engine. The idle speed
of the real engine is about half of the speed I could achieve with the
default minimum manifold pressure. While on ground I can switch off
the engine by pulling the throttle. The audible difference between the
different minimum idle speed (real vs. simulated) is extreme. With the
patch I get quite realistic sound. For the rotax engine I use
min-throttle="0.05" which is half of the former default value.
This commit is contained in:
andy 2009-02-24 00:16:03 +00:00 committed by Tim Moore
parent 8b98937e4d
commit 4a683bed1e
3 changed files with 12 additions and 1 deletions

View file

@ -801,6 +801,9 @@ void FGFDM::parsePistonEngine(XMLAttributes* a)
if(a->hasAttribute("compression"))
eng->setCompression(attrf(a, "compression"));
if(a->hasAttribute("min-throttle"))
eng->setMinThrottle(attrf(a, "min-throttle"));
if(a->hasAttribute("turbo-mul")) {
float mul = attrf(a, "turbo-mul");
float mp = attrf(a, "wastegate-mp", 1e6) * INHG2PA;

View file

@ -36,6 +36,7 @@ PistonEngine::PistonEngine(float power, float speed)
_mixCoeff = realFlow * 1.1f / _omega0;
_turbo = 1;
_minthrottle = 0.1;
_maxMP = 1e6; // No waste gate on non-turbo engines.
_wastegate = 1;
_charge = 1;
@ -72,6 +73,11 @@ void PistonEngine::setCompression(float c)
_compression = c;
}
void PistonEngine::setMinThrottle(float m)
{
_minthrottle = m;
}
float PistonEngine::getMaxPower()
{
return _power0;
@ -147,7 +153,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
// We need to adjust the minimum manifold pressure to get a
// reasonable idle speed (a "closed" throttle doesn't suck a total
// vacuum in real manifolds). This is a hack.
float _minMP = (-0.008 * _turbo ) + 0.1;
float _minMP = (-0.008 * _turbo ) + _minthrottle;
_mp = pressure * _charge;

View file

@ -14,6 +14,7 @@ public:
void setTurboParams(float mul, float maxMP);
void setDisplacement(float d);
void setCompression(float c);
void setMinThrottle(float m);
void setWastegate(float norm) { _wastegate = norm; }
void setSupercharger(bool hasSuper) { _hasSuper = hasSuper; }
void setTurboLag(float lag) { _turboLag = lag; }
@ -47,6 +48,7 @@ private:
float _wastegate; // wastegate setting, [0:1]
float _displacement; // piston stroke volume
float _compression; // compression ratio (>1)
float _minthrottle; // minimum throttle [0:1]
// Runtime state/output:
float _mp;