Board index FlightGear Development Aircraft Autopilot and route manager

IT-AUTOFLIGHT V4.0.1

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

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Sun Oct 13, 2019 4:06 pm

Thanks Josh for the helpful tips.

I could not quite understand how to use the <filter> code. I borrowed a different bit of code and attached it to the end of your "it-autoflight.nas" file. So now all I need to do is call "/it-autoflight/input/vs-abs" rather than "/it-autoflight/input/vs". I am not sure if this is efficient or simply slows down the simulation. The additions I used are shown below:

Code: Select all
# We need the absolute value of VS so that we can use it in the panel display
# create a new variable named "AbsVS", assign a function body to it
var AbsVS = func {
 # create a new variable named "vs_set" and assign the value from the getprop() call to it
 var vs_set = getprop("/it-autoflight/input/vs");
 # create a new variable named vs_displ and compute the absolute value using the vs_set variable
 var vs_displ = abs(vs_set);
 # finally, write the result to the property tree using the setprop() call
 setprop("/it-autoflight/input/vs-abs", vs_displ);
}

# update the "vs-abs" property whenever "vs" is changed
setlistener("/it-autoflight/input/vs", AbsVS);
kwanza
 
Posts: 61
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Sun Oct 13, 2019 4:50 pm

Hi kwanza - I do not recommend modifying it-autoflight.nas ever, but do so as your own risk.

Here, just paste in a file called vs-abs.xml then add this below where it-autoflight.xml and it-autothrust.xml are in your -set (or -main, -common, etc) file under systems, autopilot.

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<!-- IT-AUTOFLIGHT -->
<!-- Copyright (c) 2019 Joshua Davidson (Octal450) -->

<PropertyList>
   
   <filter>
      <name>VS ABS</name>
      <type>gain</type>
      <gain>1</gain>
      <input>
         <expression>
            <abs><property>/it-autoflight/input/vs</property></abs>
         </expression>
      </input>
      <output>/it-autoflight/input/vs-abs</output>
   </filter>

</PropertyList>


Code: Select all
<autopilot>
   <name>VS ABS</name>
   <path>Systems/vs-abs.xml</path>
</autopilot>


MUCH better than doing that messy via nasal, and using slow and inefficient setprop/getprop (which really SHOULD NOT be used!)

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Mon Oct 14, 2019 8:00 pm

Thanks Josh.

Your code worked perfectly. I wonder why the original authors used setprop, which I agree slows down the simulation.

I apologize for bringing up another query. The plane I am playing with is supposed to limit the VS to -/+3000 (at least according to the dials). I can see where you limit the ascent speed, but do you have a limit for the descent speed? What I noticed is that on deploying FLCH, I descend at > 4000fps. Nothing bad happens, so it probably a non-issue.

Thanks again.
kwanza
 
Posts: 61
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Mon Oct 14, 2019 8:11 pm

Hi Kwanza,
Glad you got it working.

FLCH does not work with V/S. FLCH will hold your airspeed via changing pitch angle, it does not care about V/S. They are talking about the vertical speed dial command limit, not FLCH.

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Thu Oct 17, 2019 10:46 pm

Hi Josh,

I am trying to modify the A380 (which is a JSBsim plane), and I've got it to work except for some problems with synchronising the AP dialog and control panel. One of the things I have found is that some properties are never assigned, so that my tests for them always fail. In particular, I cannot see where
Code: Select all
lnav-armed, loc-armed, or appr-armed from /it-autoflight/output
are assigned. In the property browser, they are always false, even when the corresponding button is selected, e.g. LNAV. I am missing something or perhaps I misunderstood how they work?

Thanks for the help.
kwanza
 
Posts: 61
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Fri Oct 18, 2019 2:25 am

Hi Kwanza,
be careful of A380 - it has some *** FlyByWire that breaks everything.

anyway those props do work - so I don't really know what is happening to you. Maybe you should make sure the controller is actually loaded and started (see if any modes can engage)

the values will true.

Kind Regards,
Josh
Last edited by Gijs on Mon Oct 21, 2019 10:54 am, edited 1 time in total.
Reason: Language
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Sat Oct 19, 2019 11:48 pm

Hi Josh,

Yes, the A380 is fiendishly convoluted. I found its autopilot rather poor hence my attempt to modify it. I am actually able to get your model to fly it and even land. I still need to work out how to disengage auto-throttle once it lands. The immediate challenge was in linking the FCU to the auto-flight dialog. I've managed to connect the essential units but what I discovered somewhat confirms my earlier comments. I also checked with the other planes that I deployed your package on. In all cases, it loads and runs as expected. However, some properties never change regardless of the situation. I would say lnav-armed, loc-armed and appr-armed are always false. Take the case when the auto-pilot and flight-director are engaged and the dialog shows [THRUST - LNAV - ALT CAP ]. Then the values of /it-autoflight/output are as follows:
Code: Select all
ap1 = true
ap2 = true or false
appr-armed = false
athr = true
fd1 = true
fd2 = true or false
lat = 1
lnav-armed = false
loc-armed = false
thr-mode = 0
vert = 0

I thought that lnav-armed should be true.

Now the corresponding values for /it-autoflight/mode are:
Code: Select all
arm =""
lat = LNV
thr = THRUST
vert = ALT HLD


It seems that I am missing something that sets /it-autoflight/mode/arm and /it-autoflight/output/lnav-armed. Are these set by any buttons in the dialog? That is probably where I am going wrong.

Thanks again and sorry to trouble you.

K
kwanza
 
Posts: 61
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Sun Oct 20, 2019 2:13 am

Hi kwanza,
You are not missing anything. Those are only true when the mode is armed - not engaged. Once the mode captures, it will be false again. This is so that we do not run the code to check if to capture, if mode is not armed. Its working as expected.

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby Mars006 » Wed Oct 30, 2019 11:56 am

Hi Josh,
I am attempting to change the A380-omega's autopilot into IT-autoflight, but unfortunately, the new autopilot doesn't show. The autopilot is still the old one. Could you please help me?
Thanks.
Mars006
 
Posts: 1
Joined: Wed Oct 30, 2019 11:37 am
Callsign: FG-6188
OS: Mac OS

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Thu Oct 31, 2019 5:48 pm

Hi Mars,
Please let me know if you followed the http://wiki.flightgear.org/IT-AUTOFLIGH ... structions
It would also help if you can post inside [code] snippets the parts you added or point me to a github folder so I can show you what you are doing wrong.

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Thu Nov 21, 2019 8:58 pm

Hi Josh,

Sorry, I have a puzzle that I need help with. This relates to the LOC and APPR modes when in range of the destination airport. To help explain the issue, I'll use and example. Suppose I am flying to a runway that has its last three waypoints all aligned with the runway, call them x, y and z. Let's use two approaches:

    Firstly, I use LNAV until I get to x and then activate LOC only once the aircraft is aligned with the runway. The result is that the plane follows the course correctly until x, then turns right and travels straight towards the runway (x -> y -> z ->), but at a slight lateral angle. So it lands on the runway and then heads off the runway.

    I tried to counter that effect by arming LOC once NAV1 is in range (/instrumentation/nav/in-range is true). This time the plane travels towards x and as soon as it encounters the runway cyan "funnel" (before it gets to x), it swings left; it realises its mistake and swings back right and finally aligns with the runway (y -> z ->)

So my question is why it always swings left on entering the funnel. This behaviour is consistent with the generic autopilot. For refeence, I was flying from KSAT 12L to KIAH 08L/R.

My second question is on the vertical mode. I arm the ILS once the GS is in range (/instrumentation/nav/gs-in-range is true). The trouble is that the GS is only activated after I've passed z. By this time, it does not have a chance to descend enough before reaching the runway. For example, it I am at 2000ft at z, then I stay at that altitude for too long. I would need to force a descent to something lower so that when the glideslope is finally captured, I'd be well on the way. So what prevents it from capturing the GS when it is already in range?

Thanks a lot.
kwanza
 
Posts: 61
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby wkitty42 » Thu Nov 21, 2019 9:25 pm

could the turning be crosswinds? what was your weather like?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5773
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Thu Nov 21, 2019 10:25 pm

I must confess that I've never considered the weather. That might explain my first observation. The A380 is quite incapable on maintaining a straight course on the runway at take-off without continuous adjustments of the rudder. I wonder if that is all to do with the wind - surprising for such a big plane?
kwanza
 
Posts: 61
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby wkitty42 » Thu Nov 21, 2019 11:49 pm

those vertical stabilizers are huge sails ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5773
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Previous

Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 1 guest