Attempt at a fix for the propeller torque problems in the
"slow/windmilling propeller" regime. I'm happy with the foundations of the solution, but this hasn't been complete tested yet. The solution behavior seems fine on the planes I tried.
This commit is contained in:
parent
b1c964030d
commit
9f2a8d4651
1 changed files with 28 additions and 36 deletions
|
@ -58,55 +58,47 @@ void Propeller::setPropPitch(float proppitch)
|
||||||
void Propeller::calc(float density, float v, float omega,
|
void Propeller::calc(float density, float v, float omega,
|
||||||
float* thrustOut, float* torqueOut)
|
float* thrustOut, float* torqueOut)
|
||||||
{
|
{
|
||||||
if (_manual) {
|
// For manual pitch, exponentially modulate the J0 value between
|
||||||
float pps = _proppitch * 0.9999f; // avoid singularity
|
// 0.25 and 4. A prop pitch of 0.5 results in no change from the
|
||||||
pps = 1 + ( Math::pow(pps,-1/(pps-1)) - Math::pow(pps,-pps/(pps-1)) );
|
// base value.
|
||||||
_j0 = (4*_baseJ0) - ( ((4*_baseJ0) - (0.26f*_baseJ0)) * pps );
|
if (_manual)
|
||||||
}
|
_j0 = _baseJ0 * Math::pow(2, 4*_proppitch - 2);
|
||||||
|
|
||||||
float tipspd = _r*omega;
|
float tipspd = _r*omega;
|
||||||
float V2 = v*v + tipspd*tipspd;
|
float V2 = v*v + tipspd*tipspd;
|
||||||
|
|
||||||
// Clamp v (forward velocity) to zero, now that we've used it to
|
// Sanify
|
||||||
// calculate V (propeller "speed")
|
|
||||||
if(v < 0) v = 0;
|
if(v < 0) v = 0;
|
||||||
|
|
||||||
// The model doesn't work for propellers turning backwards.
|
|
||||||
if(omega < 0.001) omega = 0.001;
|
if(omega < 0.001) omega = 0.001;
|
||||||
|
|
||||||
float J = v/omega;
|
float J = v/omega; // Advance ratio
|
||||||
float lambda = J/_j0;
|
float lambda = J/_j0; // Unitless scalar advance ratio
|
||||||
|
|
||||||
float torque = 0;
|
// There's an undefined point at lambda == 1.
|
||||||
if(lambda > 1) {
|
if(lambda == 1.0f) lambda = 0.9999f;
|
||||||
lambda = 1.0f/lambda;
|
|
||||||
torque = (density*V2*_f0*_j0)/(4*_etaC*_beta*(1-_lambdaPeak));
|
|
||||||
}
|
|
||||||
|
|
||||||
// There's an undefined point at 1. Just offset by a tiny bit to
|
float l4 = lambda*lambda; l4 = l4*l4; // lambda^4
|
||||||
// fix (note: the discontinuity is at EXACTLY one, this is about
|
float gamma = (_etaC*_beta/_j0)*(1-l4); // thrust/torque ratio
|
||||||
// the only time in history you'll see me use == on a floating
|
|
||||||
// point number!)
|
|
||||||
if(lambda == 1.0) lambda = 0.9999f;
|
|
||||||
|
|
||||||
// Calculate lambda^4
|
// Compute a thrust coefficient, with clamping at very low
|
||||||
float l4 = lambda*lambda; l4 = l4*l4;
|
// lambdas (fast propeller / slow aircraft).
|
||||||
|
|
||||||
// thrust/torque ratio
|
|
||||||
float gamma = (_etaC*_beta/_j0)*(1-l4);
|
|
||||||
|
|
||||||
// Compute a thrust, clamp to takeoff thrust to prevend huge
|
|
||||||
// numbers at slow speeds.
|
|
||||||
float tc = (1 - lambda) / (1 - _lambdaPeak);
|
float tc = (1 - lambda) / (1 - _lambdaPeak);
|
||||||
if(_matchTakeoff && tc > _tc0) tc = _tc0;
|
if(_matchTakeoff && tc > _tc0) tc = _tc0;
|
||||||
|
|
||||||
float thrust = 0.5f * density * V2 * _f0 * tc;
|
float thrust = 0.5f * density * V2 * _f0 * tc;
|
||||||
|
float torque = thrust/gamma;
|
||||||
if(torque > 0) {
|
if(lambda > 1) {
|
||||||
torque -= thrust/gamma;
|
// This is the negative thrust / windmilling regime. Throw
|
||||||
thrust = -thrust;
|
// out the efficiency graph approach and instead simply
|
||||||
} else {
|
// extrapolate the existing linear thrust coefficient and a
|
||||||
torque = thrust/gamma;
|
// torque coefficient that crosses the axis at a preset
|
||||||
|
// windmilling speed. The tau0 value is an analytically
|
||||||
|
// calculated (i.e. don't mess with it) value for a torque
|
||||||
|
// coefficient at lamda==1.
|
||||||
|
float tau0 = (0.25f * _j0) / (_etaC * _beta * (1 - _lambdaPeak));
|
||||||
|
float lambdaWM = 1.2f; // lambda of zero torque (windmilling)
|
||||||
|
torque = tau0 - tau0 * (lambda - 1) / (lambdaWM - 1);
|
||||||
|
torque *= 0.5f * density * V2 * _f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*thrustOut = thrust;
|
*thrustOut = thrust;
|
||||||
|
|
Loading…
Reference in a new issue