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

FSXA FSX autopilot?

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
Ok you FDE gurus seem to be giving me more luck....

How does the FSX autopilot take the flight model and use it to control the aircraft? Eg if i want to pitch up and maintain a certain climb rate does it increase the control surface angle to maintain a particular G until it reaches desired climb rate and then level off or how does it work? The reason im asking is i want to do my own autopilots....but i need to get an idea of how it works in FSX first.
 
I bet you will get a lot of inputs on this thread!

Here is one to start with.

The AP controls pitch with trim in flyable (non-AI) aircraft. AI aircraft control pitch with stick movement.

In the situation you described the AP will compute a pitch angle to get the desired rate of climb for your true airspeed and the pitch control algorithm will input nose up trim until it attains the commanded pitch angle. As you approach your set altitude, the altitude hold function computes the rate of pitch reduction required for a smooth climb rate reduction and level out.

There are a bunch of PID controllers in the AP, dedicated to things like pitch control, altitude capture, altitude hold, heading hold, speed/Mach hold, Nav hold, Glide slope hold and probably more that I do not know about. They all interact to make the aircraft follow the desired flight path.

A good start would be to find a document that describes how a real AP works.

Roy
 
Alternatively you could use the variable VELOCITY WORLD Y (feet/second) to get the actual vertical speed directly. This would avoid the need to calculate the angle of the aircraft's velocity vector (pitch angle - angle of attack).

As Roy suggests you could then use a PID controller based on the difference between that and the commanded vertical speed to adjust the trim.

You could then do a similar calculation based on the difference between the actual height and the commanded height and then blend the trim angles to level out the aircraft.
 
PID controller....thats a new term for me. Can someone explain how PID controllers work?
 
The ESP Flight Models document has a nice simple description of what PID controllers do.

PID stands for Proportional-Derivative-Integral controller, and is a feedback controller that takes an error for a controlled state and outputs a correction. For example, on an airspeed controller, the error would be the desired airspeed minus the current airspeed. The output is then determined by the sum of three factors using the error and the P, I, and D constants. The "P" factor is simply a factor proportional to the error. The "I" factor is an accumulated factor scaled by the error. The "D" factor is a factor based on the rate of change of the error.

"P factor" = P * error

"Accumulated I factor" = "Accumulated I factor" + (I * error * deltaTime), in Calculus terms, this is simply an integral. The error must reverse its sign to drive this accumulated factor to 0. This is characterized as oscillations, but drives the error to zero.

"D factor" = D * error/deltaTime. As the error gets smaller, this drives the output to be asymptotic towards the desired value.

Roy
 
I bet you will get a lot of inputs on this thread!

Here is one to start with.

The AP controls pitch with trim in flyable (non-AI) aircraft. AI aircraft control pitch with stick movement.

In the situation you described the AP will compute a pitch angle to get the desired rate of climb for your true airspeed and the pitch control algorithm will input nose up trim until it attains the commanded pitch angle. As you approach your set altitude, the altitude hold function computes the rate of pitch reduction required for a smooth climb rate reduction and level out.

There are a bunch of PID controllers in the AP, dedicated to things like pitch control, altitude capture, altitude hold, heading hold, speed/Mach hold, Nav hold, Glide slope hold and probably more that I do not know about. They all interact to make the aircraft follow the desired flight path.

A good start would be to find a document that describes how a real AP works.

Roy




Hello,
You said that AP can control the pitch and balance of aircraft. I have a question about AP control pitch. When I set the pitch angle of AI aircraft over 20 degrees, the maximum limit of AI aircraft can only reach 20 degrees or when the initial pitch angle of AI aircraft is more than 20 degrees, the pitch angle will gradually change to 20 degrees. I wonder if there is any way to lift this limit. :)
Thank you
 
max_pitch is a setting in the aircraft.cfg [autopilot] section. You could try setting max_pitch=25 if that was what you wanted.
Roy
 
max_pitch is a setting in the aircraft.cfg [autopilot] section. You could try setting max_pitch=25 if that was what you wanted.
Roy
Thank you for your timely reply. I've tried this method but it didn't work. I set up two adjacent waypoints in waypoint mode of P3DV4 to fly with C130j_AI. No matter how I set the height difference between two adjacent waypoints, the largest pitch of AI aircraft is only 5 to 10 degrees. I wonder if there are other ways to remove this restriction.
Thank you:)
 
You are probably right, though there are a few other things that could reduce angle of climb, which effectively is what you tested.
For example, you might be flying at a speed where the power available is insufficient for a steep climb.

You might try having it do a steep descent to see if the pitch limits still apply.
I do not have a lot of experience with AI, but from everything I've seen it is clear that their ability to depart from straight and level flight is somewhat limited.

There is an area in the .air file concerning AI autopilot PID constants, but I do not think it would help.
Roy
 
AI aircraft behavior parameters are mostly included in the AIR file. Remember that the simulator engine uses a simplified flight model for AI aircraft.
 
Back
Top