Board index FlightGear Development Aircraft Systems

Autostart

Modeling aircraft systems, like electrical stuff, hydraulics, pneumatics? Feel free to ask support.

Autostart

Postby Airbus330 » Wed Sep 10, 2014 10:17 am

Hi could someone please at least give me a basic idea of how to make an autostart system?
I don't even know where to start. My engines used to start already running, and i can make them start shut down, but then what?
Any advice would be much appreciated :D
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autostart

Postby Jabberwocky » Thu Sep 11, 2014 12:01 am

Basically write a complete autostart routine and place in it the same steps, you would do manually without autostart. As in you switch on the master, so in autostart, you set the property, you start the first engie, so set the property. Just all the same as you would do manually, step by step.
Jabberwocky
Retired
 
Posts: 1316
Joined: Sat Mar 22, 2014 8:36 pm
Callsign: JWOCKY
Version: 3.0.0
OS: Ubuntu 14.04

Re: Autostart

Postby Hooray » Thu Sep 11, 2014 2:29 am

If you don't like the idea of coding all this from scratch, there's is a much better method using Stuart's checklist system - you'll basically convert checklists into XML, which in turn can be "executed" by FlightGear for each step of the checklist: http://wiki.flightgear.org/Aircraft_Checklists

Image

Ideally, all aircraft should adopt this system over time - and if anything is missing, the checklists system (100% scripted) should be extended.
The good thing here is that this turns code into data, so that we can easily unify this for all aircraft to come up with a flexible system, without having to maintain possibly hundreds of different startup systems - especially keeping in mind that many aircraft are no longer maintained, and that the quality of Nasal code in aircraft is generally not overly impressive.

The data/XML-based approach has the added advantage that the Nasal code can be maintained by a few peope who are very familiar with Nasal, without them having to be experts in each and every aircraft - while aircraft developers no longer need to be proficient in Nasal and no longer need to know how to write Nasal code that behaves properly in all situations (think reset/re-init or reposition).

Having custom-scripted startup/autostart systems is not a good idea - especially because we want to support other use-cases, such as for example in-air starts, e.g. for flying approaches over and over again - an XML-based checklist can be easily executed, and it can even be used to set up the cockpit to some predefined state.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Autostart

Postby Airbus330 » Thu Sep 11, 2014 2:38 am

OK where do i put this XML. Ive look and looked in other aircraft and found nothing. I found in the 757 where it defines the menubar item "autostart" to toggle -property/sim/model/start-idling and i made this property and nothing happens when i change it :) obviously there is other code somwhere else that defines what ¨start idling¨does but i couldn't find it for the life of me.
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autostart

Postby Hooray » Thu Sep 11, 2014 2:42 am

Please see the link that I posted - where it says explicitly that the docs for this particular feature are to be found in $FG_ROOT/Docs/README.checklists: https://gitorious.org/fg/fgdata/source/ ... checklists

This is also where you can read that the c172p is considered the reference implementation.

The system itself is located in $FG_ROOT/gui/dialogs/checklist.xml (embedded Nasal), but -at least for now- that should not matter to you - unless you want to extend the system to add support for new features (in which case, you'll also want to check out $FG_ROOT/Nasal/checklist.nas).

Whatever is added to the Nasal code should never be aircraft-specific - aircraft specific stuff needs to be expressed via your own XML files - if something is missing, just extend the Nasal file, or ask for help so that we can post some pointers/snippets.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Autostart

Postby Johan G » Thu Sep 11, 2014 6:18 am

See also Aircraft checklists on the wiki. :wink:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Autostart

Postby Airbus330 » Fri Sep 12, 2014 10:54 am

Ok this is all great information.... I just can't even start the engines manually. NO i do know how to start a jet engine, i can start the A330 or 777 manually, but trying to start my A300 from the internal propertys console doesn't seem to work. I'm basically setting /controls/engine/cuttoff to false, and setting /controls/engine/starter to true. electricity and fuel are both there, and the fuel pumps are working. My engines are just basic Aeromatic jsbsim engines.
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autostart

Postby AndersG » Fri Sep 12, 2014 7:46 pm

Airbus330 wrote in Fri Sep 12, 2014 10:54 am:I'm basically setting /controls/engine/cuttoff to false, and setting /controls/engine/starter to true. electricity and fuel are both there, and the fuel pumps are working. My engines are just basic Aeromatic jsbsim engines.


IIRC you need to first spin up the engine using the starter, then set cutoff to false to get a JSBSim turbine engine to start.

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Autostart

Postby Hooray » Fri Sep 12, 2014 8:08 pm

Unfortunately, you'll probably have to do some reverse engineering and look not just at the procedures involved, but also the cockpit hotspots/bindings and the code that is triggered to perform the actual startup sequence
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Autostart

Postby Airbus330 » Sat Sep 13, 2014 12:30 am

Anders your my star!!
The engine started, now i just need to write the code :)
Thanks Everyone else too BTW :D
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autostart

Postby Airbus330 » Tue Sep 16, 2014 2:24 am

Ok I can now start my engines by useing the checklist, is there a way to assign the binding on the Autostart menu it execute the entire checklist?
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3

Re: Autostart

Postby Hooray » Tue Sep 16, 2014 2:48 am

you'll probably have to open checklist.xml and a 5-10 lines of Nasal so that a button is added to execute complete checklists - but you need some way to encode a possibly required delay in between steps, or use a constant timer of say 3-5 seconds...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Autostart

Postby Airbus330 » Wed Sep 17, 2014 9:26 am

Thanks Hooray, It works and i learned a lot about Nasal :D
Code: Select all
var start1 = func { setprop("/controls/engines/engine/cutoff", 0) };
var start2 = func { setprop("/controls/engines/engine[1]/cutoff", 0) };
setprop ("controls/engines/engine/starter", 1);
setprop ("controls/engines/engine[1]/starter", 1);
settimer(start1, 3);
settimer(start2, 16);


Heres the code i used in case it helps anyone.
"aint no use complainin´, when you got a job to do"

A300-600 Download
A300-600 Development Thread
Airbus330
 
Posts: 103
Joined: Sat Apr 12, 2014 11:33 pm
Location: Tasmania, Australia
Callsign: (Airline)3359
Version: 3.0
OS: Linux Mint 17.3


Return to Systems

Who is online

Users browsing this forum: No registered users and 1 guest