On Monday 07 January 2008 20:00, John Wojnaroski wrote: > LeeE wrote: > >On Monday 07 January 2008 18:24, LeeE wrote: > >>On Monday 07 January 2008 11:07, Chris Metzler wrote: > >>>On Sun, 6 Jan 2008 23:00:22 +0000 > >>> > >>>LeeE wrote: > >>>>Can anyone else confirm this problem on the OSG cvs branch? > >>> > >>>Yes, I see it too, and have for at least a couple of weeks. > >>> > >>>-c > >> > >>Thanks - confirms it's not just a local problem here. > >> > >>LeeE > > > >Searching through Aircraft/controls.hxx gives > > > > enum { > > ALL_TANKS = -1, > > MAX_TANKS = 8 > > }; > > > >but in Aircraft/controls.cxx there's > > > >FGControls::set_feed_tank( int engine, int tank ) > >{ > > if ( engine == ALL_ENGINES ) { > > for ( int i = 0; i < MAX_ENGINES; i++ ) { > > feed_tank[i] = tank; > > CLAMP( &feed_tank[i], -1, 4 ); > > } > > } else { > > if ( (engine >= 0) && (engine < MAX_ENGINES) ) { > > > > CLAMP( &feed_tank[engine], -1, 4 ); > > } > > } > > // feed_tank[engine] = engine; > >} > > > >If these bits of code are relevant to the problem MAX_TANKS > > seems too low - many large aircraft will have more than 8 fuel > > tanks. > > > >If I understand CLAMP syntax correctly, it's limiting the value > > to 4, which ties in with the number of tank nodes that are > > created by default. > > > >I didn't find any other occurrences of 'tank' in the FG source > > code that seemed relevant. > > > >LeeE > > > >---------------------------------------------------------------- > >--------- Check out the new SourceForge.net Marketplace. > >It's the best place to buy or sell services for > >just about anything Open Source. > >http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net > >/marketplace _______________________________________________ > >Flightgear-devel mailing list > >Flightgear-devel@lists.sourceforge.net > >https://lists.sourceforge.net/lists/listinfo/flightgear-devel > > I'm, pretty certain that might be my code for the handling a 747 > fuel system. It has nothing to do with how nasal handles fuel. > > In a nut shell, the 747 plumbing feeds the engines from 5 tanks, > the center and four wing tanks through a combination of shutoff > controls and cross-feed valves. In graph theory this can be > represented as a fully connected graph where any engine can > "suck" fuel from any one of the five tanks or any tank can feed > all four engines. Reserve tanks transfer fuel to the main feed > tanks, but CANNOT feed the engines via the fuel manifold. So > yes, you can have more tanks than those that directly feed > engines. In the 747 or any large complex system, mess up your > fuel panel and you starve an engine. This is accurately modeled > in the 747 sim. > > The 747 FMS model determines which tank is feeding which engine > and sets the value of "tank" accordingly. A "-1" indicates no > fuel connection for the engine. This value in turn is passed to > FG via the native_ctrls protocol/packet and passed in turn to > JSBSim via the jsbsim.cxx module. Unfortunately, the supporting > code is not part of the JSBSim baseline so it is impossible to > see how it works , although it has been submitted a while back. > You can see the supporting source changes by downloading the tar > file of the code used at a Mathworks expo and will be usedat the > upcoming Linux show in February. Look at the FGEngine.cxx, > jsbsim,cxx and FGTurbine.cxx modules in the modified jsbsim code. > > Personally, I don't like the way fuel is currently modeled in FG > and really don't like using a scripting language to do real-time > execution, but that's just me I guess ;-) Happy to share the > code and my ideas, but not the primary author or responsible > agent for that capability so I live with the problem and update > my version of the source as required with each FG release. > > Regards > John W.
More information is helpful & useful - thanks. Yeah - script based routines for things like fuel handling doesn't seem right but Nasal, because of the timer functions, is effectively real-time - it's just a question of resolution - for fuel handling 1/3 sec seems reasonable. Not @ you John, but the bottom line regarding this bug is that four fuel tanks nodes are created by default but they're not fully populated when they are created - they cannot be. The fuel tank nodes cannot be fully populated until the fdm config is parsed because the number of fuel tanks, and their capacities, depends upon each individual aircraft. I can see how it may be necessary to declare a single initial fuel tank node as a template but declaring four seems irrational. The best hits I found in the source, having found nothing in the config data, were those two bits of code I pasted above but if they are not relevant to the problem then we need to look elsewhere. For sure, four incomplete fuel tank nodes are _not_ being created by magic:) Sorry to all for being a nag but it is a bit of a fundamental bug. LeeE ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel