aircraft icon indicating copy to clipboard operation
aircraft copied to clipboard

feat(hyd): hydraulic actuator locking function

Open crocket63 opened this issue 2 years ago • 4 comments

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.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, click on the bottom PR tab
  4. Click on the A32NX download link at the bottom of the page

crocket63 avatar Jul 01 '22 14:07 crocket63

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 property soft_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

crocket63 avatar Jul 24 '22 09:07 crocket63

What the hell is === ?? :D

Oh no, JavaScript has cursed me 😄 .

BlueberryKing avatar Jul 24 '22 09:07 BlueberryKing

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((), ()); }

crocket63 avatar Jul 24 '22 18:07 crocket63

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!

BlueberryKing avatar Jul 29 '22 14:07 BlueberryKing

This may have conflicts with https://github.com/flybywiresim/a32nx/pull/6913

2hwk avatar Aug 21 '22 09:08 2hwk

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

crocket63 avatar Aug 21 '22 13:08 crocket63

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

mico975 avatar Aug 23 '22 12:08 mico975

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

dragold avatar Aug 26 '22 16:08 dragold