Skip to content

Commit

Permalink
feat(hyd): hydraulics base refactoring (flybywiresim#4799)
Browse files Browse the repository at this point in the history
* early refactor step

* Regulation Refactor in progress

* two sections

* accumulator added

* accumulator limitation update

* Update mod.rs

* Update main.rs

* Adding multiple pump sections capability

* testing other filter PID settings

* Graph test set to 20Hz rate

* Simpler pressure update code

* Update main.rs

* new valve pressure update

* starting A320 loop replacement

* Displacement simvars added

* firevalves as objects

* lot of rework

* system_pressure_switch simvar

* pump going in reverse do not provide flow

* reservoir level simvar updated

* moved some simvar writes

* moved simvar writers

* Removed old hyd code

* cleaning fire valves code

* clean up

* clippy clean

* cleaner loop update function

* comments on main update loop

* HYD PTU ecam memo

* accumulator with updated pressure law

* hydraulic rate set to 20hz

* Updated regulation code: removed pre target update

* hyd page updated with pressure simvars

* Update CHANGELOG.md

* Update a320-simvars.md

* corrected pressure simvars

* tuned max displacement dynamic

* Accumulator unused params removed

* Tuned brake accumulator size to match real data

* removed unused

* Update mod.rs

* Can't compile with clippy....

* Using only option for system pumps

* Finally! removed Box after long clippy fight

* namings

* Update mod.rs

* Update docs/a320-simvars.md

Co-authored-by: BBK <[email protected]>

* Update flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/EICAS/ECAM/A320_Neo_UpperECAM.js

Co-authored-by: BBK <[email protected]>

* Update src/systems/a320_systems/src/hydraulic.rs

Co-authored-by: BBK <[email protected]>

* Update src/systems/systems/src/hydraulic/mod.rs

Co-authored-by: BBK <[email protected]>

* renamed reservoir functions

* PressureSource trait cleaned up

* Some comments for ptu placeholder flow model

* Firevalves connected to power bus DC ESS

* Docs and pumps with AngularVelocity

* Physical Elec Pump model

* Updated electric pump model

* comments

* Finished merge with cargo door PR

* added test for electric pump physics

* cleanup

* clarified namings

* naming

* fixed stopping torque for epump

* regulation using shared PidController

* efficiency constant

* pump power consumption

* hydraulic tests uses AC power to 115v

* pump physics cleanup

* Update electrical_pump_physics.rs

* Core hydraulics @20hz

oops

* updated epump current control tuning

* killed the dyn

* Update mod.rs

* removed displacements simvars

* only one downstream valve per section

* refactored hydraulic update

* Update mod.rs

* Update electrical_pump_physics.rs

* updated electric pump tests

* Update mod.rs

* Update electrical_pump_physics.rs

* Update mod.rs

* updated elec pump controller

* Updated electrical pump regulation to match real pump

* Removed SWITCH simvars

* Update src/systems/systems/src/hydraulic/mod.rs

Co-authored-by: David Walschots <[email protected]>

* PTU xml template removed

* Update src/systems/a320_systems/src/hydraulic.rs

Co-authored-by: David Walschots <[email protected]>

* loop naming changed to circuit

* Update src/systems/a320_systems/src/hydraulic.rs

Co-authored-by: David Walschots <[email protected]>

* context as first arg and passing Engine trait

* context arg first

* ptu passed as Option instead of &Option

* Update src/systems/a320_systems/src/hydraulic.rs

Co-authored-by: David Walschots <[email protected]>

* unused params to _

* Update src/systems/systems/src/hydraulic/electrical_pump_physics.rs

Co-authored-by: David Walschots <[email protected]>

* Update src/systems/systems/src/hydraulic/mod.rs

Co-authored-by: David Walschots <[email protected]>

* whitespace

* naming

* &impl arguments

* Update src/systems/systems/src/hydraulic/mod.rs

Co-authored-by: David Walschots <[email protected]>

* Pressure switch state to enum

* refactoring trait for passing pressures

* rename pump_section_number

* Adjusted low pass filter on accumulator characteristics

* no more variable write for section numbers

* context argument order

* removed unused functions

* Update mod.rs

* Update src/systems/systems/src/hydraulic/mod.rs

Co-authored-by: David Walschots <[email protected]>

* firevalve cleanup and co

* merge that compiles wooohooo

* clippy

* cargo fix

* Update main.rs

* Update brake_circuit.rs

* test issues

* accumulator tuning

* section indexes to one based

* Section pressure trait rename

* simplify pushback logic

* naming of firevalve corrected in ecam code

* System sections index one based too

* PUMP rpm var for sound

* added one _ spacing in XXX_PUMP_IDX_

* updated sound from Boris files

* Pressure Simvar names messed up for no reason....

Redoing what was done already....

* Back on master sound files

Co-authored-by: BBK <[email protected]>
Co-authored-by: David Walschots <[email protected]>
Co-authored-by: Michael Corcoran <[email protected]>
  • Loading branch information
4 people authored Nov 19, 2021
1 parent a2e67ec commit 860e156
Show file tree
Hide file tree
Showing 22 changed files with 2,197 additions and 1,870 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

1. [FBW] Improved speed dependent roll law model - @IbrahimK42 (IbrahimK42)
1. [SOUND] Pack sounds use new APU model variables - @tracernz (Mike)
1. [HYD] Hydraulic system updated. Multiple sections. Better regulation - @Crocket63 (crocket)
1. [EFB] Added in-flight refueling capabilities - @Taz5150 (TazX [Z+2]#0405)
1. [EFB] Moved setting for MCDU keyboard input into the EFB - @2hwk (2Cas#1022)
1. [HYD] Placeholder simvar to trigger ptu high pitch sound - @crocket6 (crocket)
Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 23 additions & 7 deletions docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,23 @@
- 1
- 2

- A32NX_HYD_{loop_name}_PRESSURE
- A32NX_HYD_{loop_name}_SYSTEM_1_SECTION_PRESSURE
- Psi
- Current pressure in the {loop_name} hydraulic circuit
- Current pressure in the system section of the {loop_name} hydraulic circuit
- {loop_name}
- GREEN
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_RESERVOIR
- A32NX_HYD_{loop_name}_PUMP_1_SECTION_PRESSURE
- Psi
- Current pressure in the pump section of the {loop_name} hydraulic circuit
- {loop_name}
- GREEN
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_RESERVOIR_LEVEL
- Gallon
- Current fluid level in the {loop_name} hydraulic circuit reservoir
- {loop_name}
Expand Down Expand Up @@ -781,21 +789,29 @@
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_EPUMP_FLOW
- Gallon per second
- Current flow generated by {loop_name} electric pump
- A32NX_HYD_{loop_name}_EPUMP_RPM
- Rpm
- Current {loop_name} electric pump speed
- {loop_name}
- BLUE
- YELLOW

- A32NX_HYD_PTU_ON_ECAM_MEMO
- Bool
- HYD PTU memo indication should show on ecam if true

- A32NX_HYD_NW_STRG_DISC_ECAM_MEMO
- Bool
- NW STRG DISC memo indication should show on ecam if true

- A32NX_HYD_{loop_name}_EPUMP_LOW_PRESS
- Bool
- Electric pump of {loop_name} hydraulic circuit is active but pressure is too low
- {loop_name}
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_FIRE_VALVE_OPENED
- A32NX_HYD_{loop_name}_PUMP_1_FIRE_VALVE_OPENED
- Bool
- Engine driven pump of {loop_name} hydraulic circuit can receive hydraulic fluid
- {loop_name}
Expand Down
Loading

0 comments on commit 860e156

Please sign in to comment.