Board index FlightGear Development Aircraft Autopilot and route manager

Filter vs pi-simple-controller

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

Filter vs pi-simple-controller

Postby jaxsin » Fri Jan 29, 2016 5:48 pm

I been staring at this piece of code for a while now and I am positive it should work as a filter, but why not?

Code: Select all
    <pi-simple-controller>
        <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.0</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>


This is what I have tried

Code: Select all
    <filter>
        <name>Roll</name>
        <debug>false</debug>
        <enable>
            <condition>
                <equals>
                    <property>instrumentation/fgc-65/internal/lateral</property>
                    <value>ROLL</value>
                </equals>
            </condition>
        </enable>
        <type>gain</type>
        <input>
            <property>/orientation/roll-deg</property>
        </input>
        <reference>
            <property>instrumentation/fgc-65/settings/roll</property>
        </reference>
        <gain>1.0</gain>
        <output>
            <property>instrumentation/fgc-65/internal/fd/roll</property>
        </output>
        <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>
    </filter>
jaxsin
 
Posts: 396
Joined: Mon Dec 28, 2015 3:54 pm

Re: Filter vs pi-simple-controller

Postby curt » Fri Jan 29, 2016 10:53 pm

I'm pretty sure conditions are not supported in the autopilot configure (unless I'm mistaken.) I'm also not sure about relative property paths. You would want the block to look more like:

<enable>
<property>/instrumentation/fgc-65/internal/lateral</property>
<value>ROLL</value>
</enable>

The component should activate when the enable property is equal to the enable value.

Curt.
curt
Administrator
 
Posts: 1174
Joined: Thu Jan 01, 1970 12:00 am
Location: Minneapolis, MN

Re: Filter vs pi-simple-controller

Postby jaxsin » Sat Jan 30, 2016 7:29 pm

Autopilot reference

If I am reading this correctly it seems to say otherwise? In fact I think it is telling me that the way you reference was at sometime supposed to deprecated?
jaxsin
 
Posts: 396
Joined: Mon Dec 28, 2015 3:54 pm

Re: Filter vs pi-simple-controller

Postby Octal450 » Fri Oct 12, 2018 7:55 pm

I know this thread is dead, but I have the solution. Invert the sign on the <gain> in the filter. That fixes it. For some reason, the pi-simple-controller has the signs inverted from all filters (derivative, gain, integrator, etc)

And yes, conditions work fine inside <enable>

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


Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 0 guests