Board index FlightGear Development Aircraft Autopilot and route manager

Collective to Yaw Coupling

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

Collective to Yaw Coupling

Postby wlbragg » Sun Aug 07, 2022 8:42 pm

Hi all, I'm starting to program some missing pieces to the AirCrane (YASim) AFCS and basic FCS. While I have a very basic understanding of some of autopilot and property rule functionality, I am far from having even an average understanding as to what all is available or when and how to use it. So I am asking for some help and tutoring here in the forum.

The first "simple" function I want to create is a "collective to yaw coupling" for the basic fcs.

The actual aircrane controls that are involved as far as I have determined are...

/controls/engines/engine[0]/throttle
0 = no collective
1= full collective

/controls/flight/rudder
-1 = full left
1 = full right

According to the documentation..

Collective to Yaw Coupling provides input to the tail rotor to increase or decrease tail rotor pitch upon collective movement. This coupling provides automatic tail rotor torque compensation for collective changes. Collective movement is not affected by this coupling.

There is a preflight check for it explained as such that I think provides the basic functionality needed...

It involves pushing full left pedal, then raising the collective full up. If the couple is functioning correctly, the pedals should move to a nearly centered position as the collective is raised. While the collective is full up, the right pedal should be placed in the full right pedal position and the collective lowered. The pedals should return to a nearly centered position.

So what is the most appropriate autopilot or prop rule function to use here?
I assume fdm rate would be preferred for this?
Any example I can study?

I've done just enough programming using prop rules and autopilot I could probably figure something out, but I don't have the experience to know what is appropriate or best? I think my solution might be somewhat of a hack.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby Octal450 » Mon Aug 08, 2022 1:28 am

FDM rate for sure.

I'd approach this by summing the controls flight rudder property to a lookup table for collective position vs yaw command.

Or something like that - if I understood right.

Kind Regards,
Josh
Skillset: JSBsim, Systems, Canvas, Autoflight/Control, Basic Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|MD Dev Discord
User avatar
Octal450
 
Posts: 5196
Joined: Tue Oct 06, 2015 12:51 pm
Version: next
OS: Windows 11 Pro x64

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 3:00 am

Thanks Josh, I think I understand.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby S&J » Mon Aug 08, 2022 5:08 pm

Sounds to me that you have a plus 1, negative 1 bias on the rudder pedals aligned to a 0 to 1 on the collective.
"Stay away from negative people.They have a problem for every solution." - Albert Einstein
S&J
 
Posts: 577
Joined: Wed Aug 26, 2020 6:31 pm

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 6:59 pm

Yes, I think that's right. Now what's the best solution?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby S&J » Mon Aug 08, 2022 7:21 pm

Do you have a git link to the crane code please.

I'm not on my computer so can't download plane Ito FG at present.
"Stay away from negative people.They have a problem for every solution." - Albert Einstein
S&J
 
Posts: 577
Joined: Wed Aug 26, 2020 6:31 pm

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 8:11 pm

Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby S&J » Mon Aug 08, 2022 8:52 pm

That is sure complex, would I be correct in saying the fcs is written in nasal ?
"Stay away from negative people.They have a problem for every solution." - Albert Einstein
S&J
 
Posts: 577
Joined: Wed Aug 26, 2020 6:31 pm

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 9:44 pm

Locally I have added a autopilot section.

Aircraft/AirCrane/Systems/fcs.xml.

In development repo I think I pushed some limited proprule AFCS functionality. I'll be changing it to autopilot...

Aircraft/AirCrane/Systems/afcs.xml.

Yes some in nasal also...

Aircraft/AirCrane/Nasal/fcs-management.nas
Aircraft/Generic/helicopter-fcs.nas

It's a mess. I really want to eventually redo it all in JSBSim.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 10:21 pm

So would something like this work?

Code: Select all
        <input>
            <expression>
                <table>
                    <property>/controls/engines/engine[0]/throttle</property>
                    <entry><ind> 0.0 </ind><dep>  0.0 </dep></entry>
                    <entry><ind> 0.5 </ind><dep> -0.5 </dep></entry>
                    <entry><ind> 1.0 </ind><dep> -1.0 </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/controls/flight/rudder</property>
        </output>


So how is this added to /controls/flight/rudder and still allow the rudder pedals to override it? In other words how would this be mixed in real life with the pedals?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 10:38 pm

I had it backwards.
Code: Select all
        <input>
            <expression>
                <table>
                    <property>/controls/engines/engine[0]/throttle</property>
                    <entry><ind> 0.0 </ind><dep> -1.0 </dep></entry>
                    <entry><ind> 0.5 </ind><dep> -0.5 </dep></entry>
                    <entry><ind> 1.0 </ind><dep>  0.0 </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/controls/flight/rudder</property>
        </output>
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 10:52 pm

I imagine that the pedals override the collective influence if used, and then return to where ever they should be for the coupled collective? How do we do that?

Josh, is that where we sum the table value into the rudder value and limit the high and low ends to -1 to 1?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 11:00 pm

Would this make more sense to use "logic" VS "filter"?

Code: Select all
    <filter>
        <name>Collective to Yaw Couple</name>
        <!--update-interval-secs type="double">0.1</update-interval-secs-->
        <type>gain</type>
        <gain>1.0</gain>
      <enable>
         <and>
            <not>
               <prop>/controls/switches/afcs-servo</prop>
            </not>
            <not>
               <prop>/controls/switches/spring-switch/afcs</prop>
            </not>
         </and>
      </enable>
        <input>
            <expression>
            <sum>
               <property>/controls/flight/rudder</property>
               <table>
                  <property>/controls/engines/engine[0]/throttle</property>
                  <entry><ind> 0.0 </ind><dep> -1.0 </dep></entry>
                  <entry><ind> 0.5 </ind><dep> -0.5 </dep></entry>
                  <entry><ind> 1.0 </ind><dep>  0.0 </dep></entry>
               </table>
            </sum>
            </expression>
         <min>-1.0</min>
            <max> 1.0</max>
        </input>
        <output>
            <property>/controls/flight/rudder</property>
        </output>
      </filter>
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby wlbragg » Mon Aug 08, 2022 11:34 pm

Well, this may already be built in to the generic FCS. In YASim the inputs to the tail rotor are...

Code: Select all
<control-input control="COLLECTIVE" axis="/controls/flight/fcs/yaw" invert="true"   src0="-1.0" src1="1.0" dst0="-0.66" dst1="0.66"/>
         <control-input control="COLLECTIVE" axis="/controls/flight/fcs/tail-rotor/throttle" src0="-1.0" src1="1.0" dst0="-1.00" dst1="1.00"/>


Unfortunately, I have no idea if FCS works independent of AFCS in the generic aircraft code or YASim. Like for instance, where is /controls/flight/fcs/yaw and /controls/flight/fcs/tail-rotor/throttle introduced in the simulation, Are they native to YASim or what? Complex is the word. Every time I start digging, I start to rethink it all an question if I want to bother or just concentrate on making the JSBSim crossover.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 6531
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Collective to Yaw Coupling

Postby TheEagle » Tue Aug 09, 2022 12:51 am

I have no idea about YASIMs internals, but the last code you posted should do the job (apart from that <min> and max tags belong directly into the <filter> IIRC, or the <output> - but not in the <input>)
You won't believe how many issues dissolved into thin air after reinstalling !

Cessna 210 (GitHub | Wiki)
Find a list of the other aircraft I'm developing or enhancing in my wiki profile !
Addons: Landing challenge (GitHub)
Other: FGTools (GitHub)
User avatar
TheEagle
 
Posts: 2682
Joined: Sat May 01, 2021 2:27 pm
Location: France
Callsign: F-EAGLE
IRC name: none
Version: 2020.4.0
OS: Ubuntu Studio 20.04

Next

Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 1 guest