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?

IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Mon Mar 11, 2019 4:12 am

Hi,
Here is thread is for IT-AUTOFLIGHT 4.0.X.

IT-AUTOFLIGHT is an advanced, modular, and stable autopilot system designed to emulate the systems used in modern airliners.

Installation guide and info is here: http://wiki.flightgear.org/IT-AUTOFLIGHT

Repo:
http://www.github.com/Octal450/IT-AUTOFLIGHT.git

Changelog:
http://www.github.com/Octal450/IT-AUTOF ... NGELOG.txt

Kind Regards,
Josh
Last edited by Octal450 on Thu Aug 15, 2019 3:58 pm, edited 7 times in total.
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Tue Aug 13, 2019 9:30 pm

I fixed a few bugs bringing us to V4.0.1 - please update!

Thanks,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby wlbragg » Tue Aug 13, 2019 10:26 pm

Hi Josh, this is a good time for me to bring this up. I am going to add a autopilot to the pa-18 in the not to distant future. I'm considering it a custom installation of an after market AP. Which of your autopilot systems would you suggest I use (please point me to the repo) that might best represent that type of choice? I was in the middle of installing the one that didn't include the physical controls for it, I recall it required more of a custom solution for the user interface. I got as far as adding a temporary custom heading knob and a couple toggles for auto-trim and I guess the on-off switch. Anyway I abandoned it when I got busy with something else. I want to start over clean at this point but I really liked that approach as I could customize the interface and it appeared to be a very simple solution to get a decent "basic" AP.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4885
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Tue Aug 13, 2019 11:40 pm

Hi Wayne,
viewtopic.php?f=46&t=36208

This should helps with your question because this system is for airliners!

Kind Regards,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Thu Oct 03, 2019 7:57 pm

kwanza wrote in Thu Oct 03, 2019 6:59 pm:Hi Josh,

I'm trying to add the module to some existing aircraft, in one case using YASIM (C-2A/Hawkeye), and the other using JSBSIM (vulcan2b). in the first case, I do get the AUTOFLIGHT menu but none of the affect the flight. Some will increase the values (e.g Alt) but most don't appear to do anything. In the Vulcan's case, the menu does not change from the original one, so I cannot even test it. (And I did copy the file from the 'JSBsim Only' folder). To be clear, I have not attempted o tune the parameters yet - I was more concerned to get it to work in the first instance.

I largely followed the Wiki for version 4.0.1 with some changes as I will explain:

  • I create a file "Systems/it-systems.xml" with the following contents

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

    <PropertyList>

      <sim>

        <systems>

           <autopilot>
             <name>IT-AUTOFLIGHT</name>
             <path>Systems/it-autoflight.xml</path>
           </autopilot>

          <autopilot>
            <name>IT-AUTOTHRUST</name>
            <path>Systems/it-autothrust.xml</path>
          </autopilot>

        </systems>

      </sim>

    </PropertyList>

  • I create a second file "Systems/it-nasal.xml" with the following contents:

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

    <PropertyList>

       <nasal>
        <itaf>
           <file>Nasal/it-autoflight.nas</file>
        </itaf>
       </nasal>

    </PropertyList>

  • Then I create a file "Systems/it-config.xml" based on the 'ITAF CONFIG.txt' file, starting from line 6, but with the following preface:

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

    <PropertyList>

       <sim include="Systems/it-systems.xml"/>

       <nasal include="Systems/it-nasal.xml"/>

       <it-autoflight>
        :
        :


    As you can see, this file calls the previous two files above.
  • Finally, I call this last file from "c-2a-set.xml" (for example), by adding a line just above the </PropertyList> line this:

    Code: Select all
         <inherits-from>Systems/it-config</inherits-from><br/>

    </PropertyList>

Could you please correct me with what I have got wrong in this process? Thanks a lot.



Hi kwanza,

It looks like the config module isn't loaded because this is invalid:

Code: Select all
<inherits-from>Systems/it-config</inherits-from><br/>


Simply, just paste the ITAF-CONFIG.txt contents into the -set file, outside every tag except <PropertyList>. An example can be found here: https://github.com/legoboyvdlp/787-9/bl ... t.xml#L497

(Also, you don't need to do nasal- include and sim include - in fact, I recommend NOT doing this to prevent it from accidently overwriting other sim or nasal contents. Just add the sections itself.)
See:
https://github.com/legoboyvdlp/787-9/bl ... et.xml#L70
https://github.com/legoboyvdlp/787-9/bl ... .xml#L1070

Kind Regards,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Thu Oct 03, 2019 9:56 pm

Thanks a lot. That seems to have solved the issue with the the C-2A. The reason I was using the "include" statement was that I was trying to follow the scheme used in the xml files for C-2A. For example, the "c-2a-set.xml" file does not have a <systems.</systems> section (nor does is have a <nasal></nasal> section). The author used constructs such as:
Code: Select all
<PropertyList include="Systems/c-2a-base.xml">


Even in "Systems/c-2a-base.xml", there is no <systems.</systems> section. But he uses several include statements, e.g.
Code: Select all
<sim include="views.xml">


I got the idea on "inherit" from http://wiki.flightgear.org/PropertyList_XML_files, but I guess i completely misunderstood the concepts. I was trying to be lazy and save having to search and paste into several -set-files by simply inserting the "inherits" line instead.

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

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Fri Oct 04, 2019 12:27 am

Dear sir,
I am glad you got it working. If you have any more questions, feel free to ask it!

Kind Regards,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Fri Oct 04, 2019 4:30 pm

Thanks again. I have a simple question on tuning. I applied the module to a military jet that can travel faster than Mach 1. However, the dialogue keys ">>" won't increase the speed beyond 350 knots. I can type my desired speed directly into the box and the auto-thrust will respect it. I think I have traced the part of the code that limits the button speed, so I just want to check that I only need to modify this part:

Code: Select all
syncIAS: func() {
                Input.ias.setValue(math.clamp(math.round(Velocity.indicatedAirspeedKt.getValue()), 100, 350));
        },
syncMach: func() {
                Input.mach.setValue(math.clamp(math.round(Velocity.indicatedMach.getValue(), 0.001), 0.5, 0.9));
        },


Is this all I need to change? Regards.
kwanza
 
Posts: 49
Joined: Tue Aug 12, 2008 7:07 am

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Fri Oct 04, 2019 6:43 pm

I would not recommend that because the gain scheme does not support high speeds like that - thus you will start to see oscilations at high speed, and if you tune that out, bad response at low speed.

You'd also have to change a few more lines in the controller somewhere, and the dialog buttons.

Why this limitation? Because IT-AUTOFLIGHT is designed for Airliners, not fighters ;)

Kind Regards,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Sun Oct 06, 2019 7:16 pm

Hi Josh,

Sorry I've another question to ask. I have applied the module successfully and now I want to connect it to the instruments of the plane. In this example, the C-2A uses the property
Code: Select all
/autopilot/settings/target-speed-kt

to set the speed. If I change this to
Code: Select all
/it-autoflight/input/spd-kts

then the instruments and dialog are synchronised. The problem is that the instruments allow for two modes of changing speed: in -/+1 or in -/+10. The code above appears to apply to changes in 10s only. What is the corresponding property for -/+1? The original plane uses a factor/step to apply the appropriate rate, so that they refer to the same property above.

I guess the same logic will apply to spd-mach, alt, vs, etc.

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

Re: IT-AUTOFLIGHT V4.0.1

Postby Octal450 » Mon Oct 07, 2019 12:20 am

Hi kwanza,
You can modify spd-kts however much you want. Check the SDK here: http://wiki.flightgear.org/IT-AUTOFLIGHT#SDK

Kind Regards,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby kwanza » Thu Oct 10, 2019 5:49 pm

Many thanks Josh. I finally managed to understand the model and get the dialog and panel buttons synchronised. One of the challenges is that the aircraft uses several modules from other aircraft, which results in confusing labels (e.g. /controls/armament/master-arm refers to the HDG lever). Anyway, I've got it to work for the most part.

As a aside from the original topic (for anyone who might know), I have a separate question. In animating the vertical speed, the following code is used for descents:
Code: Select all
  <!-- VS minus -->
  <animation>
    <type>select</type>
    <object-name>VSmin</object-name>
    <condition>
      <less-than>
        <property>/it-autoflight/input/vs</property>
        <value>0</value>
      </less-than>
    </condition>
  </animation>


  <!-- VS setting decrease -->
  <animation>
    <type>pick</type>
    <object-name>VSSETMINUS</object-name>
    <visible>false</visible>
    <action>
      <name>decrease</name>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/it-autoflight/input/vs</property>
        <step>-100</step>
        <min>-2000</min>
        <max>2000</max>
      </binding>
    </action>
  </animation>



There is corresponding code for increasing V/S. When the plane is ascending, then the the panel display for V/S matches that in the dialog. However, when it is descending, the panel display shows (vs - 10000), where "vs" is the absolute of the V/S value. For example, if the V/S is -200, it will show -9800. This is just a animation problem - it does not affect the flight at all. Does anyone have a suggestion on what I am doing wrong?

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

Re: IT-AUTOFLIGHT V4.0.1

Postby tony » Thu Oct 10, 2019 5:52 pm

Hi Josh, thanks for your support

I think about you should make a video how to install IT-Autoflight on normal Aircraft, YASIM and JSBsim plane.
I tried to intall new autopilot system on B777 (and many other aircrafts) but into -set file i have not found autopilot area.
tony
 
Posts: 4
Joined: Sun Jul 21, 2019 8:30 pm

Re: IT-AUTOFLIGHT V4.0.1

Postby wkitty42 » Thu Oct 10, 2019 6:25 pm

some of them are defined in include files to keep things modular instead of shoved all in one file... that's if they even define an AP at all... i don't recall if an AP has to be defined to use the default one built into the sim...
"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: 5644
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 Octal450 » Thu Oct 10, 2019 8:15 pm

Hi kwanza,
Sorry I missed your message:
In the IDG MD-11 I just used an absolute value. (Maybe I should add that to ITAF...)

Code: Select all
   <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>


You can use BIAS to fix the negatives.... I kept looking for examples but I moved everything to vs-abs.

Hi tony,
777 do not install IT-AUTOFLIGHT! The latest 777 from FGAddon has a totally custom FBW and A/P system that work together. So please use that. The control loop behind it already uses IT-AUTOFLIGHT technology, but the logic does not (and are not compatible)

Kind Regards,
Josh
I am a person.
User avatar
Octal450
 
Posts: 4388
Joined: Tue Oct 06, 2015 12:51 pm

Next

Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 0 guests