Board index FlightGear Development Aircraft Systems

channels in JSBsim systems ?

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

channels in JSBsim systems ?

Postby Bomber » Tue Aug 23, 2016 10:01 pm

This has been on my mind for while...

What's the actual purpose of channels ?
Is it just a convenient way of grouping a set of functions or components together or is there something more to them ?

Does anyone have an idea ?

Simon
"If anyone ever tells you anything about an aeroplane which is so bloody complicated you can't understand it, take it from me - it's all balls" - R J Mitchel
Bomber
 
Posts: 1934
Joined: Fri Dec 14, 2007 7:06 pm
OS: Windows XP and 10

Re: channels in JSBsim systems ?

Postby Necolatis » Wed Aug 24, 2016 3:18 am

Well, for one you can set the update rate separately for each channel, with execrate="4" or similar. 4 here means 4 times slower than default, so normally 30Hz.
Its a new feature though, so will only be recognized since FG 2016.2.1 or later I think.

It is also useful if you want to disable a set of functions. Then you can just disable the entire channel, use the execute="property" for that.

Beside from those, I believe it is only for grouping together..as far as I know.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1986
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: channels in JSBsim systems ?

Postby Thorsten » Wed Aug 24, 2016 5:29 am

Is it just a convenient way of grouping a set of functions or components together or is there something more to them ?


I view them as tools to get better structure to code where this is needed (a bit like classes in C++ perhaps).

Think of a complex AP that can do altitude hold, flight level change, vertical speed hold, airspeed hold by pitch, glideslope,...in the pitch axis.

There's multiple ways you could code that. But with channels, you can create one channel per mode, all writing into the same property pitch-cmd that gets used by the lower level flight controllers.

And using a <switch> statement on the condition for channel execution, you can set the currently used channel active and all others inactive, so only one channel will actually write into pitch-cmd, and the others won't use any performance.

Elegant and clean, makes it easy to isolate mistakes - especially if you compare it with a solution where everything ends up in the same channel and is merged later.
Thorsten
 
Posts: 11057
Joined: Mon Nov 02, 2009 8:33 am

Re: channels in JSBsim systems ?

Postby Bomber » Wed Aug 24, 2016 8:29 am

thanks guys I didn't know about the tags. And as I do all my flight modeling within systems, will turn out to be a useful tool.

I did a search on wiki.... memo to self search 'JSBsim systems' not just 'system channel'

http://wiki.flightgear.org/JSBSim_Systems

Anyway it's a good page and explains it all very clearly...although a few examples wouldn't go amiss.

Code: Select all
   <switch name="T4T/execute">
      <default value="0"/>
      <test value="1">
         sim-time-sec GT 1
      </test>
      <output>T4T/execute</output>      
   </switch>


Code: Select all
   <channel name="moment_calcs" execute="T4T/execute">


or similar, possibly with the T4T removed....don't want to be accused of propoganda

(can the previous two posts be removed as they're off topic)
"If anyone ever tells you anything about an aeroplane which is so bloody complicated you can't understand it, take it from me - it's all balls" - R J Mitchel
Bomber
 
Posts: 1934
Joined: Fri Dec 14, 2007 7:06 pm
OS: Windows XP and 10


Return to Systems

Who is online

Users browsing this forum: No registered users and 1 guest