Board index FlightGear Development Aircraft Systems

Help with Su-27 fuel system

Modeling aircraft systems, like electrical stuff, hydraulics, pneumatics? Feel free to ask support.

Help with Su-27 fuel system

Postby yanes » Fri Oct 14, 2016 9:11 pm

Hi all FG'ers ,
I hope you are all fine ,
In the process of developping theSu-27 fuel system and by reading the wiki articles and other topics
I did this :

fuel.xml

but when including it as system in the aircraft's fdm file , I see the following oputput in the console :
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods



so what's happening , I can't figure out the cause of this warning ,

and actually :wink: I have some other issues with this :
One :
the aircraft has the following fuel tanks config :
Image
with


-0 tank 1 : 3180 kg (7010.70 lbs) : forward integral fuel tank
-0 tank 2 : 4160 kg (9171.23 lbs) : centre-section integral fuel tank
-0 tank 3 : 1060 kg (1168.45 lbs *2 wing tanks) : wings integral fuel tanks
-0 tank 4 : 1000 kg (2204.62 lbs) :Rear fuselage tank
====> TOTAL - 9400 kg.
(that's about 12000L with an average kerosene density of 0.785kg/dm³)


I'm stil far from writing an accurate realistic system beacause of the complicated consumption sequence which is :
-45% from the tank 1.
-empty tank 4.
-empty tank 1.
-15% from tank 2.
-empty tank 3.
-empty tank 2

That's of course is to keep the (well known Su-27) super-maneuvrability .
so at startup tanks should be filled equally in percentage (the same % from each tank overall capacity , I set it to 50% ).
Now the question is is this sequence implementable in FG ? (even with a spaghetti style code "I think it will be ,for sure :D :D ")
Two:
the fuel transfert between tanks starts immediatly as the simulation begins , I thinks with "/fdm-initialized"
so can we bind it with a property that delay it until "/engine[x]/running" for example ?
this should be more realistic and the current behaviour is totally incorrect .
so, that's it , Any help or advice is appreciated ,
Thanks in advance ,
Yanes .
Last edited by yanes on Sat Oct 15, 2016 11:37 pm, edited 2 times in total.
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 1:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: Help with Fuel system

Postby AndersG » Fri Oct 14, 2016 9:25 pm

The warnings
Code: Select all
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods

would be due to unnamed JSBSim components. They all need a unique name (=a unique property).
In the JSBSim XML the name is set by the name attribute for the component element, e.g.
Code: Select all
  <fcs_function name="hydro/active-norm">
   <description>
...
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2448
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Help with Fuel system

Postby PINTO » Fri Oct 14, 2016 9:39 pm

Re: fuel sequencing, yeah that's possible. It'll just take a little bit of time. I wrote one for the SR-71 that was quite complex. The thing with JSBsim fuel systems though is that you have to be careful of "ghost fuel", or fuel getting created out of thin air or fuel disappearing to nowhere.
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 945
Joined: Wed Oct 21, 2015 6:28 pm
Callsign: pinto
Version: 2016.3.0
OS: Win10

Re: Help with Fuel system

Postby yanes » Fri Oct 14, 2016 9:53 pm

Thank you for replying
@ AndersG : do you advice me to check for duplicated name for jsb componnets ?

@ PINTO : This is the biggest problem , since you did , do you have tips , or point to some articles or guides ,
I look to your system on the SR-71 , I hope it's the version in the repos . or please post it !
Best regards
Yanes
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 1:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: Help with Fuel system

Postby PINTO » Fri Oct 14, 2016 10:31 pm

It's not in the repos because it's a fork of the old SR71, not the "uber-approved" version. The fuel code is here, and you can see the fuel sequencing in the manual here.

You're on the right track. If fuel is decreasing while the engines aren't running then there's a bug in your code somewhere that you need to find (i.e. fuel is disappearing). If you've set up both engines to collect from tank[1], then tank[1] should only decrease when the engines are running. You then would code fuel to flow into tank[1] from the other tanks when there is room in tank[1].
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 945
Joined: Wed Oct 21, 2015 6:28 pm
Callsign: pinto
Version: 2016.3.0
OS: Win10

Re: Help with Fuel system

Postby wlbragg » Sat Oct 15, 2016 4:29 am

@yanes,

Take a look at the fuel configuration in the J3Cub and the c172p. It may have some features that might help you. The J3Cub/PA-18 is using tanks in the following configuration

Single center tank tied to
65hp engine (in J3Cub config)
90hp engine (in J3Cub config)

Twin wing tanks tied to
90hp engine (in PA-18 config)
150hp engine (in PA-18 config)

This is done with the addition of helper tanks, (we treat them like floats chambers), they may be useful for your purposes as they could just as well be virtual tanks to get the configurations you want.

See J3Cub/Systems/fuel.xml and the main FDM file in J3Cub/J3Cub.xml. Same for the c172p.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4989
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Help with Fuel system

Postby yanes » Sat Oct 15, 2016 11:34 pm

Thank you for the help guys,
I think I solved it (until more tests are performed )
the fuel flow now begins with the "/controls/engines/engine[0 and 1]/fuel-pump " which will be updated at engines startup .
The sequencing also seems to be great after adding some <test> nodes and a function that cheks the percentages between tanks .
However I still have the message :
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods
Failed to tie property fcs/ to object methods


I think (but not sure at all) that's due to the relative props paths(like"propulsion/tank[4]/collector-valve") to the fdm root prop .
in this case changing to the full paths will solve the issue , But I dont find that correct from coding perspective .

that my current fuel system if someone wants to take look .
Code: Select all
<?xml version="1.0"?>

 
<system name="Fuel">
<!-- tank[1] collector tank connected to the engine fuel pump,
 tank[0], tank[2],tank[3] and tank[4] feeds the collector through valves.
Negative Gs (<-0.5g) cuts the supply to the collector tanks -->

   <property value="1">propulsion/tank[0]/collector-valve</property>
   <property value="1">propulsion/tank[2]/collector-valve</property>
   <property value="1">propulsion/tank[3]/collector-valve</property>
   <property value="1">propulsion/tank[4]/collector-valve</property>
   
  <function name="propulsion/tank[4]/tnk0-qt">
      <description>quotient towards tank0</description>
      <quotient>
         <property>propulsion/tank[4]/contents-lbs</property>
         <property>propulsion/tank[0]/contents-lbs</property>
      </quotient>
   
  </function>


  <channel name="Fuel pumping">   

    <switch>
         <!-- Tank[0] to Collector tank[1]  -->
      <default value="-5"/>
      <test logic="OR" value="0">
            /controls/engines/engine/fuel-pump EQ 0
            /controls/engines/engine[1]/fuel-pump EQ 0
            
        propulsion/tank[0]/collector-valve EQ 0
        propulsion/tank[0]/contents-lbs LE 0
        propulsion/tank[1]/contents-lbs GE 9170.23 <!-- 1 lb below capacity -->
        accelerations/Nz LE -0.5
      </test>
      <output>propulsion/tank[0]/external-flow-rate-pps</output>
    </switch>

    <switch>
         <!-- Tank[2] to Collector tank[1]  -->
      <default value="-5"/>
      <test logic="OR" value="0">
            /controls/engines/engine/fuel-pump EQ 0
            /controls/engines/engine[1]/fuel-pump EQ 0
            propulsion/tank[0]/contents-lbs GE 1   <!-- Needed for sequencing -->
            propulsion/tank[4]/contents-lbs GE 1   <!-- Needed for sequencing -->      
            
        propulsion/tank[2]/collector-valve EQ 0
        propulsion/tank[2]/contents-lbs LE 0
        propulsion/tank[1]/contents-lbs GE 9170.23 <!-- 1 lb below capacity -->
        accelerations/Nz LE -0.5
      </test>
      <output>propulsion/tank[2]/external-flow-rate-pps</output>
    </switch>
   
    <switch>
         <!-- Tank[3] to Collector tank[1]  -->
      <default value="-5"/>
      <test logic="OR" value="0">
            /controls/engines/engine/fuel-pump EQ 0
            /controls/engines/engine[1]/fuel-pump EQ 0   
            propulsion/tank[0]/contents-lbs GE 1   <!-- Needed for sequencing -->
            propulsion/tank[4]/contents-lbs GE 1   <!-- Needed for sequencing -->      
            
        propulsion/tank[3]/collector-valve EQ 0
        propulsion/tank[3]/contents-lbs LE 0
        propulsion/tank[1]/contents-lbs GE 9170.23 <!-- 1 lb below capacity -->
        accelerations/Nz LE -0.5
      </test>
      <output>propulsion/tank[3]/external-flow-rate-pps</output>
    </switch>
   
    <switch>
         <!-- Tank[4] to Collector tank[1]  -->
      <default value="-5"/>
      <test logic="OR" value="0">
            /controls/engines/engine/fuel-pump EQ 0
            /controls/engines/engine[1]/fuel-pump EQ 0   
            /fdm/jsbsim/propulsion/tank[4]/tnk0-qt LE 0.57   <!-- Needed for sequencing -->   
            
        propulsion/tank[4]/collector-valve EQ 0
        propulsion/tank[4]/contents-lbs LE 0
        propulsion/tank[1]/contents-lbs GE 9170.23 <!-- 1 lb below capacity -->
        accelerations/Nz LE -0.5
      </test>
      <output>propulsion/tank[4]/external-flow-rate-pps</output>
    </switch>

    <summer>
      <input>-propulsion/tank[0]/external-flow-rate-pps</input>
      <input>-propulsion/tank[2]/external-flow-rate-pps</input>
      <input>-propulsion/tank[3]/external-flow-rate-pps</input>
      <input>-propulsion/tank[4]/external-flow-rate-pps</input>
      <output>propulsion/tank[1]/external-flow-rate-pps</output>
    </summer> 

  </channel>     

</system>

User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 1:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: Help with Su-27 fuel system

Postby Necolatis » Sun Oct 16, 2016 2:00 am

Stuff like <switch> and <summer> is missing name. Even if you explicit specify an output, you must still supply a name.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2032
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Help with Su-27 fuel system

Postby yanes » Sun Oct 16, 2016 9:13 am

Thank you Necolatis , this may be a good interpretation ,
I'll take a look , and report the results
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 1:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux


Return to Systems

Who is online

Users browsing this forum: No registered users and 0 guests