Board index FlightGear Development Aircraft Autopilot and route manager

Autopilot "Think Ahead"

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

Autopilot "Think Ahead"

Postby Airbus330 » Sat Aug 09, 2014 3:56 am

Hi again,

Thanks everyone for your help so far. Maybe i'm out on a limb here, but is there a way to make an AP "think ahead", like to compensate for "flap bubble" and speed decrease?
Also to make it start leveling before it reaches the target heading, not afterwards.
I think there must be way, only i couldn't find anything on the wiki or forums...
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autopilot "Think Ahead"

Postby omega95 » Sat Aug 09, 2014 4:09 am

Try tuning your PID controllers - you can easily level out before you reach the heading by increasing the effect of Kp (proportional gain - (error)) on the output. Take a look at some resources on PID controllers. Honestly, I've been working on aircraft for FG before I really understood PID controllers and 2 semsters ago, I just had a control system design class as part of my Aerospace engineering course and I understand a lot more now on how to get the autopilot to do what you want it to.

Control Theory 101 - http://www.flightgear.org/Docs/XMLAutopilot/node2.html

PID Controller - http://en.wikipedia.org/wiki/PID_controller

AP Tuning Resources - http://wiki.flightgear.org/Autopilot_Tuning_Resources#FlightGear_PID_Controller

Before I understood PID controllers well, I wrote simple nasal scripts for the A320neo/A330s to help with this - you could take a look at the FMGC nasal file if you want. :) But I'd suggest learning about PID controllers properly and using it.
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

Re: Autopilot "Think Ahead"

Postby Alant » Sat Aug 09, 2014 9:37 am

A commonly used technique is this:

Fly (in this case roll) the aircraft towards the target heading. (If the autopilot commands the roll it is a heading aquire mode)
At the same time do the heading track track calculations in the background
When the result of these calculatons becomes equal to the current bank angle engagage the heading mode. (this is also a heading hold mode)

Similar logic can be used for height, g/s and loc modes etc.

Alan
Alant
 
Posts: 1219
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: Autopilot "Think Ahead"

Postby Hooray » Sat Aug 09, 2014 11:09 am

Airbus330 wrote in Sat Aug 09, 2014 3:56 am:Thanks everyone for your help so far. Maybe i'm out on a limb here, but is there a way to make an AP "think ahead", like to compensate for "flap bubble" and speed decrease?
Also to make it start leveling before it reaches the target heading, not afterwards.
I think there must be way, only i couldn't find anything on the wiki or forums...


This is what a full-fledged "autoflight" system will typically do using a combination of software, sensors - where the autopilot is just one of the lower-level components of the whole system, i.e. to implement turn anticipation, wind compensation etc: http://wiki.flightgear.org/Implementing ... FlightGear

However, such a WXR layer would obviously be unlikely to match any simulated weather (BASIC/AW), so we should make sure to name the layer accordingly and also show a warning if METAR isn't being used.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Autopilot "Think Ahead"

Postby Airbus330 » Wed Aug 13, 2014 2:27 am

Thanks everyone, i was able to get the Heading bug hold to "stable" condition.
there is some thing in the autothrottle mode of the Generic AP called "speed lookahead"
I can´t see any difference between this and any other PID, but it does things like increase the throttle when you press the brakes (on the Ground) or pitch up.
Does anyone know more about this? :?
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autopilot "Think Ahead"

Postby chriscalef » Wed Aug 13, 2014 5:53 am

Wow, thanks to everybody involved for this discussion, I had never actually heard of a PID before. What will they think of next, lol.
chriscalef
 
Posts: 279
Joined: Wed Feb 20, 2013 10:28 pm

Re: Autopilot "Think Ahead"

Postby Hooray » Wed Aug 13, 2014 6:54 am

a PID controller will need some constant factors added, which is likely to differ for different configurations (W&B, altitude, speed etc) - which is why the performance DB serves as kind of a fancy look-up table that will give you certain thrust/pitch settings to make a certain constraint.
Those "bugs" you mentioned are simply implementation issues - typically, you'll have cascades of many different types of controllers, each configured for a certain requirement - in the case you described, the developer just omitted some logic to prevent the PID from kicking in. To model a complex autoflight system, it isn't uncommon to have fairly huge chains of controllers that are cascaded in a nested fashion.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Autopilot "Think Ahead"

Postby Airbus330 » Wed Aug 13, 2014 9:23 am

So i could make a new level in the cascade with a whole new PID and make it command pitch down when flaps are increased? and another one to pitch up when speed is decreased/up when increased?
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3


Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 2 guests

cron