-
-
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
feat: First hydraulic system implementation #3782
feat: First hydraulic system implementation #3782
Conversation
96fcff1
to
ebff2c1
Compare
Brakes were switching to alternate way too late / at low green press
… into hydraulics_updated
Someone with experience working on the real plane can probably provide better feedback than me, but my initial observation is that it seems that the PTU on/off cycle is too slow, especially for yellow to green power transfer (based off the timing of the "barks" seen in reference videos). Also, on the ground (before taxi) the PTU should be inhibited when only one engine is running, or if the parking brake is set - it seemed like the first condition wasn't modeled when I tested it out. Otherwise, great work so far! |
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.
just simple fix for you.
if fix this, lint error will disappear :)
A32NX/html_ui/Pages/VCockpit/Instruments/Airliners/A320_Neo/BRK/A320_Neo_BRK.js
Outdated
Show resolved
Hide resolved
ECAM SD page: #3833 |
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.
Overall we're nearly there. Few small things to think about and after that it's approval time. I really look forward to seeing all of this in action in the sim. Cool stuff! 🥳
I have some remarks to smoothen future PRs a bit:
- Read through the Rust style guide. It's a good resource. Something us non-Rust developers aren't used to is how getters are written: without a
get_
prefix. - Read through Visibility and Privacy in the Rust reference. Another language thing we're not used to: everything is public within the module by default. I've removed quite a few
pub
usages, and sometimes replaced them withpub(super)
orpub(crate)
. - Try to design the software structure such that it's a DAG as much as possible. I can understand that given that it's the first time you've used the language (as have I) it's sometimes a bit of a struggle. I for sure have struggled with it at times! Still, this is a key thing.
- Try to apply the Law of Demeter as much as you can, at least outside of tests. By also applying it within tests, you'll get a better feel for the "interface" you're exposing. In summary: try to avoid
self.field.fields_field.do_something()
, but instead write:self.field.do_something()
and let that function handle how to do it. - Understand that the topic at hand is complicated. You've by now researched a lot of hydraulics and thus are fully understanding most of it. However, for someone new to the topic the code will be challenging. The better the naming and abstractions, the easier it is for someone other than yourself to continue improving on top of your work. Keep challenging yourself in this area! 😀
- One particular area that I think is interesting to think about in terms of abstraction is the code around time stepping in
A320Hydraulic.update
. In a way the function goes from high level abstractions to low level abstractions and back again. It might be worthwhile to extract the way of time stepping out into a separate type at some point. Something to think about. - The default
SimulationElement.accept
implementation already visits the element itself. Thus if that's all you want to do, you don't have to implement that function again. I've removed a few usages like this. - Format comments according to the style guide:
// A comment
. Prefer to write the comment above instead of next to the code. - Write out words as much as possible.
ena
=>enable(d)
,dmnd
=>demand
,cmnd
=>command
,hyd
=>hydraulic
, etc.
Thanks a lot for the help! Lot of stuff yet to improve I know :p |
Yellow value would have be frozen until end of autobrake by a bold pilot braking while rotating
… into hydraulics_updated
ECAM hyd available here #4777 |
Category: Contributor Testing technique: Perform Full Flight Origin : RKSI RW15R ( depart direct to MONSI ) Legs Destination : RKPC RW25 ( arrival direct to RKPC, ILS RW25 ) Steps you've made to test the Pull Request:
Media: there is only brake hydraulics ( others value : 14.7 ) Only ELEC Pump on, PTU working well, pressure is stable. brake gauge also working well idk IRL reference but in sim,
Brake gauge also working well turn off all hydraulic & repeat engage parking brake on / off. Hydraulics from Engine Driven Pump is alive. Takeoff and do some test: Check Green / Blue / Yellow pump is alive ( Turn on / off to test value ) all working well.
Working well ( I Turn off PUT to test Green is dead ) and approach / landing. normally done Issues (If Any): there is no issue about hydraulics. As a description on PR, Hydraulics alive but not applied on physics ( F/CTL, actual brake ) Overall Rating: Good Conclusions of the testing: Thank you for make this awesome feature! Every value working as well :D |
Category: QA Tester Testing technique: Full Flight from EGLL to EGCC for testing - offline and not streamed Steps you've made to test the Pull Request:
Flight notes (When done a full flight): Media: N/A Issues (If Any): None found during this test Overall Rating: Good |
Changes to observe:First hydraulics system implementationTesting technique: Tryout Steps you've made to test the Pull Request:1. Spawned at HECA in C&D2. Turned On the Yellow system from the electric pump with with PTU off3. Turned On the Yellow system from the electric pump with with PTU On then yellow suppling the green system4. Started Engine 1 with PTU off5. Started Engine 1 with PTU ON6. Took off then turned off both engines to simulate both Engines failure and HYD G+Y failure7. Checked the RAT deployed and suppling the Blue HYD sys8. Spawned again took off, did a circuit then landed9. Tried the cargo door operations and checked the values10. Turned off the engines, turned off Anti Skid and tried to empty the brakes ACCUFlight notes (When done a full flight):Did a quick circuit over the airport and checked different parametersMedia:Microsoft_Flight_Simulator_2021.05.08_-_03.20.36.02-1.mp4
Fun partTried my best to survive with both engines failureOverall Rating: GoodConclusions of the testing:I had lots of fun testing this Pr and I was with Shomas to have another set of eyes while testing your Pr. Tested all the stuff you implemented and all of them are working fine and as intended. Thanks for your amazing work on this system as it's not a simple system, hopefully seeing the rest of the stuff implemented. Good job ! 👏 |
Co-authored-by: davydecorps <38904654+davydecorps@users.noreply.github.com> Co-authored-by: Will Pine <wpine215@gmail.com> Co-authored-by: David Walschots <davidwalschots@users.noreply.github.com> Co-authored-by: komp1821 <71044068+komp1821@users.noreply.github.com>
This feature request is linked #2840 but not fixed yet by this PR.
This PR is a based on PR #2767, and can replace it
Summary of Changes
Implementation of A320neo's hydraulic system using Rust and WASM.
First thing first, many thanks to:
@davidwalschots for EXTENSIVE support
@wpine215 for launching the first stage of hydraulics (and extensive support)
@CPUBlanc for starting it
@komp1821 and @avteknysian For HUGE support on all kinds of technical details
Everyone helping me getting up to speed on all different subjects in this project
First ever PR for me, and no previous knowledge on various subjects, so be patient I'll improve lot of stuff or someone will :)
Summary
This is a difficult task, and can be done at any level of details. The global target for this is aiming at the extreme limit of every details that can be implemented, without needing overkill performance, or overkill details that would bring nothing to the experience.
Further analysis on the current performance hit of this subsystem will later bring us to upgrade / downgrade details.
You won't see the internal parts of a pump moving, but you should see the landing gear swinging back and forth while retracting using only yellow electric pump and PTU providing pressure to green loop.
Important note
This first PR brings the first brick of hydraulics, and has NO INTENTED impact on FS2020 physics. Meaning actuators are not connected, brakes shows accordingly in pressure gauges but DO NOT control the braking force of the plane. Brake accumulator empty and parking brake shows 0 pressure. But FS2020 would still be applying the brakes. Or if default FS2020 hydraulics are off, plane would not brake while you have actual brake pressure available from accumulator.
Of course everything will get connected later step by step.
Next PRs will focus on documentation and code refactoring if needed (and lot is needed)
Implementation overview
Now the fun part:
This is NOT a simulation of internal pumps parts, plungers, solenoid valves.
This is NOT a simulation of all hydraulic pipes connection solving navier stokes equations on each tube node
This is NOT a faked hydraulic simulation that increments pressures on screen until it reaches 3000 psi and decrement it when pump is off.
Every pump has a dynamic displacement logic. It takes fluid from a reservoir and throw it into its hydraulic loop. The pump regulation is for now "perfect", but can be simulated in real time basically in one line of code: this only depends on performance concerns and can evolve in the future. First implementation (and that was not easy...) tries to model all of this at a low fixed rate of 10Hz, higher rates could enable us to add some more regulation details in the future.
An hydraulic loop will take fluid from any connected pump. Fluid is compressed according to its real life bulk modulus properties (you can chose your fluid if you want :)).
As every part is connected, failures that will come later should impact all the hydraulics and connected systems accordingly without any scripted faked behaviour.
As a lot of parameters are either unknown or an approximation of a real behavior for performances reasons , and as this is a representation of my current system knowledge, a lot of hydraulic performance tuning can AND WILL happen.
Feel free to note any detail that looks weird, it can either be a simple number to change, or everything to rewrite from scratch :)
Building blocks
LOGIC
PTU
Actuators
Brakes
Overhead
Temperature
DOCUMENTATION
HYD ECAM SD Page
-In progress in #3833
Known issues
PTU model is currently simplified and has some impacts like slow yellow brake accumulator recharge on elec pump, or too much impact on yellow pressure when powering green side on epump only
Time acceleration might cause high CPU usage due to hydraulics trying to update at a fixed rate
Screenshots (if necessary)
References
Additional context
Discord username : Just yell prayers in Hydraulic room
Testing instructions
This first implementation has NO IMPACT on the plane, apart from triple pressure gauge visuals.
ECAM will come just after in a next PR, so please rely on available local vars to report issues:
Use (developer mode/model behaviors/local vars) then filter those variables using "A32NX_HYD" filter.
ECAM HYD screen is available if you test using #4777. Please keep reporting results here and rely on variables only for final issue observations.
Special note: Plane is spawned with yellow brake accumulator half filled. This explains yellow level to be over max until first yellow pressurisation that will fill alternate brake accumulator accordingly.
Testing will focus on:
Specific:
General:
How to download the PR for QA
Every new commit to this PR will cause a new A32NX artifact to be created and uploaded.
The build script will have already been run with the latest changes, so no need to rerun it once you download the zip.