Skip to content
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(a380x/fctl): Automatic THS trim after engine start or touch and go #9843

Merged
merged 24 commits into from
Mar 27, 2025

Conversation

flogross89
Copy link
Contributor

@flogross89 flogross89 commented Feb 8, 2025

Summary of Changes

Adds auto THS trim after engine start or when performing touch and go.
Also, cleans up some XML for the pedestal and the visibility conditions for the magenta GW CG box in the PFD's pitch trim indicator.

Conditions for engine start:

  • First engine is started and a hydraulic system (G or Y) is pressurized OR
  • Ground spoilers become armed

Conditions for touch and go:

  • On ground for at least one second
  • Airspeed less than 80kts
  • One of the following actions performed: Flaps lever moved, ground spoilers disarmed or at least three thrust levers moved out of IDLE

Screenshots (if necessary)

References

Additional context

Discord username (if different from GitHub):

Testing instructions

  1. Start cold&dark at gate
  2. Perform engine start per SOP, THS trim should move automatically
  3. Perform take-off, traffic pattern and touch and go. THS trim should move automatically during touch and go
    Verify, that magenta PFD pitch trim indicator is only visible after first engine started and HYD is pressurized, and disappears after takeoff (not visible for landing)
    Try to find reference videos to verify whether the trim speed is comparable. Look at the degrees per second, not the overall time.

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.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, find and click on the PR Build tab
  4. Click on either flybywire-aircraft-a320-neo, flybywire-aircraft-a380-842 (4K) or flybywire-aircraft-a380-842 (8K) download link at the bottom of the page

@flogross89 flogross89 added QA A380 Only QA only for A380 required A380X Related to the A380X aircraft labels Feb 8, 2025
@flogross89 flogross89 added this to the v0.13.0 milestone Feb 8, 2025
@77W9940
Copy link

77W9940 commented Feb 8, 2025

I know the code is still ready for review, but i had a bit of time so just wanted to try it out.

Engine start automatic THS:
https://github.com/user-attachments/assets/240ac7c7-6321-4efe-bfe5-1ff833cdf886

Touch and go:
This one I am not sure about, after doing the traffic pattern, on the approach, shouldn't LAND and FLARE be on the FMA? As well as ROLLOUT. Anyways, during touch and go, set flaps to FULL->3 and TOGA. The THS value on the SD was changing.

2025-02-08.22-26-47.mp4

@Ueeew
Copy link

Ueeew commented Feb 9, 2025

@flogross89 I just wanted to give a few tips or improvements. The first thing I noticed is that process of setting the trim automatically takes way to long. In the real aircraft the process of setting the THS takes only about 2-3 seconds(Real video for reference). In the FBW it takes about 5 or even longer.
The second thing is that the purple box, indicating the optimal THS setting ,is IR only shown a few seconds prior to auto THS setting process (shown in video). In FBW the box is shown the whole time as long as THS setting is visible on PFD.
https://m.youtube.com/watch?v=uEgw2p8J0ZA&t=775s&pp=2AGHBpACAcoFDUEzODAgdGhzIHRyaW0%3D
The engine stat sequence is at minute 2:45. Unfortunately you may have to zoom a bit in to see the process.
hopefully this helps

@flogross89
Copy link
Contributor Author

@aadee9940 Thanks a lot! Have you considered joining our QA team?
It seems you didn’t arm any approach mode for your landing, but instead followed the flight plan guidance down to the runway. Did you tune an ILS, and press APP to intercept LOC and G/S?
The FMA modes are untouched by this PR, so that also wouldn’t be related.

@flogross89
Copy link
Contributor Author

@Ueeew Very helpful, thanks! Indeed, the speed is far too slow, might need to check my triggering mechanism again, I believe I have to use another method.
about the magenta box: Also well spotted, I suppose the GW CG comes from the FQMS, which only sends these values after engine start or some other condition. I‘ll investigate in my references.

@77W9940
Copy link

77W9940 commented Feb 9, 2025

@flogross89 unfortunately I don't have access to the FBW server as before, but if the mods want to have a look at my appeal LMK 😊

Yeah it completely left my mind I have to program my automatics to get proper FMA modes on landing, my fault 😂.
It was a fully visual circuit so yeah, but I hope my test shows what you are looking for? (The THS trim moving on the SD)
Wasn't really sure if this was EXACTLY what you were looking for..

@flogross89
Copy link
Contributor Author

@aadee9940 Ah, didn't know that. I'm not a mod so I don't know any details, but I trust their process. Yep, that's what I wanted to see,

@Ueeew I changed the trim triggering mechanism, it should now use the full available speed (which is limited by the PRIMs, so that should be accurate).

@Ueeew
Copy link

Ueeew commented Feb 11, 2025

@flogross89 could you just merge the master again into this PR so that it’s up-to-Date. Thanks

# Conflicts:
#	fbw-a380x/src/systems/instruments/src/PFD/PitchTrimDisplay.tsx
#	fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx
@flogross89
Copy link
Contributor Author

@flogross89 could you just merge the master again into this PR so that it’s up-to-Date. Thanks

Sure, done

@Fowl38
Copy link

Fowl38 commented Feb 26, 2025

@flogross89 I just wanted to give a few tips or improvements. The first thing I noticed is that process of setting the trim automatically takes way to long. In the real aircraft the process of setting the THS takes only about 2-3 seconds(Real video for reference). In the FBW it takes about 5 or even longer. The second thing is that the purple box, indicating the optimal THS setting ,is IR only shown a few seconds prior to auto THS setting process (shown in video). In FBW the box is shown the whole time as long as THS setting is visible on PFD. https://m.youtube.com/watch?v=uEgw2p8J0ZA&t=775s&pp=2AGHBpACAcoFDUEzODAgdGhzIHRyaW0%3D The engine stat sequence is at minute 2:45. Unfortunately you may have to zoom a bit in to see the process. hopefully this helps

We can see on your video, on the F/O's PFD that the THS took 11 seconds to be set (from 2min55 to 3min06 of the video).

# Conflicts:
#	fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx
#	fbw-a380x/src/systems/systems-host/index.ts
@heclak
Copy link
Contributor

heclak commented Mar 10, 2025

After landing, should the THS FOR value move to the current GW CG value?

image

@flogross89
Copy link
Contributor Author

After landing, should the THS FOR value move to the current GW CG value?

image

After landing, it should move to the maintenance position (zero degrees, neutral). This also happened before the PR since it’s the same behavior as on the a320s.

In case of go-around however, it will move to the GW CG position again

@heclak
Copy link
Contributor

heclak commented Mar 10, 2025

A few notes from an initial test.

  1. Magenta line appears on the gauge once the display powers on.
  2. The pink THS value only shows up a few moments after the trimming is completed. Based on the video, the THS value and magenta line should appear at the same time.

Can you confirm how should the THS trim behaviour be observed during a touch and go since the THS gauge doesn't appear during the touch and go? Should the pitch trim position be noted prior to takeoff and the pitch trim should return to the same pitch trim value during the touch and go?

@flogross89
Copy link
Contributor Author

@heclak Thanks for testing!

  1. Do you mean just the magenta line was visible, but nothing else? I discovered an issue with visible vs. inherit CSS properties, that should/could fix that. Didn't have time to check it in sim, sorry.
  2. Didn't fully understand that, do you mean the automatic THS starts moving before the magenta GW CG values are being displayed? There could be one explanation for this: The Auto THS starts as soon as one HYD system is powered, the GW CG is displayed as soon as one HYD system is powered AND at least one engine is started (N1 > 15%). I believe our HYD systems are powered very early on, I don't know whether the engine-driven HYD pumps are completely accurate in that sense. If it's only a few seconds I'd disregard it for now, and check the HYD system in the future.

When the following conditions apply, the indicator should be shown during touch&go:
image
Did those conditions apply?

During touch&go, the pitch trim should be set to the optimal value w.r.t. the current GW CG, measured/computed by the FQMS.

@heclak
Copy link
Contributor

heclak commented Mar 11, 2025

This is how the gauge appears immediately after power on. I believe the magenta box/lines shouldn't be there?

image

Once the HYD is powered, the system starts trimming but the trim value that's usually on the right isn't displayed. It trims with the same visual state as above. And the magenta value on the right only appears AFTER the trimming is completed. Refer to the magenta numbers in the screenshot below. Based on the rough footage of the auto THS working in the reference video above, the magenta markings in the middle of the trim gauge and the THS target on the right should both appear at the same time once the HYD is powered?

image

I'll have to give the touch and go a try again. The indicator didn't appear for me, maybe one of the conditions wasn't fulfilled on my run.

@heclak
Copy link
Contributor

heclak commented Mar 12, 2025

I think the color of the text might need adjustment too? Looking through this video, maybe the text is white before the magenta lines appear?

image

https://youtu.be/p28erS6uWHE?si=PzILc6PvMB_cIwpD&t=1423

Edit: Ah. Never mind. I think the color difference is because of the magenta state issue.

@flogross89
Copy link
Contributor Author

@heclak Ah, now I see it. Thanks for spotting that, I missed that nuance before. Now:
Before engine start:
image

After engine start:
image

About the difference in timing of auto trim vs. PFD indications: I changed the conditions, the cyan indications now appear before the auto trim moves. It's still not 100% synced, that would increase the complexity in the PFD indication unnecessarily, let's wait for the PRIM implementation for that.

Could you please give it one last try?

@heclak
Copy link
Contributor

heclak commented Mar 19, 2025

good news. the start up logic works good now. However, the landing and touch and go logic is missing a weight on wheels for > 1 sec check. The pitch trim indication appears when RA is below 50 feet while the aircraft is still airborne.

https://www.youtube.com/watch?v=NdThh1qOCTA

The other issue is the triggering of the auto trim. In the video, you can see the auto trim doesn't immediately. It seems to be waiting for a phase change to trigger instead.

I'm wondering if thrustTla is a correct condition check. I could be wrong but it looks like thrustTla is referring to the engine thrust setting for engine 1? The FCOM references the condition check to be checking the position of the thrust levers instead. The FCOM uses the phrase "at least three thrust levers are not at idle" and "the engine levers are moved out of idle". Maybe the lever positions should be used as the condition instead?

@flogross89
Copy link
Contributor Author

@heclak Thanks for trying it.
What I can see in the video:

  1. PFD pitch trim indicator is shown below 50ft during landing, that's wrong. I added the "on Ground" condition (without confirmation time, as per FCOM) for that case, should only be displayed on ground when at least three thrust levers are moved out of idle

Concerning your questions:

  1. Triggering of auto trim: From what I can see, it behaves correctly, doesn't it? As soon as you moved the thrust levers out of idle, the auto trim starts.
    However, the magenta box in the PFD pitch trim indicator is displayed too late, indeed I waited for a FWC flight phase change. I softened that, so it should display the magenta box faster. Hopefully it didn't worsen any other situations
  2. TLA is the thrust lever angle, i.e. doesn't correspond to thrust or N1, but only to the angle of the physical lever (see doc for A32NX_AUTOTHRUST_TLA:{index}). I updated the condition to check all thrust levers

@heclak
Copy link
Contributor

heclak commented Mar 20, 2025

@flogross89

Thanks for the changes!

Good catch on the trim moving first. It was such a small trim change that I missed it even with multiple viewings of the video. I need fresher eyes.

I'll try and keep a look out for other conditions that might be affected by the soften of the magenta box appearance. Probably need to test the post landing appearance too.

@heclak
Copy link
Contributor

heclak commented Mar 20, 2025

@flogross89 I have some odd results in this latest test.

I first started up and took off. All startup sequences were as normal. Auto THS worked fine, pitch trim position indication disappeared after passing 50ft as expected.

Flew a pattern and did an approach. This time I decided to test the auto THS response towards the flap lever change first. Auto trim started once the flaps lever was moved but the magenta marking with appearing in the wrong location. I proceeded with a go around.

https://www.youtube.com/watch?v=RhFDF1fMRiY

Completed a circuit and came in for a second approach. Tested this go around using the thrust lever instead. pitch trim indications did not appear.

https://www.youtube.com/watch?v=AzTRh14rJYI

Completed another circuit. Performed a full stop landing. Pitch trim indicator appears below 30 knots, auto trim to 0 position.

@flogross89
Copy link
Contributor Author

@heclak Thanks again, this helped my find two other issues:

  1. Somehow the SimVarPublisher wasn't added for thrust levers 3&4 (one of those a32nx copy&paste errors), so the idle thrust check didn't trigger. This fixes the issue when only moving the thrust levers and not touching the ground spoilers or flaps
  2. The optimal pitch trim was set to 0 once we landed, which doesn't make sense (even not below 30kts, since it's not the optimal position, but the maintenance position. It will be displayed in white anyways when it returns to 0 after landing.

Just pushed the changes. I feel we're converging on a final solution here :)

@heclak
Copy link
Contributor

heclak commented Mar 27, 2025

Quality Assurance Tester/Trainee Report

Discord Username : Heclak
Object of testing : #9843
Aircraft : A380X
Tier of Testing : 1
Date : 27/03/2025

Testing Process:

  1. Start Cold and Dark and startup aircraft as per SOP
  2. Perform engine start per SOP, THS trim should move automatically ✔️
  3. Perform take-off, traffic pattern and touch and go. THS trim should move automatically during touch and go
    • Touch and Go 1 - Moved flaps. Check THS responded correctly ✔️
    • Touch and Go 2 - Moved thrust levers. Check THS responded correctly ✔️
    • Touch and Go 3 - Disarm spoilers. Check THS responded correctly ✔️
  4. Full stop landing. Check pitch trim position indication appears under 30 knots and THS trims to 0 position.

Testing Results:
Passed

Negatives:

Noticed two minor details that I think are not critical but doesn't need to be in the scope of this PR.

  1. In this specific test, I noticed there is a rounding difference between the left and right values. In the EFB, the GWCG is 34.76%. Which makes me suspect it's a rounding method difference between the two values.

image

  1. The movement speed of the striped portion of the pitch trim position indicator might need tweaking. It currently looks to move in an almost 1:1 ratio with the left side of the trim indicator. However, in the video, it appears it should be moving much faster with a per degree change in THS. This is purely visual. https://youtu.be/uEgw2p8J0ZA?si=yRknN00h7iLLbLUO&t=173

It think both issues could be handled in a separate PR if needed.

Conclusions:

Core function of the THS is functioning as designed and no blocking issues. The two minor negatives could be handled separately if needed.

Media:

@flogross89
Copy link
Contributor Author

@heclak Thank you so much! I'll merge this now then.
Concerning your two findings:

  1. Indeed those values were only floored instead of rounded, and differences in the precision of the input number might have led to this difference. Fixed it in a new commit, and quickly tested it in sim.
  2. When I implemented the pitch trim display in the PFD I thought I verified the speed of this tape against YT sources, but might need further tuning. Will keep that for the future. Could you write an issue for that? Could be a good first issue for beginners.

@flogross89 flogross89 enabled auto-merge (squash) March 27, 2025 18:24
@flogross89 flogross89 merged commit d18780d into flybywiresim:master Mar 27, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A380X Related to the A380X aircraft QA A380 Only QA only for A380 required QA Passed QA Ready to Test
Projects
Status: ✔️ Done
Development

Successfully merging this pull request may close these issues.

7 participants