Board index FlightGear Development Aircraft Flight dynamics model

Internal Table

Good sims require good FDMs (the "thing" that makes an aircraft behave like an aircraft).

Internal Table

Postby WittyOldman » Tue Apr 17, 2018 10:27 am

Could somebody please tell me what is meant by making a table "internal"? Can 3D tables be internal?
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am

Re: Internal Table

Postby Thorsten » Tue Apr 17, 2018 10:45 am

Would you mind providing some context (which FDM, what are you trying to do,...)?

JSBSIm FDMs can use 3d tables, but I have no clue whether that applies to your question or not.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Internal Table

Postby WittyOldman » Tue Apr 17, 2018 10:59 am

JSBSIm FDM.
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am

Re: Internal Table

Postby WittyOldman » Tue Apr 17, 2018 11:00 am

and I am trying to do this.
viewtopic.php?t=33995
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am

Re: Internal Table

Postby Thorsten » Tue Apr 17, 2018 11:51 am

That looks like a normal 3d table as specified in the JSBSim manual - I'm not sure where the 'internal' comes in.

You need to take the thrust table you have and divide by the factors which make it different from a coefficient table (Dave has given the equations in the other thread), then you have a standard thrust coefficient table which you use normally.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Internal Table

Postby WittyOldman » Wed Apr 18, 2018 5:25 am

In the propeller xml files of C172P, we can see tables like C_THRUST, C_POWER are internal tables. [<table type="internal"> ..... </table>]. They don’t have the lookup elements.
So far I successfully made the thrust 3D table. But it does not get tied up to the property tree.
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am

Re: Internal Table

Postby Thorsten » Wed Apr 18, 2018 6:40 am

Thanks, I missed that.

From comparing to the SRB implementation which also use the keyword, it appears that these tables are tied more closely to the source code, i.e. they have a standard format and you don't control the meaning of the rows and columns, so you don't need to specify what row and column are supposed to mean.

Again, it means you have to convert your own data to the format that the table expects.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Internal Table

Postby WittyOldman » Thu Apr 19, 2018 6:25 am

Me too would like my table to be tied to the source code than to the property tree.

But, 3D Tables cannot be internal. They have to be tied to the property tree. This is where I find it troublesome. Any help?
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am

Re: Internal Table

Postby Thorsten » Thu Apr 19, 2018 7:54 am

I'm beginning to see your problem (which is why it's important you provide the context...) If you're trying to use a table that has a standard format as 2d table with 3d data input, it doesn't work and you can't make it work.

So the solution then might be to not use an internal table at all, implement whatever thrust model you like and let it act on the FDM as an external force.

(For the record, I have no idea what you mean by 'tied to the property tree' - there's a thing called 'tied property', but I somehow don't suspect you mean that...)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Internal Table

Postby erik » Thu Apr 19, 2018 9:13 am

Internal tables are fixed to their layout. In case of the propeller you only have a 1D table (advance ratio only) or a 2D table (advance ration vs. propeller-pitch).

I see no easy way to use non-internal tables for propeller thrust when reading the code.

You could however define a CT_MACH table which gets multiplied to the C_THRUST value and a CP_MACH table which gets multiplied to the C_POWER value which effectively makes it 3D.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Internal Table

Postby WittyOldman » Thu Apr 19, 2018 10:41 am

Thank you for the replies.

I have the thrust table of an aircraft. It is a 3D table. For given altitude, throttle and velocity it will provide the exact thrust. This means I dont have to use the standard thrust formula. I can take it from the table.
After changing the propeller.cpp file to read the propeller.xml file, which has the thrust table defined, made changes to the calculate method of the same file. Made it to read 'altitude-ft' and 'throttle' from the property tree. But I am afraid these properties are tied at a later point. I get signal 11 segmentaion fault.
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am

Re: Internal Table

Postby Thorsten » Thu Apr 19, 2018 11:13 am

As I said, you don't have to use the JSBSim propeller standard XXX - you can define your own systems and add the result as external force - and you don't need to change any code for that.

If you insist in the really hard way, that's up to you of course.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Internal Table

Postby erik » Thu Apr 19, 2018 12:42 pm

In that case, for a propeller:
Code: Select all
Thrust = ThrustCoeff*RPS*RPS*D*D*D*D*rho


Where:
Code: Select all
 ThrustCoef is the value from the 3D table.
 RPS is propeller RPM*60
 D is the propeller diameter
 rho air density at altitude.
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Internal Table

Postby erik » Thu Apr 19, 2018 1:37 pm

Just now I realize the table is probably already providing the Thrust force, not the Thrust coefficient like I thought.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Internal Table

Postby WittyOldman » Fri Apr 20, 2018 5:25 am

Yes Erik.
I have Thrust in the table. No need to find it out again.
WittyOldman
 
Posts: 9
Joined: Fri Mar 23, 2018 9:43 am


Return to Flight dynamics model

Who is online

Users browsing this forum: No registered users and 2 guests