Board index FlightGear Development Aircraft Autopilot and route manager

Boeing 777 - Holding Pattern

Designing a stable autopilot is one of the hardest things. Need help?

Boeing 777 - Holding Pattern

Postby Walter York » Tue Mar 19, 2019 2:28 am

I am completing a new menu option and nas to do holding patterns around a navaid/fix. The nasal code, when enabled via the menu, flies to the selected point and circles using AP. At the point of being enabled it will snapshot current AFDS/Route Mgr info and will put that back into play when the hold is disabled. The user can set the navaid/fix by name, diameter from the aid to circle, Right/Left pattern, and speed. I plan to add oval and square patterns later, One last feature is that you can choose to return to the point where the hold was enabled or just continue on from where you left off in Route Mgr.

I greatly enhanced SpokenATC to be more realistic and added send to hold as a feature which drove this enhancement. Since this uses AP speed, direction, and hold altitude it should be adaptable to other aircraft rather easily. Additionally, I do not have a clue as to the usage of SpokenATC but I would would be willing to submit my updates to it too. I have tested it whit a variety of planes and am adding helicopter support now too.

is holding pattern for the 777 something that others would be interested in having? If so please let me know next steps or point me to the process.


thanks,
Walter York
Walter York
 
Posts: 15
Joined: Tue Feb 05, 2019 9:04 pm
Location: Kansas City, MO
Version: 2018.3.2
OS: Windows 10

Re: Boeing 777 - Holding Pattern

Postby tdammers » Tue Mar 19, 2019 9:19 am

Automatic holding patterns are something I direly miss in general. However, I would prefer having those integrated with the FMS and route manager.

Unfortunately, while the route manager logic does currently support holds, the GUI frontend to it doesn't allow you to enter them; the only way to add holding points to your route is through an FMC implementation that supports them, or by selecting a STAR that includes holding points.

I had started on holding point support for the CRJ700 family at some point, but it turned out trickier than I had anticipated. The main challenge is that the system needs to correct for all sorts of errors - for example, if you overshoot the fix, you should still proceed on the outbound leg, instead of turning around in an attempt to hit the fix exactly.
tdammers
 
Posts: 391
Joined: Wed Dec 13, 2017 11:35 am
Callsign: NL256
IRC name: nl256

Re: Boeing 777 - Holding Pattern

Postby Isaak » Tue Mar 19, 2019 12:10 pm

I would be very eager to implement this on the 777, it's a feature I 've been missing for a long time! As tdammers I would prefer that it can be integrated with the FMS (Hold page on the CDU) and Route Manager, but I guess this is just some UI work on top of the logic you created. Can you share a screenshot/video of the result (e.g. of the map with flight history on). I 'd love to see it!

To get it included in the 777, you can either ask commit access to the FGaddon SVN-repository on the mailing list, or I (or someone else with commit access) can commit the changes for you if you'd like that. Thanks a lot for this great piece of work, can't wait to see it in action!
Want to support medical research with your pc? Start Folding at Home and join team FlightGear!
Isaak
 
Posts: 768
Joined: Sat Jun 04, 2011 3:52 pm
Location: Hamme, Belgium
Pronouns: he, him
Callsign: OO-ISA
Version: next
OS: Windows 10

Re: Boeing 777 - Holding Pattern

Postby Walter York » Wed Mar 20, 2019 1:02 am

Thanks for the comments. I will make a run a grab some screen shots. After taking a look at those I can do some video if y'all want. I agree that getting the Hold info from Stars is a logical next step. I started working on a Sid/Star injection into the Route Manager but put it aside to work on the holding pattern code. I though parsing XML was fun until I had to relearn Trig. :) My plan was to hack the R/M dialog code to fill in the Dropdowns . After the comments I guess I also need to consider the CDU too. I have tried to get Sid/Star/Apps to load following wiki instructions to no avail. If the code is there then the wiki instructions need some work. I did try to integrate some of the 787 as a learning experience to get to understand the architecture, Their approach was to code Sid/Stars/Apps into the CDU with nas form a local DB, so at least there is some model to follow.

I have gotten around this by just adding the SID/Stars into my flightplan with Notepad++ directly. I guess I need to become more of a CDU user to get a more realistic experience. At some point I will become brave and jump into the C++ code and then I can do these enhancement a lot easier. I much rather the compiler tell me I misspelled a var rather than finding out 20 min into testing.

Thanks,
Walter York
Walter York
 
Posts: 15
Joined: Tue Feb 05, 2019 9:04 pm
Location: Kansas City, MO
Version: 2018.3.2
OS: Windows 10

Re: Boeing 777 - Holding Pattern

Postby Octal450 » Wed Mar 20, 2019 5:18 am

Hi Walter York
Maybe that is not such a good idea in my view to mess with Route Manager. He is already quite unrealistic for airliners. (and some bugs) I suggest if you serious to make these wonderful additions to make a custom route and flightplan controller and ignore Route Manager all together (As I am now for IDG Airbus A32X/A33X series) using the nasal flightplan:
http://wiki.flightgear.org/Nasal_Flightplan

Here is my current one so far, is controlled by my MCDU system. It's not complete, but it can already do many things!

I am happy to answer any questions about the matter of getting an FMC/MCDU to control such things correctly, instead of a just manipulate RM.

I am very happy to see your holding pattern. Perhaps you can post the code sometime? I'd like to look there and see what you did, as I am going to attempt same thing in some months.

Welcome here :)

Kind Regards,
Josh
Last edited by Octal450 on Thu Feb 15, 2024 8:22 am, edited 1 time in total.
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Boeing 777 - Holding Pattern

Postby Walter York » Wed Mar 20, 2019 8:22 am

Hi josh,

Thanks for the info and the links to explore. I agree with your comments on RM. It seems a consensus from tdammer's, Isaak's, and your comments that FMS/CDU is the best integration point. SIDs, Stars, and Approaches will the next enhancement I need to get working to have a more complete solution. But first I need to kick this version out the nest. I guess I need to that the plunge for full realism and start using the CDU.

I will take gladly take you up on any help as I get this mod into a completed state. It is pretty close but I still have a little more testing to do to make sure there are not any problems. But overall it works well and I directly control the autopilot to make it work via trig calcs in my nas code. So no worries about the RM being involved. Also fyi I have this mod integrated into the latest 777 posted to download site.

Isaak asked for some screen shots but I cannot figure how to post them or attach the code for that matter :(. Also they are 1M each so let me know if I need to reduce them too, Any help there would appreciated. Then I can share this will everyone.

The holding pattern has a little drift b/c I have not figures out how to control the pitch angle. If you have any insight on that please send it my way, I have the correct dynamic PA calculated and that would fix my drift.

Thanks,,
Walter
Walter York
 
Posts: 15
Joined: Tue Feb 05, 2019 9:04 pm
Location: Kansas City, MO
Version: 2018.3.2
OS: Windows 10

Re: Boeing 777 - Holding Pattern

Postby tdammers » Wed Mar 20, 2019 12:01 pm

The route manager will have to be involved if you want to integrate holdings with flight plans and procedures. But you don't have to use the route manager's calculated flight path, just grabbing the waypoint data should be enough. The route manager waypoint data structure includes a "hold" property that tells you whether the waypoint is supposed to be a hold, and also defines hold parameters (fix, heading, direction, leg distance / time), from which you can calculate the correct holding flight path yourself.
tdammers
 
Posts: 391
Joined: Wed Dec 13, 2017 11:35 am
Callsign: NL256
IRC name: nl256

Re: Boeing 777 - Holding Pattern

Postby sidi762 » Wed Mar 20, 2019 12:23 pm

Hi,

As you may not have already noticed, I'm doing a 777 CDU Improvement project which is currently able to select SID/STAR using R/M (Having sloooow progress due to my heavy school work in China). In the future, however, I'm planning to switch to nasal flight plan and get rid of the R/M while still providing an option for users who still want to stick with the R/M for whatever reasons. Also, I'm planning to add the holding function to the CDU too. Though I don't have enough time to put on this project in the near future, I think we should avoid duplicate work, so maybe you can have a look on my project and do something based on it. In the master branch is the one based on the old framework and is where most of my previous work being done, and in the canvas branch is the WIP canvas framework version.

https://gitlab.com/sidi762/FG777CDUimprovementProject

Kind regards,
Sidi
sidi762
 
Posts: 223
Joined: Sat Jun 18, 2016 9:15 am
Location: Beijing, China
Callsign: DAG0762
Version: 2020.3.18
OS: macOS Catalina

Re: Boeing 777 - Holding Pattern

Postby Octal450 » Wed Mar 20, 2019 2:31 pm

Hi tdammers
I disagree. It is easy to add a hold flag to custom system. Anything the RM can do, we can do via nasal flight plan, and better and more realistic.

Hi Walter
Pitch angle should be not controlled by that. Holding pattern is just an extension of the LNAV system. The lateral mode stays in LNAV whole doing it. The Vertical mode can be anything else. All that needs to be done is to drive the LNAV driver (which is already buggy) to follow your course for the pattern instead.

Hi sidi
I don't know this is good idea. RM works so wrong from real plane if you fix it with a nasal flight plan RM support will just make your project messy in my view. (That's why I dropped it). I strongly recommend a fully custom system instead if just controlling RM off nasal flight plan if realism is your goal here.

Yes it's the hard way, but it's worth it.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Boeing 777 - Holding Pattern

Postby sidi762 » Wed Mar 20, 2019 2:58 pm

Hi Josh,

Maybe I failed to explain it properly. My plan is to indeed make a custom system but gives the user the option to use the current system in case someone for whatever reason wants to use it, also it makes sure that the 777 won't miss any updates on R/M if there will be any. For users, using the custom system might be a pain such as struggling to get the latest level_D or whatever format of nav data. I think it would be better to have both options available. But for the custom system part, I totally agree with you, that only a custom system can provide enough realism.

Kind regards,
Sidi
sidi762
 
Posts: 223
Joined: Sat Jun 18, 2016 9:15 am
Location: Beijing, China
Callsign: DAG0762
Version: 2020.3.18
OS: macOS Catalina

Re: Boeing 777 - Holding Pattern

Postby Octal450 » Wed Mar 20, 2019 3:29 pm

Hi sidi,
I think I also failed to explain.

The custom system uses the default FG navdata. There is no difference to the user. Even installing levelD is done exactly the same way as with R/M. The changes are all behind the scenes. (and we don't even need to make them! Nasal Flightplan works off FG's data, as does R/M) The only change that affects the pilot is that Route Manager won't work with the plane, and they must use the FMC. I think this is the way to go. R/M is useless in realism. Hence why people like PMDG abandoned the FSX route entry system. There is no advantage to having it work. I strongly think you will waste your time making both, as everything needs to be corrected, the way flightplan waypoint advancing works (planes get rid of the WP before FROM on most Boeings and others), LNAV tracking, ND, etc. It just isn't possibly to keep both working without using a total mess and waste of hours and hours of time.
I think you think about using Nasal Flightplan to control the R/M the "conventional" way? My way is suggesting building a new route control system properly. (see my link above).

In my book, R/M only exists for those planes that are not developed enough to have their own flightplan code.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Boeing 777 - Holding Pattern

Postby Walter York » Wed Mar 20, 2019 4:24 pm

Hi it0uchpods,

I had it backwards, I need to control the Bank angle not pitch. I use ground speed and calculate the the bank angle to stay at the desired radius from the fix/navaid. The speed changes as I go in circle, the autopilot keeps the turn generally with in 1-2 degrees of the required BA but not dead on. My theory is that is causing the slight drift.

Hi Sidi,

I will take a look at your project, no sense in duplicated efforts. The CDU seems to be the place to tie this all together.

to All,

I will paste the code into this thread sometime today so yall can see what I have. I also will explore the projects josh and Sidi are working on to get a idea of what I will need to do to tie this into the CDU.

Thanks,
Walter
Walter York
 
Posts: 15
Joined: Tue Feb 05, 2019 9:04 pm
Location: Kansas City, MO
Version: 2018.3.2
OS: Windows 10

Re: Boeing 777 - Holding Pattern

Postby Octal450 » Wed Mar 20, 2019 6:59 pm

HI Walter York:
Do you have my latest 777 A/P version from FGAddon? I rewrote the A/P a bit back to make it more precise.

And, where did you inject your bank angle command? If its not in the right place it won't work.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Boeing 777 - Holding Pattern

Postby Walter York » Wed Mar 20, 2019 9:21 pm

Hi josh,

I downloaded the latest ver from the FG download page 3 days ago. But to be sure I have the correct one I have pulled the trunk version off of the FGAddons. Let me know if trunk is not the correct branch. I can plug in my code in minutes.

"And, where did you inject your bank angle command? If its not in the right place it won't work."

I am at the point of trying to control the BA. my next step is to look at the AFDS system to try and understand how it controls the BA. At this time I am reading it from "/orientation/roll-deg". If you have any suggestions where to control it from please let me know.

I calculate the desired BA by rewriting the the radius of turn eq to solve for bank angle using ground speed (comp for wind) and desired radius for the hold. I will post the nas today after I run a few more test cases.

var ba1 = speed * speed / (11.26 * nm * radius);
var ba = atan2(ba1,(1.0 - ba1));

thanks,
Walter
Walter York
 
Posts: 15
Joined: Tue Feb 05, 2019 9:04 pm
Location: Kansas City, MO
Version: 2018.3.2
OS: Windows 10

Re: Boeing 777 - Holding Pattern

Postby Octal450 » Wed Mar 20, 2019 10:02 pm

Hi Walter
Since holding pattern is part of the LNAV system, I'd recommend the following:

This is 777-autopilot.xml
You have 2 props to control:
/instrumentation/afds/ap-modes/lnav-is-pattern
When that is 1, the system is in "follow holding pattern mode". When not 1, it is in LNAV normal mode.

/autopilot/internal/holding-pattern-roll
Here, output your commanded bank angle.

Hope this helps!

Kind Regards,
Josh
Last edited by Octal450 on Thu Feb 15, 2024 8:22 am, edited 1 time in total.
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Next

Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 0 guests