Board index FlightGear Development New features

New physics system of flight

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: New physics system of flight

Postby WoodSTokk » Mon Aug 26, 2019 10:35 pm

V12 wrote in Mon Aug 26, 2019 6:20 pm:CitationX, Cessna 550, Citation Bravo, DHC6 - strange behaviour on all control inputs

I work on the C550 and play with the FDM also. If you want test this YAsim file: http://lepanto.at/download/flightgear/Citation-II-yasim.xml
Thats not the latest, but i'm actually on vacation. If you are interested, i send you my latest file as soon i'm at home.
WoodSTokk
 
Posts: 566
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: New physics system of flight

Postby V12 » Tue Aug 27, 2019 4:12 am

woodstokk :
I'm working on protocol for blackbox with basic data about control sufrace positions and rates of the pitch, climb and yaw. Then I will try visualize behaviour of the CitX and will test new YASIM files for C550.

@all :
Autor of the first post still did not specified aircraft. Then it is possible that he really tested some on YASIM FDM. We all know, that YASIM is not as good as JSBSIM.We should wait for his reply (which aircraft tested), or mark this thread as solved.
Last edited by V12 on Tue Aug 27, 2019 12:00 pm, edited 1 time in total.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1868
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: New physics system of flight

Postby abassign » Tue Aug 27, 2019 8:20 am

The title of the post is very stimulating and for this reason I want to contribute to this discussion

I don't know if my contribution can give some useful advice to the discussion, but it comes from my experience in building the FDM of the FIAT G91R1B project.
When I started the FIAT G91R1B project ( https://github.com/abassign/G91-R1B_HD.git ) I had done some checks on the two FDMs currently present in FGFS, the first YASIM that I found nice, but then, looking at the code, I verified that it consisted of the FDM dynamically using software derived from the philosophy of known Datcom ( http://wpage.unina.it/agodemar/DSV-DQV/Digital_Datcom_Users_Manual_1.2.pdf ) which is a program that calculates the aerodynamic tables of an aircraft according to its geometry and flight envelope. This approach is useful for making airplanes with simplicity (something like this was used by X-Plane), but without paying particular attention to the real characteristics of the aircraft.

Datcom is certainly useful for building the base tables, but then these must be further elaborated on the basis of real data. A real plane has an aerodynamics that often moves away from the one theoretically calculated by a simple program like Datcom, it would be necessary to use other fluid-dynamic simulation programs to obtain more exact tables. The best thing would be to have the aerodynamic tables made in the tests of the real plane, but it is rare to own such tables. Therefore Datcom (and therefore YASIM) can be used to obtain a plane that performs a flight close to the real plane, but certainly not to get a plane with flight characteristics close to the real one. If you complain that an FGFS plane, in flight, is not similar to the real one ... we don't have to complain about the FDM used, but the data used to configure the FDM!

Obtaining the data necessary to correctly configure our FDM (I use JSBSim not YASM, but it is the same problem) it is necessary to perform hundreds of flight tests. For example, I had to do a lot of tests on the engine down rate (efficiency) which is a great way to understand the aerodynamic efficiency of the aircraft, I had to do (me and other friends of this adventure) many tests to get something like this real. For brakes, I had to use force vectors directly, using the JSBSim tag: external_reactions which allows you to get enough fine control over the forces that apply to the aircraft. For example the airbrakes have been simulated in this way and finally I realized that for the G91R1B they are not particularly effective, but due to their position far from the center of gravity they tend to modify the trajectory, this is also true for the landing gear etc.

So if we want to get a model close to reality, we have to work a lot with successive refinements, until we get what we think is the real plane, the FDM is simply an engine that interprets what we insert and not a "magic wand" that calculates from a 3D drawing the behavior of the real plane.

Go beyond JSBSim, YASIM and NASAL

Currently FGFS has two FDMs, the system XML and a NASAL scripting language. This fact confuses a little and makes it difficult to make a model close to reality.
For example for the G91R1B I had to realize in NASAL a sort of robot for piloting the plane, this rather complex module (I've been working on it for three months) allows me to be able to test the aircraft in various phases of flight and figure out how much I'm really close to reality. NASAL and JSBsim with the system XML as a glue are quite powerful, but there are three different ways to program! I use JSBSim when I want to simulate a real device (for example an on-board system, the electrical system, erodynamics etc ...) with a simple code to maintain and light in its execution, while I use NASAL when I want to simulate the interaction of the aircraft with the pilot and the external environment for which the frame rate can be quite low (1-10 fps).
My desire would be to be able to have a single programming environment, always with a data-driven functional philosophy (which is followed by JSBSim ... even if with some limitations) and not using NASAL and limiting the system XML only for interface with 3D objects.
For this reason I am studying various functional languages (python leave at home please ... it is absolutely not easy to program and maintain in data-driven / functional mode!).

I am currently exploring Haskell which is a pure functional language which actually eliminates loops (like JSBSim) and the variables are static and therefore does not pose particular problems in concurrent programming, an essential fact in systems simulation.
I hope soon to write a simple FDM in Haskell to understand if this approach makes sense and therefore to replace with Haskell also NASAL, for this it is enough to make a binding in C ++ (as it was done for JSBSim) and try. The nice thing is that Haskell has a very efficient and fast compiler that creates a pure C-code which, if written well, has the same speed as the equivalent C code. My idea is to be able to create the modules in a single language and integrate them, through the system XML, directly into the folder of the aircraft without penalty in performance and possibly working in a multithreaded way with transparency and effectiveness and a high isolation to allow have an effective multi-user and not too limited like the current one.
Obviously mine is only a search for a solution, an exercise to understand, but I hope that over time we will all find something useful that can renew the current work approach.
abassign
 
Posts: 838
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: New physics system of flight

Postby bugman » Tue Aug 27, 2019 8:24 am

V12 wrote in Tue Aug 27, 2019 4:12 am:We all know, that YASIM is not as good as JSBSIM. We should wait for his reply (which aircraft tested), or mark this thread as solved.


This statement is plain wrong. It depends on your input data. There are two cases here:

  1. Airplanes/Spacecraft/Watercraft/Vehicles: If you have no aero data (e.g. most historical aircraft), the YASim solution is superior. If you have a little data, YASim and JSBSim might both produce something reasonable. But if you have lots of aero data (e.g. craft from NASA), JSBSim is superior.
  2. Helicopters: I do not know of a JSBSim FDM for this. YASim for helicopters is a completely different solver than YASim for airplanes, and the YASim result is very good.

The X-Plane implemented "Blade element theory" is similar in concept to YASim, in that you don't feed it the aero data but it comes up with a "solution". With access to lots of aero data, JSBSim will always be superior to this.

Regards,
Edward
bugman
Moderator
 
Posts: 1794
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: New physics system of flight

Postby WoodSTokk » Tue Aug 27, 2019 8:53 am

V12 wrote in Tue Aug 27, 2019 4:12 am:We all know, that YASIM is not as good as JSBSIM.

Thats because YAsim try to calculate the behaviour out of geometry and YAsim has many values build in without posibility to change it.
There is actually a thread on the dev list from a developer they try to improve the behaviour and give more property values in the xml file.
In the last month i have played around with the engines of the C550 to match the real as close as possible, but the 'jet' engine in YAsim is to bad.
I try actually to calculate turbines in a spreadsheet to work out the important formulas to come close to the reality.
We will see how far i came.
WoodSTokk
 
Posts: 566
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: New physics system of flight

Postby Thorsten » Tue Aug 27, 2019 10:55 am

Currently FGFS has two FDMs, the system XML and a NASAL scripting language. This fact confuses a little and makes it difficult to make a model close to reality.


Well, not everyone is confused by four options - most people just use the right tool for the job.

But it is manifestly not true that any of this makes it more difficult to get close to reality - the main limitation when getting closer to reality is not computation, it is input data. Even Nasal is capable of solving orbital targeting problems in multiply-accelerated time - it would not break a sweat computing real-time flight dynamics, it would just be awkward to re-implement what JSBSim already does.

Which is what any other language (you keep suggesting exotic options from various corners of the internet) would be - a re-implementation of features which already exist. As such, they would just make things more complicated without gaining any benefit and for sure without gaining realism.

For example for the G91R1B I had to realize in NASAL a sort of robot for piloting the plane, this rather complex module (I've been working on it for three months)


Wrong choice of tool basically - doing it in JSBSim would have cost you no more than three weeks... sure the FG toolkit is cumbersome if you insist in hammering nails with a drilling machine. But it doesn't help to replace the drilling machine by a 3d printer - the hammer still works best to get the nail in.
Thorsten
 
Posts: 11695
Joined: Mon Nov 02, 2009 8:33 am

Re: New physics system of flight

Postby abassign » Tue Aug 27, 2019 11:09 am

bugman wrote in Tue Aug 27, 2019 8:24 am:Helicopters: I do not know of a JSBSim FDM for this. YASim for helicopters is a completely different solver than YASim for airplanes, and the YASim result is very good.


JSBSim is a complete data-driven functional language, so it can very well reproduce a helicopter, just build the right JSBSim code. In fact this link shows the work done in 2012 by a user for the R22:

https://gitorious.org/ron-s-hanger/r22-jsbsim/?p=ron-s-hanger:r22-jsbsim.git;a=summary

The discussion forum:
https://sourceforge.net/p/jsbsim/mailman/message/33067480/

YASIM seems like a great environment to do something quickly ... but it certainly doesn't have the flexibility of JSBSim ... this can lead to problems along the development of a more sophisticated FDM.
I personally believe it is important for an author to choose a methodology suited to his technical ability. If an author has more ability to work with 3D I think he is attracted to YASIM, because with little work he can get a good working model. Then as FGFS is opensource GPL2 / 3 ... any other can complete the model in the JSBSim version as was done for the K13.
My hope is that YASIM is always well followed and developed, like JSBSim for which I developed a kernel module last year.
abassign
 
Posts: 838
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: New physics system of flight

Postby V12 » Tue Aug 27, 2019 12:01 pm

bugman, woodstokk :
OK, I changed my post viewtopic.php?p=352997#p352997
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1868
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: New physics system of flight

Postby bugman » Tue Aug 27, 2019 12:46 pm

abassign wrote in Tue Aug 27, 2019 11:09 am:JSBSim is a complete data-driven functional language, so it can very well reproduce a helicopter, just build the right JSBSim code. In fact this link shows the work done in 2012 by a user for the R22:


The presence of 2 JSBSim FDMs for helicopters, with most discussion about testing out the little used JSBSim helicopter code, does not mean that JSBSim is superior. As far as I remember, the JSBSim helicopter code is not very good, as simulating helicopter aerodynamics is incredibly hard. My memory is that most people agree that YASim is far superior for helicopters. And that YASim is superior to all the FDMs of the other flight sims. Actually, I don't remember anyone ever arguing that JSBSim is superior in this category before.

Your opinion against YASim clearly also biases your judgement of it. So I'll give you a challenge - try to produce a JSBSim FDM for the Kalinin K7 that is superior to the YASim one currently present in FGAddon. The point is that some aircraft have a distinct lack of data - and that makes a JSBSim FDM inferior to YASim. You'll obviously have to use AeromatiC++, but I challenge you nevertheless to produce a superior FDM.

Regards,
Edward
bugman
Moderator
 
Posts: 1794
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: New physics system of flight

Postby V12 » Tue Aug 27, 2019 2:05 pm

And here https://ulozto.net/file/tUYVDSndPbIF/fdr-citx-crash-ods is record of the uncommanded barel roll and crash CitationX.
Sample rate 10 Hz, units :
Elev, AileronL, AileronR, Rudder are normalized surface postion with range from -1 to 1, on both charts on left Y axis
PitchRate, RollRate and YawRate are in degs per second, on botch charts on right Y axis

On first chart (Elev vs PitchRate), You can see strange pitch behaviour, when pitch rate is changing without change of elevator position very inconsistently. Maximum pitch rate is 13 degs per second, but there are extremly fast changes of the pitch rates from 13 to 0 degs per 0.3 seconds

On second chart is clearly visible uncommanded barel roll with crash some seconds later. Maximum roll rate is almost 190 degs per second, best roll rate is 420 degs per second on aerobatic specials like Extra 300 or Corvus Racer, not private passenger jet.
Last edited by V12 on Tue Aug 27, 2019 2:13 pm, edited 1 time in total.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1868
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: New physics system of flight

Postby Thorsten » Tue Aug 27, 2019 2:08 pm

You can see strange pitch behaviour, when pitch rate is changing without change of elevator position


Sorry - is that your understanding of how aerodynamics works - that the only way to change pitch rate is changing elevator position?

If that's the case, you're just miserably wrong...
Thorsten
 
Posts: 11695
Joined: Mon Nov 02, 2009 8:33 am

Re: New physics system of flight

Postby Alant » Tue Aug 27, 2019 2:27 pm

Unlike conventional winged aircraft, helicopter flight dynamics are not covered well in the literature. I have a copy of Bramwell's Helicopter Dynamics - https://books.google.pt/books/about/Bramwell_s_Helicopter_Dynamics.html?id=Nge8WzkoHKwC&printsec=frontcover&source=kp_read_button&redir_esc=y#v=onepage&q&f=false, and Google will probably find you a few similar titles.

It is a specialised subject, not likely to be taught during undergraduate flight dynamics course.

The equations are more complicated than those for a fixed wing aircraft as the rotor blades and their motion play a rather important part. I would say that a mathematical model of a helicopter is at least one order (i.e. 10 times) more difficult than a fixed wing aircraft.

However , IF you can find some data, I have no doubt that JSBSim will cope with these equations.

NACA report NAS2-11665 hhttp://www.robertheffley.com/docs/Sim_modeling/Heffley-Mnich--Minimum-Complexity%20Helicopter%20Simulation%20Math%20Model--NASA%20CR%20177476.pdf may be of some use as it describes a simulation made in 1988.

Alan
Alant
 
Posts: 980
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: New physics system of flight

Postby V12 » Tue Aug 27, 2019 2:27 pm

Thorsten :
When you quote me, do it properly, not just what suits you.

I'm talking about this effect :
Data point 105, elevator position -0.68, pitch rate 0.82 degs per second
Data point 108, elevator position -1 (full pull), pitch 9 degs per second
Data point 113, elevator position -1, pitch rate suddenly drop to 1.3 degs per second
From 114 to 142 elevator position still -1, pitch rate oscilating around 2.3 degs per seconds

Image

Why is there present sudden drop in pitch rate (red) when there was still full elevator input (blue) ??? If You check data, You can find other occurences of that event.
Last edited by V12 on Tue Aug 27, 2019 2:46 pm, edited 1 time in total.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1868
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: New physics system of flight

Postby Thorsten » Tue Aug 27, 2019 2:42 pm

You pull the elevator fully back, and while initially the pitch starts growing rapidly, you really can't conceive of a reason why this trend breaks soon after?

Seriously?
Thorsten
 
Posts: 11695
Joined: Mon Nov 02, 2009 8:33 am

Re: New physics system of flight

Postby V12 » Tue Aug 27, 2019 2:47 pm

Thorsten wrote in Tue Aug 27, 2019 2:42 pm:You pull the elevator fully back, and while initially the pitch starts growing rapidly, you really can't conceive of a reason why this trend breaks soon after?

Seriously?


Not. There is not elevator stall in YASIM...
Last edited by V12 on Tue Aug 27, 2019 2:57 pm, edited 2 times in total.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1868
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

PreviousNext

Return to New features

Who is online

Users browsing this forum: No registered users and 0 guests