• 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 Flight model physics SDK

Messages
15
Country
france
Hello all,

I have been working to improve the default 747-8 flight model and I have been reading the SDK and other resources in order to familiarise myself with the subject.

In the flight model physics SDK, it is indicated that the wing area is calculated as follows:

image


It looks to me that this is only half the wing area, or am I plain wrong and stupid?

To me, the correct formula would be:

image


In both cases, b is the wing span and c(x) is the chord in function of the lateral position x along the wing.

Thanks!

EDIT: better pictures for formulae and expression for the second formula changed to the double of the first formula
 
Last edited:
Messages
15
Country
france
According to this link, the second formula I’ve put in the OP is the correct one for calculating the wing area.

I don’t know if these formulae are actually used by the MSFS, most probably not, but if some of them are wrong, then I assume that some of the weirdness of the flight model can be explained by the use of wrong formulae to model the aircraft behaviour.
 
Messages
244
Country
unitedkingdom
haha 10 points for being eagle-eyed... given the style of integral is used similarly through the SDK flight model doc and the subsequent uses seem correct (like the MAC calculation) and the document author includes notes like "(TO BE IMPROVED: I CANNOT EXPLAIN THE FORMULA USED IN THE CODE, sim1_World.cpp, SurfaceInformation::CalculateBodyToSurfaceMatrix. FURTHER INVESTIGATION NEEDED)" I'm guessing this error on the relatively simple first integral in the doc is actually a typo.

The FSX flight model was such a limited hack. Asobo mostly took that flight model but applied it to 1000 surfaces instead of just a handful -given all the other work they've done in the sim I bet they wish now they'd just thrown the FSX flight model away and started a nice clean model from scratch.

But IMHO hacking the MSFS/FSX parameters to get the flight performance you want can feel pretty painful but ultimately it seems perfectly possible to build nice handling aircraft in MSFS (as it was in FSX).
 
  • Like
Reactions: tml

Lagaffe

Resource contributor
Messages
865
Country
france
Exactly, I have done this on my current projects (Menestrel HN-433 and Canso PBY-5A) and my old FSX flight models are just slightly adapted to match what MSFS wait.
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
I think there are two aspects to modeling flight dynamics.
The first is performance. That is mostly having correct lift, drag and thrust throughout the envelope. FSXA and P3D give me the ability to just about perfectly match a detailed performance manual. The turbine engine when correctly modeled is very accurate. The only glaring issue is fuel consumption with afterburner which is incorrectly modeled.
The second is handling. Under most conditions it is hard to fault what you can achieve in FSXA if you know what the standard aerodynamic coefficients are for and what they do. Sure, you may be off post stall but you should not go there according to every aircraft manual written. It may tell you what to expect but there is no need to take the risks in normal civil or military flying.
Both aspects can be accurately modeled in the FSXA and later dynamics package and frankly there was zero real need to change the model the way it was done. I have seen zero published material that says the FSXA model is inaccurate.
Comments are welcome
Roy
 
Messages
244
Country
unitedkingdom
Having programmed "tricky" (i.e. gliders) flight models in FS2002, FS2004,FSX,X-Plane and now MSFS, there's clearly a difference between X-Plane and the Microsoft series - where X-Plane encourages you to set the fundamental parameters for the flying surfaces (e.g. lift coefficient vs alpha, drag coefficients, etc) and rely on the sim engine to derive the behaviour, the Microsoft model has a long reliance on the modeller putting in parameters that more directly control the behaviour in the sim. Asobo's flight modelling strategy so far seems to be to keep the FSX simplistic surface modelling method, but break the model down into a much larger number of surfaces and try and deprecate many of the additional 'direct control' parameters that FSX requires.

So both methods give you a lot of levers to tweak to get the performance and handling you're aiming for, and the MSFS flight model is unquestionably a significant advance on FSX.

But for gliders the limitations of FSX modelling becomes painfully obvious at the edges of the flight envelope where high performance gliders spend a lot of their time. A simple example is the support for flaps - in the FSX flight model these are treated as additional flat surfaces which can be retracted (zero affect on main wing) or tilted down into the airflow with the resulting increase in lift and drag (makes sense, right? And works great for a Cessna). Gliders can tilt their flaps UPWARDS - the FSX model allows this but incorrectly adds the same drag in this case, when in reality the overall drag for a glider goes DOWN (I can explain this if anyone cares). Asobo are adding additional parameters to the flap definitions which may give us more levers to tweak, but this is ultimately a repeat of the FSX approach where the modelling is too simplistic so you add special parameters to fix individual cases.

This isn't a bash at MSFS - the flap modelling in X-Plane has similar limitations.
 
Messages
15
Country
france
Thanks to all of you for your inputs.
I got interested in flight models in MSFS after trying to tweak the default 747-8 one, as I've mentioned in the OP.

I completely agree with you Roy and I know that out of the normal flying envelope, sims tend to be inaccurate.
What bothered me in the first place was the incorrect location of CP vs CG, with the horizontal tail producing an uplift in most phases of the flight.

From there I discovered that the wing sweep angle had an influence on the CP vs CG location, in the sim and I suspect that Asobo is not taking into account the particularities of flying a swept wing. This, or Asobo miscalculated the position of the MAC and aerodynamic center in that case.

As a matter of fact, if you try it, the 747 will stall like a straight winged aircraft, with the wing root stalling first and the wing tip last.

That's how I started reading the SDK physics in more details. I was hoping with this post that someone with more knowledge in flight physics and aerodynamics could provide a better analysis than mine lol.

But I have no doubts that it possible to tweak the numbers to get the plane flying with the correct numbers.

I'm just disappointed as I was expecting a better physics modelling from MSFS.

Hopefully, it will get better with the updates.
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
The techniques used to simulate flight in the original Microsoft flight simulator (not MSFS) are described in a paper by Michael Zyskowski published in the AIAA Modeling and Simulation Technologies Conference 11 -14 August 2003 Austin Texas. It uses a basic 6 degrees of freedom approach using standard equations of motion as driven by the usual non-dimensional aerodynamic coefficients. There are exterior methods of introducing "Realism Factors" to reduce the workload for novice users, but if they are ignored the result is accurate and in complete agreement with textbook theory. However, the coefficient values need to be correct and if not the airplane will behave accordingly (badly). If anyone is going to adjust these coefficients they should only make one change at a time, write down the result and if happy, go on to the next coefficient. This is a slow process but eventually you find less things to change because they are OK. The flight dynamics for Dino's Typhoon and F-35 both took me 6 months to get right, or as right as I could considering there is little released flight data. The performance was fairly straightforward. The handling had to simulate a fly by wire system which I assumed would be very effective. How they handle is as close to a Hawker Hunter as I could make it, crisp and clean and without the wall to wall buffet of the F-4 when turning hard, just the "feather's edge" that told you when the airflow was starting to break away slightly.

As regards gliders, the basic requirements are fairly simple. You need to design for two situations. First, for minimum rate of descent (max endurance) when circling in thermals and for minimum glide angle (max range) when going for distance. These two situations are achieved at different angles of attack and speeds, endurance is slower than range. They are at different points on a drag versus velocity chart. It is important to minimise induced drag which is due to spanwise flow and the long wing span of a glider helps that. Nevertheless, induced drag is typically 3 times as high as form drag when at max endurance speed. If you go slower the induced drag increases. For range you need to fly at the lower AOA and higher speed for L/D max.

Flap wise, apart from landing, you could use some flap depression to increase the lift coefficient for better endurance and some flap raising to straighten out the airfoil a tad and decrease induced drag. In a glider induced drag is always the issue.

All of the above should be possible with the standard FSX system. You may have to adapt what you do to cater for things the sim cannot do. For example, the Tornado has variable sweep, so I designed the basic airplane as having 60 sweep and then added flap to simulate the aerodynamic changes at 45 and 25 settings. You could design your glider as having raised flaps normal, then a small flap amount to simulate no-flap flight and more to simulate lowered flap. That is purely in the numbers, your model would show the raised flap.

Roy
 
Messages
244
Country
unitedkingdom
yes Roy your idea to use zero flap to simulate negative flap and go positive from there is indeed one of the tricks in the sim glider arsenal. That then causes issues at the low speed end of the glider polar where zero flap has a higher glide RATIO than any positive flap setting until you enter the stall (which does correctly happen at slower speeds for +ve flap). These are things no power sim developer has ever measured, looked at or cared about (we use specialized dev tools for gliders), and that often leads to simple assumptions about what the sim does and doesn't do in this area.

The optimal solution in FSX has been to add a modest element of fly-by-wire, using Roy's trick (congrats) of shifting the flap range and incrementally opening the spoilers to increase drag in the zero flap (i.e. simulated negative) setting at speeds below that flap's efficient design speed (e.g. 80 knots, i.e. far above the stall speed). That's after months of .cfg and .air tweaking to get the overall polar and handling to be accurate in the first place.
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
I would expect zero flap to give a higher glide ratio since it is the same property as minimum glide angle that gives maximum range. The key factor is induced drag as I said above.
Basically, Drag= drag coefficient * wing area * indicated speed^2 * air density. Drag coefficient is in two parts, the form drag coefficient Cd which is a constant for a give airplane configuration and the induced drag coefficient CDi which varies according to the wing aspect ratio AR (span/chord) and lift coefficient squared. Cdi= CL^2/(pi*e*AR). CL increases with angle of attack (AOA) so is higher at slower speeds up to the stall and higher with positive flap. AR has a linear effect and high aspect ratio decreases induced drag. e is span efficiency which is maximum for an elliptical wing planform (like a Spitfire). 1 is maximum for e and most glider wing planforms are around 0.95.

The aerodynamics of lift and drag are identical for powered and unpowered airplanes. The difference is their relative importance in the big scheme of things. Not having an engine means you need something else to help you stay in the air and travel any distance. That is, of course, rising air currents so your concentration on those aspects leads to certain design conclusions that do not affect powered airplanes. In other words they have different performance requirements not different aerodynamics.

Looking at generic flaps, trailing edge flaps increase the camber of the airfoil to give it higher lift characteristics at any AOA. Leading edge flaps increase the AOA where flow separation occurs and the increased AOA capability gives higher CL. Generic spoilers are either for added form drag (speedbrakes) or decreased CL, hence increased AOA and higher induced drag. Could be a mix of both. Generally for gliders you want to avoid high AOA since it brings high induced drag and drag is the enemy.

Automatic flap application based on speed or AOA is available in the sim, just needs coding. I use it in the F-35 for take-off, landing and high g turns.

If you look at a chart of drag versus speed, there are 2 points of interest. Considering reducing speed from a medium value, the drag decreases with the square of the speed but that decrease reduces and turns into an increase at slow speeds due to the influence of CL^2 as speed drops and AOA increases. At the point where a tangent through the chart origin (zero airspeed) to the drag line is parallel with the drag line you have minimum glide angle, highest glide ratio where you get maximum range. At the lowest point of the drag line, where a tangent is horizontal, is minimum drag, lowest descent rate, and maximum endurance where you should fly to take advantage of rising air and gain height.. Any slower than that and you will not necessarily stall but induced drag will be increasing and you will have to give up hard won altitude gain to get the speed back.

Gliding is a sport and competition is intense. The aims are usually to achieve endurance, altitude gain and distance goals. For instance the Silver badge goals are 5 hours, 5000 ft and 50 km. The 50 km is pretty modest these days with the newest sailplanes but was quite tough when I got that badge.
Roy
 
Top