Jump to content

Archived

This topic is now archived and is closed to further replies.

Steve Hess

Fuel tank priority

Recommended Posts

Steve, Post just the (FUEL) section of the aircraft.cfg for the aircraft that you want to make this for. I have some old code that may port over nicely. Do you have a manual fuel selector already, or just fuel valves? Do you want to make this fully automatic?Roman


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

Steve,Here is a logic gauge that I slapped together with the morning coffee as a brain waker-upper LOL!! Without the aircraft.cfg (Fuel) section I cannot test it as it is unknown what exact tanks you are using in the aircraft along w/ unusable values etc... The way it is written it can be easily modified for your application.RomanEDIT - I threw this assumed fuel config into the test aircraft and tested / fixed bugs. It works well but still need your (Fuel) section to adjust accordingly.In modes 3 & 6 (Mixing/Balance) it will keep tank difference to no greater than 1%.It will empty all tanks, in order, to 0%It will cooperate with autostart.. ( was a big bug there )

<Gauge Name="AUTO TANK SWITCHER" Version="1.0"><Macro Name="L_Drop">(A:FUEL TANK EXTERNAL1 LEVEL, percent)</Macro><Macro Name="R_Drop">(A:FUEL TANK EXTERNAL2 LEVEL, percent)</Macro><Macro Name="L_Wing">(A:FUEL TANK LEFT MAIN LEVEL, percent)</Macro><Macro Name="R_Wing">(A:FUEL TANK RIGHT MAIN LEVEL, percent)</Macro><Macro Name="Aft">(A:FUEL TANK CENTER2 LEVEL, percent)</Macro><Macro Name="Fwd">(A:FUEL TANK CENTER3 LEVEL, percent)</Macro><Macro Name="Has">0.025 ></Macro><Macro Name="Set">(>K:FUEL_SELECTOR_SET)</Macro><Macro Name="Selected">(A:FUEL TANK SELECTOR 1, enum)</Macro><Update Frequency="4"><!-- FIND WHAT TANKS HAVE FUEL IN THEM, THEN SELECT THE PROPER MODE FOR LOGIC - REFERENCE BELOW,0 = No Fuel, 1 = Left drop only, 2 = Right drop only, 3 = Mix drop tanks evenly, 4 = Left wing only, 5 = Right wing only, 6 = Mix wing tanks evenly, 7 = Aft tank, 8 = Fwd tankTHE ORDER BELOW HAS SIGNIFICANT VALUE!-->@Fwd @Has if{ 8 s1 }@Aft @Has if{ 7 s1 }@R_Wing @Has if{ 5 s1 }@L_Wing @Has if{ 4 s1 }@L_Wing @Has @R_Wing @Has and if{ 6 s1 }@R_Drop @Has if{ 2 s1 }@L_Drop @Has if{ 1 s1 }@L_Drop @Has @R_Drop @Has and if{ 3 s1 }<!-- APPLY MODE LOGIC TO FUEL TANK SELECTOR - REFERENCE BELOW,OFF = 0, ALL = 1, LEFT = 2, RIGHT = 3, L_AUX = 4, R_AUX = 5, CTR = 6, CTR2 = 7, CTR3 = 8, EXT1 = 9, EXT2 = 10, R_TIP = 11, L_TIP = 12, XFEED = 13, XL2R = 14, XR2L = 15, BOTH = 16, ALL_EXT = 17, ISOLATE = 18	  --><!-- BASIC NON-MIXING LOGIC -->l1 0 == @Selected 0 != and if{ 0 @Set }l1 1 == @Selected 9 != and if{ 9 @Set }l1 2 == @Selected 10 != and if{ 10 @Set }l1 4 == @Selected 2 != and if{ 2 @Set }l1 5 == @Selected 3 != and if{ 3 @Set }l1 7 == @Selected 7 != and if{ 7 @Set }l1 8 == @Selected 8 != and if{ 8 @Set }<!-- ADVANCED MULTI TANK BALANCING/MIXING -->l1 3 == if{ @L_Drop @R_Drop - -0.5 < @L_Drop @R_Drop == || if{ @Selected 10 != if{ 10 @Set } } els{ @L_Drop @R_Drop - 0.5 > if{ @Selected 9 != if{ 9 @Set } } } }l1 6 == if{ @L_Wing @R_Wing - -0.5 < @L_Wing @R_Wing == || if{ @Selected 3 != if{ 3 @Set } } els{ @L_Wing @R_Wing - 0.5 > if{ @Selected 2 != if{ 2 @Set } } } }</Update></Gauge>


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

Here is the fuel section of the cfg fileThank youfuel_type = 2number_of_tank_selectors = 1electric_pump = 1fuel_dump_rate = 0.0167Center1 = 0.000, 0.000, 0.000, 2700.000, 0.000Center2 = 0.000, 0.000, 0.000, 1350.000, 0.000LeftMain = 0.000, -8.000, 0.000, 400.000, 1.500RightMain = 0.000, 8.000, 0.000, 400.000, 1.500LeftAux = 0.000, -6.000, 0.000, 600.000, 1.500RightAux = 0.000, 6.000, 0.000, 600.000, 1.500

Share this post


Link to post
Share on other sites

It looks like we're on the right path here. The wing tanks feed at the same time (good) , but the external tanks feed one then the other (bad). They do feed in the correct order Ext then Wing (good). After the Ext and Wing tanks are empty, the Aft and Fwd tanks DO NOT feed at all and the engines shut off (very bad). If the Fwd and Aft tanks could also feed at the same time to help maintain CG that would be nice.Thank you for your HelpSteve

Share this post


Link to post
Share on other sites

Steve, Working on it, should be ready in an hour.. Need one clarification - Which tank is FWD Center? Center 1 or Center 2? right now they are both located at the same physical place on the aircraft.Roman


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

Steve,Whoah! Some big problems occurred if Autostart was ever used.. Not on the gauge side but MSs Programming of the Autostart routine. In a nutshell.Assuming a 2 engine aircraft with only 1 fuel selector in the aircraft.cfg.1. During autostart a 2nd "virtual" selector is created.2. This "virtual" selector is COMPLETELY locked from any input because only 1 selector is assigned in the aircraft.cfg !!Even if you donot use autostart, but, accidently used it even once it will screw up the logic until the aircraft was reloaded!!I am assuming this is for a F-111 or any other 2 engine aircraft, any more engines and the code will have to be updated, not difficult. A single engine is OK as is.So on your side you must change the (Fuel) section to "number_of_tank_selectors = 2" <-- equals number of engines.This set of code is ready for testing on your side. A diagnosing gauge should be up shortly.Roman

<Gauge Name="AUTO TANK SWITCHER" Version="1.0"><Macro Name="L_Drop">(A:FUEL TANK LEFT AUX LEVEL, percent)</Macro><Macro Name="R_Drop">(A:FUEL TANK RIGHT AUX LEVEL, percent)</Macro><Macro Name="L_Wing">(A:FUEL TANK LEFT MAIN LEVEL, percent)</Macro><Macro Name="R_Wing">(A:FUEL TANK RIGHT MAIN LEVEL, percent)</Macro><Macro Name="Aft">(A:FUEL TANK CENTER2 LEVEL, percent)</Macro><Macro Name="Fwd">(A:FUEL TANK CENTER LEVEL, percent)</Macro><Macro Name="Has">0.1 ></Macro><Macro Name="Set">(>K:FUEL_SELECTOR_SET)</Macro><Macro Name="Selected">(A:FUEL TANK SELECTOR 1, enum)</Macro><Update><!-- FIND WHAT TANKS HAVE FUEL IN THEM, THEN SELECT THE PROPER MODE FOR LOGIC - REFERENCE BELOW,0 = No Fuel, 1 = Left drop only, 2 = Right drop only, 3 = Mix drop tanks evenly, 4 = Left wing only, 5 = Right wing only, 6 = Mix wing tanks evenly, 7 = Aft tank, 8 = Fwd tank 9 = Mix center tanks evenlyTHE ORDER BELOW HAS SIGNIFICANT VALUE!-->@Fwd @Has if{ 8 s1 }@Aft @Has if{ 7 s1 }@Fwd @Has @Aft @Has and if{ 9 s1 }@R_Wing @Has if{ 5 s1 }@L_Wing @Has if{ 4 s1 }@L_Wing @Has @R_Wing @Has and if{ 6 s1 }@R_Drop @Has if{ 2 s1 }@L_Drop @Has if{ 1 s1 }@L_Drop @Has @R_Drop @Has and if{ 3 s1 }<!-- APPLY MODE LOGIC TO FUEL TANK SELECTOR - REFERENCE BELOW,OFF = 0, ALL = 1, LEFT = 2, RIGHT = 3, L_AUX = 4, R_AUX = 5, CTR = 6, CTR2 = 7, CTR3 = 8, EXT1 = 9, EXT2 = 10, R_TIP = 11, L_TIP = 12, XFEED = 13, XL2R = 14, XR2L = 15, BOTH = 16, ALL_EXT = 17, ISOLATE = 18    --><!-- BASIC NON-MIXING LOGIC -->l1 0 == @Selected 0 != @Selected 1 == || and if{ 0 @Set }l1 1 == @Selected 4 != @Selected 1 == || and if{ 4 @Set }l1 2 == @Selected 5 != @Selected 1 == || and if{ 5 @Set }l1 4 == @Selected 2 != @Selected 1 == || and if{ 2 @Set }l1 5 == @Selected 3 != @Selected 1 == || and if{ 3 @Set }l1 7 == @Selected 7 != @Selected 1 == || and if{ 7 @Set }l1 8 == @Selected 6 != @Selected 1 == || and if{ 6 @Set }<!-- ADVANCED MULTI TANK BALANCING/MIXING -->l1 3 == if{ @L_Drop @R_Drop - -0.5 < @L_Drop @R_Drop == @Selected 1 == || || if{ @Selected 5 != if{ 5 @Set } } els{ @L_Drop @R_Drop - 0.5 > if{ @Selected 4 != if{ 4 @Set } } } }l1 6 == if{ @L_Wing @R_Wing - -0.5 < @L_Wing @R_Wing == @Selected 1 == || || if{ @Selected 3 != if{ 3 @Set } } els{ @L_Wing @R_Wing - 0.5 > if{ @Selected 2 != if{ 2 @Set } } } }l1 9 == if{ @Aft @Fwd - -0.5 < @Aft @Fwd == @Selected 1 == || || if{ @Selected 6 != if{ 6 @Set } } els{ @Aft @Fwd - 0.5 > if{ @Selected 7 != if{ 7 @Set } } } }<!-- FIX MS AUTOSTART LOGIC (FOR 2 ENGINES ONLY!!!!) --> @Selected (A:FUEL TANK SELECTOR 2, enum) != if{ @Selected (>K:FUEL_SELECTOR_2_SET) }<!-- SEND DATA TO A MONITORING GAUGE -->l1 (>L:TEST_MODE, number)</Update></Gauge>


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

Steve,OK I did modify the code above (Post #10) so give that a try, keep tank selectors to 2.. First off I was using my Baron testbed for development. It does not have quite the same fuel flow as the 111 LOL! But the auto switching bug did come up. So 1st I updated the gauge read frequency from 4 HZ to 18 HZ to keep better tabs on the higher flow rate. 2nd, and you may have to modify this to suit, on line 9 "<Macro Name="Has">0.1 ></Macro>" I changed this so the tanks will switch when levels get down to .1% instead of 0.025%. The tanks will still mix within 1% but will only empty to 0.1% before a switch, or considered empty. If you still have problems try raising that number, if it gets too high a workaround may have to be made. I also checked whether a copy/paste from the forum had any ill effects,,,, negative.Below is code for a diagnostic gauge, its native size is X=315 Y=110.Hopefully this will take care of the not so good results you are getting. Unfortunately I will not be able to do any more testing today, just let me know how it goes, if still problems, I'll giver another crack at it tomorrow.Roman

<Gauge Name="Diagnostics" Version="1.0"><Element Name="DIAGNOSTIC DISPLAY"><Position X="0" Y="0"/><FormattedText X="315" Y="225" Font="Arial" FontSize="14" BackgroundColor="Yellow" VerticalAdjust="Center" Color="Red" Bright="Yes"><String>%LOGIC MODE - %('MIX CENTER' 'CTR FWD' 'CTR AFT' 'MIX WING' 'RT WING' 'LT WING' 'MIX DROP' 'RT DROP' 'LT DROP' 'EMPTY' 10 (L:TEST_MODE, number) case)%!s!%n%TANK1 SELECTED - %('INVALID' 'CTR AFT' 'CTR FWD' 'RT DROP' 'LT DROP' 'RT WING' 'LT WING' 'INVALID' 'EMPTY' 9 (A:FUEL TANK SELECTOR 1, enum) case)%!s!%n%TANK2 SELECTED - %('INVALID' 'CTR AFT' 'CTR FWD' 'RT DROP' 'LT DROP' 'RT WING' 'LT WING' 'INVALID' 'EMPTY' 9 (A:FUEL TANK SELECTOR 2, enum) case)%!s!%n%LT DROP QTY - %((A:FUEL TANK LEFT AUX LEVEL, percent))%!5.2f!%%	 %RT DROP QTY - %((A:FUEL TANK RIGHT AUX LEVEL, percent))%!5.2f!%%	 %DIFF - %((A:FUEL TANK LEFT AUX LEVEL, percent) (A:FUEL TANK RIGHT AUX LEVEL, percent) - )%!5.2f!%%n%LT WING QTY - %((A:FUEL TANK LEFT MAIN LEVEL, percent))%!5.2f!%%	 %RT WING QTY - %((A:FUEL TANK RIGHT MAIN LEVEL, percent))%!5.2f!%%	 %DIFF - %((A:FUEL TANK LEFT MAIN LEVEL, percent) (A:FUEL TANK RIGHT MAIN LEVEL, percent) - )%!5.2f!%%n%CTR FWD QTY - %((A:FUEL TANK CENTER LEVEL, percent))%!5.2f!%%	 %CTR AFT QTY - %((A:FUEL TANK CENTER2 LEVEL, percent))%!5.2f!%%	 %DIFF - %((A:FUEL TANK CENTER2 LEVEL, percent) (A:FUEL TANK CENTER LEVEL, percent) - )%!5.2f!%%n%-----------------------------------%n%((A:TURB ENG1 NUM TANKS USED, number))%!d!% | %((A:TURB ENG2 NUM TANKS USED, number))%!d!% | %((A:TURB ENG3 NUM TANKS USED, number))%!d!% | %((A:TURB ENG4 NUM TANKS USED, number))%!d!%n%((A:TURB ENG1 TANK SELECTOR, number))%!d!% | %((A:TURB ENG2 TANK SELECTOR, number))%!d!% | %((A:TURB ENG3 TANK SELECTOR, number))%!d!% | %((A:TURB ENG4 TANK SELECTOR, number))%!d!%n%((A:FUEL TANK SELECTOR 1, enum))%!d!% | %((A:FUEL TANK SELECTOR 2, enum))%!d!% | %((A:FUEL TANK SELECTOR 3, enum))%!d!% | %((A:FUEL TANK SELECTOR 4, enum))%!d!%n%((A:TURB ENG1 TANKS USED, number))%!d!% | %((A:TURB ENG2 TANKS USED, number))%!d!% | %((A:TURB ENG3 TANKS USED, number))%!d!% | %((A:TURB ENG4 TANKS USED, number))%!d!%n%((A:FUEL SELECTED TRANSFER MODE, number))%!d!% | %((A:FUEL CROSS FEED, enum))%!d!% | %((A:NUM FUEL SELECTORS, number))%!d!% | %((L:AutostartUsed, bool))%!d!%n%END%</String></FormattedText></Element></Gauge>


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

You're almost there.The drop tanks feed together (good), then the wing tanks feed together (good again), and the engines do not shut down until all four tanks are dry (great).The only problems remaining are the Aft tank feeds while the drop and wing tanks feed and the Fwd tanks does not feed until the Aft tank is emptyI am grateful for your helpSteve

Share this post


Link to post
Share on other sites

Steve, I am assuming you're using FSX, correct? And if so are you using the AS F-111 w/ the panel from your page? If so, do the transfer fwd aft switches work? There might just be some auto leveling logic invovled. In order to have the transfer tank function to I do believe an old FS8 Concorde entry in the air file is present and, IF, it is in there it might be doing something a little screwy... Big ???? here. Also make sure selectors are set to 2. If not it will do exactly as you describe if autostart is used, even once..I donot have the AS F111, can you recommend one of the packages from your site that matches as close as possible to your current testing setup?Roman


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

Yes, I am using FSX and the AS F-111 panel from my website. There are no fuel transfer switches. I don't know about the air file. I could send it to you if you like. When I start FSX, the aircraft already has it's engines running.Any of the Mike Stone based F-111s from my website will do for testing. In fact I copied the fuel section from that cfg file to the AS F-111 so the fuel gauges would read the tanks.This is the original fuel section of the cfg file[fuel]//Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons)fuel_type = 2number_of_tank_selectors = 1Center1 = 0.000, 0.000, 0.000, 4000.000, 0.000electric_pump= 1ThanksSteve

Share this post


Link to post
Share on other sites

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    42%
    $10,690.00 of $25,000.00 Donate Now
×
×
  • Create New...