Re: [Flightgear-devel] Engine models: start-up and commonality between FDMs

2002-11-13 Thread David Luff
On 11/13/02 at 12:16 AM Julian Foad wrote:

David Luff wrote:
 
 It looks to me like you've
 got 2 too many curly brackets in doEnginePower, although I could be
 misunderstanding what you're doing there.

Yes, I have got too many.  This is the friction that was applied only 
when starting; I was making it permanent but haven't finished with it. 
Do you agree that it should be permanently in?  Does a constant torque 
sound about right?  That sounds more likely than constant power (which 
means decreasing torque), to me.  Conventional friction would give 
constant torque; I'm not sure how oil and air viscosity behave, but I'd 
expect the torque to increase at higher speeds rather than decrease.

Yes, friction mean effective pressure (basically torque non-dimensionalised
by engine volume) goes up with speed.  Typically it could be about 3 times
as great at 2500rpm as at idle.  IO360.cxx in LaRCsim has data from a
published friction model in it that reflects this, and this ought to be put
into FGPiston.cpp to provide resistance to windmilling operation and
cranking instead of the crappy -x HP that I had in there as a hack.  In
fact, I'm not entirely sure why it got left out - I think it went into
IO360.cxx after the JSBSim port and then never made the jump across.

In the long term I'd like to see it go in during running as well, together
with a model of how efficiently the fuel energy is converted to mechanical
energy, which should be quite portable across most GA piston engines.
However, the present power correlation we have is *brake* power, from
Phil's Cessna flight management computor (Phil being the guy who originally
started writing the file).  Hence we can't put the friction in during
normal running, or the power at the prop will be wrong, which will be
noticable in the normal flight envelope. 


I don't understand how it could have worked with no resistance 
implemented.  A propeller hardly provides any resistance at low speeds, 
so I would have thought you would have needed to tweak the developed 
power down to almost zero at idle.

Yes, it was hard to get the engine to idle slowly - in fact I'm not what we
did in the end!  I do recall that my first guess at starter motor torque
had to be revised downwards considerably since the imbalance caused the
speed to go unstable in the first time-step.



  What I am concerned about is the throttle minimum being set to 0.2. ...

Ah, thank you for explaining this.  I had not understood the mapping 
onto manifold pressure and the power correlation.  It certainly sounds 
like the power correlation is the thing to un-tweak instead!


This puzzled me: the manifold pressure seems to be modelled as (for a 
given throttle position) independent of speed.  When a real engine is 
running fast and you cut the throttle, the fast air flow will cause a 
very low manifold pressure which will then rise to its new steady value 
as the engine slows down.  Without this effect, throttle changes will 
not take effect as quickly as they should and the speed variation with 
load changes will not be right.  Maybe the effect is too small to be 
important?


I might be attempting too much here; I know how car engines work but 
don't have data to work from (or a lab), and I don't have experience of 
modelling them either.  I will tread carefully and check with you again 
when I make some more progress.

During engine running, manifold pressure is primarily a function of
throttle position, but yes, also affected by engine speed.  However, the
throttle position effect is considerably larger, and is currently all we
have in the model.  The effect with speed should be modelled though, in
order to make it harder to set a given engine speed and man pressure with a
variable pitch prop.  Obviously, in the limit when the engine speed is cut
to zero, the effect of speed dominates completely, and the man pressure
goes to ambient.  This is implemented.

Cheers - Dave  


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



Re: [Flightgear-devel] Engine models: start-up and commonality between FDMs

2002-11-12 Thread David Luff
On 11/12/02 at 12:28 AM Julian Foad wrote:
Ah, glad you're there.  If you're interested and have time to look, my 
current attempt is at

   http://www.btinternet.com/~julianfoad/fgfs/JSB_piston_engine.diff
   http://www.btinternet.com/~julianfoad/fgfs/engine_sound.diff

but, as I said, not finished.  (Well, it will never be finished.  I 
mean not completely satisfactory as a patch yet.)  It removes some of 
the arbitrary bits - especially the non-linear bits like if RPM  N 
then ... - and makes starting and idling nicer (especially at throttle 
less than the minimum allowed idle setting - it was fun running it below 
500 RPM, on the unstable side of its power curve, after I put the 
friction always present but before I put the idle adjust constant in 
there).

It looks good, although I haven't tried it out since I don't have any sound
drivers installed.  A couple of points though.  It looks to me like you've
got 2 too many curly brackets in doEnginePower, although I could be
misunderstanding what you're doing there.  What I am concerned about is the
throttle minimum being set to 0.2.  The throttle values are meant to
represent the available physical range of throttle movement using 0 - 1.0.
 I don't understand why you've put the 0.2 bottom limit in.  I assume real
planes will idle with the throttle on the stop in the same manner as a car.
 The air getting through in this case is set by the minimum manifold
pressure in the engine model.  By putting the 0.2 limit in you've
effectively changed the range of throttle movement to be 0.2 - 1.0 and
hence raised the minimum manifold pressure obtainable when running, which
was set at about 0.3bar MAP (~6inHg), a value I measured from an idling car
engine in the labs.  If this was what you really intended then you should
raise the min man pressure if you think its too low rather than munging the
lower throttle value.  If you think the min man pressure is OK but need
more power at the bottom end to overcome the friction you should tweak the
power correlation, which I had tweaked downwards in the idle region from
Phils original values in order to get it to idle slow enough in the absence
of friction.  All IMHO of course :-)

Cheers - Dave


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



Re: [Flightgear-devel] Engine models: start-up and commonality between FDMs

2002-11-10 Thread David Luff
On 11/10/02 at 4:02 AM Julian Foad wrote:

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 

Parts of it are, parts of it aren't and are overdue a re-visit.

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.


Ah yes, starting, I seem to recall a lot of hacking and kludging to get
everything to work :-)  There's a number of problems currently:

1/  My assumption of cranking speed at the time (480rpm!!!) was *way*
too high.

2/ There's currently no friction modelled, which means there's not enough
resistance to a proper starter motor torque at very low rpm when there's no
prop resistance (I put a friction model into the LaRCsim IO360.[ch]xx to
resist the prop when the engine was switched off in flight but I haven't
brought it over to the JSBSim one yet).

3/ Need a proper starter motor torque curve.  I did dig one out at one
point but never put it in and now I've lost it.  I'll have another look.
Part of the problem is that I have to make sure that I'm working from
publically available data and not anything internal.

Have fun :-)

Cheers - Dave



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



[Flightgear-devel] Engine models: start-up and commonality between FDMs

2002-11-07 Thread Julian Foad
I was having a look at the piston engine start-up code.  I absolutely 
love the way it chugs away for a second or two and then coughs into life 
- the sound effects really make it - but I wanted to make the speeds 
and stuff more realistic.   Looking at the JSBSim engine code, it uses 
lots of arbitrary speeds and time delays and abrupt transitions from one 
mode to another.  I have some improvements to this.

Much of this code in JSBSim is very similar to FDM/IO360.cxx which seems 
to be only used by LARCsim even though it is not in the LARCsim 
subdirectory; presumably one was derived from the other.  I really don't 
like duplication; I feel that any work I do on one of them is half 
wasted if it isn't automatically shared by the other.  And then there is 
Yasim's engine code.  Three piston engine models, each specific to its 
own FDM.  So I started thinking about deriving them all from a common 
PistonEngine interface with the aim of making the engine models 
interchangeable.  Haven't gone anywhere down this road yet, though.

Thoughts?

- Julian


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


re: [Flightgear-devel] Engine models: start-up and commonality between FDMs

2002-11-07 Thread David Megginson
Julian Foad writes:

  Much of this code in JSBSim is very similar to FDM/IO360.cxx which seems 
  to be only used by LARCsim even though it is not in the LARCsim 
  subdirectory; presumably one was derived from the other.  I really don't 
  like duplication; I feel that any work I do on one of them is half 
  wasted if it isn't automatically shared by the other.  And then there is 
  Yasim's engine code.  Three piston engine models, each specific to its 
  own FDM.  So I started thinking about deriving them all from a common 
  PistonEngine interface with the aim of making the engine models 
  interchangeable.  Haven't gone anywhere down this road yet, though.
  
  Thoughts?

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.


All the best,


David

-- 
David Megginson, [EMAIL PROTECTED], http://www.megginson.com/

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