David Megginson wrote:
I like the idea as well: it would be nice if the engine were its own
subsystem and we could mix-and-match engines and FDMs (let's try the
J3 cub with 180HP).  Unfortunately, the FDM people haven't been too
enthusiastic: in particular, JSBSim is supposed to run standalone as
well as inside FlightGear, so they need some kind of internal engine
model.
Well, I suppose it needs someone to show how the two aims can be compatible. But it's not easy; it would require becoming familiar with both implementations and re-arranging the interfaces a bit. While that's the sort of thing I do at work, I'm not yet in a position to do it here.


As for the guts of how the engines are modelled ... I first worked on the starting and stopping behaviour of the JSBsim engine. The thermodynamic model of the engine is probably very good but there's lots of yucky stuff there to do with starting etc. I've done some stuff there, and in the sound configuration, but not finished. I'll go into that later.

Then I looked at the YASim piston engine to see how that handles starting. Before I try to do anything in there I want to ask about some things (Andy?):

1. PistonEngine::calc says

// Calculate manifold pressure as ambient pressure modified for
// turbocharging and reduced by the throttle setting. According
// to Dave Luff, minimum throttle at sea level corresponds to 6"
// manifold pressure. Assume that this means that minimum MP is
// always 20% of ambient pressure. (But that's too much idle
// power, so use 10% instead!) But we need to produce _zero_
// thrust at that setting, so hold onto the "output" value
// separately. Ick.
_mp = pressure * (1 + _boost*(_turbo-1)); // turbocharger
float mp = _mp * (0.1f + 0.9f * _throttle); // throttle
_mp *= _throttle;

What's that bit about the separate "output" mp? An engine doesn't produce zero thrust at idle, just a low
thrust. And manifold pressure isn't supposed to be related to thrust in a simple way, is it?

Sorry to peer into a nasty bit. The beauty of Open Source is ... we can see the whole thing, warts and all! :-)

2. At the end of the same function,

_egt = corr * (power * 1.1f) / (massFlow * specHeat);
if(_egt < temp) _egt = temp;

When I'm running this at idle, _egt comes out at 80 (kelvin); presumably this should be added to ambient "temp" (which is 288) rather than clamped to it:

_egt = corr * (power * 1.1f) / (massFlow * specHeat);
_egt += temp;

3. The engine revs up and slows down very slowly. For example, when I cut the magnetos from 2000 RPM it takes over a minute to run down and stop. There is a negative torque added that should make it stop quickly, and I can't see what's wrong with it (that would have this effect). Actually, as acceleration of the engine is equally slow, perhaps the problem is in the transfer of the torque to the external propulsion system code - perhaps the wrong units?

4. That negative torque: "Interpolate it away as we approach cruise RPMs, though, to prevent interaction with the power computations. Ugly." Actually, the only way the variable "power" is used after that point is to compute the EGT, and that wants to know thermally developed power anyway (i.e. excluding the starter motor contribution and the friction reduction) so that should be fine. I think it would be correct to subtract the torque loss at all speeds - in fact, more loss at higher speeds because of gas flow turbulence etc.

By the way, the experimental values here were with j3cub-yasim because c172-yasim gives a solution failure for elevator. I have some local changes, but nothing in YASim or anything that I think could affect it - just in the JSBSim engine, sound handling, joystick, etc.


For all this, my original aim was just to get simple things like a realistic cranking speed of about 100 RPM, and some rotation sound while the engine is spinning down after being switched off!

- Julian



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Reply via email to