reiszner / KAP140

The Bendix/King KAP 140 autopilot for FlightGear Flight Simulation (FGFS)
GNU General Public License v2.0
0 stars 2 forks source link

GS availability check and locking potentially wrong #1

Closed hbeni closed 3 years ago

hbeni commented 3 years ago

Hello, I think GS arming is wrong, and the following lines be removed: https://github.com/reiszner/KAP140/blob/3d4f3590d11e9b2b1b97225996d21ee6c41593d5/kap140/kap140-proprules.xml#L1721-L1724

Instead, the GS-capture should check if GS-signal is available. The Locking should not occur "everywhere" when the needle is below, but only if it is a somewhat correct range (half the gauge=about 3 dots).

<!-- capture GS -->
    <filter>
        <name>capture GS</name>
        <type>gain</type>
        <debug>false</debug>
        <enable>
            <condition>
                <equals>
                    <property>autopilot/kap140/settings/lateral-mode</property>
                    <value>4</value>
                </equals>
                <property>instrumentation/nav-source/gs-in-range</property>
                <less-than>
                    <property>instrumentation/nav-source/gs-needle-deflection</property>
                    <value>0.0</value>
                </less-than>
                <greater-than>
                    <property>instrumentation/nav-source/gs-needle-deflection</property>
                    <value>-0.5</value>
                </greater-than>
            </condition>
        </enable>
        <input>3</input>
        <output>autopilot/kap140/settings/vertical-mode</output>
    </filter>

The reasoning behind is that the KAP140 has no capability to check if the tuned station has a gs signal or not. APR-mode should always try to lock onto a GS when APR-lateral mode had locked in, even when there is no signal (yet).

reiszner commented 3 years ago

Correct, good catch. I have also the upper limit to 0.1 so that the AP has more time to react before we cross. The lower limit is now -0.3 . I know from other experience that also 0.5 is to much. The AP start often a steep dive if this value is too low. We can fine tune this value later if we have nice control loops.

hbeni commented 3 years ago

OK - do you want to keep the issue open for this?

reiszner commented 3 years ago

Yes, let it open as a reminder to check it at the end a second time.

hbeni commented 3 years ago

I think you missed the <property>instrumentation/nav-source/gs-in-range</property> line, commented on the code itself. did you got a notification?

reiszner commented 3 years ago

Ooops, sorry

… and yes, we had a problem with email in the last 24 hours

update pushed

hbeni commented 3 years ago

...I think this was fixed already and can be closed.

reiszner commented 3 years ago

yes, closed.