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

MSFS Autopilot PID Values

Messages
14
Country
unitedstates
Hello. I was wondering if the PID values for the Autopilot are available to us? I've been messing around with a plane which needs some tuning of the PID values. If they are available, im not sure where they are.
Does anyone know?
 
Messages
20
Country
australia
Not a problem... I'm still finding my way through how the new system works for MSFS, much prefer it so far over the old cfg and air file combo. :)
 
Messages
14
Country
unitedstates
Seems that these effect just the AI traffic. I wasn't getting a response in any change so i changed the pitch gain by a order of magnitude and nothin. I tried re-sync and also a sim restart. Nothin.
 
Messages
20
Country
australia
hmm, odd, I found that changing it seemed to have an effect, though who knows, I may be wrong... it's a bit like stubling about in the dark at the moment lol!
 
Messages
17
Country
unitedkingdom
PID values are found in the systems.cfg file under the AUTOPILOT section and are almost carbon copies of the FSX autopilot values and parameters. Anything labelled "ai" only affects ai aircraft and is entirely unconnected with the flyable aircraft. Correction: I should not have said PID in the systems.cfg. I meant the standard autopilot variables. The PID edited values while flying should become "live" if you resync when in the Project/Aircraft Editor in dev mode.
 
Last edited:
Messages
5
Is it possible to change the bank speed of the autopilot?
The A320 ap imo still banks too fast while following the route at cruise altitude.
 
Messages
14
Country
unitedstates
PID values are found in the systems.cfg file under the AUTOPILOT section and are almost carbon copies of the FSX autopilot values and parameters. Anything labelled "ai" only affects ai aircraft and is entirely unconnected with the flyable aircraft.
Rob, i don't see any PID values in systems.cfg I've been adjusting the PID values in ai.cfg and i am able to change behavior.
 
Messages
87
Country
egypt
Strangely, The PID values in the aircraft editor reads from ai.cfg, changing them in either aircraft editor or ai.cfg does change autopilot behavior ,
Seems to me that PID values in systems.cfg are largely ignored , at least from what I've tested , I tried changing them to no effect.. Perhaps this is a bug? there are many parameters in systems.cfg that are needed , for example the max bank angle; flc PID etc.

for example, I set integrator control and deriviative control of pitch to zero in ai.cfg , Then monioring the autopilot debug in msfs I see infact their actions are zeroed out, When they are assigned a value in ai.cfg, their actions shows in the AP debug screen.


See the below images for more infomation:
Zero Ki & Kd in ai.cfg
Screenshot 2020-10-13 154536.png


Valued Ki & Kd in ai.cfg:
Screenshot 2020-10-13 154739.png
 
Last edited:
Messages
497
Country
unitedstates
So, values can be changed, but how does one optimize the values to obtain the required overall systems response required. (typically, criticality damped)

In theory, one wants to see the Impulse response, but introducing an Impulse input into an operating real life control systems, is often not an option for various practical and safety reasons.
In this case, a small amount of Noise can be introduces, that does not severely upset the system, and an Auto-Correlation calculation can generate both time and frequency responses.

If this could be done in real time, for the PID systems in MSFS, and those plots displayed in real time, as the values are altered.
Then optimizing the AP for any particular plane would become a very easy process, rather than just altering them by Trail & error, and then seeing how the plane flies ... which I suspect, was done in FSX, and still is being done in MSFS, assuming any of these PID values are even being updated for MSFS.

If the MSFS flight modeling has been improved, it would seem highly unlikely, that any old FSX "fudged" PID values to tame a FSX aircraft running in FSX, is still the optimum values for a given MSFS aircraft.

For this to work,, it assumes the values being altered in the Debug Aircraft AP, take effect in real time. ?

Maybe this is getting really more a question for "Microsoft Aircraft Design Simulator" :)
 
Last edited:
Messages
87
Country
egypt
The challenge I am finding with the tuning is that PIDs are stacked,
For example for vertical PIDs: Vertical speed is a PID for the flight director, ie. PID for the set point ... and Pitch PID is for for the actuators of the elevator/Trim .. so doing a flight level change autopilot command has the pitch PID trying to follow the vertical speed PID (Flight director PID) , which is very difficult to tune as I have been trying for days..

For following the magenta line ; Nav Ext1 is a PID for the flight director and Roll is a PID for the ailerons.. the former is the latter's set point ..

Additionally you cannot change Realtime, so you have to change values then resync = Reloads the aircraft , have to get the aircraft under control manually then auto pilot on then see the results.. so you don't really get immidiate feedback.

add to that that any modification to the flight dynamics =>You must update the legacy values manually otherwise the autopilot is out of whack..
 
Messages
497
Country
unitedstates
Well, that makes it a PITA to "tweak" !!
But its only a SIM, so no reason why you cannot introduce a Impulse and see the response, in real time, to what the aircraft does.
The issue then become, you are looking at the combined response cause by both the AP and the planes dynamic and static stability.

So #1 is to measure the Planes Stability to an impulse, with the AP off.
Then, when that is "Good", either fully optimized, or something representing the real aircraft, only then can you start Optimising the AP to match that planes response.

I believe, as a RL private pilot of over 30 years, that for example, the MSFS's C172 is unrealistically Dynamically unstable in Pitch.
So trying to tweak the AP, to compensate for that is just covering up the issue, for a plane that does not even fly correctly with the AP OFF

Unfortunately, so many over on the MSFS Forum, are just complaining about the AP, (the Dolphin effect), without 1st considering that the AP can only do so much to tame an unstable aircraft.

If I allowed it, I would find it highly frustrating, especially having had a background in designing and testing RL Guided Missle Control system.
 
Messages
87
Country
egypt
Well I simulate an impulse either by changing the set point rapidly.. like changing speed setpoint in FLCH mode, Changing throttle input rapidly , and also yanking the yoke!

Static and dynamic stability in manual flight is another aspect I am struggling with at the moment, I am no pilot but id do expect when trimmed for speed, Throttle inputs will translate to vertical speed much faster than what I see with MSFS..
But the model I am working on now for example, I am at 200kts trimmed for level flight.. I Push the throttle all the way forward, and the vertical motion is so much lagging behind , that the plane only starts to pitch up by the time I am at 260-270 KIAS a full 7 to 8 seconds later...same for idling the throttle, speed drops.. no vertical descent untill around 170 kias starts to see something substantial..
Not sure what parameters to play with here to affect this, I tried playing with lift vs AoA , Flight tuning pitch stability , Pitch rate , empty weight %MAC, MOIs ..
 
Messages
2,077
Country
us-ohio
I really am uncertain why a PID controller would be used to change the flight director. Most flight directors are simply a command that is constrained by acceleration limits of degrees/second and movement limits of degrees. A PID would introduce a lag into the process as well as overshoot, etc... that really doesn't exist.
 
Messages
108
But the model I am working on now for example, I am at 200kts trimmed for level flight.. I Push the throttle all the way forward, and the vertical motion is so much lagging behind , that the plane only starts to pitch up by the time I am at 260-270 KIAS a full 7 to 8 seconds later.
Pitch up (or lack of) depends a lot on the location of the engine and/or the angle the engine is mounted. Both can be adjusted in the corresponding cfg file.
E.g. many high wing Cessnas have the engine mounted with a significant negative pitch angle to avoid (excessive) pitch up when increasing power.
 
Messages
14
Country
unitedstates
Edit - This is for the A320


Guys thanks for your replies. I've been working on PID values in the AI.CFG for a while and I've had success on the last few iterations. On my first try, i attempted to get someone from the forums to test these values to be sure i wasn't seeing things lol.

There are several things that can be adjusted to clear some of the handling problems with the AP. I stopped a week or so back because of the updates, I would need to start over each time. That's ok with me if they fix stuff :)

Heading Control and Roll Control can pretty easily be tuned. The complicating factor for Vertical Control is there are several things that play into it including Auto Throttle, Pitch Control, Vertical Speed Control for Maintaining Airspeed Speed and G-Limiting.

Through testing I've found that the G-Limiting Control appears to have some issues. There must be a PID that is specific to Fly By Wire systems, however there doesn't appear to be a gain adjustment we can get at.

My Current understandings :
Regarding Heading and Roll Control - The Heading PID controller creates a Roll Command Reference and is sent to the Roll PID controller. Reference for the Roll control is in the range of +- 0 to Max Bank Angle. Both the Heading PID and the Roll PID have integral and derivative terms used. Commonly, when you have two PID controllers working in series, having both PID's using Integral terms is not recommended as it can cause instability (Fighting each other) like wagging left and right which in this case is one of the problems the A320 and other planes exhibit. There are times where this has been used but the inner most PID must have a faster integration gain and also likely to have a faster loop rate where in this case all these loops run at the same rate. Additionally, the Derivative term is only used when there is good reason and only complicates control problems. It is indeed a good method to contain overshoot, but unless its implemented properly it can hurt things.

What i have done with this particular set of PID's is to remove the Integral Term and the Derivative Term from the Heading Controller. The PID only responds to Heading Error and Multiplying it by Gain. I have made Gain only adjustments to this PID. The Gain will do two things, It will certainly make it more responsive and potentially nervous depending on magnitude of gain, but it will also determine how long the bank angle will stay at Max Bank Angle during a turn. It will also cause the heading to be achieved sooner as a higher bank angle will be commanded for a given amount of heading error.

I've been asked how i would ever expect the heading to be achieved if there is no Integral Term in the Heading PID. The reasoning is there is integral in the Roll control which is the prime mover for heading control. If i only have 1 deg of error in heading, it will still multiply that by gain and send it to the Roll control as a Bank angle and it will do what it needs to do to remove any error in its loop with Gain+Integral+Derivative until the Heading PID is satisfied and ends up with a 0 deg Reference command to the Roll PID.

Regarding Vertical Control - I'm still messing with this, however there are multiple interactions here. There is defiantly a issue in this section that cant be properly tuned until it is fixed. I'll keep playing.

In the end now that the new patch is here I'll mess around with gains and do testing on the PID's. I'll post here with what i think may be satisfactory gains.
 
Last edited:
Messages
14
Country
unitedstates
Pitch up (or lack of) depends a lot on the location of the engine and/or the angle the engine is mounted. Both can be adjusted in the corresponding cfg file.
E.g. many high wing Cessnas have the engine mounted with a significant negative pitch angle to avoid (excessive) pitch up when increasing power.
They also mount the engines at a slight angle to help reduce yaw under high levels of power.
 
Messages
14
Country
unitedstates
Did some testing today. Autopilot seems to fly pretty good. ive attached the effected files here. Tuning on Heading, Vertical Speed, pitch, roll and Altitude mode. Could someone test and let me know your feedback?
 

Attachments

  • A320neo Testing Files.rar
    11.1 KB · Views: 325
Top