Board index FlightGear Support Flying

ILS not working in new FG2020.3.13 version

Controlling your aircraft, using the autopilot etc.

Re: ILS not working in new FG2020.3.13 version

Postby tonyz » Mon Aug 22, 2022 11:56 pm

Just to check all was copied well, here is the text from my new b1900d-autopilot.xml created following your instructions. Unfortunately there does not seem to be any way to attach a file here.

<?xml version="1.0"?>
<!--FGC-65 -->

<PropertyList>

<filter> <!-- Heading bug offset -->
<name>heading bug</name>
<debug>false</debug>
<type>gain</type>
<input>
<property>instrumentation/fgc-65/settings/hdg</property>
<offset>
<property>orientation/heading-magnetic-deg</property>
<scale>-1.0</scale>
</offset>
</input>
<output>instrumentation/fgc-65/internal/offsets/hdg-bug</output>
<period>
<min>-180</min>
<max>180</max>
</period>
<gain>1.0</gain>
</filter>

<filter> <!-- NAV1 heading offset -->
<name>NAV1 heading </name>
<debug>false</debug>
<type>gain</type>
<input>
<property>instrumentation/nav[0]/heading-deg</property>
<offset>
<property>orientation/heading-deg</property>
<scale>-1.0</scale>
</offset>
</input>
<output>instrumentation/fgc-65/internal/offsets/nav1-brg</output>
<period>
<min>-180</min>
<max>180</max>
</period>
<gain>1.0</gain>
</filter>

<filter> <!-- NAV2 heading offset -->
<name>NAV2 heading </name>
<debug>false</debug>
<type>gain</type>
<input>
<property>instrumentation/nav[1]/heading-deg</property>
<offset>
<property>orientation/heading-deg</property>
<scale>-1.0</scale>
</offset>
</input>
<output>instrumentation/fgc-65/internal/offsets/nav2-brg</output>
<period>
<min>-180</min>
<max>180</max>
</period>
<gain>1.0</gain>
</filter>

<filter> <!-- CRS1 heading offset -->
<name>CRS1 heading </name>
<debug>false</debug>
<type>gain</type>
<input>
<property>instrumentation/nav[0]/radials/selected-deg</property>
<offset>
<property>orientation/heading-magnetic-deg</property>
<scale>-1.0</scale>
</offset>
</input>
<output>instrumentation/fgc-65/internal/offsets/crs1-brg</output>
<period>
<min>-180</min>
<max>180</max>
</period>
<gain>1.0</gain>
</filter>

<filter> <!-- CRS2 heading offset -->
<name>crs2 heading </name>
<debug>false</debug>
<type>gain</type>
<input>
<property>instrumentation/nav[1]/radials/selected-deg</property>
<offset>
<property>orientation/heading-magnetic-deg</property>
<scale>-1.0</scale>
</offset>
</input>
<output>instrumentation/fgc-65/internal/offsets/crs2-brg</output>
<period>
<min>-180</min>
<max>180</max>
</period>
<gain>1.0</gain>
</filter>

<!--
Lateral Controllers
-->

<pi-simple-controller> <!-- Heading hold -->
<name>Heading Hold</name>
<debug>false</debug>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/internal/lateral</property>
<value>HDG</value>
</equals>
</condition>
</enable>
<input>
<property>instrumentation/fgc-65/internal/offsets/hdg-bug</property>
</input>
<reference>
<value>0.0</value>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/roll</property>
</output>
<config>
<Kp>-1.0</Kp>
<Ki>0.0</Ki>
<min>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>-25.0</scale>
</min>
<max>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>25.0</scale>
</max>
</config>
</pi-simple-controller>

<pi-simple-controller> <!-- NAV1 hold -->
<name>Nav1 Hold</name>
<debug>false</debug>
<enable>
<condition>
<property>instrumentation/fgc-65/internal/nav-active</property>
</condition>
</enable>
<input>
<property>instrumentation/fgc-65/internal/offsets/crs1-brg</property>
<offset>
<property>instrumentation/nav/heading-needle-deflection-norm</property>
<scale>45.0</scale>
</offset>
</input>
<reference>
<value>0</value>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/roll</property>
</output>
<config>
<Kp>-1.0</Kp>
<Ki>0</Ki>
<min>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>-25.0</scale>
</min>
<max>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>25.0</scale>
</max>
</config>
</pi-simple-controller>

<pi-simple-controller> <!-- ILS hold -->
<name>ILS Hold</name>
<debug>false</debug>
<enable>
<property>instrumentation/fgc-65/internal/appr-active</property>
</enable>
<input>
<property>instrumentation/fgc-65/internal/offsets/crs1-brg</property>
<offset>
<property>instrumentation/nav/heading-needle-deflection-norm</property>
<scale>30.0</scale>
</offset>
</input>
<reference>
<value>0</value>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/roll</property>
</output>
<config>
<Kp>-1.0</Kp>
<Ki>0</Ki>
<min>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>-15.0</scale>
</min>
<max>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>15.0</scale>
</max>
</config>
</pi-simple-controller>

<pi-simple-controller> <!-- Roll -->
<name>Roll</name>
<debug>false</debug>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/internal/lateral</property>
<value>ROLL</value>
</equals>
</condition>
</enable>
<input>
<property>/orientation/roll-deg</property>
</input>
<reference>
<property>instrumentation/fgc-65/settings/roll</property>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/roll</property>
</output>
<config>
<Kp>1.0</Kp>
<Ki>0.35</Ki>
<min>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>-30.0</scale>
</min>
<max>
<property>instrumentation/fgc-65/app-65a/BANK</property>
<scale>30.0</scale>
</max>
</config>
</pi-simple-controller>

<pid-controller> <!-- Aileron Controller -->
<name>Aileron Control</name>
<debug>false</debug>
<input>
<property>orientation/roll-deg</property>
</input>
<reference>
<property>instrumentation/fgc-65/internal/fd/roll</property>
</reference>
<output>
<property>controls/flight/aileron-filter</property>
</output>
<config>
<Kp>0.01</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>25.0</Ti>
<Td>0.01</Td>
<min>
<value>-1.0</value>
</min>
<max>
<value>1.0</value>
</max>
</config>
</pid-controller>

<filter> <!-- Aileron output filter -->
<name>aileron filter</name>
<debug>false</debug>
<feedback-if-disabled>false</feedback-if-disabled>
<initialize-to>output</initialize-to>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/app-65a/AP</property>
<value>AP</value>
</equals>
</condition>
</enable>
<input>
<property>controls/flight/aileron-filter</property>
</input>
<output>controls/flight/aileron-trim</output>
<type>noise-spike</type>
<max-rate-of-change>0.3</max-rate-of-change>
<min>-1</min>
<max>1</max>
</filter>

<!--
Pitch Controllers
-->
<filter> <!-- V/S Sample for ALT Hold/Track V/S to make smooth transitions -->
<name>V/S Sample</name>
<debug>false</debug>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>PITCH</value>
</equals>
</condition>
</enable>
<type>gain</type>
<gain>1.0</gain>
<input>autopilot/internal/vert-speed-fpm</input>
<output>instrumentation/fgc-65/settings/vs</output>
</filter>

<filter> <!-- Altitude hold -->
<name>Altitude hold</name>
<debug>false</debug>
<enable>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>ALT</value>
</enable>
<type>gain</type>
<input>
<property>instrumentation/altimeter/indicated-altitude-ft</property>
</input>
<reference>
<property>instrumentation/fgc-65/settings/alt</property>
</reference>
<gain>-1.0</gain>
<output>
<property>instrumentation/fgc-65/settings/vs</property>
</output>
<min>-1500</min>
<max>2000</max>
</filter>

<pid-controller>
<name>Glideslope hold</name>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>GS</value>
</equals>
</condition>
</enable>
<input>
<property>/instrumentation/nav[0]/gs-needle-deflection</property>
</input>
<reference>0</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/pitch</property>
</output>
<config>
<Kp>-5</Kp>
<Ti>10</Ti>
<Td>0.001</Td>
<u_min>-10</u_min>
<u_max>15</u_max>
</config>
</pid-controller>

<pid-controller> <!-- IAS hold -->
<name>IAS</name>
<debug>false</debug>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>IAS</value>
</equals>
</condition>
</enable>
<input>
<property>instrumentation/airspeed-indicator/indicated-speed-kt</property>
</input>
<reference>
<property>instrumentation/fgc-65/settings/ias</property>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/pitch</property>
</output>
<config>
<Kp>-1.0</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>10.0</Ti>
<Td>0.0</Td>
<min>-1</min>
<max>1</max>
</config>
</pid-controller>

<pid-controller> <!-- Vertical speed hold -->
<name>Vertical speed hold</name>
<debug>false</debug>
<enable>
<condition>
<or>
<equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>VS</value>
</equals>
<equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>ALT</value>
</equals>
</or>
</condition>
</enable>
<input>
<property>autopilot/internal/vert-speed-fpm</property>
</input>
<reference>
<property>instrumentation/fgc-65/settings/vs</property>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/pitch</property>
</output>
<config>
<Kp>0.0005</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>1.0</Ti>
<Td>0.00001</Td>
<min>-10</min>
<max>20</max>
</config>
</pid-controller>

<filter> <!-- Pitch tracking for smooth transitions -->
<name>Pitch tracking</name>
<debug>false</debug>
<enable>
<condition>
<not-equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>PITCH</value>
</not-equals>
</condition>
</enable>
<type>gain</type>
<gain>1.0</gain>
<input>orientation/pitch-deg</input>
<output>instrumentation/fgc-65/settings/pitch</output>
</filter>

<pi-simple-controller> <!-- Pitch -->
<name>Pitch</name>
<debug>false</debug>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/internal/vertical</property>
<value>PITCH</value>
</equals>
</condition>
</enable>
<input>
<property>orientation/pitch-deg</property>
</input>
<reference>
<property>instrumentation/fgc-65/settings/pitch</property>
</reference>
<output>
<property>instrumentation/fgc-65/internal/fd/pitch</property>
</output>
<config>
<Kp>1.0</Kp>
<Ki>0.0</Ki>
<u_min>-15</u_min>
<u_max>30</u_max>
</config>
</pi-simple-controller>

<pid-controller> <!-- Elevator trim controller -->
<name>Elevator Trim Control</name>
<debug>false</debug>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/app-65a/AP</property>
<value>AP</value>
</equals>
</condition>
</enable>
<input>
<property>orientation/pitch-deg</property>
</input>
<reference>
<property>instrumentation/fgc-65/internal/fd/pitch</property>
</reference>
<output>
<property>controls/flight/elevator-filter</property>
</output>
<config>
<Kp>-0.05</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>10.0</Ti>
<Td>0.0001</Td>
<u_min>-1</u_min>
<u_max>1</u_max>
</config>
</pid-controller>

<filter> <!-- Elevator filter -->
<name>Elevator filter</name>
<debug>false</debug>
<feedback-if-disabled>false</feedback-if-disabled>
<initialize-to>output</initialize-to>
<enable>
<condition>
<equals>
<property>instrumentation/fgc-65/app-65a/AP</property>
<value>AP</value>
</equals>
</condition>
</enable>
<input>
<property>controls/flight/elevator-filter</property>
</input>
<output>controls/flight/elevator-trim</output>
<type>noise-spike</type>
<max-rate-of-change>0.3</max-rate-of-change>
<min>-1</min>
<max>1</max>

</filter>

</PropertyList>
tonyz
 
Posts: 12
Joined: Fri Aug 19, 2022 7:07 pm

Re: ILS not working in new FG2020.3.13 version

Postby TheEagle » Tue Aug 23, 2022 12:15 am

Cannot reproduce - please copy and paste my code again, this time without doing ANY edits to it ! :wink:
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: ILS not working in new FG2020.3.13 version

Postby tonyz » Tue Aug 23, 2022 10:52 am

Hi Eagle,
I have repeated the copy paste with exactly the same effect.
No edits have been made by me. The text I sent earlier was exactly as I copied/pasted.
I don't know whether it makes a difference but the version of fgfs I am using is 2020.3.12

By the way, thank you for the work you have done on the Cessna 210, a very enjoyable plane to fly.
It would be nice to have the b1900 behave as well as the 210

Best regards,
Tony
tonyz
 
Posts: 12
Joined: Fri Aug 19, 2022 7:07 pm

Re: ILS not working in new FG2020.3.13 version

Postby polly » Tue Aug 23, 2022 10:56 am

Hi,
I spent time with the previous yasim version and I've been working with @eagle 's patch, many thanks.
It looks to me that the properties in fgc-65 internal can act as accumulators if the A/P's filter sections are left active, so I added, to all enable clauses, a condition on the autopilot master:
Code: Select all
                    <equals>
                        <property>instrumentation/fgc-65/app-65a/AP</property>
                        <value>1</value>
                    </equals>


So far those changes on top of @eagle GS fix, give me altitude, VS, GS control but not NAV capture at times: in Nasal flightdirector.nas the function monitor_Larmed uses property:
instrumentation/fgc-65/internal/offsets/crs1-brg
this can have a -179.0 and so NAV1 capture ( not ILS1 ) capture gets blocked.

I can make a diff or whatever but I'm slowly taking a look at it. Tks again for updating the AP, the plane is a great challenge.
User avatar
polly
 
Posts: 956
Joined: Thu Nov 04, 2010 3:45 pm

Re: ILS not working in new FG2020.3.13 version

Postby TheEagle » Tue Aug 23, 2022 12:30 pm

tonyz wrote in Tue Aug 23, 2022 10:52 am:By the way, thank you for the work you have done on the Cessna 210, a very enjoyable plane to fly.

Glad you like it ! :) In fact, the FDM was mainly made by Ysop, not me - huge thanks to him, and the FDM is going to get even better, when he gets the time to continue work on it 1 :)

tonyz wrote in Tue Aug 23, 2022 10:52 am:It would be nice to have the b1900 behave as well as the 210

Yeah, the Beech 1900 flies pretty badly - as pretty much all aircraft in FG that have a stock AeroMatic FDM. If i could multiply myself, the B1900 would already have an FDM with the quality similar to that of my PC-6 ! ;) But sadly, that's not possible …

Back to topic, I have tested my modifications with a nightly build, so I'm gonna try it with 2020.3.13 later - maybe there were changes that affect the AP.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: ILS not working in new FG2020.3.13 version

Postby eegrek » Tue Nov 22, 2022 7:47 am

Thank you TheEagle for your code and instructions on 20th August/ think I have followed them o.k and now I get the Morse code signal and the AP shows GS in the Armed field and Loc1 in the Lateral field. I am not sure if I should have ALT or IAS inthe Vertical field. I have still to achieve a proper landing because I thought Ihat I had to switch the route map off when enteing APPR, or I am not matching the correct power setting with the glide height. I am now going to try to correct my errors and try again.
eegrek
 
Posts: 47
Joined: Sun Oct 09, 2022 11:17 am
Location: Norwich - United Kingdom
Callsign: EEGREK
Version: 2020.3.13
OS: Linux Mint

Previous

Return to Flying

Who is online

Users browsing this forum: No registered users and 6 guests