• 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.

Elevator Trim/Elevator Trim Indicator Problem

Jimi,
I think the major problem is using the same control for two purposes. A button used for trim can not be used for another control input, it is assigned to trim down or trim up. At least that is what I believe and someone may know better.

You can differentiate between a trim change activated by a button and one done by the code using <Keys> but I have never experimented with that. I believe you could adjust the desired AOA that way, but you would still be changing the trim setting. See Tom's input at 0816 today.

Could you check whether the FA-18 trim button still controls trim when in the landing mode when it also adjusts the desired AOA. If you have one of the system diagrams or tables for different mode you may find that it does something different in landing mode. This would not be at all unusual. For instance the ADI vertical steering bar in the A-7 has different functions depending on what mode you are in. And the HUD has different symbology.

You can do this in FS with a programmable joystick like the Saitek X52. This stick has three modes with different coding for buttons within each mode. One of the modes could be "Landing" That is the only way I can think of doing it.

I tried downloading the zip file, but I think you have to share it with me before I can do that. I would like to see it so could you email it to me on bibbiroy@verizon.net

Roy
 
The short answer is that AFAIK your approach just will not work, and you will have to give up adjusting the trim values directly. That just will not work! No "trim counters", nothing like that. Use an L: variable to set the AOA gauge indication, and then use your gauge code to adjust the FS trim variables to get the AOA to match that of the L: variable the pilot set. The FS trim variables are *invisible* - no visible indication of those variables are in any gauge on the panel and also *not* pilot controllable - your gauge code is doing that for him/her.
 
Tom,
I am in full agreement with everything you said.

Jimi,

I downloaded a NATOPS manual for the F/A-18E/F this afternoon. It is the clearest manual I have seen and really easy to skim and find the data you need. It was promulgated in 2000, so it may be out of date and things may be different now, however this is my take on the requirements as stated in the Manual I have.

We are talking about the Powered Approach (PA) mode of the Control Augmentation System (CAS). This mode is automatically entered when the flap is set to HALF or FULL and the airspeed is less than 240 Knots calibrated air speed (KCAS) FS does not recognize KCAS, but at values less than 240 it is close to Indicated Airspeed (Indicated, not TRUE airspeed). The mode is entered irrespective of Weight on Wheels (WoW) or Weight off Wheels (WoffW) WOW corrresponds to (A:SIM ON GROUND,bool) being 1. Although the mode is called PA it is used for take-off as well. From what I read in the Manual this is because the optimum AOA conditions on an approach are the same as the optimum AOA conditions for a take-off or bolter.

Lots of things happen in PA mode, but I will only address the longitudinal mode and consider a decelerating straight-in approach, to keep things simple.

With flaps set at FULL, speed below 240 KCAS and autopilot NOT selected, the CAS enters PA mode. This mode tries to null the difference between commanded AOA and actual AOA, but does require manual pitch trim inputs to get there and stay there. No surprise, setting the trim instantly for 135 kts on speed (at max landing weight) when at 240 would be pretty exciting!

You have to trim nose up as speed decreases and AOA increases, but can bump the commanded AOA to 6 by hitting the paddle switch. This would set trim to whatever is needed for 6 degrees AOA and level flight. The paddle switch with WoffW and autopilot not selected, does this. With WoW it disconnects the Nose wheel Steering (NWS) and with WoffW and autopilot selected, it disconnects the autopilot. FYI, I use the equivalent positioned switch on my joystick to engage parking brake which is why my PID code had parking brakes application as a disconnect.

At this point you continue trimming nose up as speed reduces to to get to 8.1 AOA and level flight. The CAS tries to null the difference between 8.1 and actual AOA. BUT it does this in a gentle manner and becomes most effective after you get settled down on-speed. You used the trim when at on-speed to get 8.1 AOA (actually between 7.4 t0 8.8 based on the indexer lights and more accurately based on the AOA bracket position with respect to the HUD flight path marker (FPM).

So, the last commanded AOA position was yours when you used trim to get it to 8.1 at the correct speed.

If you then again used trim, you would alter the "commanded" AOA, because the AOA would change since trim was changed.

At this point and after ten (10) acronyms I would like to ask you if the commanded AOA that you saw on the simulator HUD was in a different place and also different from the actual AOA display. What I think happened was that you applied nose-up trim which, naturally, increased the AOA. I was not there, I'm not disputing what you saw and said, but if there was a different window for commanded AOA in the HUD, there is no mention of it in the NATOPS Manual I have. I worked for 11 years on HUD displays and their OFP's (Operational Flight Programs). Dang, another acronym!. Each display of data in a HUD is assigned a window by the OFP. Depending on mode selected the same window can be used for different data. You could close out my argument by asking if there is a "commanded" AOA window in the HUD, in addition to the normal AOA window.

So, like Tom says, forget about trim counters. Use nose up trim until you are level at the correct airspeed for 8.1 AOA, depending on airplane weight. If you want some code to adjust trim automatically once you are there, the PID code I wrote would do that. But you still need to adjust Flight Path Angle (FPA ) with throttle to make sure your speed, hence lift, hence AOA is correct.

Without my PID code or similar, this would involve more pilot workload, With it included and automatically applied once in PA mode and within a few degrees of 8.1 AOA you would would essentially be able to do what is described in the version of NATOPS I have.

Since I got into this thread in a big way, I'll stay the course if you are in agreement with my argument and need more detailed help.

Roy
 
Last edited:
Roy,

From what I've read in the F/A-18 NATOPS and from what a few Naval Aviators have told me, the FCS system, controls the trim to maintain whatever AOA the pilot has set. He sets this by using the trim hat on the stick. I confirmed this when I flew this past weekend. I used trim as I came in on approach, and every time I pushed or pulled the trim hat, I got a number that briefly flashed on the bottom right of the HUD telling me what AOA I was now telling the aircraft to trim to and maintain. Just as in a normal aircraft with a trim system, the nose would initially move up or down based on what I dialed in, but unlike most aircraft, once the set AOA was reached, the aircraft would re-adjust its pitch to maintain selected AOA, leaving me to use throttle to maintain glideslope on approach. As far as the link, it shouldn't require certain access to it. I will double check.

Roy/tgibson,

I decided to try a different approach today. I decided to lower the elevator effectiveness to 0 and re-code the pitch trim system to use the ELEVATOR (not elevator trim) as the primary control surface to maintain assigned flight conditions. Now the elevator trim value, is only effective an numeric input to be used by the FCS to include in its calculations for the elevator.

Here's how it works now:
During Up & Away flight (Gear Up, Above 250), every 0.1 indicated on the elevator trim indicator now tells the FCS to add and maintain that value, but in terms of G. So, if I dial in 0.1 Nose Up on the trim indicator, the jet will apply fore and aft elevator until it reaches and maintains 1.1 G. If I set -0.1 Nose Down, it will achieve and maintain 0.9 G. It continues do do this as trim is added or subtracted, so if i dial in .5 Nose Up, the FCS will maintain 1.5 G, 1.8 Nose Up, the FCS will maintain 2.8 G.

During Powered Approach flight (Gear Down, Below 250), the value indicated on the Elevator Trim Indicator now becomes the AOA that the FCS strives to maintain. So, I've I use my trim buttons, to dial in 8.1, the elevators will move up/down in order to establish and maintain 8.1 degrees of AOA. If I use my buttons to change the value on the Trim Indicator, the aircraft will re-adjust itself accordingly.

Only problem now, is to figure out how to stop it from oscillating so much. Although the system will maintain the selected G/AoA, this is a noticeable oscillation going on. I am pretty sure this is due to the ELEV_UP & ELEV_DOWN key events which increment the elevators up or down instead of giving the elevators a direct or set value to go to. Just thinking off the top of my head... the needed algorithm need to give an accurate value to the elevators would have to include, aircraft weight, speed, angle of bank, and pitch angle. Not to mention that the elevator effectiveness/speed is not linear in this model. Sounds like a pretty complex algorithm if you ask me.

Anyways, this is what I have coded now:

// --- POWERED APPROACH

(L:TRIM SET, number) 0 &gt;
(A:GEAR CENTER POSITION,Percent) 30 &gt; &amp;&amp;
if{ (A:ELEVATOR TRIM POSITION, degrees) (A:INCIDENCE ALPHA,Degrees) } / (&gt;L:AOA ADJ, number) }

(L:AOA ADJ, number) 1 &gt;
(A:GEAR CENTER POSITION,Percent) 30 &gt; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &lt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) -90 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) 90 &lt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;K:ELEV_UP) } els{ }

(L:AOA ADJ, number) 1 &lt;
(A:GEAR CENTER POSITION,Percent) 30 &gt; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &lt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) -90 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) 90 &lt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;K:ELEV_DOWN) } els{ }


// --- UP AND AWAY

(A:SIM ON GROUND, bool) !
if{ (A:ELEVATOR TRIM POSITION, degrees) 1 } + (&gt;L:TRIM SET, number) }

(L:TRIM SET, number) 0 &gt;
(A:GEAR CENTER POSITION,Percent) 30 &lt; &amp;&amp;
if{ (A:G FORCE,G Force) (L:TRIM SET, number) } / (&gt;L:TRIM ADJ, number) }

(L:TRIM ADJ, number) 1 &lt;
(A:GEAR CENTER POSITION,Percent) 30 &lt; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) -90 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) 90 &lt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;K:ELEV_UP) } els{ }


(L:TRIM ADJ, number) 1 &gt;
(A:GEAR CENTER POSITION,Percent) 30 &lt; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) -90 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) 90 &lt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;K:ELEV_DOWN) } els{ }

(A:ROTATION VELOCITY BODY X, feet per second) 0.00 &lt;
(L:TRIM ADJ, number) 0.2 &gt; &amp;&amp;
(L:TRIM ADJ, number) 1.8 &lt; &amp;&amp;
(A:ELEVATOR TRIM POSITION, degrees) 0 ==; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:GEAR CENTER POSITION,Percent) 30 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &gt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;K:ELEV_DOWN) } els{ }

(A:ROTATION VELOCITY BODY X, feet per second) 0.00 &gt;
(L:TRIM ADJ, number) 0.2 &gt; &amp;&amp;
(L:TRIM ADJ, number) 1.8 &lt; &amp;&amp;
(A:ELEVATOR TRIM POSITION, degrees) 0 ==; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:GEAR CENTER POSITION,Percent) 30 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &gt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;K:ELEV_UP) } els
 
Last edited:
Jimi,
We sort of crossed paths with these posts!

Have a good look at my post and fire away with questions. It seems there is a newer HUD window than described in the Manual I have. If you can find out what it displays and why we could possibly get to an up to date solution. That would depend on whether the latest NATOPS is released for use by the general public "Distribution A Unlimited" If not just go with the 2000 edition. I suspect it is an advisory display of what the commanded AOA would become due to your pitch trim input based on a new commanded trim setting.

Using elevator position is a Bang Bang control system, OK for missiles that are not prone to air sickness. You will have continual overshoots of the desired conditions. A PID system, as used for autopilots etc tries to minimize overshoots so that it converges smoothly on a solution.

FYI you could simplify your code by making the result of all the flight conditions become something like (&gt;L:PA_valid,bool) and then use this with (L:AOA ADJ, number) 1 &gt; to avoid code repitition.

To put it simply, you can not simulate the F/A-18 CAS PA trim/AOA relationship with three "if" statements. It just is not that simple.

You have to understand the aerodynamic effects of your inputs most of which are secondary effects based on established relationships between indicated airspeed, lift coefficients according to basic wing lift plus flap additives and the AOA changes due to pitch changes that are very non-linear during a high AOA approach. The airplane software systems designers have huge programs to deal with these variables.

Up to you where you want to go from now.

Roy
 
Roy,

Once again, thanks for your input on this. I am definitely willing to stay the course, as this has been a side project of mine for the past 10 months or so. Some of the things we have implemented in our F/A-18 are a little different from NATOPS due to limitations of either our knowledge of coding or limitations of FSX. One example is the Auto Flaps. Just like you stated in your piece out of the NATOPS, Auto Flaps and thus Pitch Autotrim is entered once flaps are placed in "AUTO" mode. We had to go with the Gear function due to our inability to separate what the flaps are actually doing from the flaps indication or the flaps handle, but that's another long story....

I just tested the link, posted previously. I works, so I'm not sure what the issue is. That version, does not have the system we are currently discussing for it's powered approach mode. The PA mode contained in the download uses pitch trim to trim the aircraft to zero-pitch rate while gear/flaps down.

The file is 76 MB zipped. I tried uploading it here with no luck and most email services will not allow files that big to be sent. The only other option that I can think of is something like Skype of Instant Messenger where I can send you there file directly. If that seems like an option for you or anyone else or that matter, my Skype name is "justheman2008".

....I'll search for a picture or video showing the AOA trim adjustment on the HUD...

Thanks again.
 
Would it help to use a visibility tag and just have 2 trim wheels.
So one works like normal and the other can sit still during approach.
And use the auto pilot the switch over.

DG
 
Last edited:
The F/A-18 has a "fly-by-wire" control augmentation system (CAS) with two basic models Powered Approach (PA) and Up-AUTO (UA).

To model these, the relevant outputs from the controller (stick) need to be disconneced from the inputs to FS and code included to provide your own required inputs based on the controller outputs and aircraft state.

This can be done with FSUIPC, but I don't know if if it can be done with XMLor SimConnect because of my limited knowledge.
 
Last edited:
Jimi,
I modified and simplified the AOA hold XML code.

It runs when the initial conditions are met, no mouse inputs required, no test display. It is invisible to the pilot, which is what you wanted.

You will have to change some of the numbers because they are set up for an A-7 and I'll cover that later.

You can not change the target AOA once it is set, but that is a minor issue.

What the code does is let you fly with no longitudinal stick inputs at constant AOA using the throttle for pitch hence glide slope control.

I have flown approaches and hands off landings in the A-7D and it works well. You have to be gentle on the throttle movements and anticipate overshooots but that is normal practice.

With the number changes commented on in the code you should be able to add this gauge in the panel config and go fly.

Code:
<?xml version="1.0" encoding="UTF-8"?>

<Gauge Name="A-7D_AOA_HOLD">
	<Image Name=""/>
	<!-- Valid conditions for code to operate -->
	<Element>
		<Select>
			<Value>(A:AIRSPEED INDICATED,knots) 180 &lt;
(A:TRAILING EDGE FLAPS LEFT ANGLE,degrees) 39 &gt;
and
(A:GEAR CENTER POSITION,percent) 90 &gt;
and
if{ 1 (&gt;L:VALID HOLD,enum) }
els{ 0 (&gt;L:VALID HOLD,enum) }
</Value>
		</Select>
	</Element>
	<!-- For F/A-18 use 8.1 instead of 10.5 -->
	<Element>
		<Select>
			<Value>(L:AOA_init,bool) 0 ==
	if{ 10.5 (&gt;L:AOA HOLD VAR,number) 1 (&gt;L:AOA_init,bool) }</Value>
		</Select>
	</Element>
	<!-- Overall algorithm -->
	<!-- output  =  loop gain * ( error + (integral(error) / INT) + (derivative(error) * DIF ) ) -->
	<!-- AOA TRIM HOLD -->
	<!-- Load Parameters with Loop Gain, Integral Constant, Differential Constant, Time Interval (TI superflous in software?) -->
	<Element>
		<Element>
			<Select>
				<Value>150 (&gt;L:TRIMLoopGain,Number) 
				100 (&gt;L:TRIMInt,Number) 
				1 (&gt;L:TRIMDif,Number) 
				1 (&gt;L:TRIMTInt,Number)
			</Value>
			</Select>
		</Element>
		<!-- Proportional -->
		<Element>
			<Select>
				<Value>(A:INCIDENCE ALPHA,degrees) (L:AOA HOLD VAR,number) - 
				(&gt;L:TRIMSetErr,Number) 
				(L:TRIMSetErr,Number) (&gt;L:TRIMpidOut,Number)
			</Value>
			</Select>
		</Element>
		<!-- Integral -->
		<Element>
			<Select>
				<Value>(L:TRIMpidOut,Number) (L:TRIMIntegral,Number) (L:TRIMTInt,Number) (L:TRIMInt,Number) / * + 
				(&gt;L:TRIMpidOut,Number)
			</Value>
			</Select>
		</Element>
		<Element>
			<Select>
				<Value>(L:TRIMSetErr,Number) abs 2 &lt; 
			if{ 
				(L:TRIMIntegral,Number) (L:TRIMSetErr,Number) + 
				(&gt;L:TRIMIntegral,Number) } 
			els{ 
				0 (&gt;L:TRIMIntegral,Number) 
			}
			</Value>
			</Select>
		</Element>
		<!-- Derivative -->
		<Element>
			<Select>
				<Value>(L:TRIMSetErr,Number) (L:TRIMDerivative,Number) - 
				(&gt;L:TRIMChange,Number)
			</Value>
			</Select>
		</Element>
		<Element>
			<Select>
				<Value>(L:TRIMpidOut,Number) (L:TRIMChange,Number) (L:TRIMDif,Number) (L:TRIMTInt,Number) / * + 
				(&gt;L:TRIMpidOut,Number)
			</Value>
			</Select>
		</Element>
		<!-- Last Error -->
		<Element>
			<Select>
				<Value>(L:TRIMSetErr,Number) 
				(&gt;L:TRIMDerivative,Number)
			</Value>
			</Select>
		</Element>
		<!-- Add loop gain -->
		<Element>
			<Select>
				<Value>(L:TRIMpidOut,Number) (L:TRIMLoopGain,Number) * 
				(&gt;L:TRIMpidOut,Number)
			</Value>
			</Select>
		</Element>
		<!-- Output windup limiting-->
		<Element>
			<Select>
				<Value>(L:TRIMpidOut,Number) 3000 min -3000 max 
				(&gt;L:TRIMpidOut,Number)
			</Value>
			</Select>
		</Element>
		<!-- Drive output Note the 4100 offset will need to be changed for the F/A-18 trim value at 8.1 AOA-->
		<Element>
			<Select>
				<Value>
				(L:VALID HOLD,enum) 0 !=
			if{ 
				(L:TRIMpidOut,Number) 4100 -
				(&gt;K:AXIS_ELEV_TRIM_SET) 
			}
			</Value>
			</Select>
		</Element>
	</Element>
</Gauge>
The initial code stipulates the conditions required for it to be valid. The desired AOA HOLD VAR is then input as an initialization routine that happens only once. You may want to change the speed, flap settings etc to suit.

Then you come to the meat of the code.

First, the PID constants are loaded.

The Proportional section compares AOA with the Set value and the result is output as the first PID output.

The Integral section derives the second PID output and zeros the integral unless the Set error is 2 or less. This is done to limit the bounds for integral calculation.

The Derivative section is then calculated. It is a measure of the rate of change of the solution and is the third PID output. The "Last error section" updates the derivative for use on the next pass through the algorithm.

Loop gain is applied and limited in the next section to avoid windup.

Finally, There is a test for valid conditions. If that test passes the trim position is set according to the PID output and an offset. K:AXIS_ELEV_TRIM_SET will be a number between -16383 and +16383 where 16383 represents the full range of trim specified in degrees in the config file. I made this 16.38 degrees for mathematical convenience and the 4100 offset puts the desired trim at 4.1 degrees nose up with reference to a zero PID result. You will have to adjust the offset value to suit your configuration

The PID constants have not been optimized but seem about right. Also the strength of trim effect is a coefficient in the .air file (section 1101 Cm_dt Pitch Moment - Trim) which is -1 for my model and -2.2 for the FA-18. Your PID constants would most likelly be different than mine.

I have left you to make numerical changes, but that is all that you need to do.

To sum up. This code will operate when the valid conditions are met and requires no pilot selection. It will hold AOA on the approach and glide slope is maintained with throttle. That is what happens with autopilot not selected. If you select AP and are in the approach mode it obviously does not directly control glide slope. It does still work at holding AOA, but the throttle becomes more like a speed control since the AP is adjusting trim.

Let me know if you have any questions about adapting it to the F/A-18.

Roy

PS. I claim no originality for the PID code, I just adapted it from PID code that Chris (with the lampshade hat) published last year.
 
According to my copy of NATOPS for the F/A-18E/F

In PA, AOA and pitch rate feedbacks are used to augment inherent airframe pitch damping and
stability. P CAS nulls the difference between the commanded AOA and actual AOA. With neutral
longitudinal stick, P CAS maintains trim AOA. Unlike UA, pitch trim is required in PA to trim the
aircraft on-speed...
 
Jimi,
No luck so far but perhaps you could send it on Skype. I'm roy.holmes431

mgh,
you always have to trim to get an airplane at a desired AOA, but what PA mode does is maintain the AOA at the value you trimmed to. You then use throttle to adjust pitch and altitude.

Have a look at post # 23, I covered the system there. The code that Jimi is looking at is a good simulation of the PA system as defined in the Manual

Roy
 
I suggest you may have misinterpreted the quotation from 2.10.5 of NATOPS FLIGHT MANUAL NAVY MODEL F/A-18E/F 165533 AND UP AIRCRAFT

With neutral longitudinal stick, P CAS maintains trim AOA.

The manual also says:

2.10.9.3.1…In PA, pitch trim is required to trim for on-speed AOA

7.7.2…If the autopilot is “paddled off” and AOA is greater than or equal to 6°, pitch trim is automatically set to on-speed.*

11.1.2…The FCS employs full-time AOA and pitch rate feedback with flaps HALF or FULL. Therefore, longitudinal trim is required to maintain constant AOA and/or airspeed. Once trimmed to an AOA, the aircraft tends to remain at that AOA until changed by longitudinal stick or trim.

* If less than 6° then presumably it’s set to actual AoA with the pilot manually trimming as necessary?

Surely, this means that in PA the pilot can command and achieve any AoA he wishes, by moving the stick. On returning the stick to neutral the aircraft will resume the trimmed AoA.

As I understand it, your code would trim out any change in AoA arising from stick movement.
 
mgh,
Thanks for your input. It always helps to have questions about posts because it is easy to miss something when immersed in code.

I have the same NATOPS as you, but the PA section is 2.9, 2.10 deals with the autopilot.

To answer your points.
With neutral longitudinal stick, P CAS maintains trim AOA

Correct, once the pilot has trimmed for neutral at the desired AOA.

7.7.2…If the autopilot is “paddled off” and AOA is greater than or equal to 6°, pitch trim is automatically set to on-speed.

In post #23 I misinterpreted my scribbled notes from the manual. I meant to say just that. I believe the paddle switch sets the target for AOA at 8.1 and until used there is no target set, the pilot is just trimming nose up to maintain steady flight as speed decreases and AOA increases .

I chose to have the target AOA set once valid conditions are met. My reason for that was that Jimi wanted the system to operate without pilot inputs or key strokes. It is a difference between the Manual description and my code. However it only applies to the period between achieving valid conditions and achieving on-speed AOA. The issue here is that during that period the large set error would cause a build up in the integral term of the PID algorithm. I avoided this by zeroing the integral until the set error was within 2 degrees. So the full algorithm only starts when the pilot has trimmed such that AOA is within 2 degrees of target. It is similar to setting the 8.1 target when at 6 AOA in the F/A-18, but avoids the need to press a switch. For simplicity I also chose to use full, not half flap as a valid condition.

As I have explained in previous posts the code I published is for an A-7 not the F/A-18 and the target is 10.5 not 8.1. The code also has an output offset that results in trim being set at 4.1 degrees nose-up when 10.5 AOA is achieved, the trim setting that gives level flight at 10.5 in my simulated A-7D. I left it to Jimi to adjust these values in the F/A-18. So, again the code works well, but is not correct for the F/A-18.

As I understand it, your code would trim out any change in AoA arising from stick movement.

The main purpose of the PA mode is to avoid the need for longitudinal stick movements during the approach. You can override it by making stick movements to adjust attitude and glide slope. However it continually works at maintaining the target AOA. For example, on a carrier bolter the pilot will apply power, speed will increase giving increased lift and the nose will rise. Because 8.1 AOA gives the safest flight conditions during a bolter he does not need to pull back on the stick. If he did the AOA would increase above 8.1 reducing the stall margin. This is because stick movements have a stronger effect than trim movements.

What I have found is that during small stick movements the code does a good job of maintaining AOA, but you only need them if you have failed to control flight path with the throttle. The primary effect of throttle movement is a decrease or increase in speed. The secondary effect due to stability is an attitude change, nose down with speed decrease and vice versa. The actual speed can be ignored, the attitude change is corrected by throttle movement.

The main advantage of using AOA on an approach is that you achieve the correct airspeed regardless of aircraft weight. That is why the correct AOA is called "on-speed" AOA.

What the code does is compare current AOA with Target AOA and output a trim setting according to the set error. The trim setting is designed to decrease the set error to zero, so you establish and maintain the target AOA.

You are correct that the code will affect AOA changes due to stick movement, but such movements are contrary to NATOPS pilot procedures when using PA. The procedure is to avoid stick movements for attitude changes and use the throttle instead.

7.7.5 Final Approach. Timely, well-controlled power corrections will be required to capture and/or maintain the desired glideslope.

Thanks again for the input and let me know if you still believe I have misinterpreted the NATOPS descriptions and procedures.

Roy
 
I think we agree on the basic principles of the F18 system, although I would disagree to some extent with your final words here:

You are correct that the code will affect AOA changes due to stick movement, but such movements are contrary to NATOPS pilot procedures when using PA. The procedure is to avoid stick movements for attitude changes and use the throttle instead.

This may the case for landing, but PA is also engaged on takeoff. 1/3 to 1/2 aft stick is required for a shore-based takeoff. For a carrier-based take-off trim is to be set to T/O TRIM. This sets the reference AOA which the FCS attempts to hold after launch. This value is 12° when the stabilators are trimmed to 6° TEU or higher.

My point is not to criticise your approach, but to emphasise that I don’t believe XML can correctly model a fly-by-wire system, and that compromises have to be made. (Having said that, someone will, no doubt, pop out of the woodwork to contradict me!)
 
Roger that and due to the limited access we have to certain aircraft files and our current coding ability, you are correct. Some compromises will have to be made. I agree, we will probably not be able to get the CAS modeled 100% accurate, but I think we have definitely made some substantial progress over the default F/A-18. Sometimes the answers come easy, other times...no so much...

Anyways Roy, Mgh...

You guys seem to have a pretty good handle on the Hornet NATOPS. Maybe you guys can help me understand something here:

P CAS nulls the difference between the commanded AOA and actual AOA. With neutral
longitudinal stick, P CAS maintains trim AOA.

The way I interpret that statement, is that in PA mode, as you pull or push to a different pitch attitude, the CAS actually augments the trim so that your result after a few seconds is always 0 longitudinal input. As an example, let's say you are currently at 7 degrees AOA and you want 8 degrees. So you pull back on the stick, let's say 5 %. The CAS realizes the input and starts feeding in NU trim to null the difference. As the trim gets dialed in, you as the pilot, start instinctively easing the back pressure to maintain the jets heading, until eventually, the resultant of stick pressure is 0. From there the AOA is recorded and maintained by the CAS. The manual trim can be used to make small corrections to the set AOA.

If this is the case, the following coding might work. Sorry in advance for the crappy coding example as I currently do not have the SDK in front of me (I'm at work).

<--Landing conditions to activate PA Mode-->
(L:AOA ADJ, number) 1 &gt;
(A:GEAR CENTER POSITION,Percent) 30 &gt; &amp;&amp;
(L:switch_master_arm,number) 1 &lt; &amp;&amp;
(A:INCIDENCE ALPHA,Degrees) 22 &lt; &amp;&amp;
(A:AIRSPEED TRUE,knots) 250 &lt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) -90 &gt; &amp;&amp;
(A:PLANE BANK DEGREES,degrees) 90 &lt; &amp;&amp;
(A:SIM ON GROUND, bool) ! &amp;&amp;
(A:AUTOPILOT MASTER, bool) ! &amp;&amp;
if{ (&gt;L:PA_LND_MODE, bool) } els{ }


<---This instructs the code to start incrementally dialing in NU or ND trim if more that 10% of pull or push on the control stick is detected. This is the part that "nulls the difference between actual and commanded AOA/input"--->

(L:PA_LND_MODE, bool);
(A:ELEVATOR POSITION,Percent) 10 &gt; &amp;&amp;
if{ (&gt;K:ELEV_TRIM_UP) } els{ }

(L:PA_LND_MODE, bool);
(A:ELEVATOR POSITION,Percent) -10 &lt; &amp;&amp;
if{ (&gt;K:ELEV_TRIM_UP) } els{ }


<---This part instructs the CAS to record the new AOA as actual and commanded inputs are being nulled out. )This coincides with the stick returning to 0 input on longitudinal axis). This coding creates a small window that the controller has to be in in order to record the new AOA to maintain. In this case a, a window that is between 3 to 5 percent from center of the longitudinal axis. Anything outside of that window the CAS will not record the AOA.

(L:PA_LND_MODE, bool);
(A:ELEVATOR POSITION,Percent) 5 &lt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) 3 &gt; &amp;&amp;
if{ (A:INCIDENCE ALPHA,Degrees) (&gt;L:AOA RECORD, number) } els{ }

(L:PA_LND_MODE, bool);
(A:ELEVATOR POSITION,Percent) -3 &lt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) -5 &gt; &amp;&amp;
if{ (A:INCIDENCE ALPHA,Degrees) (&gt;L:AOA RECORD, number) } els{ }


<---The section compares the recorded trim to the actual trim. This is what decided whether NU or ND trim gets used--->

(L:PA_LND_MODE, bool);
(&gt;L:AOA RECORD, number)
(A:ELEVATOR POSITION,Percent) 2 &lt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) -2 &gt; &amp;&amp;
if{ (L:AOA RECORD, number) (A:INCIDENCE ALPHA,Degrees) / (&gt;L:AOA DIFF RATIO, number) } els{ }

<---This part then tells the CAS to maintain the recorded AOA (using elevator trim) once the stick is returned within 2 degrees of center. This is done by constantly comparing the recorded AOA with actual AOA. Here, the recorded AOA is divided, by the actual AOA to give a ratio. If the ratio provides a result greater than 1, then NU trim is used in an effort to bring the ration to 1/1. If the ration provides a result less than 1, then ND trim is used to do the same. All of this only happens at neutral longitudinal stick (or very close to it). The trim control mentioned above and shown below is basic logic. Roy's/Chris' coding would probably provide better AOA maintenance at this point since it derives direct trim values instead of using trim increments/decrements.

(L:PA_LND_MODE, bool);
(L:AOA DIFF RATIO, number) 1 &gt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) 2 &lt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) -2 &gt; &amp;&amp;
if{ (&gt;K:ELEV_TRIM_UP) } els{ }

(L:PA_LND_MODE, bool);
(L:AOA DIFF RATIO, number) 1 &lt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) 2 &lt; &amp;&amp;
(A:ELEVATOR POSITION,Percent) -2 &gt; &amp;&amp;
if{ (&gt;K:ELEV_TRIM_DN) } els{ }

Thanks again.
 
I believe that if the pilot has 6 deg AoA with the stick neutral and then pulls back the stick to achieve 10 deg then the aircraft will hold that commanded AoA as long as the stick is held in that position.

If the pilot wanted 10 deg f0r some time, he could use the trim button the let the stick return to neutral while still maintaining 10 deg. No difference in principle to trimming a conventional aircraft. Mathematically, the commanded AoA could be expressed as:

AoA_Commanded = S1 * Stick_Displacement + T1 * Trim_Displacement

where S1 and T1 are scaling constants.
 
Last edited:
mgh, Jimi
As you said, PA is used on field take-offs until airborne when gear is raised and flaps set to Auto. The aft stick movement is there to initiate rotation and is input approaching the predicted nose-wheel lift off speed. Once the velocity vector indicates a climb the aft stick pressure is removed. With flaps at auto the system is switched out of PA to UA.

The take-off trim setting is set at 4° TEU by means of the T/O TRIM button and there is no target AOA. Normally T/O trim setting puts the airplane substantially in trim once airborne and this appears to be the case here.

For instance, in the F-4M I flew, when in the RAF, the take-off trim setting was between 2° nose down and 3° nose down depending on external tank/gunpod configuration. You held the stick full aft from brakes release to get rotation as soon as possible. As soon as the nosewheel lifted you moved the control column forward to maintain a 10° nose-up attitude, in trim.

So, what is PA doing during take-off? You certainly do not want to be in UA mode on take-off. You have to have the Pitch CAS operating and so you will be in PA mode automatically because you have set Half Flap. It is just providing stability augmentation, not trying to maintain a target AOA.

Since PA means Powered Approach, that is where its full utility is employed during field operations.

The main difference between a field take-off and a carrier take-off is that the latter is done with hands off the stick. You need a trim setting that will give you the correct nose-up rate of rotation. That is why a target AOA of 12 is set once the trim is above 6.5°. The actual trim setting is calculated, prior to take-off, from Gross weight, whether MIL or MAX power will be used, what the end speed will be, and CG %MAC. The nominal setting is 14° TEU. It could be anything between 7° minimum and 22.

Like a field take-off PA is cancelled as soon as the airplane is airborne and the pilot selects Auto Flap

In any approach and in a carrier take-off, PA is designed to be used with no stick longitudinal inputs and it has a target AOA to maintain. In a field take-off there is no target AOA set.

A fly by wire system creates control movements that are necessary because the basic airplane is unstable. In FS the simulation of PA relies on inherent longitudinal stability. It is not in any way intended to be a fly by wire system. You would need inputs from variables such as ACCELERATION BODY Z and ROTATION BODY Z to even start making a fly by wire system and that would be way beyond anything I could do.

By the way, if you have a set target AOA and are steady at that value, if you then pull back on the stick, PA mode will apply nose-down trim in an attempt to maintain the set AOA. If you then let go of the stick the nose will drop, AOA will be less than Target until PA catches up with it. It will always reference itself with respect to a target AOA.

As a reminder, the 8.1 target AOA on an approach is set with the paddle switch, on a carrier take-off it is set to 12 by having more than 6.5° TEU trim. These two numbers are the Target AOA values used by PA mode.

The UA mode is another story mainly because it has no set AOA values. You command an AOA by pulling/pushing the stick. Different ball game, although the CAS tries to null the difference in both modes.

I think we should concentrate on the hands off intent of the PA mode. This mode tries to null the difference between Set (Commanded) AOA and actual AOA by using trim. The PID code I submitted does exactly that. I'll be happy to help you implement it in the FS F/A-18 and I'll be happy to entertain changes to it. I'll also be happy to try to answer any questions regarding the NATOPS.


Roy
 
Coming out of the woodwork myself, would the following enable fly-by-wire to be modelled?

The F18 has a stabilator but the stock FSX F-16 is modelled with elevator and trim in the .cfg and .air files. (I image all stock aircraft are.) Suppose these files were changed to make the elevator ineffective and the trim effectiveness the same as the original elevator effectiveness. Stick movement would then have no direct effect on the flight dynamics, which would instead be controlled by the trim setting. For AoA control the basic equations would be:

Code:
AoA_Commanded = S1 * Stick_Displacement + T1 * Trim_Displacement;

Trim_Setting = Trim_setting + A1 * (AoA_Commanded – AoA_Actual);

Where S1, T1, and A1 are constants, For clarity I’ve only shown the proportional effect, not the integral and differential effects. Any thoughts?
 
Back
Top