aircraft
aircraft copied to clipboard
feat(hyd): hydraulic actuator locking function
Fixes #[issue_no]
Summary of Changes
This PR adds a mechanism to be able to limit actuator speed in extension or retraction (up to a zero speed). It can be used to limit the movement of any actuator such as in a failure case.
This will also implement the downlocking function of spoiler actuators, preventing them to go up when no pressure is available.
Screenshots (if necessary)
References
Additional context
Discord username (if different from GitHub):
Testing instructions
Check that any unpressurised spoiler panel can go down but never up.
How to download the PR for QA
Every new commit to this PR will cause a new A32NX artifact to be created, built, and uploaded.
- Make sure you are signed in to GitHub
- Click on the Checks tab on the PR
- On the left side, click on the bottom PR tab
- Click on the A32NX download link at the bottom of the page
Nice work!
I think there's something you could consider changing here. What I don't really like is that the
soft_lock_velocity
property is often meaningless when the actuator is not soft-locked. To fix this, we could introduce an enum:enum SoftLockMode { None, Locked(AngularVelocity, AngularVelocity), // Min and max angular velocity when the body is soft-locked }
Then,
CoreHydraulicForce
would only have a single propertysoft_lock_mode: SoftLockMode
.To implement the
HydraulicLocking
trait, you could use the following:impl HydraulicLocking for CoreHydraulicForce { fn should_soft_lock(&self) -> bool { self.soft_lock_mode === SoftLockMode::Locked } fn soft_lock_velocity(&self) -> (AngularVelocity, AngularVelocity) { match self.soft_lock_mode { SoftLockMode::None => (AngularVelocity::default(), AngularVelocity::default()), SoftLockMode::Locked(min, max) => (min, max), } } }
This is only a suggestion, let me know if you think this is not appropriate to use in this case. 😄
Idea looks good, now need to try :) What the hell is === ?? :D
What the hell is === ?? :D
Oh no, JavaScript has cursed me 😄 .
What the hell is === ?? :D
Oh no, JavaScript has cursed me 😄 .
Problem then is when you want to set it to soft locked.... You need to know the velocities and can't just turn it true: if self.locks_position_in_closed_mode { self.soft_lock = SoftLockMode::Locked((), ()); }
What the hell is === ?? :D
Oh no, JavaScript has cursed me 😄 .
Problem then is when you want to set it to soft locked.... You need to know the velocities and can't just turn it true: if self.locks_position_in_closed_mode { self.soft_lock = SoftLockMode::Locked((), ()); }
Ah, yeah, that's an issue, forget what I said!
This may have conflicts with https://github.com/flybywiresim/a32nx/pull/6913
This may have conflicts with #6913
There's no functional conflict, will just have to merge carefully. If we can test this one on master context, then I'll do the merge on #6913
Quality Assurance Tester Report
Discord : mico#3145 Object of testing: #7314 Tier of Testing : 1 Date : 23/08/2022
Testing Process: Check that any unpressurised spoiler panel can go down but never up. - OK
Negatives:
N/A
Testing Results: Passed
Conclusions: LGTM
Category: QA Tester Name: Mr.Blank#6197 Date of testing MM/DD/YYYY:08/26/2022
PR Tested: 7314 Tier of testing:1
Testing technique: Brute force tryouts Test Instructions: Check that any unpressurized spoiler panel can go down but never up.
Methodology:
All as per Testing instructions
Off Normal input test
Negatives: NIL
Testing Results: PASS
Conclusions: results were of normal outputs