Board index FlightGear Development Aircraft Flight dynamics model

JSBSim Turboprop starting

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

JSBSim Turboprop starting

Postby Soitanen » Tue Feb 24, 2015 7:31 pm

I have problem - I cannot start my turboprop engine, if it is shutted down. I tried the same procedure, as on jet turbines:
- /controls/engine/starter=true
- wait some time
- /controls/engine/cutoff=false
and engine will start. On turboprop nothing happens when I set starter to true. How can I start engine using controls?
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 7:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: JSBSim Turboprop starting

Postby erik » Thu Jun 02, 2016 2:26 pm

I needed this too so I looked at the code:

- /controls/engine/starter=true
- bring /fdm/jsbsim/propulsion/engine/n1 above 15
- /controls/engine/cutoff=false

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: 2248
Joined: Thu Nov 01, 2007 2:41 pm

Re: JSBSim Turboprop starting

Postby dg-505 » Sat Dec 03, 2016 1:01 pm

Hi all,

I'm also trying to start the turboprop engine of the Twin Otter. I'm orientating on the Beechcraft 1900 because they have similar engines (both are PT6A)

I observed that the property engines/engine[0]/starting is set to true while the engine is starting, but in the code I didn't find an alias or a binding that sets this property to true, so I think this property is handled somehow internally by the FDM and there are ceratin requirements that have to be met to get the engine starting.

Can someone please tell my if my assumption is correct, and what these requirements are?

Thanks in advance
Jonathan
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby Josh_grtuxteam » Sat Dec 03, 2016 3:02 pm

erik wrote in Thu Jun 02, 2016 2:26 pm:I needed this too so I looked at the code:

- /controls/engine/starter=true
- bring /fdm/jsbsim/propulsion/engine/n1 above 15
- /controls/engine/cutoff=false

Erik


i confirm the engine related
using propulsion/engine/n1 = 20 do the job



Josh
User avatar
Josh_grtuxteam
 
Posts: 106
Joined: Mon Oct 17, 2016 3:58 pm
Location: France
Version: lastStable
OS: Linux OpenSUSE

Re: JSBSim Turboprop starting

Postby dg-505 » Sat Dec 03, 2016 5:54 pm

@Josh
Yeah, I've already understood that, but in my case n1 doesn't even rise.
Now I need to know under what conditions the engines actually spool up.
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby Josh_grtuxteam » Sat Dec 03, 2016 6:17 pm

@dg-505

Like Eric did say +> /controls/engine/starter=true => /controls/engine/cutoff=false should answer .
About the process, I would recommend
=> first /controls/engine/cutoff=false
and
then with multiple binding to do
=> /controls/engine/starter=true => /fdm/jsbsim/propulsion/engine/n1 = 20 ............. at the same moment

Josh
User avatar
Josh_grtuxteam
 
Posts: 106
Joined: Mon Oct 17, 2016 3:58 pm
Location: France
Version: lastStable
OS: Linux OpenSUSE

Re: JSBSim Turboprop starting

Postby dg-505 » Sat Dec 03, 2016 6:52 pm

Ah, thanks Josh, now we get closer :D

When setting fdm/jsbsim/propulsion/engine/n1 to 20 manually e.g. using the property browser and then switching engines/engine/cutoff to false, then the engine starts correctly!

That brings me to the next question: In systems.nas of the b1900d there is the following nasal block (lines 498 - 529):
Code: Select all
var update_engine = func(eng){
    if(FDM=="jsb")return;
    N1[eng] = getprop("engines/engine["~eng~"]/n1");
    var rn=getprop("engines/engine["~eng~"]/running");
    var cnd =getprop("controls/engines/engine["~eng~"]/condition");
    var cutoff =getprop("controls/engines/engine["~eng~"]/cutoff");
    var tm=getprop("sim/time/delta-sec");
        if(rn){
                setprop("instrumentation/eng-gauge/fuel-pph["~eng~"]",getprop("engines/engine["~eng~"]/fuel-flow-gph")* 6.72);
                setprop("controls/engines/engine["~eng~"]/condition-input",cnd);
                setprop("engines/engine["~eng~"]/n1",getprop("engines/engine["~eng~"]/n2"));
        }else{
            var ign= getprop("controls/engines/engine["~eng~"]/ignition");
            var strtr=getprop("controls/engines/engine["~eng~"]/starter");
                setprop("controls/engines/engine["~eng~"]/condition-input",0);
                if(strtr){
                N1[eng] = N1[eng] + (tm * 3);
                if(N1[eng]>15){
                    if(N1[eng]>30)N1[eng]=30;
                    if(ign==1){
                        if(cnd>0.01){
                            setprop("controls/engines/engine["~eng~"]/condition-input",cnd);
                        }
                    }
                }
            }else{
                N1[eng] = N1[eng] - (tm * 2);
                if(N1[eng]<0)N1[eng]=0;
            }
            setprop("engines/engine["~eng~"]/n1",N1[eng]);
    }
}


My question is specifically about the "if(FDM=="jsb")return;": What does "return;" do? In other words does this line cause that the code is executed only when the FDM is JSBSim or when the FDM is not JSBSim?

Thanks again for your help
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby dg-505 » Sat Dec 03, 2016 7:08 pm

Another question:

The Engine file has a definition for n1
Code: Select all
<turboprop_engine name="PT6A-27">
    [...]
    <idlen1>                       60.0   </idlen1>
    <maxn1>                        96.0   </maxn1>
    [...]
</turboprop_engine>


But neither the wiki nor the JSBSim reference manual tell what exactly n1 is.

In Yasim, engine/n1 not defined, engine/n2 is the engine rpm, and engine/rpm is the propeller rpm.
In JSBSim, engine/n2 is not defined, as well as engine/rpm. engine/thruster/rpm seems to be the propeller rpm, so am I correct that engine/n1 is the engine rpm?
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby dg-505 » Sat Dec 03, 2016 7:18 pm

Well, unfortunately not, but thanks

This page tells basically the same like the wiki (i.e. no clear statement what n1 exactly is.
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby sanhozay » Sat Dec 03, 2016 7:20 pm

Sorry, I deleted my post when I realised it didn't have any useful information.

For reference, it was a just a link to the FGTurboprop class reference:

http://jsbsim.sourceforge.net/JSBSim/cl ... oProp.html
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 12:57 pm
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: JSBSim Turboprop starting

Postby dg-505 » Sat Dec 03, 2016 7:22 pm

No problem, but thanks anyway
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby wkitty42 » Sat Dec 03, 2016 9:55 pm

dg-505 wrote in Sat Dec 03, 2016 6:52 pm:My question is specifically about the "if(FDM=="jsb")return;": What does "return;" do? In other words does this line cause that the code is executed only when the FDM is JSBSim or when the FDM is not JSBSim?

as i read it, it returns to whatever the caller was if the FDM equals jsb... in other words, that rest of that code block is for YASim... it is a jump out check in case we're not using the FDM it was written for...

FWIW: there is also work going on to move yasim properties into the same area along side the jsb properties... possibly also some aliasing to have properties show up in both places for those craft that expect them... there's been talk on the dev list about this in the last week or two...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9162
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: JSBSim Turboprop starting

Postby Josh_grtuxteam » Sun Dec 04, 2016 1:01 pm

there is also work going on to move yasim properties into the same area along side the jsb properties... possibly also some aliasing to have properties show up in both places for those craft that expect them... there's been talk on the dev list about this in the last week or two...


@wkitty42 I don't understand, jsb has yet an alias feature which answer to most of the request, i have noticed it when maintaining the grtuxhangar.( you may check it with the models we are delivering )
To my opinion since jsb is powerful and flexible enough, it does NOT need any yasim property. (don't make me wrong i do not want open a fight jsb versus yasim)
Mixing both would be a crime :(
Well , i hope that project won't break the perfect enbedded jsbsim alias feature.


@dg-505
propulsion/engine/engine-rpm is the engine-rpm
n1 is a percentage

You may read carefully you Engines/XXXXX.xml file you will notice there is some reference to n1

Josh
Last edited by Josh_grtuxteam on Sun Dec 04, 2016 1:52 pm, edited 1 time in total.
User avatar
Josh_grtuxteam
 
Posts: 106
Joined: Mon Oct 17, 2016 3:58 pm
Location: France
Version: lastStable
OS: Linux OpenSUSE

Re: JSBSim Turboprop starting

Postby dg-505 » Sun Dec 04, 2016 1:43 pm

Okay, finally I think I figured it out:

To get a JSBSim Turboprop starting, there have to be met only two requirements:
1. /controls/electric/engine[~n~]/generator = 'true'
2. /engines/engine[~n~]/starter = ’true’

I.e. that seems to be completely independent from the electrical system or whatever...

Thanks all for your help!
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: JSBSim Turboprop starting

Postby Josh_grtuxteam » Sun Dec 04, 2016 1:57 pm

Good, you got it working

Though we ( our team ) don't use the same process, everything is done within JSBSim since , our AC can be flown stand alone, so not FG dependant

Josh
User avatar
Josh_grtuxteam
 
Posts: 106
Joined: Mon Oct 17, 2016 3:58 pm
Location: France
Version: lastStable
OS: Linux OpenSUSE

Next

Return to Flight dynamics model

Who is online

Users browsing this forum: No registered users and 1 guest