-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(a380x): Various fuel system fixes #9045
fix(a380x): Various fuel system fixes #9045
Conversation
…lanes/FlyByWire_A380_842/flight_model.cfg
…lanes/FlyByWire_A380_842/Climb.flt
…lanes/FlyByWire_A380_842/approach.FLT
…lanes/FlyByWire_A380_842/apron.FLT
…lanes/FlyByWire_A380_842/cruise.FLT
…lanes/FlyByWire_A380_842/final.FLT
…lanes/FlyByWire_A380_842/runway.FLT
…lanes/FlyByWire_A380_842/hangar.flt
…lanes/FlyByWire_A380_842/systems.cfg
…lanes/FlyByWire_A380_842/taxi.flt
Looks like some changes were made post the master code I used for this PR. I will need to back these out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One inadvertent change still, you already saw the other ones :)
...rc/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me syntax-wise. However I can't verify the fuel system changes, need @Maximilian-Reuter or someone else for that
…onstim/a32nx into fix-A380-trim-tank-cg-transfer
} | ||
|
||
public onUpdate(): void { | ||
const onGround = SimVar.GetSimVarValue('SIM ON GROUND', 'bool'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 Questions:
- Do we not need to wait for GameStart here?
- You mentioned you wanted to throttle the update rate here, is that still something that's missing or did you decide against it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experience, onUpdate is already not called before gamestart. As for throttling, the actions are throttled already ,in that they only activate once a change is necessary. I also didnt see any real performance impact as the real work is getting all the updated simvar values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onUpdate is definitely called before the gamestate is ingame, usually a lot of times. The reason some things wait for ingame is because .flt files etc. will have finished loading by then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough, though the code in on update doesnt really execute anyways until off the ground. So I wager the only situation where you might get issues is during an airspawn, probably why I havent seen any yet
} | ||
|
||
public onUpdate(): void { | ||
const onGround = SimVar.GetSimVarValue('SIM ON GROUND', 'bool'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might consider moving this to a publisher as well(SIM_ON_GROUND is also used elsewhere on systems-host), but maybe not for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even more nitpick/something to think about, anything using SIM ON GROUND should really be in extras-host because it's not an aircraft system (they use other aircraft systems to determine on ground/in-flight status).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was kinda going back and forth on that and ended up just using the existing file. In the end this code isnt designed to stay around for long (hopefully) and be replaced by our own fqms.
…onstim/a32nx into fix-A380-trim-tank-cg-transfer
Other than cleaning up the review comments as above, these changes seem to have a positive impact on ensuring fuel is not imbalanced and doesn't get "stuck" anywhere. |
…onstim/a32nx into fix-A380-trim-tank-cg-transfer
Fixes various fuel system issues. See summary of changes.
Summary of Changes
Fixes the following issues with the fuel system:
Screenshots (if necessary)
Visualisation of the MSFS Fuelsystem according to the flightmodel.cfg
References
Additional context
ECAM fuel system page may need changing due to the addition of the 2nd trim tank inlet valve . If any overhead fuel system buttons are operational, these may also need to be checked.
Be aware that not all automatic transfers are modeled. Specifically, the load alleviation transfers are not included because MSFS does not have the necessary triggering conditions to accurately model these.
Valves, lines, and junctions are included to model fuel transfers beyond what is used by the automatic transfers that are modeled. These will need to be checked once the overhead push buttons for all the pumps, valves, etc. are all fully modeled.
Fuel transfer rates have not yet been tuned. This first implementation is just to ensure that the fuel transfer occur according to the logic detailed in the testing instructions and at sufficient rates such that the feed tanks will not empty before the transfer tanks.
Discord username (if different from GitHub): donbikes
Testing instructions
**Most immediate testing need is for a short test as follows:
The work folder can be found using these instructions: https://docs.flybywiresim.com/fbw-a32nx/feature-guides/flypados3/throttle-calibration/?h=work+folder#work-folder
, note if fuel is being transferred out of the inner tanks (fuel quantity decreasing). Report back (either here or on Discord)**
For testing of all transfers, here is the transfer logic:
The feed tanks feed the engines. A certain amount of fuel is kept in the feed tanks with that amount varying depending on the amount of fuel in the transfer tanks (inners, mids, outers, and trim). The trim tank is also used for cg control transfers.
Starting with fuel in each tank (including more than 4000 kg in the left mid tank), the normal transfer sequence should be: inners, then mids, then trim, then outers. In addition, trim tank fuel may be transferred at any time to keep the cg from going too far aft. (Normal loading is for an aft cg, so there is no transferring back to the trim tank to move the cg further aft.)
Until the left mid tank has less than 4000 kg of fuel, the inner and mid tank transfers should work like this:
2 The transfers to feed tanks 2 and 3 work the same way, except they begin when the lower one reaches 20840 kg and end when they each reach 21840 kg. Note that feed tanks 2 and 3 are higher capacity than 1 and 4, are normally fueled initially to a higher level, and retain a higher level until made symmetrical by the transfer process detailed below.
When there is less than 8000 kg in the mid tanks (the MSFS trigger actually uses <4000 kg in the left mid), the begin and end transfer levels for feed tanks 2 and 3 are changed to be the same as those used for feed tanks 1 and 4. The following transfer process is then used to balance the amount of fuel in the tanks: When the tank with the least amount of fuel reaches the transfer activation threshold, fuel begins transferring in. (This will be both feed tanks 1 and 4 since they will be approximately equal, and they start at a lower level than 2 and 3.) As the level in feed tanks 1 and 4 increase, and 2 and 3 decrease, when they become equal, fuel will start transferring into 2 and 3. (Although this approximately equalizes the fuel level in all the feed tanks, it will differ by a bit since the transfers don't start immediately and the transfer rates into 1 and 4 are just a tiny bit different than 2 and 3.)
When the mid tanks are empty, fuel will be transferred from the trim tank to the feed tanks when the fuel level in any feed tank is less than 6000 kg. The same balancing process is used as described above. Once started, the trim tank will transfer fuel until it is empty.
When the trim tank is empty, fuel wil be transferred from the outer tanks to the feed tanks when the fuel level in any feed tank is less than 4000 kg. The transfer process uses a similar balancing technique, but only between the pairs or symmetric fuel tanks (1/4 and 2/3). The transfer stops when the fuel level in each pair of feed tanks is greater than 4500 kg and starts again when the fuel level in any feed tank is less than 4000 kg.
CG fuel transfers: These may happen independently and simultaneously with the main transfers described above. The transfer begins when the CG is higher (more aft) than the schedule vs gross weight shown below and ends when the CG is 1% lower (more forward) than than target. (Note: the CG shown in the CRUISE page of the ECAM is rounded off, so the transfer will start a little while after the ECAM shows a CG equal to the target CG.) The fuel will be transferred to the inner tanks, or to the mid tanks if the inner tanks are empty, or to the feed tanks if both the inner and mid tanks are empty.
For the testing, please observe whether the fuel transfers are following the description given above. You can use the MSFS fuel and payload UI to see the transfer activation/deactivation points without the round off used in the cockpit display. There should not be any fuel transfers taking place while the airplane is on the ground.
Additional notes:
It would be helpful to have flights done starting with different initial fuel loads: 18 T, 26 T, 36 T, 47 T, 103 T, and >158 T. The test can be terminated whenever one of the following occur: fuel transfer not occurring per above schedule
Note if there are any discrepancies and describe the circumstances as much as possible.
How to download the PR for QA
Every new commit to this PR will cause new A32NX and A380X artifacts to be created, built, and uploaded.