From e4142d94d4d87b3504d5e58db6936c5ff70d3466 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 22 Mar 2005 18:17:08 +0000 Subject: [PATCH] I fixed the gear-ratio handling in the solution computations a while back, but forgot to put the same fix into the runtime code. Also added some comments so I don't get confused again the next time I come through here. :) --- src/FDM/YASim/PropEngine.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FDM/YASim/PropEngine.cpp b/src/FDM/YASim/PropEngine.cpp index 7930f26ca..866ef8165 100644 --- a/src/FDM/YASim/PropEngine.cpp +++ b/src/FDM/YASim/PropEngine.cpp @@ -125,8 +125,11 @@ void PropEngine::stabilize() _eng->calc(_pressure, _temp, _omega); _eng->stabilize(); - // Compute torque as seen by the engine's end of the - // gearbox. + // Compute torque as seen by the engine's end of the gearbox. + // The propeller will be moving more slowly (for gear ratios + // less than one), so it's torque will be higher than the + // engine's, so multiply by _gearRatio to get the engine-side + // value. ptau *= _gearRatio; float etau = _eng->getTorque(); float tdiff = etau - ptau; @@ -173,6 +176,7 @@ void PropEngine::integrate(float dt) _eng->setFuelState(_fuel); _prop->calc(_rho, speed, _omega * _gearRatio, &thrust, &propTorque); + propTorque *= _gearRatio; _eng->calc(_pressure, _temp, _omega); _eng->integrate(dt); engTorque = _eng->getTorque(); -- 2.39.5