• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Controlling Aileron Trim with Gauge

rcbarend

Resource contributor
Messages
435
Country
netherlands
I am going to need to figure out how to bring in aileron trim to my AIR file. Searching posts here for that.

I imported section 516 (Ailerons and Rudder Trim) from the B737 AIR file to my modified Extra 300 AIR file. No joy. Copied settings. Trim still not activating in the sim.

Roy talked about a second section in the AIR files for ailerons that I didnt find; 515. Thats not in the B737 file. Also, the B737 has 'nothing' about aileron trim (that I could find) in the config file.

https://www.fsdeveloper.com/forum/threads/aileron-trim.435319/#post-724173
Hi Bill,

I know virtually nothing about Air files and it's tables; just how to work around them in gauge code ...LoL
I do know that the default FSX B737-800 has an active Aileron Trim (maybe defined in Air file only ?) ; just fly straight ahead with centered Ailerons and activate AileronTrim Left/Right ; it will start to bank Left/Right.
So I do suggest you take the time to try my experiment with the default B737-800; if only to see that my code above works and what the effect is ….

Cheers, Rob
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
Every airplane has aileron trim, but you have to assign a joystick command to it in the Options menu.
Roy
 
Messages
10,088
Country
us-arizona
Thanks for that, Roy. And I did that test, linking aileron trim to my joystick and it was indeed working...

Rob, I found out why your code wasnt working. My gauge I embedded it in, had a comment embedded in a comment, lol.... Hours yesterday of coding and nothing worked. Frustrating. Just found the issue at 5:30 PM the next today.... sigh. Glad I found it though. Its my 'systemsmanagement' gauge that runs everything on Update.

Now to start experimenting with this feature.

A thousand thanks, guys for all your input and help.
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
Bill,
The main reason why left rudder creates a left turn is that the right wing goes faster from the yaw to left, gets more lift and banks left. If you apply right aileron trim when left rudder is used, it will not bank so any left turn will be minimal. It is called cross controlling, and creates very little turn. If you get slow and it cross controls you will probably spin and your cross control will keep you in the spin.
Roy
 
Messages
10,088
Country
us-arizona
Bill,
The main reason why left rudder creates a left turn is that the right wing goes faster from the yaw to left, gets more lift and banks left. If you apply right aileron trim when left rudder is used, it will not bank so any left turn will be minimal. It is called cross controlling, and creates very little turn. If you get slow and it cross controls you will probably spin and your cross control will keep you in the spin.
Roy

Many thanks Roy for that input. I am pretty much trying to simulate what the B2 flying wing does, but with less wingspan. Also I am using prop feathering as well as spoilers for Yaw control. So far so good.

Would be interesting to do a RC model of this and see if it flies.
 
Messages
10,088
Country
us-arizona
Hi Bill,

I know virtually nothing about Air files and it's tables; just how to work around them in gauge code ...LoL
I do know that the default FSX B737-800 has an active Aileron Trim (maybe defined in Air file only ?) ; just fly straight ahead with centered Ailerons and activate AileronTrim Left/Right ; it will start to bank Left/Right.
So I do suggest you take the time to try my experiment with the default B737-800; if only to see that my code above works and what the effect is ….

Cheers, Rob


THIS DANG THING WORKS AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Messages
10,088
Country
us-arizona
Bill,
The main reason why left rudder creates a left turn is that the right wing goes faster from the yaw to left, gets more lift and banks left. If you apply right aileron trim when left rudder is used, it will not bank so any left turn will be minimal. It is called cross controlling, and creates very little turn. If you get slow and it cross controls you will probably spin and your cross control will keep you in the spin.
Roy

The feature is pretty cool, Roy. I am wondering, in real world, with such a plane, doing this with a computer input, to help the plane (or enable it) to do these flat turns. Its narly...


Bill
 
Messages
10,088
Country
us-arizona
Ok, it was late. I thought it was working and it wasnt. My apologies.

I found that my testing gauge wasnt working also, got that working proper. It was using Events instead of Parameters.

Found that its adding only '10' on trim. I would think it would measure up to 100%. Perhaps this is 'adds only 10 percent per input' that Bill was talking about.
To counter this, I increased the 0.5* to something like 7.5 * at one point. That did nothing. I also increased aileron trim effectiveness to up to 10 lolol... Nothing works. But it registers trim going in, and it clears when I bring rudder back to neutral.

I'll just keep plugging away at it. Would be interesting to get it working.
 
Messages
10,088
Country
us-arizona
Still plugging away.

Got this system working nicely except no noticeable aileron 'effect' occuring.
Test system shows its setting up 10 and -10 on trim.

I have tried all I know to increase the trim input. Nothing seems to work. 10 is the highest it goes to.

I wonder if I can 'pulse' in 3 settings or 5 settings of trim? Rob, could that be what you were doing with 6 * in your script? Is that 6x trim input settings?

Code:
// RIGHT RUDDER AND AILERON MANAGEMENT ON FLAT TURNS WITH NO AILERON INPUT
(A:RUDDER POSITION,percent) 10 >
        if{ (A:AIRSPEED INDICATED,knots) 60 >
            (L:AUTO AILERON SYSTEM,bool) 0 == and
               if{ -6000 (>K:AILERON_TRIM_SET)
                         1 (>L:AUTO AILERON SYSTEM,bool) } }

// RESET
9.9 0 (A:RUDDER POSITION,percent) rng
(A:AIRSPEED INDICATED,knots) 59.9 < or
     if{ (L:AUTO AILERON SYSTEM,bool) 1 ==
               if{ 0 (>K:AILERON_TRIM_SET)
                   0 (>L:AUTO AILERON SYSTEM,bool) } }

// LEFT RUDDER AND AILERON MANAGEMENT ON FLAT TURNS WITH NO AILERON INPUT
(A:RUDDER POSITION,percent) -10 <
        if{ (A:AIRSPEED INDICATED,knots) 60 >
            (L:AUTO AILERON SYSTEM,bool) 0 == and
               if{ 6000 (>K:AILERON_TRIM_SET)
                         1 (>L:AUTO AILERON SYSTEM,bool) } }

// RESET
-9.9 0 (A:RUDDER POSITION,percent) rng
(A:AIRSPEED INDICATED,knots) 59.9 < or
     if{ (L:AUTO AILERON SYSTEM,bool) 1 ==
               if{ 0 (>K:AILERON_TRIM_SET)
                   0 (>L:AUTO AILERON SYSTEM,bool) } }

Note that Aileron trim is 6000 (binary) input. I tried 10, 30, 40, 70, then 1000, 3000, and now 6000, trying to increase aileron trim amount.
Aileron trim effectiveness is at 10x, not 1.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I'm not seeing that key event (>K:AILERON_TRIM_SET) in the Prepar3D SDK Bill. I know that Rob recommended it, but it's not listed in the SDK... :scratchch

I only see:
(>K:ELEVATOR_SET) <!-- Sets elevator position (-16383 - +16383) -->

Ah! I see here in the distant past* this revelation from Jon:
Actually there is. It just isn't documented. It is listed however in the Gauges.h.

K:AILERON_TRIM_SET and K:RUDDER_TRIM_SET
also:
99 (>K:AILERON_TRIM_SET) results in "99" for (A:AILERON TRIM PCT, percent)

* Note: https://www.fsdeveloper.com/forum/threads/aileron-trim.435319/
 
Last edited:

rcbarend

Resource contributor
Messages
435
Country
netherlands
I'm not seeing that key event (>K:AILERON_TRIM_SET) in the Prepar3D SDK Bill. I know that Rob recommended it, but it's not listed in the SDK... :scratchch

I only see:
(>K:ELEVATOR_SET) <!-- Sets elevator position (-16383 - +16383) -->

Ah! I see here in the distant past* this revelation from Jon:

also:


* Note: https://www.fsdeveloper.com/forum/threads/aileron-trim.435319/
Correct.
Not sure where I picked this up in the past, but it's not in any SDK as far as I know.
But I've been using it in FSX for many of my VSTOL implementations since 2008, to control stuff using AileronTrim as a "proxy" axis (works in P3Dv4 too).
Like for nacelles control in Maryadi's V22 Osprey and for STOVL speed control in Dino's F35B.

But the behavior of AileronTrim quite peculiar, and unlike e.g. ElevatorTrim; it's kind of a discrete axis with 201 discrete values.
As I said above, each AILERON_TRIM_RIGHT or AILERON_TRIM_LEFT event, increases/decreases the value of (A:AILERON TRIM PCT, percent) with exactly 1% (no "acceleration").
So the full range of the AileronTrim axis is from -100% (full left trim) upto +100% (full right trim).
The event AILERON_TRIM_SET takes a value from -100 to +100, and sets (A:AILERON TRIM PCT, percent) to that (rounded to integer) value.

Rob
 

rcbarend

Resource contributor
Messages
435
Country
netherlands
Test system shows its setting up 10 and -10 on trim.
Most probably your testsystem is reading (A:AILERON TRIM,degrees) and not (A:AILERON TRIM PCT,percent)
Which is quite different (the first gives "angle", the second gives "percentage of max. deflection")

Also, I don't understand why you persist in splitting your code in left and right rudder input.
What
Code:
(A:RUDDER POSITION,percent) -0.6 * (&gt;K:AILERON_TRIM_SET)
does, is proportionally set rudder input to opposite AileronTrim.
So:
- Full left rudder sets AileronTrim to 60% right trim.
- Full right rudder sets AileronsTrim to 60% left trim.

But most importantly, I think you are missing the point about the difference between how AileronTrim is set, and what the effect of it is on flight behavior.
As said, I know very little about .air files.
But somewhere in the .air file, you should be able to define the effect of AileronTrim setting.
I can only describe what I observe myself in FSX-Accel:

- My code to set AileronTrim based on Rudder input works the same for any default aircraft; be it the Extra300, the Cessna172 or the B737-800.
I tested that myself.

- However, the EFFECT on how the aircraft reacts to AileronTrim setting is very different:
For the Extra300 and Cessna172 the flight effect of whatever AileronTrim setting, is Zero.
Also meaning that whatever value for aileron_trim_effectiveness= you set in the aircraft.cfg, makes no difference at all on flight behavior.
Even a setting of aileron_trim_effectiveness=100 has no effect whatsoever on flight, if you set full AileronTrim right of left .
But doing the same in the default B737-800, the difference on flight behavior is hugh.

Again, your problem is NOT the setting of AileronTrim (whatever code you use), but how the aircraft (i.e. it's FDE) reacts to the setting of AileronTrim.
Surely, this must be something specified in the .air file. Where else ??

Rob
 
Messages
10,088
Country
us-arizona
Man... This is becoming a super power for me... Finding all these road blocks and problems. One after the other, I find them.... :(
 
Top